all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefan@marxist.se>
Cc: 18132@debbugs.gnu.org, rrt@sc3d.org
Subject: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el)
Date: Sat, 23 Oct 2021 11:34:52 +0300	[thread overview]
Message-ID: <83h7d85ec3.fsf@gnu.org> (raw)
In-Reply-To: <CADwFkmmP5tgu8eJCRqdbqwbqezHbjkQxtsotwhPszF9_ECdJzA@mail.gmail.com> (message from Stefan Kangas on Sat, 23 Oct 2021 01:16:48 -0700)

> From: Stefan Kangas <stefan@marxist.se>
> Date: Sat, 23 Oct 2021 01:16:48 -0700
> Cc: rrt@sc3d.org, 18132@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > It's not only that.  Emacs's ability to run programs given a file can
> > extend and surpass those of the underlying OS, and the ability of
> > Emacs users to configure and customize that in a unified
> > system-independent manner are either better or simply not available at
> > all in the OS-level tools which offer similar functionality.
> >
> > So I think it would be nice to extend dired-guess-shell-* so that it
> > could delegate to the OS-level capabilities like xdg-open or
> > w32-shell-execute, but we should preserve the abilities to override or
> > extend that with Emacs-level associations between files and programs.
> 
> That sounds like exactly the right thing to do.  So we need to add stuff
> here, without taking anything away.

Yes, that's the idea.

> However, I will add that while we maintain our current capabilities for
> customization, we might want to consider removing or updating some
> entries from `dired-guess-shell-alist-default'.  For example, we
> currently recommend xpdf for PDF:s, which, sure, is presumably available
> "everywhere", but also is pretty lacking in features and just plain
> clunky compared to something like evince.
> 
> To make matters even worse,
> 
>     emacs -Q --eval "(progn (require 'dired-x) (dired \"~\"))"
> 
> happily offers up xpdf as the default command for PDF:s even though I
> don't even have xpdf installed!  So perhaps it's not that ubiquitous
> these days... you have to specifically install it to even have it.

I think that's a separate issue: how to deal with a failure to invoke
the program which we guessed would be appropriate for the file in
question.  I could argue that we should try invoking the program
anyway, because failure to invoke it could mean the user should
install some component, and that is useful information for the user.

> Looking even more closely at this, I guess `xdg-open' could be used as
> some final fallback, but it doesn't seem to add anything that isn't
> already available from mailcap?  And we already have
> `mailcap-file-default-commands', so why not just provide a default based
> on that?

Because that's not portable enough?

> On my machine, I get the very reasonable:
> 
>     (mailcap-file-default-commands '("foo.pdf"))
>     => ("evince" "xdg-open")

Here, the above returns something much less useful:

  ("pdftotext ? -" "gv -safer")

None of that would have helped me to view a PDF file.

So if we want to use mailcap for this, we'd need to extend that, and
make it smarter, in particular on non-GNU/Linux platforms.

More generally, I'm not sure mailcap is the right tool for the job:
its main purpose is to view attachments to email messages, where we
generally have metadata (MIME etc.) which is not necessarily available
for arbitrary disk files.





  reply	other threads:[~2021-10-23  8:34 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 18:26 bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Reuben Thomas
2014-07-28 18:44 ` bug#18132: Sample code Reuben Thomas
2014-07-29 23:49 ` bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el) Juri Linkov
2014-07-30  9:12   ` Reuben Thomas
2014-07-30 16:32     ` Juri Linkov
2014-07-30 16:44       ` Reuben Thomas
2014-08-04 23:45         ` Juri Linkov
2014-08-05  9:41           ` Reuben Thomas
2021-10-23  5:25             ` Stefan Kangas
2021-10-23  7:44               ` Eli Zaretskii
2021-10-23  8:16                 ` Stefan Kangas
2021-10-23  8:34                   ` Eli Zaretskii [this message]
2021-10-23  9:48                     ` Stefan Kangas
2021-10-23 11:48                       ` Eli Zaretskii
2021-10-23 13:06                       ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-23 13:20                         ` Eli Zaretskii
2021-10-23 13:01                   ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-23 13:56                     ` Stefan Kangas
2021-10-23 14:03                       ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-23 15:45                         ` Stefan Kangas
2021-10-23 17:17                           ` Gregory Heytings
2021-10-23 20:53                           ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-24  6:02                             ` Eli Zaretskii
2021-10-24  7:56                               ` Juri Linkov
2023-11-23 17:49                                 ` Juri Linkov
2023-11-23 19:40                                   ` Eli Zaretskii
2023-11-24  7:51                                     ` Juri Linkov
2023-11-24 14:24                                       ` Eli Zaretskii
2023-11-25 18:10                                         ` Juri Linkov
2023-11-26 10:37                                           ` Eli Zaretskii
2023-11-27 17:32                                             ` Juri Linkov
2023-11-28 17:05                                               ` Juri Linkov
2023-11-28 17:35                                                 ` Eli Zaretskii
2023-11-29  7:09                                                   ` Juri Linkov
2023-11-29 13:07                                                     ` Eli Zaretskii
2023-12-02 17:44                                                       ` Juri Linkov
2023-12-02 18:37                                                         ` Drew Adams
2023-12-03 17:04                                                           ` Juri Linkov
2023-12-03 21:16                                                             ` Drew Adams
2023-12-06 17:28                                                               ` Juri Linkov
2023-12-07 17:33                                                                 ` Juri Linkov
2023-12-07 17:48                                                                   ` Eli Zaretskii
2023-12-08  7:37                                                                     ` Juri Linkov
2023-12-08  8:08                                                                       ` Eli Zaretskii
2023-12-09 17:13                                                                         ` Juri Linkov
2024-05-22  6:16                                                                           ` Juri Linkov
2024-05-22 12:42                                                                             ` Eli Zaretskii
2024-05-23  6:19                                                                               ` Juri Linkov
2024-05-23  7:16                                                                                 ` Eli Zaretskii
2024-05-23 17:31                                                                                   ` Juri Linkov
2024-05-23 18:15                                                                                     ` Eli Zaretskii
2024-05-24  6:44                                                                                       ` Juri Linkov
2024-05-24  7:31                                                                                         ` Eli Zaretskii
2024-05-24 17:56                                                                                           ` Juri Linkov
2021-10-23 17:57                       ` Howard Melman
2021-10-23 18:29                         ` Juri Linkov
2021-10-23 19:22                           ` bug#18132: [External] : " Drew Adams
2021-10-24 16:35                           ` Howard Melman
2021-10-24 19:08                             ` Juri Linkov
2021-10-24  5:10                       ` Thierry Volpiatto
2014-07-30  3:56 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h7d85ec3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18132@debbugs.gnu.org \
    --cc=rrt@sc3d.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.