]> git.eshelyaron.com Git - emacs.git/commitdiff
Add file name and its extension to suggestions in dired-mark-files-regexp
authorJuri Linkov <juri@linkov.net>
Mon, 27 Feb 2017 22:45:21 +0000 (00:45 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 27 Feb 2017 22:45:21 +0000 (00:45 +0200)
* lisp/dired.el (dired-mark-files-regexp): Add file name
and its extension to the list of suggested defaults.  (Bug#25578)

lisp/dired.el

index 2733372eb7b0575273c0b8a236d77dcc8f7f7054..8396652d50b2e50b40d1084243524c0b9172195c 100644 (file)
@@ -3361,7 +3361,14 @@ object files--just `.o' will mark more than you might think."
   (interactive
    (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
                               " files (regexp): ")
-                      nil 'dired-regexp-history)
+                      ;; Add more suggestions into the default list
+                      (cons nil (list (dired-get-filename t t)
+                                      (and (dired-get-filename nil t)
+                                           (concat (regexp-quote
+                                                    (file-name-extension
+                                                     (dired-get-filename nil t) t))
+                                                   "\\'"))))
+                      'dired-regexp-history)
         (if current-prefix-arg ?\040)))
   (let ((dired-marker-char (or marker-char dired-marker-char)))
     (dired-mark-if