From a17ad0b212330fd6a196fef55721195f281b205d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 24 Aug 2020 02:17:52 +0200 Subject: [PATCH] Add "Delete" submenu to Dired "Operate" menu * 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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 94d3befda85..08d04688519 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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")) -- 2.39.2