GNU bug report logs - #2414
23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands

Previous Next

Package: emacs;

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

Date: Fri, 20 Feb 2009 20:10:04 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.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 2414 in the body.
You can then email your comments to 2414 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2414; Package emacs. (Fri, 20 Feb 2009 20:10:05 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 Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 20 Feb 2009 20:10:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands
Date: Fri, 20 Feb 2009 12:01:29 -0800
Enhancement request:
 
`minibuffer-default-add-shell-commands' should add to the minibuffer
defaults list not only the commands determined by MIME type (which it
does now, using `mailcap-file-default-commands'), but also the
commands determined by `dired-guess-default'.
 
`dired-guess-default' is defined in dired-x.el, but it has nothing to
do with Dired, AFAICT, so there is no reason that it should not be
available (and used) generally.
 
And variables `dired-guess-shell-alist-user' and
`dired-guess-shell-alist-default' should also be factored out of
dired-x.el. They too are not Dired-related, AFAICT.
 
It is true that the default value of `dired-guess-shell-alist-default'
is computed using some variables, such as `dired-guess-shell-gnutar',
that are defined in dired-x.el.  However, those parts of the value
could be picked up dynamically and conditionally instead. Or, if they
too are not Dired-related, they could be moved elsewhere and made
available generally.

Note, BTW, that dired-x.el already uses `minibuffer-default-add-shell-commands'
in `dired-smart-shell-command' (in dired-x.el). It makes no
sense that only the MIME types be used to come up with defaults, and
not also `dired-guess-default', in the very library that defines
`dired-guess-default'!

My guess is that someone just updated `dired-smart-shell-command' for
Emacs 23 mechanically, without thinking about the commands provided
by `dired-guess-default'. IOW, it was a mechanical substitution of
the same diff that was used to update `read-shell-command'.
 
The idea behind this enhancement request is that there is no reason
that `minibuffer-default-add-shell-commands' should not benefit also
from the candidate commands defined by these alists.
 

In GNU Emacs 23.0.90.1 (i386-mingw-nt5.1.2600)
 of 2009-02-01 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
 





Severity set to `wishlist' from `normal' Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sat, 21 Feb 2009 15:10:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2414; Package emacs. (Sun, 22 Feb 2009 22:05:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Feb 2009 22:05:09 GMT) Full text and rfc822 format available.

Message #12 received at 2414 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 2414 <at> debbugs.gnu.org
Subject: Re: bug#2414: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands
Date: Sun, 22 Feb 2009 23:54:10 +0200
> Enhancement request:
>
> `minibuffer-default-add-shell-commands' should add to the minibuffer
> defaults list not only the commands determined by MIME type (which it
> does now, using `mailcap-file-default-commands'), but also the
> commands determined by `dired-guess-default'.
>
> `dired-guess-default' is defined in dired-x.el, but it has nothing to
> do with Dired, AFAICT, so there is no reason that it should not be
> available (and used) generally.
>
> And variables `dired-guess-shell-alist-user' and
> `dired-guess-shell-alist-default' should also be factored out of
> dired-x.el. They too are not Dired-related, AFAICT.

Instead of generalizing `dired-guess-shell-alist-default',
I'd rather create a similar user-defined list of commands
to override default MIME commands in `mailcap-mime-data'
(using something like `mailcap-add').

> Note, BTW, that dired-x.el already uses `minibuffer-default-add-shell-commands'
> in `dired-smart-shell-command' (in dired-x.el). It makes no
> sense that only the MIME types be used to come up with defaults, and
> not also `dired-guess-default', in the very library that defines
> `dired-guess-default'!

Thanks for the pointer.  After moving code with
`minibuffer-default-add-shell-commands' from `shell-command'
to `read-shell-command' on 2008-07-31 I forgot to change
`dired-smart-shell-command' the same way.  Fixed now.

> My guess is that someone just updated `dired-smart-shell-command' for
> Emacs 23 mechanically, without thinking about the commands provided
> by `dired-guess-default'. IOW, it was a mechanical substitution of
> the same diff that was used to update `read-shell-command'.

`dired-smart-shell-command' is unrelated to `dired-guess-default'
with its alists.  `dired-smart-shell-command' is bound to `M-!'
and according to its docstring it should work like `shell-command'.

Moreover, currently `M-!' is the only way to use MIME commands from
`mailcap-file-default-commands' when dired-x is loaded!

-- 
Juri Linkov
http://www.jurta.org/emacs/




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2414; Package emacs. (Sun, 22 Feb 2009 23:10:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Feb 2009 23:10:04 GMT) Full text and rfc822 format available.

Message #17 received at 2414 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Juri Linkov'" <juri <at> jurta.org>
Cc: <2414 <at> debbugs.gnu.org>
Subject: RE: bug#2414: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands
Date: Sun, 22 Feb 2009 15:04:53 -0800
> > Enhancement request:
> >
> > `minibuffer-default-add-shell-commands' should add to the minibuffer
> > defaults list not only the commands determined by MIME type 
> (which it
> > does now, using `mailcap-file-default-commands'), but also the
> > commands determined by `dired-guess-default'.
> >
> > `dired-guess-default' is defined in dired-x.el, but it has 
> > nothing to do with Dired, AFAICT, so there is no reason that
> > it should not be available (and used) generally.
> >
> > And variables `dired-guess-shell-alist-user' and
> > `dired-guess-shell-alist-default' should also be factored out of
> > dired-x.el. They too are not Dired-related, AFAICT.
> 
> Instead of generalizing `dired-guess-shell-alist-default',
> I'd rather create a similar user-defined list of commands
> to override default MIME commands in `mailcap-mime-data'
> (using something like `mailcap-add').

`dired-guess-shell-alist-user' is the user-defined list;
`dired-guess-shell-alist-default' is not user-defined. But a user-defined list
lets users override and supplement a default list of rules.

Why would this necessarily have anything to do with MIME types? The Dired-X
style rules provide an orthogonal way to provide guesses of shell commands for
given file types.

If you want to *also* do something similar for MIME types (a user-defined
MIME-association list, to override default MIME-association behavior), that's
another story. That is a separate suggestion from the one I am making.

What is wrong with having a default set of Dired-X style rules, such as
`dired-guess-shell-alist-default' - but outside of Dired(-X), and likewise let
users provide a set of custom rules to override these default rules (like
`dired-guess-shell-alist-user' - but outside of Dired(-X))?

Why couple such rules with MIME-type overrides? MIME-type associations are a
different kind of file-type association from the simple Dired-X style rules.

And we could go beyond this, to include MS Windows file-type associations (which
I believe are in the Registry). On Windows, Emacs could employ also those
associations when trying to suggest appropriate programs (shell commands) for a
given set of file types.

FWIW, (except for including MS Windows associations), I do this in Icicles. For
example, for a PDF file marked in Dired, the MIME-type association comes up with
commands `gv -safer' and `pdftotext ? -', and the Dired-X rules come up with
command `xpdf' (with my Cygwin bash shell and default MIME types). There's no
reason not to provide all three commands to the user.

And there's no reason to try to shoehorn everything into the form of MIME-type
associations, so that MIME alone is made to come up with all three guesses.
Improving MIME associations is possible, but it is a separate question.

Not everything need be done in the context of MIME types. The Dired-X style
rules are handy and orthogonal, as are MS Windows file-type associations.

Come to think of it, there might be a reason for Dired to keep its own set of
such rules, in *addition* to creating a global set. That might be handy for use
by code and hooks etc. Dunno.

But the main thing is to move these two alists out of Dired-X and make their
associations available generally, in the same way as the MIME associations are
available generally.

> > Note, BTW, that dired-x.el already uses 
> > `minibuffer-default-add-shell-commands'
> > in `dired-smart-shell-command' (in dired-x.el). It makes no
> > sense that only the MIME types be used to come up with defaults, and
> > not also `dired-guess-default', in the very library that defines
> > `dired-guess-default'!
> 
> Thanks for the pointer.  After moving code with
> `minibuffer-default-add-shell-commands' from `shell-command'
> to `read-shell-command' on 2008-07-31 I forgot to change
> `dired-smart-shell-command' the same way.  Fixed now.
> 
> > My guess is that someone just updated 
> > `dired-smart-shell-command' for
> > Emacs 23 mechanically, without thinking about the commands provided
> > by `dired-guess-default'. IOW, it was a mechanical substitution of
> > the same diff that was used to update `read-shell-command'.
> 
> `dired-smart-shell-command' is unrelated to `dired-guess-default'
> with its alists.  `dired-smart-shell-command' is bound to `M-!'
> and according to its docstring it should work like `shell-command'.

Yes, you're right about that - I misspoke.

> Moreover, currently `M-!' is the only way to use MIME commands from
> `mailcap-file-default-commands' when dired-x is loaded!





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2414; Package emacs. (Sun, 22 Feb 2009 23:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Feb 2009 23:45:02 GMT) Full text and rfc822 format available.

Message #22 received at 2414 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 2414 <at> debbugs.gnu.org
Subject: Re: bug#2414: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands
Date: Mon, 23 Feb 2009 01:37:45 +0200
> Come to think of it, there might be a reason for Dired to keep its own
> set of such rules, in *addition* to creating a global set. That might
> be handy for use by code and hooks etc. Dunno.
>
> But the main thing is to move these two alists out of Dired-X and make
> their associations available generally, in the same way as the MIME
> associations are available generally.

I mostly agree but such a general task is for after the release.

However, now I fixed an omission in dired-x.el to use exactly
the same functions as were implemented for dired-aux.el
(using read-shell-command instead of read-from-minibuffer and
correctly setting minibuffer-default-add-dired-shell-commands
in dired-read-shell-command).  This causes MIME commands to be
automatically added after guess-shell commands.  So currently
Dired-x users can be more happy because they have both command sets.

-- 
Juri Linkov
http://www.jurta.org/emacs/




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2414; Package emacs. (Mon, 23 Feb 2009 00:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 23 Feb 2009 00:35:03 GMT) Full text and rfc822 format available.

Message #27 received at 2414 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Juri Linkov'" <juri <at> jurta.org>
Cc: <2414 <at> debbugs.gnu.org>
Subject: RE: bug#2414: 23.0.90; use dired-guess-default too for minibuffer-default-add-shell-commands
Date: Sun, 22 Feb 2009 16:25:47 -0800
> > Come to think of it, there might be a reason for Dired to 
> > keep its own set of such rules, in *addition* to creating
> > a global set. That might be handy for use by code and hooks
> > etc. Dunno.
> >
> > But the main thing is to move these two alists out of 
> > Dired-X and make their associations available generally,
> > in the same way as the MIME associations are available
> > generally.
> 
> I mostly agree but such a general task is for after the release.

Sure.

> However, now I fixed an omission in dired-x.el to use exactly
> the same functions as were implemented for dired-aux.el
> (using read-shell-command instead of read-from-minibuffer and
> correctly setting minibuffer-default-add-dired-shell-commands
> in dired-read-shell-command).  This causes MIME commands to be
> automatically added after guess-shell commands.  So currently
> Dired-x users can be more happy because they have both command sets.

Looks good.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#2414; Package emacs. (Sat, 04 Dec 2021 21:28:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 2414 <at> debbugs.gnu.org
Subject: Re: bug#2414: 23.0.90; use dired-guess-default too for
 minibuffer-default-add-shell-commands
Date: Sat, 04 Dec 2021 22:27:18 +0100
"Drew Adams" <drew.adams <at> oracle.com> writes:

> `dired-guess-default' is defined in dired-x.el, but it has nothing to
> do with Dired, AFAICT, so there is no reason that it should not be
> available (and used) generally.
>
> And variables `dired-guess-shell-alist-user' and
> `dired-guess-shell-alist-default' should also be factored out of
> dired-x.el. They too are not Dired-related, AFAICT.

Well...  they are dired-specific, because they're only used in dired.
(And using them elsewhere would be pretty surprising.)

Emacs does have a problem in this area, though -- I'm guessing there's a
dozen different packages that define similar functionality (i.e.,
"what's in mailcap but with some extras"), and consolidating these would
be nice.  But the problem is that there's different use cases -- the
things a person wants to do in Dired isn't necessarily what they'd want
to do in Gnus when receiving an attachment).

And so we're where we are.

So I don't want to make the minibuffer function depend on Dired, and I
don't want to make these things non-Dired-applicable (because that'd
annoy people who have customised their Dired experience), so there's
nothing actionable left here, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 21:28:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 2414 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 21:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#2414; Package emacs. (Sun, 05 Dec 2021 10:05:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Drew Adams <drew.adams <at> oracle.com>, 2414 <at> debbugs.gnu.org
Subject: Re: bug#2414: 23.0.90; use dired-guess-default too for
 minibuffer-default-add-shell-commands
Date: Sun, 05 Dec 2021 11:25:05 +0200
> Emacs does have a problem in this area, though -- I'm guessing there's a
> dozen different packages that define similar functionality (i.e.,
> "what's in mailcap but with some extras"), and consolidating these would
> be nice.  But the problem is that there's different use cases -- the
> things a person wants to do in Dired isn't necessarily what they'd want
> to do in Gnus when receiving an attachment).

Such consolidation was discussed recently in https://debbugs.gnu.org/18132#92




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Jan 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 108 days ago.

Previous Next


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