unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
@ 2020-05-25 11:22 jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-05-25 15:05 ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: jan via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-05-25 11:22 UTC (permalink / raw)
  To: 41524

Hi all,
I was using dired recently after a very long break from it.

I marked some files for deletion, wasn't sure how to actually trigger
the delete, had a suspicion it was 'x' but checked the menu anyway (I
often use the menu merely as a handy cheat-sheet for the keyboard
commands). It appears not to be there.

If it is actually missing I request it be added as it makes no sense for
beginners, who may actually use the menu with the mouse, to be able to
variously mark stuff but then lack a way of carrying them out.

thanks

jan



In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29 built on CIRROCUMULUS
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Recent messages:
Contacting host: en.wikipedia.org:443
Mark set
C-x C-g is undefined
Contacting host: en.wikipedia.org:443
Mark set
scroll-down-command: Beginning of buffer [121 times]
scroll-up-command: End of buffer [21 times]
scroll-down-command: Beginning of buffer [4 times]
Contacting host: en.wikipedia.org:443
Making completion list...

Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired dired-loaddefs rfc822 mml
mml-sec epa derived epg mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader sendmail parse-time lao-util thai-util thai-word
shr-color color cl-extra help-mode network-stream starttls url-http tls
gnutls mail-parse rfc2231 url-gw nsm rmc url-cache url-auth eww puny
mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mail-utils wid-edit mm-util mail-prsvr url-queue url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap shr svg xml dom browse-url elec-pair
helm-gtags subr-x pulse which-func imenu helm-files helm-buffers
helm-occur helm-tags helm-locate helm-grep helm-regexp format-spec
helm-utils helm-help helm-types helm easy-mmode helm-source eieio-compat
helm-multi-match helm-lib async edmacro kmacro desktop frameset
cus-start cus-load finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads w32notify w32
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 352911 239249)
 (symbols 48 29182 42)
 (miscs 40 52 278)
 (strings 32 69289 14969)
 (string-bytes 1 2747170)
 (vectors 16 28306)
 (vector-slots 8 726417 94096)
 (floats 8 275 772)
 (intervals 56 12156 6748)
 (buffers 992 15))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-05-25 11:22 bug#41524: 26.3; Request for 'x' for 'execute' in dired menu jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-05-25 15:05 ` Drew Adams
  2020-08-24  0:26   ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2020-05-25 15:05 UTC (permalink / raw)
  To: jan, 41524

> I was using dired recently after a very long break from it.
> 
> I marked some files for deletion, wasn't sure how to actually trigger
> the delete, had a suspicion it was 'x' but checked the menu anyway (I
> often use the menu merely as a handy cheat-sheet for the keyboard
> commands). It appears not to be there.
> 
> If it is actually missing I request it be added as it makes no sense
> for
> beginners, who may actually use the menu with the mouse, to be able to
> variously mark stuff but then lack a way of carrying them out.

Yes, `x' is not in a menu-bar menu.  It should be.

If you use Dired+, it is.  There, you have submenu
`Delete', with menu items `Delete Marked (not Flagged)'
and `Delete Flagged'.  The former has key `D', and the
latter has key `x'.

(In Dired+, menu-bar menu `Operate' is named `Multiple',
so submenu `Delete' is `Multiple > Delete', not `Operate
> Delete'.)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-05-25 15:05 ` Drew Adams
@ 2020-08-24  0:26   ` Stefan Kangas
  2020-08-24 15:09     ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-24  0:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: jan, 41524

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

tags 41524 + patch
thanks

Drew Adams <drew.adams@oracle.com> writes:

>> I was using dired recently after a very long break from it.
>>
>> I marked some files for deletion, wasn't sure how to actually trigger
>> the delete, had a suspicion it was 'x' but checked the menu anyway (I
>> often use the menu merely as a handy cheat-sheet for the keyboard
>> commands). It appears not to be there.
>>
>> If it is actually missing I request it be added as it makes no sense
>> for
>> beginners, who may actually use the menu with the mouse, to be able to
>> variously mark stuff but then lack a way of carrying them out.
>
> Yes, `x' is not in a menu-bar menu.  It should be.
>
> If you use Dired+, it is.  There, you have submenu
> `Delete', with menu items `Delete Marked (not Flagged)'
> and `Delete Flagged'.  The former has key `D', and the
> latter has key `x'.
>
> (In Dired+, menu-bar menu `Operate' is named `Multiple',
> so submenu `Delete' is `Multiple > Delete', not `Operate
>> Delete'.)

