emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 5ee56c4: Fix 'dired-mark-extension' with prefix arg


From: Eli Zaretskii
Subject: [Emacs-diffs] master 5ee56c4: Fix 'dired-mark-extension' with prefix argument
Date: Sat, 24 Sep 2016 15:11:06 +0000 (UTC)

branch: master
commit 5ee56c4613e9380dbbe4bbaa97b29dd377e2134c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix 'dired-mark-extension' with prefix argument
    
    * lisp/dired-x.el (dired-mark-extension): Allow to specify
    MARKER-CHAR interactively as a string, not as a character's
    codepoint.  (Bug#24518)
    
    * doc/misc/dired-x.texi (Advanced Mark Commands): Document the
    behavior when invoked with a prefix arg.
---
 doc/misc/dired-x.texi |    3 ++-
 lisp/dired-x.el       |   14 ++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi
index 474dd0a..2391852 100644
--- a/doc/misc/dired-x.texi
+++ b/doc/misc/dired-x.texi
@@ -710,7 +710,8 @@ variable @code{window-min-height}.
 @findex dired-mark-extension
 Mark all files with a certain extension for use in later commands.  A @samp{.}
 is not automatically prepended to the string entered, you must type it
-explicitly.
+explicitly.  If invoked with a prefix argument, this command asks for
+a character to use as the marker.
 
 When called from Lisp, @var{extension} may also be a list of extensions
 and an optional argument @var{marker-char} specifies the marker used.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 41c2256..7d73c42 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -333,8 +333,18 @@ See also the functions:
   "Mark all files with a certain EXTENSION for use in later commands.
 A `.' is *not* automatically prepended to the string entered.
 EXTENSION may also be a list of extensions instead of a single one.
-Optional MARKER-CHAR is marker to use."
-  (interactive "sMarking extension: \nP")
+Optional MARKER-CHAR is marker to use.
+Interactively, ask for EXTENSION, and if invoked with a prefix
+argument, for MARKER-CHAR as well."
+  (interactive
+   (list (read-string "Marking extension: ")
+         (and current-prefix-arg
+              (let* ((dflt (char-to-string dired-marker-char))
+                     (input (read-string
+                             (format
+                              "Marker character to use (default %s): " dflt)
+                             nil nil dflt)))
+                (aref input 0)))))
   (or (listp extension)
       (setq extension (list extension)))
   (dired-mark-files-regexp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]