|
From: | Max Nikulin |
Subject: | Re: [BUG] org-open-file immediately termininates when calling xdg-open that calls emacsclient |
Date: | Sun, 22 May 2022 15:13:41 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
On 22/05/2022 11:37, Ihor Radchenko wrote:
I have a problem with the following commits: 869b7a21b org-open-file: Avoid make-process for Emacs 24 compatibility 5db61eb0f org.el: Avoid xdg-open silent failure They both set process-connection-type to nil/'pipe. Somehow, this change breaks org-open-file for me when org-open-file calls xdg-open and xdg is confugured to open the file with emacsclient. I only see a flicker and the file does not open. Sometimes, Emacs even crashes.
I can not reproduce a problem, however I tried to factor-out xdg-open. Emacs-27.1, a minimal LXC container, so "&" to simulate kde-open5 starting process in background. On the other hand I consider behavior when emacsclient is called from emacs as confusing due to requirement of C-x # to notify emacs about completion.
---- >8 ---- #+begin_src elisp (push '("\\.txt\\'" . "emacsclient %s &") org-file-apps) #+end_src [[file:some.txt]] ---- 8< ----Nothing happens if emacs server is not started, but error handling was sacrificed for compatibility with old emacs versions.
Do you see the same problem for a function from mailcap.el in the development emacs version?
Eli Zaretskii suspected some compatibility issue, but he successfully resisted my attempts to pull some details from him. I know how to create a MIME handler that will cause 100% CPU consumption by Emacs for pipe processes, but he does not consider it as a real problem.
If I change the process type back to default tty value, things work again as expected.
You might try `call-process' with 0 as DESTINATION (attention! not nil!).See #+begin_comment snippet from the following patch (this part was not committed since Robert convinced me that it is confusing): Max Nikulin to emacs-orgmode. [PATCH v3] Fix FAQ entry about mailto links. Mon, 14 Feb 2022 20:22:14 +0700. https://list.orgmode.org/9437ade2-af18-f97e-8790-a2df27c9017c@gmail.com
I do not know a way to reliably launch external MIME handler from Emacs. All means I am aware of have some caveats.
[Prev in Thread] | Current Thread | [Next in Thread] |