[Top][All Lists]

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

bug#25578: [PATCH] Prompt default extension in dired-mark-extension

From: Juri Linkov
Subject: bug#25578: [PATCH] Prompt default extension in dired-mark-extension
Date: Mon, 06 Feb 2017 01:20:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

> I want 'M-x dired-mark-extension' (from dired-x) in Dired to use the
> extension of the file at point as default extension, when it is
> possible. Because, in this way, I usually no longer need to type the
> extension manually, which saves some time for me–someone can't type
> English words quickly and accurately.

Thanks, I think your patch is a useful addition.

Also I'm using a similar feature for another Dired command
‘dired-mark-files-regexp’ that could provide similar defaults
based on the current file and its extension:

diff --git a/lisp/dired.el b/lisp/dired.el
index 2733372..7d7af0b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3361,7 +3361,12 @@ (defun dired-mark-files-regexp (regexp &optional 
    (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
                               " files (regexp): ")
-                      nil 'dired-regexp-history)
+                      (delq nil (list (dired-get-filename t t)
+                                      (and (dired-get-filename nil t)
+                                           (concat (regexp-quote 
(dired-get-filename nil t) t))
+                                                   "\\'"))))
+                      'dired-regexp-history)
         (if current-prefix-arg ?\040)))
   (let ((dired-marker-char (or marker-char dired-marker-char)))

reply via email to

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