Subject: Re: bug#18132: Time for a smarter dired-guess-shell-alist-default? (dired-x.el)

From: Eli Zaretskii <[email-masked]>
Date: Sat, 23 Oct 2021 14:48:06 +0300

> From: Stefan Kangas <[email-masked]>
> Date: Sat, 23 Oct 2021 02:48:19 -0700
> Cc: [email-masked], [email-masked]
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > 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.
> 
> Isn't that just "file --mime-type -b"?  file is a BSD command AFAICT so
> it should presumably be available almost everywhere.

It isn't available on Windows, for starters.  (I do have it, but I
ported it myself.)

And what about files that have no MIME type defined for them?  Or
where 'file's output is not really useful, like this:

  $ file --mime-type -b elisp.info
  application/octet-stream