GNU bug report logs -
#18132
Time for a smarter dired-guess-shell-alist-default? (dired-x.el)
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Mon, 28 Jul 2014 18:27:01 UTC
Severity: wishlist
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #110 received at 18132 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 18132 <at> debbugs.gnu.org
> Date: Fri, 24 Nov 2023 09:51:54 +0200
>
> >> > Then its possible options for such hook could include:
> >> >
> >> > - xdg-open-function
> >> > - mailcap-function that adds mailcap candidates
> >> > - dired-x-guess that adds existing dired-guess-shell-alist-default
> >> > - Windows-specific candidates from w32-shell-execute
> >> > - etc.
> >>
> >> Here is the implementation:
> >
> > Thanks, but please don't put this stuff in simple.el. There's no
> > reason to have this preloaded in Emacs.
>
> I can't find other place to put these 50 lines. I added to simple.el
> near read-shell-command because it's used by read-shell-command.
IMO, read-shell-command should not by default call these helpers.
If we cannot find a suitable non-preloaded file to put this stuff (is
subr-x.el okay, for example?), it's okay to start a new file.
> > And let's try to implement this in a way that won't load mailcap, xdg,
> > dired, and dired-aux whenever shell-command is invoked.
>
> It already doesn't load mailcap, xdg, dired, and dired-aux
> when shell-command is invoked. It loads these files only
> when the user needs to use them and types 'M-n' twice in the
> minibuffer of read-shell-command ('M-!' and 'M-&').
That's immaterial: M-n is an integral part of shell-command (of any
command, really), and thus should not cause such massive loading of
helper stuff, not by default anyway. Why do we think we can
second-guess what user wants from shell-command guessing? why do we
think the user will want XDG in this picture? or mailcap? These are
explicit user preferences, and we should leave it to the users to
express their preferences.
> Also shell-command-guess is used by dired-read-shell-command
> ('!' and '&' on a file in dired).
Likewise here: users should by default be able to invoke these Dired
commands without automatically loading those helpers, which come with
quite tangible ballast. For Dired, this is perhaps less important,
since Dired itself is an optional package, but still: I think it's
wrong to do this by default.
This bug report was last modified 363 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.