From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QGZ/FuXwiWKEmwAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 10:14:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OB+SFuXwiWJM+wAA9RJhRA (envelope-from ) for ; Sun, 22 May 2022 10:14:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2BBDB9DF6 for ; Sun, 22 May 2022 10:14:29 +0200 (CEST) Received: from localhost ([::1]:36740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsgjM-0005JX-5P for larch@yhetil.org; Sun, 22 May 2022 04:14:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsgim-0005J5-BS for emacs-orgmode@gnu.org; Sun, 22 May 2022 04:13:52 -0400 Received: from ciao.gmane.io ([116.202.254.214]:40976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsgik-0000Bh-O9 for emacs-orgmode@gnu.org; Sun, 22 May 2022 04:13:52 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nsgii-00031e-SR for emacs-orgmode@gnu.org; Sun, 22 May 2022 10:13:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org 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 Message-ID: References: <87ee0mp4hb.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US In-Reply-To: <87ee0mp4hb.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653207269; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mFX5wLdYnJOnEzzy9Q6FeHQz3pr4UwSGyaM5AKaUPmE=; b=lcDUK8KuzmdpWCNjBEQmms5QAg/YxLU4OuIHs4g9WcOpDZmHknyr4yXoWrJkWhBn96Gz3h ojKsPZBNNV40fOMNZPH9zVkbwqqjxOQuEozKY1hdCUoBUmwD+FFO03qQTTldX3LP8YU2l/ zfJhwRp2Xs8EkSCpYaPnFrRKMciXl4yD6EHoEzzbuYMTTyNH43hqpeTyqUfz93Ajgd/LYW gZRwSaUANselqhdWxZwLyKggzwTRISuWhuwclIfb8o/3L5IR6DBsezNdDrT+JFFKj5vtHT JLGLXOCb0UhhGyWBnRtMa5bGcpsBjDhoteEYhanKUIU7/qYHUGgtD/If/ezTbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653207269; a=rsa-sha256; cv=none; b=HYlNIIH2bTh3S+Z7jzW8/VA7wT5bb5h3v/IWG+s/y0Q72VcQPqQ2iGGkEawFZdyGn1qXrF DLzJagZ22EMyajFdI/S3jZiRXYnCCGb0aNrW71Cx1SU/wq+9wY42aC1+Pfm8z+l5SUp+dS mFMz7l1tuzhs8i4ioBMTiQhT7q6AEII+zh7ITnD2zRc3ClomgK8l8X0IpcxPmC3JzYu6NJ yXFqJddpzbvfY2BKwyU8Go23Fy+LJt9ks2eAkDS1A/YYtRgWQAAAU6w2jcongwhJkb1UWK uGtD8VvU/0+gcqtSxKuHRk+fgKdP48fvdUdyv/mP+QPca1zbEPSe2gdOdjQqIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.65 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2BBDB9DF6 X-Spam-Score: 2.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: SmrfEP7B0FzC 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.