[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DISCUSSION, default settings] Using mailcap as default handler for
From: |
Ihor Radchenko |
Subject: |
Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links |
Date: |
Mon, 12 Feb 2024 12:36:50 +0000 |
Max Nikulin <manikulin@gmail.com> writes:
> On 04/06/2022 20:42, Ihor Radchenko wrote:
>>
>> It appears that using mailcap is giving us more trouble than benefits.
>> I am not sure about the situation on Windows and Mac though.
>>
>> Should we change the default file handlers to Emacs globally (unless
>> user customizes otherwise)? Should we continue efforts to work around
>> mailcap issues? Maybe there is yet another alternative generic way to
>> open files?
>
> ...
> I believe, there are enough issues with mailcap implementation in Emacs,
> but do we have some alternative? There is no support of queries to
> mimeapps.list files in Emacs (XDG). Like Chrome it is possible to call
> xdg-open for any type that can not be handled internally. Maybe it
> possible to leave it in Org as is or with the patch to call "file"
> utility (after some fixes).
I have been digging more on this issue recently, and I have found that
Carsten once attempted to tweak this default to use xdg-mime:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=15ae89b39
Use `xdg-open' to open files where available
* lisp/org.el (org-file-apps-defaults-gnu): Use `xdg-open' to open files
where available.
(defconst org-file-apps-defaults-gnu
- '((remote . emacs)
- (system . mailcap)
- (t . mailcap))
+ (append
+ '((remote . emacs))
+ (if (executable-find "xdg-open")
+ '((system . "xdg-open %s")
+ (t . "xdg-open %s"))
+ '((system . mailcap)
+ (t . mailcap))))
However, that commit had been reverted because xdg-open did not work for
some users, "failing silently":
https://list.orgmode.org/CAN_Dec8n=yNTto6Uh0dN50fG_HbqHFQtmYOCchH7wsyJdm3_Gg@mail.gmail.com/
I believe that xdg-open issue has been fixed by you in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5db61eb0f
org.el: Avoid xdg-open silent failure
So, it may be safe to re-apply that Carsten's commit now.
WDYT?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links,
Ihor Radchenko <=
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Max Nikulin, 2024/02/13
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Ihor Radchenko, 2024/02/13
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Max Nikulin, 2024/02/13
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Max Nikulin, 2024/02/13
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Ihor Radchenko, 2024/02/14
- Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links, Max Nikulin, 2024/02/27