emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Ihor Radchenko
Subject: Re: Bug in 9.5.3 org--file-default-apps
Date: Mon, 16 May 2022 19:57:46 +0800

Craig STCR <craig.stcr1@gmail.com> writes:

> OK, I'll take a look as you suggested as soon as I can.
>
> So the form in 9.5.2 was a bug?

Yes, 9.5.2 version of that function was a bug.

> The problem I encounter with the new form in 9.5.3 is that when opening 
> a shell script -- no file extension, e.g. /home/user/myscript -- 9.5.2 
> would consult mailcap and open the script in Emacs.  The mailcap entry is:
>
>     application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY"
>
> 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. In Org 9.5.2 the error in org--file-default-apps made Org
mode skip using mailcap and use the last possible fallback, which is
opening in emacs. That fallback just happened to be the same with your
setting in mailcap file.

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?

Best,
Ihor




reply via email to

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