Subject: RE: bug#41524: 26.3; Request for 'x' for 'execute' in dired menu

From: Stefan Kangas <[email-masked]>
Date: Mon, 24 Aug 2020 11:50:42 -0400

Drew Adams <[email-masked]> writes:

> It belongs on menu `Operate', as it operates on the
> (typically) multiple files that are marked (or flagged).

Ah, right.  I never use the menu so I overlooked that.

Should be fixed in the attached.

Best regards,
Stefan Kangas
From 645c91dce0714de04366ad7981361bb25d964d8b Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
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 94d3befda8..08d0468851 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2244,8 +2244,15 @@ dired-mode-map
       '(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.28.0