[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in 9.5.3 org--file-default-apps

From: Max Nikulin
Subject: Re: Bug in 9.5.3 org--file-default-apps
Date: Mon, 16 May 2022 22:14:39 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 16/05/2022 18:57, Ihor Radchenko wrote:
Craig STCR writes:
But with the new form in 9.5.3, /home/user/myscript is opened by
/bin/less, not emacs.  I assume mailcap is not consulted.  Which does
not work well.  These behaviors are only for org.  Outside of org, emacs
behaves correctly.

mailcap does get consulted. What you are seeing happens because
mailcap.el (built-in Emacs library) is only able to recognise mime-types
by extension. So, your file is likely recognised as "nil" mimetype thus
making Org mode fallback to default mailcap handler, which is /bin/less
in your case.

Sounds reasonable. However I just have tried a [[file:~/path/to/script]] link running Org main HEAD and the file is opened in emacs (26.3) other window.

I guess that Org can also try to use `file' command (when available) to
determine the mime type. Though ideally, it should be all handled by
mailcap.el Would you mind writing to emacs-devel mailing list and asking
to add the feature of using `file' command into mailcap.el?

Re: using libmagic in Emacs?
From:   joakim
Subject:        Re: using libmagic in Emacs?
Date:   Mon, 24 Aug 2009 14:30:33 +0200

A never committed patch. It is sour from my point of view.

From:   Eli Zaretskii
Subject:        Re: using libmagic in Emacs?
Date:   Sun, 30 Aug 2009 06:09:23 +0300
From: Juri Linkov
Date: Sun, 30 Aug 2009 02:19:12 +0300

I agree that running `file' is a simpler solution.

PLEASE do not base Emacs infrastructure on external programs, unless
they come with Emacs.  `file' is not available on every platform, and
even on those it is, the quality and extent of its database is unclear
and so cannot be relied upon.

From:   Richard Stallman
How hard would it be to change the code in Emacs to recognize these
using the existing mechanism?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]