GNU bug report logs - #63875
26.3; Doc of `dired-guess-shell-alist-user'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 3 Jun 2023 16:09:02 UTC

Severity: minor

Found in version 26.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63875 in the body.
You can then email your comments to 63875 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Jun 2023 16:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.3; Doc of `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 16:08:11 +0000
The doc string doesn't say what REGEXP is, e.g., what it's intended to
match.  It should say that up front and explicitly.

Manual (dired-x) `Shell Command Guessing' sort of says it, if you read
carefully and guess a bit.

Please say explicitly that REGEXP is a regexp that's used to match file
names.  And say how the alist entries are used.  All that's said, so
far, is that this is a "User-defined alist of rules for suggested
commands."

Rules used how?  What does matching file names have to do with using a
command?  Again, the manual does say this somewhat, but not the doc
string.

The doc refers to `dired-guess-shell-alist-default', but the doc for
that variable doesn't explain anything, so it doesn't help with the
missing info for `dired-guess-shell-alist-user'.

FWIW, the comment in file dired-x.el that introduces these variables
describes them better than the doc in some ways: what they're for, how
they're used.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19045
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>, "63875 <at> debbugs.gnu.org"
 <63875 <at> debbugs.gnu.org>
Subject: RE: 26.3; Doc of `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 16:14:01 +0000
Maybe say something similar to what oantolin says
in this Reddit post:

  "an alist that maps filename regexps to a list
   of commands you might want to apply to the file."

https://www.reddit.com/r/emacs/comments/13yrk5k/is_there_a_package_for_a_opening_a_menu_of_file/jmprpp2/

And maybe make clear that "shell command" here can
also mean any executable program.  (No shell need
be involved.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:17:01 GMT) Full text and rfc822 format available.

Message #11 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 63875 <at> debbugs.gnu.org
Subject: Re: bug#63875: 26.3; Doc of `dired-guess-shell-alist-user'
Date: Sat, 03 Jun 2023 19:16:48 +0300
> From: Drew Adams <drew.adams <at> oracle.com>
> Date: Sat, 3 Jun 2023 16:08:11 +0000
> 
> The doc string doesn't say what REGEXP is, e.g., what it's intended to
> match.  It should say that up front and explicitly.

???The doc string says:

  Each element of this list looks like

      (REGEXP COMMAND...)

  COMMAND will be used if REGEXP matches the file to be processed.
  If several files are to be processed, REGEXP has to match all the
  files.

"REGEXP matches the file to be processed".  What else needs to be
said?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 16:21:55 +0000
> > The doc string doesn't say what REGEXP is, e.g., what it's intended to
> > match.  It should say that up front and explicitly.
> 
> ???The doc string says:
> 
>   Each element of this list looks like
> 
>       (REGEXP COMMAND...)
> 
>   COMMAND will be used if REGEXP matches the file to be processed.
>   If several files are to be processed, REGEXP has to match all the
>   files.
> 
> "REGEXP matches the file to be processed".  What else needs to be
> said?

Apologies.  The bug report was from Emacs 26.  I see
now that the doc string was improved since then to
what you quote.

In Emacs 26, it says only this:

 Each element of this list looks like

     (REGEXP COMMAND...)

 where each COMMAND can either be a string or a Lisp
 expression that evaluates to a string.

Feel free to close the bug.  Thx.





Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 03 Jun 2023 16:24:01 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Sat, 03 Jun 2023 16:24:01 GMT) Full text and rfc822 format available.

Message #19 received at 63875-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 63875-done <at> debbugs.gnu.org
Subject: Re: [External] : Re: bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 03 Jun 2023 19:24:39 +0300
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
> Date: Sat, 3 Jun 2023 16:21:55 +0000
> 
> > > The doc string doesn't say what REGEXP is, e.g., what it's intended to
> > > match.  It should say that up front and explicitly.
> > 
> > ???The doc string says:
> > 
> >   Each element of this list looks like
> > 
> >       (REGEXP COMMAND...)
> > 
> >   COMMAND will be used if REGEXP matches the file to be processed.
> >   If several files are to be processed, REGEXP has to match all the
> >   files.
> > 
> > "REGEXP matches the file to be processed".  What else needs to be
> > said?
> 
> Apologies.  The bug report was from Emacs 26.  I see
> now that the doc string was improved since then to
> what you quote.
> 
> In Emacs 26, it says only this:
> 
>  Each element of this list looks like
> 
>      (REGEXP COMMAND...)
> 
>  where each COMMAND can either be a string or a Lisp
>  expression that evaluates to a string.
> 
> Feel free to close the bug.  Thx.

Closing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:27:02 GMT) Full text and rfc822 format available.

Message #22 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Drew Adams <drew.adams <at> oracle.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 16:26:02 +0000
> Feel free to close the bug.  Thx.

But it would be good, I think, to add that it's
not just about shell commands.  Some users will
not recognize that they can invoke executable
programs this way.

E.g., on MS Windows, users who never use anything
like a shell explicitly will nevertheless want to
know how to associate files (by name matches) with
applications, in Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 16:29:01 GMT) Full text and rfc822 format available.

