]> git.eshelyaron.com Git - emacs.git/commitdiff
Add "Delete" submenu to Dired "Operate" menu
authorStefan Kangas <stefankangas@gmail.com>
Mon, 24 Aug 2020 00:17:52 +0000 (02:17 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Tue, 25 Aug 2020 18:24:22 +0000 (20:24 +0200)
* lisp/dired.el (dired-mode-map): Add "Delete" submenu to "Operate"
menu with an entry for 'dired-do-flagged-delete'.  (Bug#41524)

lisp/dired.el

index 94d3befda858f99b3cf10236f7ac58266da030de..08d04688519801607f18ee0e8a52e4c4cabd7c0d 100644 (file)
@@ -2244,8 +2244,15 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
       '(menu-item "Shell Command..." dired-do-shell-command
                  :help "Run a shell command on current or marked files"))
     (define-key map [menu-bar operate delete]
-      '(menu-item "Delete" dired-do-delete
-                 :help "Delete current file or all marked files"))
+      `(menu-item "Delete"
+                  ,(let ((menu (make-sparse-keymap "Delete")))
+                     (define-key menu [delete-flagged]
+                       '(menu-item "Delete Flagged Files" dired-do-flagged-delete
+                                   :help "Delete all files flagged for deletion (D)"))
+                     (define-key menu [delete-marked]
+                       '(menu-item "Delete Marked (Not Flagged) Files" dired-do-delete
+                                   :help "Delete current file or all marked files (excluding flagged files)"))
+                     menu)))
     (define-key map [menu-bar operate rename]
       '(menu-item "Rename to..." dired-do-rename
                  :help "Rename current file or move marked files"))