]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'dired-mark-extension' with prefix argument
authorEli Zaretskii <eliz@gnu.org>
Sat, 24 Sep 2016 15:10:42 +0000 (18:10 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Sep 2016 15:10:42 +0000 (18:10 +0300)
* 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
lisp/dired-x.el

index 474dd0a52082ace7551fae302cd37a5c20d6ab48..2391852ca0f81d19ccacb7154bb833fb8064c1de 100644 (file)
@@ -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.
index 41c2256ec6f91253a99ac9efb64f5bb8023b9443..7d73c42befb28856ae72e37ed0636b183e450ba8 100644 (file)
@@ -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