From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wCaPAhHwA2G4eAEAgWs5BA (envelope-from ) for ; Fri, 30 Jul 2021 14:26:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8KbPORDwA2GWUAAAB5/wlQ (envelope-from ) for ; Fri, 30 Jul 2021 12:26:56 +0000 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 5E47AD24F for ; Fri, 30 Jul 2021 14:26:56 +0200 (CEST) Received: from localhost ([::1]:38030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9RbK-0000Ve-Ug for larch@yhetil.org; Fri, 30 Jul 2021 08:26:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9RaU-0000VS-Om; Fri, 30 Jul 2021 08:26:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9RaU-00009D-HK; Fri, 30 Jul 2021 08:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m9RaU-0004Oj-Ca; Fri, 30 Jul 2021 08:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode Resent-From: Maxim Nikulin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Fri, 30 Jul 2021 12:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12972 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Received: via spool by 12972-submit@debbugs.gnu.org id=B12972.162764790316830 (code B ref 12972); Fri, 30 Jul 2021 12:26:02 +0000 Received: (at 12972) by debbugs.gnu.org; 30 Jul 2021 12:25:03 +0000 Received: from localhost ([127.0.0.1]:59301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RZX-0004NO-6u for submit@debbugs.gnu.org; Fri, 30 Jul 2021 08:25:03 -0400 Received: from mail-lf1-f46.google.com ([209.85.167.46]:36816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RZU-0004Mm-MK for 12972@debbugs.gnu.org; Fri, 30 Jul 2021 08:25:01 -0400 Received: by mail-lf1-f46.google.com with SMTP id x8so4210021lfe.3 for <12972@debbugs.gnu.org>; Fri, 30 Jul 2021 05:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Pni0Jwt0xKBGJ8ErVmClUwhQyNYgjj6lAyFvHGj3V10=; b=mhTIXmNLhUzDlTCk3dJ4ZmgyCmgFw4D0vY9Iy6NJ/ubS8jtxUTP0Lnvo4jvJb/QNYl opOL7F01ZsDXHPA29mhsL3KhZN3C2QFmQSgOjO45/FPhK4ldA3cA4MZHitzAIKycTPL1 myPHGid1urrQdHEDMn7XuZKeX+8LSlWyhuUpkCYlzt1HiWbePLUOtnnng+XSC0S2H2AU IkUp/g8b/Bn/VD4TKllv24MrtmlEsQeQ4s+NUkfAhO6ATdw/BMIa0X84K3fsB+Qhsqp5 NHROXjifnJ+me4EcB0+JK0cbFLaRhVOJHmCju5b/Irq/jV4rSLAabJOs3bnb5xBeoT5e divA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Pni0Jwt0xKBGJ8ErVmClUwhQyNYgjj6lAyFvHGj3V10=; b=VTNc3yWj3vSwRRhof73GRxvm/VFbMGkZMCYYwfGdCL3btrk34odOzAMndAsd5u13ij wyZAnNCSQtZVahS4onn+DEFyRRxiDOovtokJRtmeRMlA3WfaACIwtmKXOMWrEA8fA45h rI9GbrjrZtp9Nli8621lWOGHIe2fjqecDi7Aw8mN9FCW1THz1ZgElSUWnvjFgS/oDuWy refn+IVW+h2uWmqvQEbuglGHEQh9yBXhoJL8a82Kb06t4ySgeg5PS9frZmvarOBjgbHQ 4lavDjtp/bzRBOStE36m3PwgGWFuhSapbAMZEWayEuASkkue5U63M+1s/0ughU0VlAUe JJsw== X-Gm-Message-State: AOAM532GV30v3cqoi2NQemtfg4Mj2zcHVhVqJZe8zy0mIvYePdiPP+Cx DpENGYu7BszjEsr0qfu9Df6iPIkRfpgeTw== X-Google-Smtp-Source: ABdhPJx0lMlSzj1d8AzRIGSWt7mJmbTVzlxm2zGGEps17qQL/1zzYk3eX4U7kL7FyA0OQmScIVlv3g== X-Received: by 2002:ac2:4ac6:: with SMTP id m6mr1824327lfp.73.1627647894437; Fri, 30 Jul 2021 05:24:54 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id z13sm138528lfg.245.2021.07.30.05.24.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jul 2021 05:24:53 -0700 (PDT) References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <87r1fgnh7t.fsf_-_@gnus.org> From: Maxim Nikulin Message-ID: <631ca586-51ef-a967-f01b-410f69068aae@gmail.com> Date: Fri, 30 Jul 2021 19:24:47 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87r1fgnh7t.fsf_-_@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 12972@debbugs.gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627648016; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Pni0Jwt0xKBGJ8ErVmClUwhQyNYgjj6lAyFvHGj3V10=; b=NaBkYMz3Xv2DU3FaWaA2aWzV00NVOa9R3F5IK/yYi1/AnJCmKadolM6OEHMS+/x+/QzIiH UjUw3A8Cjmuql7zkstxK5ZEaL0dkxlI8kN1qIpFmBsU2PW3h2SkCqLGrVMx0B8HwVjktuM GqB8Ljihrb5FuYzcVYAx14pp+I/YbudqlhcX8hrSd+buD99sBhG0c0dIeLkcbRhmRM/s9+ 4FTU+cNtjrejOekPVQdO1O4p++AHjjM4jbMu+gFSeP0Dvy33BTZvgAGgOOL/DJhxehf7XT x4EEan9nz0hCOZXVvYUrGUaOP/b82mr0LN00nWPrbJW4BCSPcF9OYwl8f9/SAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627648016; a=rsa-sha256; cv=none; b=BDhOqRnYkkVxfJ07BH2ounNtpLWvY5E3jSJZ6nE8qMSELNAB7nPSNRJgc81CTqXxwbida8 IFSy/WgI+o2vU70GSr5amJknZhw0eFWpQ53tALSH/kukCXW/rqi/KDW3VR5ANn1CCn6ISq btkQz5+PlAh8Cd+rA/xyPGDkGHrQ8N877JQ2W5+VnD3HTdzxW7TElPE16TB58m/iTwym2P 0Wlc8pZCC6WVo4V/wlxASjFwUDM85XM/p1FoOTNmhHTXF1L+sLzfQk4r16Kk/+f60cMjSF gokFOgzgkt76naLjuNWBu1Lh8HZjoe+D+ytrstlFhTr8Fj5zY/SUHMHZ+gKKJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=mhTIXmNL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=mhTIXmNL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 5E47AD24F X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: s9yM8ZNmQKxu On 30/07/2021 19:01, Lars Ingebrigtsen wrote: > Maxim Nikulin writes: > >> I am attaching a patch similar to proposed to Org mode that should >> help to avoid obscure failures of viewers due to unnecessary terminal >> sessions. > > Thanks; makes sense to me (and seems to fix these persistent issues with > xgd-open etc), so I've applied it to Emacs 28. Thanks for looking into this issue. Please, consider the following additional change: ----- 8< ----- diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index f64897ac9b..aeeb9bd8d3 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1186,7 +1186,6 @@ See \"~/.mailcap\", `mailcap-mime-data' and related files and variables." (make-process :name "mailcap-view-file" :connection-type 'pipe - :noquery t :buffer nil ; "*Messages*" may be suitable for debugging :sentinel (lambda (proc event) (when (and (memq (process-status proc) '(exit signal)) ---- >8 ---- I did not update the patch since Eli had some objections (unclear to me). I wrongly added :noquery expecting to get a process completely detached from Emacs, something like result of "synchronous" (process-file-shell-command command nil 0 nil) on linux (on stackoverflow I have seen a note that w32 requires special treatment). Notice that "pipe" asynchronous Emacs processes have a problem with CPU consumption if a process does something like #!/bin/sh exec 1>&- exec 2>&- sleep 30 Though I believe even silently killed on exit children and CPU-hungry Emacs in rare cases are better than decade old pseudoterminal+SIGHUP problem with xdg-open. I suppose, it is an Emacs bug, note Gnome or KDE issue. https://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html