Message #25 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 63875 <at> debbugs.gnu.org
Subject: Re: [External] : bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 03 Jun 2023 19:29:30 +0300
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
> Date: Sat, 3 Jun 2023 16:26:02 +0000
> 
> > Feel free to close the bug.  Thx.
> 
> But it would be good, I think, to add that it's
> not just about shell commands.  Some users will
> not recognize that they can invoke executable
> programs this way.

Shell commands are a super-set of executable programs, so I see no
reason to change anything here.  The variable is used to invoke
commands via a shell, so "shell command" is exactly right.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 17:21:02 GMT) Full text and rfc822 format available.

Message #28 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 17:20:14 +0000
> > But it would be good, I think, to add that it's
> > not just about shell commands.  Some users will
> > not recognize that they can invoke executable
> > programs this way.
> 
> Shell commands are a super-set of executable programs, so I see no
> reason to change anything here.  The variable is used to invoke
> commands via a shell, so "shell command" is exactly right.

Yes, but many Emacs users won't know that.

Unless they're programmers or they are used to
GNU or Unix or Linux, some users won't guess
that they can use this user option to associate
applications (executable binaries) with file
names for Emacs.

MS Windows, for example, may know how to create
default file associations for programs invoked
normally (for Windows), but Emacs users on
Windows might well not guess that they can
associate files with programs for Emacs.

If you disagree that this is the case, fine.
But if you agree then maybe you'll consider
explicitly mentioning this use of the option.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 18:50:02 GMT) Full text and rfc822 format available.

Message #31 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 63875 <at> debbugs.gnu.org
Subject: Re: [External] : bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 03 Jun 2023 21:50:05 +0300
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
> Date: Sat, 3 Jun 2023 17:20:14 +0000
> 
> > > But it would be good, I think, to add that it's
> > > not just about shell commands.  Some users will
> > > not recognize that they can invoke executable
> > > programs this way.
> > 
> > Shell commands are a super-set of executable programs, so I see no
> > reason to change anything here.  The variable is used to invoke
> > commands via a shell, so "shell command" is exactly right.
> 
> Yes, but many Emacs users won't know that.

Why wouldn't they? we have a chapter named "Running Shell Commands
from Emacs" in the Emacs manual.  Typing "i shell commands RET" in
Info brings you there.

I think you see a problem where there is none.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sat, 03 Jun 2023 19:30:02 GMT) Full text and rfc822 format available.

Message #34 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#63875: 26.3; Doc of
 `dired-guess-shell-alist-user'
Date: Sat, 3 Jun 2023 19:29:35 +0000
> > > > But it would be good, I think, to add that it's
> > > > not just about shell commands.  Some users will
> > > > not recognize that they can invoke executable
> > > > programs this way.
> > >
> > > Shell commands are a super-set of executable programs, so I see no
> > > reason to change anything here.  The variable is used to invoke
> > > commands via a shell, so "shell command" is exactly right.
> >
> > Yes, but many Emacs users won't know that.
> 
> Why wouldn't they? we have a chapter named "Running Shell Commands
> from Emacs" in the Emacs manual.  Typing "i shell commands RET" in
> Info brings you there.
> 
> I think you see a problem where there is none.

Is that Emacs manual node linked from the
Dired-x manual page that describes the option?

Is it linked from the *Help* output for the option?

Else it's unlikely that most users reading the doc
for the option will search for "shell commands"
in the Emacs manual.

Most users have likely heard of shell commands,
but it's not at all obvious that nonprogrammers
etc. will realize that mention of shell commands
in a description of this option will likely be of
use to them for associating files with apps.

That's the purpose of this option.  It would be
far clearer, and far easier for doc maintainers
and users of the doc, to simply add a brief
sentence or phrase to indicate that "shell
commands" here covers programs in general.

I've said enough to get the point across.  If
you don't want to fix this because a user has
the ability to go to the Emacs manual from
the doc string or from the Dired-X manual, and
look up "shell command" in the Emacs manual,
fine.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63875; Package emacs. (Sun, 04 Jun 2023 17:02:02 GMT) Full text and rfc822 format available.

Message #37 received at 63875 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "63875 <at> debbugs.gnu.org" <63875 <at> debbugs.gnu.org>
Subject: Re: bug#63875: 26.3; Doc of `dired-guess-shell-alist-user'
Date: Sun, 04 Jun 2023 19:44:10 +0300
> Maybe say something similar to what oantolin says
> in this Reddit post:
>
>   "an alist that maps filename regexps to a list
>    of commands you might want to apply to the file."
>
> https://www.reddit.com/r/emacs/comments/13yrk5k/is_there_a_package_for_a_opening_a_menu_of_file/jmprpp2/

The request was:

  "I was thinking of something similar to OS file managers, where you can
  right-click a file and have operations relevant to the extension pop up."

So does it makes sense to add to the context menu in Dired a submenu
like this?

  "Open with ..." ->
    "Command 1"
    "Command 2"
    ...




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Jul 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.