How does the attached patch look?

(I had a look at Dired+ and lifted some help strings from there.
Thanks Drew.)

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Add-Delete-submenu-to-Dired-Mark-menu.patch --]
[-- Type: text/x-diff, Size: 1466 bytes --]

From 935683608dc3e9ab0d607fb5cdf0eca3d50b280d Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Mon, 24 Aug 2020 02:17:52 +0200
Subject: [PATCH] Add "Delete" submenu to Dired "Mark" menu

* lisp/dired.el (dired-mode-map): Add "Delete" submenu.
(Bug#41524)
---
 lisp/dired.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/dired.el b/lisp/dired.el
index aad44a6d69..7d70f4288e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2065,6 +2065,16 @@ dired-mode-map
 		  :help "Replace marker with another character"))
     (define-key map [menu-bar mark unmark-all]
       '(menu-item "Unmark All" dired-unmark-all-marks))
+    (define-key map [menu-bar mark delete]
+      `(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 (not flagged files)"))
+                     menu)))
     (define-key map [menu-bar mark symlinks]
       '(menu-item "Mark Symlinks" dired-mark-symlinks
 		  :visible (fboundp 'make-symbolic-link)
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-08-24  0:26   ` Stefan Kangas
@ 2020-08-24 15:09     ` Drew Adams
  2020-08-24 15:50       ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2020-08-24 15:09 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: jan, 41524

> > Yes, `x' is not in a menu-bar menu.  It should be.
> >
> > If you use Dired+, it is.  There, you have submenu
> > `Delete', with menu items `Delete Marked (not Flagged)'
> > and `Delete Flagged'.  The former has key `D', and the
> > latter has key `x'.
> >
> > (In Dired+, menu-bar menu `Operate' is named `Multiple',
> > so submenu `Delete' is `Multiple > Delete', not `Operate
> >> Delete'.)
> 
> How does the attached patch look?
> 
> (I had a look at Dired+ and lifted some help strings from there.
> Thanks Drew.)

Thanks for looking into this.

I don't think this belongs on menu `Mark', however.

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

Menu `Mark' is for marking files, not for acting on
marked files.

IMO, it would not be good to start mixing up marking
with acting on marked files, on the same menu.  That
would set a bad precedent.  Once things get set in
an Emacs menu, it seems to take a major earthquake
to later change them, so it's better to try to keep
things clear from the outset.

[When I said in my previous post, that Dired+
has a `Delete' submenu, I should have mentioned
that it is on menu `Multiple' (which corresponds
to vanilla menu `Operate'), not on menu `Marks'
(which corresponds to vanilla menu `Mark'.]





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-08-24 15:09     ` Drew Adams
@ 2020-08-24 15:50       ` Stefan Kangas
  2020-08-24 16:04         ` Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-24 15:50 UTC (permalink / raw)
  To: Drew Adams; +Cc: jan, 41524

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

Drew Adams <drew.adams@oracle.com> 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

[-- Attachment #2: 0001-Add-Delete-submenu-to-Dired-Operate-menu.patch --]
[-- Type: text/x-diff, Size: 1629 bytes --]

From 645c91dce0714de04366ad7981361bb25d964d8b Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-08-24 15:50       ` Stefan Kangas
@ 2020-08-24 16:04         ` Drew Adams
  2020-08-25 18:34           ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2020-08-24 16:04 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: jan, 41524

> > 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.

I took only a quick look at the patch, but LGTM.
Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#41524: 26.3; Request for 'x' for 'execute' in dired menu
  2020-08-24 16:04         ` Drew Adams
@ 2020-08-25 18:34           ` Stefan Kangas
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2020-08-25 18:34 UTC (permalink / raw)
  To: Drew Adams; +Cc: jan, 41524

close 41524 28.1
thanks

Drew Adams <drew.adams@oracle.com> writes:

> I took only a quick look at the patch, but LGTM.

Thanks, Now pushed to master as commit a17ad0b212.  Closing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-25 18:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-25 11:22 bug#41524: 26.3; Request for 'x' for 'execute' in dired menu jan via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-05-25 15:05 ` Drew Adams
2020-08-24  0:26   ` Stefan Kangas
2020-08-24 15:09     ` Drew Adams
2020-08-24 15:50       ` Stefan Kangas
2020-08-24 16:04         ` Drew Adams
2020-08-25 18:34           ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).