From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 14:15:10 2012 Received: (at submit) by debbugs.gnu.org; 23 Nov 2012 19:15:10 +0000 Received: from localhost ([127.0.0.1]:35222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbyiU-0000Qt-3L for submit@debbugs.gnu.org; Fri, 23 Nov 2012 14:15:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45657) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbyiR-0000Qm-Es for submit@debbugs.gnu.org; Fri, 23 Nov 2012 14:15:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tbygx-0002gS-NL for submit@debbugs.gnu.org; Fri, 23 Nov 2012 14:13:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbygx-0002gO-Jx for submit@debbugs.gnu.org; Fri, 23 Nov 2012 14:13:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbygv-00076T-Ff for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 14:13:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tbygr-0002fw-Ez for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 14:13:33 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:30411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbygr-0002fq-8Y for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 14:13:29 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qANJDQUe004694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Nov 2012 19:13:27 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qANJDPWs029678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 23 Nov 2012 19:13:26 GMT Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qANJDPPQ031988 for ; Fri, 23 Nov 2012 13:13:25 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Nov 2012 11:13:24 -0800 From: "Drew Adams" To: Subject: 24.3.50; Move `org-open-file' and associated code out of Org mode Date: Fri, 23 Nov 2012 11:13:19 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac3JrpkfelCJsZaaSq6M+nlDbkmvnw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) IIUC, `org-open-file' and its associated code, such as `org-file-apps', `org-default-apps', and `org-apps-regexp-alist', have nothing particularly to do with Org mode. They constitute general-purpose code for opening files using associated programs. Code that uses them should not need to load the Org code, and this code should be maintained separately for general use. Please move all such code out of the Org files and into a more general file, such as files.el. Create a new general file for such things, if that is more appropriate. Anything in the code that is truly specific to Org mode, such as Org-state mgt and link recognition/following (e.g., `org-mark-ring-push', `org-link-frame-setup', `org-file-apps-entry-match-against-dlink-p', `org-link-search'), should be kept (only) for Org mode. What is important is to factor out the generic code that opens a file using an associated app. Seems like this should have been done when the Org code was added to Emacs. There might be additional opportunities for factoring out some useful, general-purpose code from Org mode - dunno. In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600) of 2012-11-19 on MS-W7-DANI Bzr revision: 110950 monnier@iro.umontreal.ca-20121119182725-5p6w4wjimm7epggr Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -Ic:/emacs/libs/libXpm-3.5.10/include -Ic:/emacs/libs/libXpm-3.5.10/src -Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/zlib-1.2.5 -Ic:/emacs/libs/giflib-4.1.4-1-lib/include -Ic:/emacs/libs/jpeg-6b-4-lib/include -Ic:/emacs/libs/tiff-3.8.2-1-lib/include -Ic:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2 -Ic:/emacs/libs/gnutls-3.0.9-w32-bin/include -Ic:/emacs/libs/libiconv-1.9.2-1-lib/include' From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 15:29:05 2012 Received: (at 12972) by debbugs.gnu.org; 23 Nov 2012 20:29:05 +0000 Received: from localhost ([127.0.0.1]:35281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tbzs1-0002E7-0m for submit@debbugs.gnu.org; Fri, 23 Nov 2012 15:29:05 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:42316) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tbzry-0002Dq-HH for 12972@debbugs.gnu.org; Fri, 23 Nov 2012 15:29:03 -0500 Received: by mail-pb0-f44.google.com with SMTP id uo1so6368309pbc.3 for <12972@debbugs.gnu.org>; Fri, 23 Nov 2012 12:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version:content-type; bh=Zqh2o0NRGLtOSvhIllixlAGXtOvwi2b5VVcxqTdpCdI=; b=G0pWVEIkx7tStnR5gYQKZPQFdyOrcn4IIu6euGXsBUg2SF6KMTwZZbdupTTLzwyNPQ ZCLDYVDd/xrQnbs1g8QeURN2h52TYhPxEuK76Q/+yHoGyj05tcbJ32otflSw7oDDIril DFGacZs9LN5paOJROWRQ1f3SG+dOuRvGbtejQoNuajvk0RnBRAIpjRNr5A9N2zzbpb0I 8EeDFfyDFRz0rHuqN2Nj53hrnc6ndslaQXzsA3NrDhks649m31j3wCny1FUKgku4YSF+ Py7koHxgkS4hP/nIYgYoHd2Wrke+Ai3oQacT9XW4US2D4JiCn2iGywlHSIfxSGk7OX9y l5DQ== Received: by 10.66.75.234 with SMTP id f10mr13102880paw.32.1353702454017; Fri, 23 Nov 2012 12:27:34 -0800 (PST) Received: from debian-6.05 ([115.242.128.35]) by mx.google.com with ESMTPS id jw10sm4289456pbb.20.2012.11.23.12.27.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 12:27:33 -0800 (PST) From: Jambunathan K To: 12972@debbugs.gnu.org Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode References: Date: Sat, 24 Nov 2012 02:00:02 +0530 Message-ID: <87sj806p11.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) "Drew Adams" writes: > IIUC, `org-open-file' and its associated code, such as `org-file-apps', > `org-default-apps', and `org-apps-regexp-alist', have nothing > particularly to do with Org mode. They constitute general-purpose code > for opening files using associated programs. Code that uses them > should not need to load the Org code, and this code should be > maintained separately for general use. +10. There should also be key binding within dired for opening files "blindly". For a long time, within dired, I had `C-u RET' open file in a system-registered app. (defun my-dired-find-file (&optional prefix) (interactive "P") (if prefix (org-open-file (dired-get-file-for-visit) 'system) (dired-find-file))) (define-key dired-mode-map "\r" 'my-dired-find-file) When I don't have above snippet installed, I do the following. On Windows, & open or ! open On Linux, I can do, C-c C-m C-l It would be wonderful if I can just rely on Emacs to abstract out the OS I am working on. -- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 01 02:56:31 2021 Received: (at 12972) by debbugs.gnu.org; 1 Jun 2021 06:56:31 +0000 Received: from localhost ([127.0.0.1]:35575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnyKE-0005n3-Qy for submit@debbugs.gnu.org; Tue, 01 Jun 2021 02:56:31 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnyKD-0005mn-2L for 12972@debbugs.gnu.org; Tue, 01 Jun 2021 02:56:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MZn2g4W6UPirdgx4fLUATM0bG6sgAPAdTP0GPr5SPXw=; b=b861i8m1jh+KItfIbBlbwCqSxE mHzi1TKcfSdy2/UrSyGw2N7SWWn+FehgCdimEqVKyQToOxB6RkRwubhZ/O2XfHv0Oi5oHTHtev8/W wjzbhrNO91d+OFFxA/O2+JqTnNY+Pc+NgSrrfbNXjCuaM6HF2w3xEOKquEy1a3F+OTIA=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnyK3-0004sm-Ul; Tue, 01 Jun 2021 08:56:22 +0200 From: Lars Ingebrigtsen To: "Drew Adams" Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode References: X-Now-Playing: 75 Dollar Bill's _I Was Real_: "I Was Real" Date: Tue, 01 Jun 2021 08:56:19 +0200 In-Reply-To: (Drew Adams's message of "Fri, 23 Nov 2012 11:13:19 -0800") Message-ID: <87r1hmdqek.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Drew Adams" writes: > IIUC, `org-open-file' and its associated code, such as `org-file-apps', > `org-default-apps', and `org-apps-regexp-alist', have nothing > particularly to do with Org mode. They constitute general-pu [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) "Drew Adams" writes: > IIUC, `org-open-file' and its associated code, such as `org-file-apps', > `org-default-apps', and `org-apps-regexp-alist', have nothing > particularly to do with Org mode. They constitute general-purpose code > for opening files using associated programs. Code that uses them > should not need to load the Org code, and this code should be > maintained separately for general use. `org-open-file' is too Org-specific to move out of Org. But there should be a command to do what it essentially does outside of Org -- that is, use ~/.mailcap to determine what viewer to use. So I've now added this to Emacs 28 under the name `mailcap-view-file'. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 01 02:56:36 2021 Received: (at control) by debbugs.gnu.org; 1 Jun 2021 06:56:36 +0000 Received: from localhost ([127.0.0.1]:35578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnyKK-0005nK-3D for submit@debbugs.gnu.org; Tue, 01 Jun 2021 02:56:36 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnyKI-0005mt-LB for control@debbugs.gnu.org; Tue, 01 Jun 2021 02:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=y+pBTE24hBTYzZuhnLCU1qiUMvSbnDWVheu/y+bZFEU=; b=PK0WmgKDZxoXMJh8V9ED80QgMa 9Wo9Nw6HjcD6RGdTLn7NR5kywfMmCNraro11vj9ul1IqENFdLhdP5/FO+bH3HDN0Tdtlhzr0vN65t 6sFvQWOedoS2b3wXmu9B8ZIMaDtp/iN9Ht83nzz00lJnderhUzo19QFsr8XpkCCQv0g0=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnyKB-0004su-6C for control@debbugs.gnu.org; Tue, 01 Jun 2021 08:56:29 +0200 Date: Tue, 01 Jun 2021 08:56:26 +0200 Message-Id: <87pmx6dqed.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12972 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 12972 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 12972 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 02 13:01:17 2021 Received: (at 12972) by debbugs.gnu.org; 2 Jun 2021 17:01:17 +0000 Received: from localhost ([127.0.0.1]:41258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loUF2-0000oD-I2 for submit@debbugs.gnu.org; Wed, 02 Jun 2021 13:01:16 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:33707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loTc3-00088f-Ki for 12972@debbugs.gnu.org; Wed, 02 Jun 2021 12:21:00 -0400 Received: by mail-lf1-f50.google.com with SMTP id a5so4332755lfm.0 for <12972@debbugs.gnu.org>; Wed, 02 Jun 2021 09:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:cc:newsgroups:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ya6aiAJD1Igr7jXa0vozrMZXAQMuRezgtp9or/ZTaHk=; b=GfgBSFK2M864EGQMvpikhFcKgAK+XD7eWmuUPgJAqZ46KdtHnjx3M//I4emkzxL7uy SihkRpLrseM6wbZp+F0nzo0W7nyrCQvrmLmZybgPWxZ7lecrG5YmoB0CcF9JFQKqSCeR Ql+Th7yIFk9btuA2dxihoZ5hrkgan25B4UJrPZCE7pwJUsB9OQPj36kAIp5AgSMoepIs qMf6vHKcwpOjU/LoPJxuDfk1NV7dpVWLUx1JMlOPNJxSOCifkxN6NP6eNFfkMN5Jrtvu 15hmHoMQ1Hmd6OYLLfiSSFAzJFYI9vCE7nvFvic0ZmGr89D8xydWwb+CK+XzBGClQ5kD c3LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:cc:newsgroups:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ya6aiAJD1Igr7jXa0vozrMZXAQMuRezgtp9or/ZTaHk=; b=rAPnfiLWf+rmaKHQ4+tvdbgc9ofuFNvkFz7nUaW7U10T8zmk6LVRumpBnPDqwKHfLz sNYzPHYKYcnVO6tKA19gpNv5x3eJ5Oef6WyA7DLW6XuP3xY+svMqCwUp9AC6Ep/w/zN8 Fx4XYZvLehP3KuKxV4zPOzcsDKNbbosbgfY2XWQnuqOpXKQo4iUxsIXVQuS/78JXShuw kXMK+kqzzM6Mhpy/GX5Vg3nQ1cj+4r7Wx7fJzwuH0qEAW5j1f9gFqpvpWTGp0Nz/np5/ xjTExK2//efkduxR8Z8AxJP++SUIk9E/BubZfTBeaAJ4S3otpYlq+AE0e/ioyGe71utm 1X9A== X-Gm-Message-State: AOAM5303wqqhFBj+Z8qTG2UPtmpexZR8ux0BGDp/EXIDb+iShko64ZeQ HaIJZvt8u8NkN+L6IPMdxACXWc2nQc7bH8lk X-Google-Smtp-Source: ABdhPJznkwmT2mn8gtwNUtYO3OU2D0UybQb/hjCUJpNTEGzVXGEbKPBydAXse2rb4lOuP99ZRgNZAA== X-Received: by 2002:a19:4086:: with SMTP id n128mr23375429lfa.464.1622650853647; Wed, 02 Jun 2021 09:20:53 -0700 (PDT) Received: from [192.168.0.101] (nat-32-4.nsk.sibset.net. [5.44.168.126]) by smtp.googlemail.com with ESMTPSA id h19sm28036ljk.138.2021.06.02.09.20.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 09:20:52 -0700 (PDT) Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode Newsgroups: gmane.emacs.orgmode References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> From: Maxim Nikulin Message-ID: Date: Wed, 2 Jun 2021 23:20:50 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: 12972 X-Mailman-Approved-At: Wed, 02 Jun 2021 13:01:14 -0400 Cc: Lars Ingebrigtsen , 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) On 01/06/2021 13:56, Lars Ingebrigtsen wrote: > So I've now added this to Emacs 28 under the name > `mailcap-view-file'. I am sorry if it is a false alarm. Feel free to close the bug again if something changed recently in `start-process-shell-command' or if you prefer to discuss the issue as another bug. It seems that implementation of `mailcap-view-file' is unreliable due to creation of unnecessary terminal session and it can cause obscure and difficult to reproduce failures similar to https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00195.html https://lists.gnu.org/archive/html/emacs-orgmode/2020-06/msg00332.html The thread is actually longer than it is shown in the archive interface. Another lengthy discussion: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44824 In Org latest change was required for compatibility reason: https://code.orgmode.org/bzg/org-mode/commit/869b7a21b94ed112f6640c8f2711c2a68b661dea Let-bind (process-connection-type nil) is a minimal required change to avoid unnecessary terminal session. However it is not friendly to users in the case when troubleshooting is required. `make-process' with sentinel is hopefully better. The following could be ignored since it likely requires significant amount of work with unclear benefits. 1. `org-open-file' besides Org-specific stuff allows to specify precise target inside the file. It can be quite useful, e.g. okular --page 11 --find "some pattern" file.pdf PDF files have internal anchors as well. I have no consistent vision how to express additional "locators" in general API. 2. There are at least two sources of truth for MIME-handlers on linux desktop that are not necessary synchronized. Info from extracted from .desktop files may be configurable from desktop UI unlike mailcap. Distros may have some instruments to mitigate discrepancies. Debian adds entries from .desktop handlers to system-wide mailcap DB. Another approach is to add to maicap greedy xdg-open handler that tries to guess currently running desktop and pass arguments to appropriate command. Maybe mailcap should be secondary MIME database in Emacs, not the primary one. 3. Currently only file suffix is inspected to determine MIME type of a file. libmagic (or file command) usually provides more precise info, so it is possible to open an incorrectly named file. 4. Mailcap has more features that are not addressed in Emacs. They may be handy if Emacs is launched in terminal on remote server. It might allow e.g. to open PDF file using pdftotext handler. - A buffer for command output should be created for "copiousoutput" option. - A buffer should be created and terminal session should be enabled if an entry "needsterminal". - There are more substitutions than "%s". However I am unsure if it is possible to provide more info than application can obtain from the file. I think, it is intended for mail multipart messages and additional headers. On the other hand mailcap handlers might expect safe file names (minimal ASCII subset), users may have files with arbitrary names (national charset or some special characters). I hope, almost all handlers do not have such problem. In summary, during launch of external command terminal session must be suppressed. There is enough room for MIME-related improvements in Emacs in general and in Org mode in particular. From unknown Sun Jun 22 22:44:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug No longer marked as fixed in versions 28.1 and reopened. Date: Wed, 02 Jun 2021 17:02:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug No longer marked as fixed in versions 28.1 and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 13:02:17 2021 Received: (at 12972) by debbugs.gnu.org; 1 Jul 2021 17:02:17 +0000 Received: from localhost ([127.0.0.1]:33625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz04v-00082E-Gn for submit@debbugs.gnu.org; Thu, 01 Jul 2021 13:02:17 -0400 Received: from mail-lj1-f179.google.com ([209.85.208.179]:47050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz04u-00081z-4p for 12972@debbugs.gnu.org; Thu, 01 Jul 2021 13:02:16 -0400 Received: by mail-lj1-f179.google.com with SMTP id q4so9378020ljp.13 for <12972@debbugs.gnu.org>; Thu, 01 Jul 2021 10:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=rrfSNKM8QMUYic1UkGs5ueImfm1IoIl0YybtBO3bQ/I=; b=lxEIxAtKLIEb0OcNKbvpS56ShFhwdEbPp/FpD0TLfLGfMziZbBefWXtBBSEWt2X9g1 1Spg6luGFXf4gic5Bg495esaKxWZGHgA9LlddpB0NGjqgDaBjLyGfSx3fbxgaiLEHm6p xHXnRjHFCqIGdpx1tnzH4csy5VhpS4k7Cw7gsbB1S1g3Ber06ii1zsZ3aO7bkTIgBETk OPQ7o4+NiyqjuDJ5kbDUuYgi58ULHHPCI9pbN+AKpVoRS8OAcCyBx7Nx4UFkGkJPBzF+ JMhZTPHIaZFNhBbzNmZXWq4azmVE6jcvftRwOzb9/jOB9+b7kTcpC6nKj+uuklVay9lQ WLsQ== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=rrfSNKM8QMUYic1UkGs5ueImfm1IoIl0YybtBO3bQ/I=; b=NKsmxNPN2yWog/AX0YXHcdweaF6RrLia3ksKo41ywkePV7ODvL21zw5VtGtrvwaaxO LZQ1f2Pv8O5jNXfiEuppMC3ftK4H9hChDG9wIOx3lOo/Ji/pDAXFDPuDrZcCEVagtvPd FTmSGfkgc1uv1m3A+GxAhyMObUGd/wa7IOw9Xq1HVBZSMP75/mnV4PUIbV22CrwqsG8J eJTvLLi6t6EFSGrpVHPFa4UwUFst6HzUfid2Jax6GQLNqGA5kjor/FtOvAQxhH6qVASd y3Zh+S+Q+s+zFFoabSF2ZZ1IYgxLkWVMRI8ekc+mifNOC0QjyajBaYg7kzHn0ENpSQCA IiXw== X-Gm-Message-State: AOAM531ZA9L+m3NMOkSs/PtjUPG1I2XuaLgskZcRq/zVUleLMP/6bdwk /0/4jkV4KhFFYqScx9D41/i3wt6GKP8= X-Google-Smtp-Source: ABdhPJw4/byzn0dwoidheH1J2N4NcRs79RMdrmj+RTUHB/385P8uFpvFmN6p1Jq851dtt0o/i+8bNA== X-Received: by 2002:a2e:b4ce:: with SMTP id r14mr466618ljm.76.1625158928368; Thu, 01 Jul 2021 10:02:08 -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 t12sm22147lfg.148.2021.07.01.10.02.06 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 10:02:07 -0700 (PDT) Subject: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> From: Maxim Nikulin Message-ID: Date: Fri, 2 Jul 2021 00:01:59 +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: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> Content-Type: multipart/mixed; boundary="------------67F3D79E45EE4A50C0EC9894" Content-Language: en-US X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------67F3D79E45EE4A50C0EC9894 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 01/06/2021 13:56, Lars Ingebrigtsen wrote: > So I've now added this to Emacs 28 under the name `mailcap-view-file'. 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. --------------67F3D79E45EE4A50C0EC9894 Content-Type: text/x-patch; charset=UTF-8; name="0001-mailcap.el-Avoid-xdg-open-silent-failure.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-mailcap.el-Avoid-xdg-open-silent-failure.patch" >From de55b623810736df04641a4d8f6027ccb04caa7f Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Thu, 1 Jul 2021 23:41:16 +0700 Subject: [PATCH] mailcap.el: Avoid xdg-open silent failure * lisp/net/mailcap.el (mailcap-view-file): Use 'pipe :connection-type instead of 'pty to prevent killing of background process on handler exit. Avoid regression similar to Bug#44824. Problem happens only in some desktop environments where mailcap handler launches actual viewer (as defined in .desktop files and obtained from mimeapps.list) in background. E.g. xdg-open invokes "gio open" or kde-open5 for Gnome or KDE accordingly and these handlers launch e.g. eog or okular in background. As soon as main process exits, temporary terminal session created by `start-process-shell-command' is terminated. As a result background processes receive SIGHUP. Previously command were executed with no buffer as well, so the change does not affect "needsterminal" and "copiousoutput" mailcap features, they are not supported as earlier. If main process of the handler fails then show a message with exit reason. Output (including error messages) is ignored as before. Gtk applications tend to report significant amount of failed asserts hardly informative for majority of users. --- lisp/net/mailcap.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index 54f7f416ab..a53e385662 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1177,7 +1177,23 @@ See \"~/.mailcap\", `mailcap-mime-data' and related files and variables." (shell-quote-argument (convert-standard-filename file)) command nil t)) - (start-process-shell-command command nil command))) + ;; Handlers such as "gio open" and kde-open5 start viewer in background + ;; and exit immediately. Avoid `start-process' since it assumes + ;; :connection-type 'pty and kills children processes with SIGHUP + ;; when temporary terminal session is finished (Bug#44824). + ;; An alternative is `process-connection-type' let-bound to nil for + ;; `start-process-shell-command' call (with no chance to report failure). + (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)) + (/= (process-exit-status proc) 0)) + (message + "Command %s: %s." + (mapconcat #'identity (process-command proc) " ") + (substring event 0 -1)))) + :command (list shell-file-name shell-command-switch command)))) (provide 'mailcap) -- 2.25.1 --------------67F3D79E45EE4A50C0EC9894-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 01 14:38:25 2021 Received: (at 12972) by debbugs.gnu.org; 1 Jul 2021 18:38:25 +0000 Received: from localhost ([127.0.0.1]:33693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1Zx-0002Fh-E6 for submit@debbugs.gnu.org; Thu, 01 Jul 2021 14:38:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lz1Zv-0002FU-IL for 12972@debbugs.gnu.org; Thu, 01 Jul 2021 14:38:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58114) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lz1Zq-0006uS-B9; Thu, 01 Jul 2021 14:38:18 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4078 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lz1Zq-0002Dg-01; Thu, 01 Jul 2021 14:38:18 -0400 Date: Thu, 01 Jul 2021 21:38:15 +0300 Message-Id: <835yxtlw14.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: (message from Maxim Nikulin on Fri, 2 Jul 2021 00:01:59 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Fri, 2 Jul 2021 00:01:59 +0700 > > --- a/lisp/net/mailcap.el > +++ b/lisp/net/mailcap.el > @@ -1177,7 +1177,23 @@ See \"~/.mailcap\", `mailcap-mime-data' and related files and variables." > (shell-quote-argument (convert-standard-filename file)) > command > nil t)) > - (start-process-shell-command command nil command))) > + ;; Handlers such as "gio open" and kde-open5 start viewer in background > + ;; and exit immediately. Avoid `start-process' since it assumes > + ;; :connection-type 'pty and kills children processes with SIGHUP > + ;; when temporary terminal session is finished (Bug#44824). > + ;; An alternative is `process-connection-type' let-bound to nil for > + ;; `start-process-shell-command' call (with no chance to report failure). > + (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)) > + (/= (process-exit-status proc) 0)) > + (message > + "Command %s: %s." > + (mapconcat #'identity (process-command proc) " ") > + (substring event 0 -1)))) > + :command (list shell-file-name shell-command-switch command)))) I have two issues with this change: First, you replace start-process-shell-command with make-process, and I'm not sure I understand why. If all you want is to use pipes, why not simply bind process-connection-type around the call to start-process-shell-command? Does it not work for some reason? And second, I'm not sure we should make this change unconditionally. It isn't guaranteed that the handler will be one of those which have the problem, is it? And with other handlers, this could be an incompatible behavior change if the handler behaves differently when its standard handles are connected to a pipe rather than a terminal device. So I'd rather make this a conditional change, ideally only when one of the affected handlers is used (assuming we can detect that somehow). Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 07:11:23 2021 Received: (at control) by debbugs.gnu.org; 2 Jul 2021 11:11:23 +0000 Received: from localhost ([127.0.0.1]:35059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzH4t-0006Sm-8s for submit@debbugs.gnu.org; Fri, 02 Jul 2021 07:11:23 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzH4r-0006Sa-Dd for control@debbugs.gnu.org; Fri, 02 Jul 2021 07:11:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=i5tYei48K82tSTdHwhC2dJ9l6fBqz8hDtDBG4qKcKUQ=; b=q+Q5cfJLIJQnPz0PBhGb8qlSIQ 41wV9fFyz+dUahe3iXQFnhWMx/m0HeRbNVrsDWaQIpw16LN5yZX8gy3KpiZ2PBC5hzLbF32vXlzgA /nsylK3wBK+XfFs7eVCf8t+dcqmoQ/ctEOSOiOEJNeN9ePJGcJkuG/FW30UQuRMYi6ng=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzH4j-00083L-M0 for control@debbugs.gnu.org; Fri, 02 Jul 2021 13:11:15 +0200 Date: Fri, 02 Jul 2021 13:11:13 +0200 Message-Id: <8735sxvulq.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12972 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 12972 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 12972 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 08:22:06 2021 Received: (at 12972) by debbugs.gnu.org; 2 Jul 2021 12:22:06 +0000 Received: from localhost ([127.0.0.1]:35186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIBJ-0004F3-Sq for submit@debbugs.gnu.org; Fri, 02 Jul 2021 08:22:06 -0400 Received: from mail-lf1-f42.google.com ([209.85.167.42]:36700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIBH-0004EY-Hb for 12972@debbugs.gnu.org; Fri, 02 Jul 2021 08:22:04 -0400 Received: by mail-lf1-f42.google.com with SMTP id d16so17728978lfn.3 for <12972@debbugs.gnu.org>; Fri, 02 Jul 2021 05:22:03 -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=lebDnOxcgbHY/ONBaRsvdirSXCAcFdy+jw0m4nLUmU0=; b=EzWr9NpkeMY1MighInJTWN0CJNwI/PL2N7UBIs8jGI8yVFnxB7p6zPwREGCoXFcCd2 9sTqAvYh5/PNkTseYn0vbhYqqVp4FcuiD01cv0/yM5YeMnwvsgANdVI3NciQ2qcHIgcZ qWGnw0hmZ620BuItf1nHBxcUdTqy/+kdrAR8Y+5OtuLC0dYM5PlgDRR8agIv74tDk6+3 0zqBa+S756+RhzpX5owKUXmsC2NT/R4q2tGz+4DnYmYROJkMsG3rEu2nkZOIOXR0gC2d oGqhwmjy1PIt47VIKPw7NwbVfVtqHRtKfbSIAqjVZxr2KxOU2c8b0Qb2ZSnwUAN2cBHa 1HGQ== 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=lebDnOxcgbHY/ONBaRsvdirSXCAcFdy+jw0m4nLUmU0=; b=jcQyZtqZiICjKiyOvuKbLqEg5erp0h86lmWLLgNb8n6/5o+Q2S95S9c9092bSbsGrC 0xekLT8DNrtVxyUmfKen5a7DhasVFQeJfCcuPI7KEkMvCdLNogOgU39FG8nqBIluUAi3 VRZIoy+QWqTBzeW9AFpc4jhRIhw5D0S0HcFq0Wz0ttcsIUGEsKpuMZSdz5yCTN3AIlCK lNm4EwG+xWpF0ejxry8L0EMichj35BzJTa595v608biSF+3oJaevkvZl9rXw4DEqfKZ7 fV3PL2AO4jw3WM8xmTLDXKK0RbMYcTNX2M5mUP4Uj7BtxKq3VwPRCRW/h8d/pD0zf3eR wP+Q== X-Gm-Message-State: AOAM5303brwM+4g5dEqZ9MiCtGL2wgBdorXi0LsFKcKuFJa6psz5X6aI yeLv1ip7cHkCkgCj0rG9XS0= X-Google-Smtp-Source: ABdhPJxRiAHozM72IY04xNg0EqY2n4hxU1jX/JKHU/Fyc9NOsocfaCoRkRKHyVic9FjHpmwOmGSbOQ== X-Received: by 2002:a19:c506:: with SMTP id w6mr3724310lfe.656.1625228517473; Fri, 02 Jul 2021 05:21:57 -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 p15sm257754lfr.293.2021.07.02.05.21.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 05:21:56 -0700 (PDT) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> From: Maxim Nikulin Message-ID: <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> Date: Fri, 2 Jul 2021 19:21:55 +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: <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12972 Cc: Lars Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 02/07/2021 01:38, Eli Zaretskii wrote: >> From: Maxim Nikulin Date: Fri, 2 Jul 2021 00:01:59 +0700 >> >> --- a/lisp/net/mailcap.el >> +++ b/lisp/net/mailcap.el >> - (start-process-shell-command command nil command))) ... >> + (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)) >> + (/= (process-exit-status proc) 0)) >> + (message >> + "Command %s: %s." >> + (mapconcat #'identity (process-command proc) " ") >> + (substring event 0 -1)))) >> + :command (list shell-file-name shell-command-switch command)))) > > First, you replace start-process-shell-command with make-process, and > I'm not sure I understand why. If all you want is to use pipes, why > not simply bind process-connection-type around the call to > start-process-shell-command? >> + ;; An alternative is `process-connection-type' let-bound to nil for >> + ;; `start-process-shell-command' call (with no chance to report failure). -----------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> If main process of the handler fails then show a message with exit >> reason. ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > And with other handlers, this could be an > incompatible behavior change if the handler behaves differently when > its standard handles are connected to a pipe rather than a terminal > device. Example of such handler, please. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 08:37:53 2021 Received: (at 12972) by debbugs.gnu.org; 2 Jul 2021 12:37:53 +0000 Received: from localhost ([127.0.0.1]:35208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIQb-0006nl-5V for submit@debbugs.gnu.org; Fri, 02 Jul 2021 08:37:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzIQY-0006nX-AO for 12972@debbugs.gnu.org; Fri, 02 Jul 2021 08:37:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33320) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzIQS-0000UQ-W4; Fri, 02 Jul 2021 08:37:45 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2966 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzIQS-00075K-DY; Fri, 02 Jul 2021 08:37:44 -0400 Date: Fri, 02 Jul 2021 15:37:39 +0300 Message-Id: <837di8ki24.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> (message from Maxim Nikulin on Fri, 2 Jul 2021 19:21:55 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: larsi@gnus.org, 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Fri, 2 Jul 2021 19:21:55 +0700 > Cc: Lars Ingebrigtsen > > > And with other handlers, this could be an > > incompatible behavior change if the handler behaves differently when > > its standard handles are connected to a pipe rather than a terminal > > device. > > Example of such handler, please. Why do you need one? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 12:24:35 2021 Received: (at 12972) by debbugs.gnu.org; 2 Jul 2021 16:24:35 +0000 Received: from localhost ([127.0.0.1]:36976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzLxz-00070l-JU for submit@debbugs.gnu.org; Fri, 02 Jul 2021 12:24:35 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]:33574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzLxw-00070W-GU for 12972@debbugs.gnu.org; Fri, 02 Jul 2021 12:24:33 -0400 Received: by mail-lf1-f47.google.com with SMTP id t17so19169757lfq.0 for <12972@debbugs.gnu.org>; Fri, 02 Jul 2021 09:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5QstJtowVMjBE2QcVtLlzKt6leJX9Z4X70k+nynvwpU=; b=dacLG6ncT+qlWz3YCuXdnuWvX07pQyoaq8oC3FNF6hM2E6zom8Qw4nQMCHlmdv/Czs 9lQJlWPdC5iwUoiomlFsraNC4Jvy3RCMCp+I2viF4vPkLYvuxHrQMY36wUoigFwxzKsf C7N8XnbWwPH6NX/ypXVdW5bge1MXkMzHefPF/PptMJ/5mZRpKehstH2tp76KYqqUId1t aCFkmUcOJPI45+L4+mxw5a8ivya4Wj2SFEw2lLx/Vq6l0PwmoUsLlOZdS3O0J4FZ2qlR Zr1YwlnbU1d9IpyoW523dP+xBKeDC3Voc9rL17bbOi7/6qpEEjku4orQlvGNwEqLUXmR Iaxw== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5QstJtowVMjBE2QcVtLlzKt6leJX9Z4X70k+nynvwpU=; b=uV49luaHQeNvXoOtbT/ffrb9HR8kYIsKC3oeYy6arbJP56U6rB4AI8ocHgqFvpKsu5 l8t2CiREkrtzJOLyIaXUFzHmWKY6R2shDXAdlGPa9wvz06XwTEyODsuiM4HjUYArOUqM vcFTUq4rLw38tcznWXcpEjRBdaY338+CR420vQl88q/y8XxYvaq4C0anAU8GZk5mFCK6 bTsnU38Q32K6qu+GHbfcZ/S83imE0IDmRE0GQYi6TJi2fguiX7/4Zg+KtPqKRdan44jE 3RHfCo0dRUi0pKj+R1FKy5u2YvozKXGgYvFG9tDJBpf9UCf22ThtpTqr+wqI3wxSWXWd HwBg== X-Gm-Message-State: AOAM533KLffM8nCYhSXknfBkqP489HW/5KM6JXdX4ej2wB9Vm1SFDv9i E8EiByErSeSifv0rfGUDpPbZq4k4z8s= X-Google-Smtp-Source: ABdhPJyfUCFBw6jhKlNTJwjzdYijv560M3jlZ09kNTjPCQc+ksQDnADrrU7gRXlqiwwm1vgPvsQmHw== X-Received: by 2002:a19:490d:: with SMTP id w13mr308804lfa.285.1625243066174; Fri, 02 Jul 2021 09:24:26 -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 v16sm401758ljn.93.2021.07.02.09.24.24 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Jul 2021 09:24:25 -0700 (PDT) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> From: Maxim Nikulin Message-ID: Date: Fri, 2 Jul 2021 23:24:23 +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: <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 02/07/2021 19:37, Eli Zaretskii wrote: >> From: Maxim Nikulin >> Date: Fri, 2 Jul 2021 19:21:55 +0700 >> Cc: Lars Ingebrigtsen >> >>> And with other handlers, this could be an >>> incompatible behavior change if the handler behaves differently when >>> its standard handles are connected to a pipe rather than a terminal >>> device. >> >> Example of such handler, please. > > Why do you need one? Because of I can not imagine such case for mailcap handler in Emacs yet and, accordingly to you, "this could be an incompatible behavior change". From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 02 13:28:15 2021 Received: (at 12972) by debbugs.gnu.org; 2 Jul 2021 17:28:15 +0000 Received: from localhost ([127.0.0.1]:37109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzMxb-0004nH-8F for submit@debbugs.gnu.org; Fri, 02 Jul 2021 13:28:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzMxZ-0004n2-EY for 12972@debbugs.gnu.org; Fri, 02 Jul 2021 13:28:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41722) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzMxT-0008Bo-VR; Fri, 02 Jul 2021 13:28:07 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4833 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzMxT-0007yv-J2; Fri, 02 Jul 2021 13:28:07 -0400 Date: Fri, 02 Jul 2021 20:28:07 +0300 Message-Id: <831r8gk4m0.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: (message from Maxim Nikulin on Fri, 2 Jul 2021 23:24:23 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Fri, 2 Jul 2021 23:24:23 +0700 > > On 02/07/2021 19:37, Eli Zaretskii wrote: > >> From: Maxim Nikulin > >> Date: Fri, 2 Jul 2021 19:21:55 +0700 > >> Cc: Lars Ingebrigtsen > >> > >>> And with other handlers, this could be an > >>> incompatible behavior change if the handler behaves differently when > >>> its standard handles are connected to a pipe rather than a terminal > >>> device. > >> > >> Example of such handler, please. > > > > Why do you need one? > > Because of I can not imagine such case for mailcap handler in Emacs yet > and, accordingly to you, "this could be an incompatible behavior change". You don't need to imagine it, you just need to trust me that I know what I'm talking about: it would be an incompatible change. Is it possible to detect that the handler is one of those that are affected by this issue? If so, let's do that; it cannot be worse than what you suggested, or worse than the current situation. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 07:29:41 2021 Received: (at 12972) by debbugs.gnu.org; 3 Jul 2021 11:29:41 +0000 Received: from localhost ([127.0.0.1]:37978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzdq9-00081Y-5h for submit@debbugs.gnu.org; Sat, 03 Jul 2021 07:29:41 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:36514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzdq6-00081G-Qu for 12972@debbugs.gnu.org; Sat, 03 Jul 2021 07:29:39 -0400 Received: by mail-lj1-f180.google.com with SMTP id a6so17285939ljq.3 for <12972@debbugs.gnu.org>; Sat, 03 Jul 2021 04:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=m+ABobPGrlMRHd6M92VSJY25iLxCWMykU3frB5Ik1h8=; b=bMw+hflcyj87IU5FvJqKAxhOUFEfbzzx8K9OLfd9Ac/vA8u9ft+3nbiwX9/wzhY3PI XHz+KCGiXCnTa90z+QhY74nXAX0WptykykCYM4YycfFLmiC/+ydgWIO54vJcz1nxFq0i wge8EMOIsO8VnkuVmQF9Enhoqmnt+ZHhAOjvlM32keaNzt9Q4kwP6jmELcFabJL/f/Af 7mujSIZHDzkH8pWm/781gOQQZIx7oblK5aTNkfjXmN6Hbp/PoqxfETDIk7aIlSOv8+AN vuJH0f/KXIglMaDHwvMk0f6g9UOT+NpT3Rc1Qn/GmYOLoRLZ2pXDarxJe5gOW9qjMcCi 7DVA== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=m+ABobPGrlMRHd6M92VSJY25iLxCWMykU3frB5Ik1h8=; b=dfIB1uLcComY2Q4qmosuda2R2rz0OG9uEMpxH6MucFZIa8Xzms3Scbv/6UOnJ+2qnl VyJOGGUiHm2ZHxAduaxOeo+5e/xfaHL6WdJoBtzhDOp5ejPeGToSPxVxh8G20LmA8CPb NUiNWc0spV9/5GgnIr4SaV5C+5653VM8Nd7ffOe97Vc2bOWaQZL0FDeB0ILMaSIW3yzM M/iNpwYJMVZ/eEEv1oGBT28j1/KjkbzvTXIzvxMcUPA+ehzaXqXhSHKsDoEGEYJLu3Oi 2x2Lhy3k10SPEgFlo3f5hlLGzUMkR4Q8hlk0dXjgGXQB3gqfX/dj6SNZW8ka55sNlcOq ybHw== X-Gm-Message-State: AOAM533DRmAd/RGmvPYEesKs7drVDISUjJ2/4sOtF7pt0FF6n0718Uro W5WTc2UM4jv23xUwwatAsFWnxpvbAFs= X-Google-Smtp-Source: ABdhPJzfEh+wxEdYjwykyZKmrIqrjWKAoR/2sRI9lTuNI3P3+h+Noq+CVz1kgC5/Q4WjWJfYR71vsg== X-Received: by 2002:a2e:9608:: with SMTP id v8mr2050749ljh.206.1625311772366; Sat, 03 Jul 2021 04:29:32 -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 u24sm522268lfc.162.2021.07.03.04.29.31 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Jul 2021 04:29:31 -0700 (PDT) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> From: Maxim Nikulin Message-ID: <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> Date: Sat, 3 Jul 2021 18:29:30 +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: <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) I am giving up with this issue. My summary. New function `mailcap-view-file' has a problem similar to Bug#44824 (kde-open5 and "gio open" called directly or through xdg-open are unreliable in Emacs, I consider it as fixed in Org mode) that was reported by several users and refused by developers as not reproducible at first. I tried my best to draw attention to this problem and then to suggest a change that fixes the obscure problem and improves error handling. I am unaware of any real negative consequences of my patch. It is up to Emacs developers to leave the new bug as is or to fix it in a way they like On 03/07/2021 00:28, Eli Zaretskii wrote: >> From: Maxim Nikulin Date: Fri, 2 Jul 2021 23:24:23 +0700 >> >> On 02/07/2021 19:37, Eli Zaretskii wrote: >>>> From: Maxim Nikulin Date: Fri, 2 Jul 2021 19:21:55 +0700 >>>> >>>>> And with other handlers, this could be an >>>>> incompatible behavior change if the handler behaves differently when >>>>> its standard handles are connected to a pipe rather than a terminal >>>>> device. >>>> >>>> Example of such handler, please. >>> >>> Why do you need one? >> >> Because of I can not imagine such case for mailcap handler in Emacs yet >> and, accordingly to you, "this could be an incompatible behavior change". > > You don't need to imagine it, you just need to trust me that I know > what I'm talking about: it would be an incompatible change. Is it a kind of Church of Emacs that I have to just believe in you? Previous time you were trying to convince me that unconditional 'pipe is perfectly safe when I was unsure concerning behavior on Windows. You prefer to keep reasons of your objections unveiled. I see no issue with the patch. It can be by a few lines shorter but the price is worse user experience. I have no idea how to move further. Finally, the patch touches month-old unreleased code, so I see no point to discuss that it is "incompatible". P.S. It was my fault to use `make-process' in Org since the function is not available in Emacs-24. I'm sorry for that incompatibility. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 03 07:56:30 2021 Received: (at 12972) by debbugs.gnu.org; 3 Jul 2021 11:56:30 +0000 Received: from localhost ([127.0.0.1]:37982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzeG6-0002Pf-Fh for submit@debbugs.gnu.org; Sat, 03 Jul 2021 07:56:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzeG2-0002PO-Ts for 12972@debbugs.gnu.org; Sat, 03 Jul 2021 07:56:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39902) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzeFx-0008Sx-Km; Sat, 03 Jul 2021 07:56:21 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1940 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzeFw-0003u4-Jw; Sat, 03 Jul 2021 07:56:21 -0400 Date: Sat, 03 Jul 2021 14:56:20 +0300 Message-Id: <83im1ripaz.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> (message from Maxim Nikulin on Sat, 3 Jul 2021 18:29:30 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Sat, 3 Jul 2021 18:29:30 +0700 > > I am giving up with this issue. That's too bad. I see no reason to give up, and I urge you to reconsider, please. > >> Because of I can not imagine such case for mailcap handler in Emacs yet > >> and, accordingly to you, "this could be an incompatible behavior change". > > > > You don't need to imagine it, you just need to trust me that I know > > what I'm talking about: it would be an incompatible change. > > Is it a kind of Church of Emacs that I have to just believe in you? It isn't a church, but some kind of trust cannot harm. > Previous time you were trying to convince me that unconditional 'pipe is > perfectly safe when I was unsure concerning behavior on Windows. It is indeed safe for Windows, because Emacs on Windows always uses pipes (as PTYs are not available there). My concern here is for systems other than Windows and other than those where you saw the issue. Your patch unconditionally assumes that every handler will immediately exit, and that it doesn't care about the connection type with the parent Emacs process, but that is not guaranteed to be true. What I'm asking is to let some kind of "fire escape" for users who could be adversely affected by this assumption. Ideally, some automatic detection of the handlers that need pipes would be the best. If that is not feasible, at least an option to control process-connection-type would be enough. > You prefer to keep reasons of your objections unveiled. I see no issue > with the patch. It can be by a few lines shorter but the price is worse > user experience. I have no idea how to move further. I explained the issue I have with unconditionally changing the interface. I have explained it above again. I hope it is clear enough. > Finally, the patch touches month-old unreleased code, so I see no point > to discuss that it is "incompatible". Hmm... that's true. So I guess an option to use PTYs should be good enough here. > P.S. It was my fault to use `make-process' in Org since the function is > not available in Emacs-24. I'm sorry for that incompatibility. Great, thanks. So I think it should be easy to adjust your patch to have a variable that controls process-connection-type, and then it could be installed. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 09:37:35 2021 Received: (at 12972) by debbugs.gnu.org; 4 Jul 2021 13:37:35 +0000 Received: from localhost ([127.0.0.1]:40579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02JT-0003iV-GG for submit@debbugs.gnu.org; Sun, 04 Jul 2021 09:37:35 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:46706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02JR-0003iE-FI for 12972@debbugs.gnu.org; Sun, 04 Jul 2021 09:37:34 -0400 Received: by mail-lf1-f44.google.com with SMTP id p21so5734244lfj.13 for <12972@debbugs.gnu.org>; Sun, 04 Jul 2021 06:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4lhJWbT2hQqQ57kA8/RtQ7VgtHvbAxSlFzLMnifBD7A=; b=MObBeEecxhzwp29ie5Scd9j22kpK046wetw07bd8b6NUrhjdpcoG1KcRkbI92vqTew AJfJep1026m1BPUHrUymchFaFbuV5OeWIw++M+1E29U96Zj+LwWWsB2W8WUu1PHGvWWe Xv0glLOgQZzMurlqpxQw7Tsy/hAHoQONnsOIDACjRMh7lFTpeHuQGUHPb+0sTOfg47wG 6fVX9wp1Bs38O9EPB+EWeoaTWqgh01TeJN7BOVAde73p3mhdessp1vyj7M37vEN1Bty3 Nl98SK/MbO+FGV/s4lTm24QYPQPBBipHS+GwV/JdUjlY5Io+Kb0wv/ppKUOmIJdz06DL swOA== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4lhJWbT2hQqQ57kA8/RtQ7VgtHvbAxSlFzLMnifBD7A=; b=Js+ohihqTAw4amIpsTruMV4QB0L8NDTIrokREQ97x39DeHxR4tbshwcift4fcV6pKU GYOx1dyIpn0J2rn80bb6NQNdtPKnKXT4W3qcnTzpWnPOUJQahOhtceIWahmqPmL2HsnJ V0mCowRxYTtXKVW+/7kOLkFcAkxQJQAFGD8dbLzjIjOGownsb/bcWC1Hl2CqLVximvVo OzOsU8m2RIP+HIpNfvMKvyE1vFcxS1Cm6SE7IB3xICZPVkR0mrxF0/xlTn1ViMDYogff QTGF4LzLdZpSPtL1D7lGLbyYcCdsbJcuzEdYmyqVp2D9b7Kkgns3DFbfGtIOn2PGu3bt fGCw== X-Gm-Message-State: AOAM533aqQnphnG6VUdJio8RHSIxvXYcxSIp49wFuoYeAFcxhBV1ukmj 5roNbG0SjjawsanFmOboOpMbiZgA+Ys= X-Google-Smtp-Source: ABdhPJyw9sW1FTtvU3YGaeVIpgpKoAThJQJt8xs1FFCjQQbvN9KNNeY/FHD2pp2AuOfB0BMFyeDghQ== X-Received: by 2002:ac2:58d9:: with SMTP id u25mr2570817lfo.49.1625405847071; Sun, 04 Jul 2021 06:37:27 -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 a2sm1097780ljp.117.2021.07.04.06.37.25 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jul 2021 06:37:26 -0700 (PDT) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> From: Maxim Nikulin Message-ID: Date: Sun, 4 Jul 2021 20:37:24 +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: <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 03/07/2021 18:56, Eli Zaretskii wrote: >> From: Maxim Nikulin Date: Sat, 3 Jul 2021 18:29:30 +0700 >> >> I am giving up with this issue. > > That's too bad. I see no reason to give up, and I urge you to > reconsider, please. Sorry, but the space of your assumptions and maybe confusions has too high number of dimension to realize what you actually mean and what you consider as a problem that should be fixed. So any further steps are impossible. > Your patch unconditionally assumes that every handler will immediately > exit, and that it doesn't care about the connection type with the > parent Emacs process, but that is not guaranteed to be true. There is no intention of such assumption and it *works* even for handlers that does not exit immediately. I admit that I wrongly added ":noquery t", for some reason I believed that it allows to choose whether processes are allowed to exist longer than emacs or it is preferred to kill them with emacs. Actually asynchronous processes are killed always and the option manages the query only. This option should be dropped to restore compatibility with previous variant. I have not found a way to detach asynchronous process from emacs. Surprisingly it is possible for synchronous processes but it is impossible to detect failure (thus to allow a user to figure out what has happened) (process-file-shell-command command nil 0 nil) So process API in emacs is a kind of a short blanket. Accidentally I have created an example of program that is incompatible with 'pipe asynchronous processes in emacs #!/bin/sh exec 1>&- exec 2>&- sleep 30 (let ((command "cpu-stress-test") (process-connection-type nil)) (start-process-shell-command command nil command)) And emacs (at least 26.3) consumes 100% CPU for the specified amount of time. I do not see any reason to do so since the program does not do anything ugly. I have not found a way to explicitly force emacs to close pipes. That is why I consider it as an outstanding bug. Emacs must properly handle closed pipes. So `process-file-shell-command' ... 0 is better than current `start-process-shell-command' but it does not allow to add error handling. So besides that I still have no guess what problem you suspect, now I know that emacs may become mad in response to purely innocent action of a child process. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 04 09:49:57 2021 Received: (at 12972) by debbugs.gnu.org; 4 Jul 2021 13:49:57 +0000 Received: from localhost ([127.0.0.1]:40606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02VR-0006LH-2A for submit@debbugs.gnu.org; Sun, 04 Jul 2021 09:49:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m02VO-0006L0-HW for 12972@debbugs.gnu.org; Sun, 04 Jul 2021 09:49:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42128) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m02VI-0006KK-UL; Sun, 04 Jul 2021 09:49:48 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2940 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m02VI-0005XX-1X; Sun, 04 Jul 2021 09:49:48 -0400 Date: Sun, 04 Jul 2021 16:49:53 +0300 Message-Id: <83zgv2gpdq.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: (message from Maxim Nikulin on Sun, 4 Jul 2021 20:37:24 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Sun, 4 Jul 2021 20:37:24 +0700 > > I admit that I wrongly added ":noquery t", for some reason I believed > that it allows to choose whether processes are allowed to exist longer > than emacs or it is preferred to kill them with emacs. Actually > asynchronous processes are killed always and the option manages the > query only. This option should be dropped to restore compatibility with > previous variant. > > I have not found a way to detach asynchronous process from emacs. > Surprisingly it is possible for synchronous processes but it is > impossible to detect failure (thus to allow a user to figure out what > has happened) > > (process-file-shell-command command nil 0 nil) > > So process API in emacs is a kind of a short blanket. > > Accidentally I have created an example of program that is incompatible > with 'pipe asynchronous processes in emacs > > #!/bin/sh > exec 1>&- > exec 2>&- > sleep 30 > > (let ((command "cpu-stress-test") > (process-connection-type nil)) > (start-process-shell-command command nil command)) > > And emacs (at least 26.3) consumes 100% CPU for the specified amount of > time. I do not see any reason to do so since the program does not do > anything ugly. I have not found a way to explicitly force emacs to close > pipes. That is why I consider it as an outstanding bug. Emacs must > properly handle closed pipes. > > So `process-file-shell-command' ... 0 is better than current > `start-process-shell-command' but it does not allow to add error handling. > > So besides that I still have no guess what problem you suspect, now I > know that emacs may become mad in response to purely innocent action of > a child process. Sorry, I'm not sure I understand what this is all about. Are you still talking about the patch you proposed? From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 09:12:46 2021 Received: (at 12972) by debbugs.gnu.org; 5 Jul 2021 13:12:46 +0000 Received: from localhost ([127.0.0.1]:44418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0OOz-0001T7-Ol for submit@debbugs.gnu.org; Mon, 05 Jul 2021 09:12:45 -0400 Received: from mail-lf1-f45.google.com ([209.85.167.45]:41914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0OOw-0001Sm-KD for 12972@debbugs.gnu.org; Mon, 05 Jul 2021 09:12:44 -0400 Received: by mail-lf1-f45.google.com with SMTP id n14so32436788lfu.8 for <12972@debbugs.gnu.org>; Mon, 05 Jul 2021 06:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=S1M45sJT/UvxaVcmrd2GEFGFOpdIMSVK55GoBX5Xc3U=; b=Nn9UpGl8s+HhbCg1PiMfrJQniMq/jqomMoNKKpUbom7Y+D0dXUV6nOcfuXbRnIgDxs a886RfgI+0f04Ipr7Aaq0DBEYzlLuKD/M2pchvA/FGDHJ2mdPdsOBbE5uk1Yt2wEJQkj ESWzNk/jSlMjA8BRy/rYMPyv945Uh3OrPRBANRHy31YkHytIIroWvEq5Bw7VR+O2OPYM JJ6RUnGb3bySxPXJ3YT4S8OZtJDjUXvpcuKq6g+QgziyBfgEPo4ufQBvIGS/8ZsWpPNH eEgX/JuihkpgZCsogugd4dpzd0kf/KtlCgOjGXhC98Sruj8MBtLzUEaCTrjBZQarLRmM z7TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=S1M45sJT/UvxaVcmrd2GEFGFOpdIMSVK55GoBX5Xc3U=; b=ocLKPgavLy/VfqTGbvjkC/59RO+8lFLkgV2TTLelH1Iy76wdABYuU5S1QWxtCWvLnX vte0mTiqK0mpWAMDb88wRn3wAFSV/QWVZ2q31cP4jUnJksi+H2aQO8tio4yXyb/2M666 pa5MbKHnuFcW7QYLy59XeGTJwDIiO63vTUs+ik5QFa7Qaj44up/rVWeIB5/psXDcSE6w 7N7Co4TzL3jN9S2G8Is1vO+vX+hlMIeND71nMQ7zmNaw3NmA7aYD+1ySkpuw77ADkSOL J7PlsC+P7iaznTphIJLtWgIPxPNeNDQCKZFNfZz6HKFo3oIeRkusGlfJJHCVFuoypMY3 GZmQ== X-Gm-Message-State: AOAM530vIylXDBEF2gu4G4y/HwgsV/Ex5dKo2ok7WJ9zFIkXAWBm1WkK srQ6Wp0VG5jb+i0goaiJH6Bwor3UW/g= X-Google-Smtp-Source: ABdhPJzB75daR+Att9oDC9bIbIlp9sM+3LYL4xbS/qhXqKvexSa5uniir6czoSivYdsRI3p56mDR8g== X-Received: by 2002:a19:4916:: with SMTP id w22mr10926854lfa.374.1625490756377; Mon, 05 Jul 2021 06:12:36 -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 z82sm555424lfa.55.2021.07.05.06.12.35 for <12972@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jul 2021 06:12:35 -0700 (PDT) From: Maxim Nikulin Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 To: 12972@debbugs.gnu.org References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> <83zgv2gpdq.fsf@gnu.org> Message-ID: <16b88d78-de85-75d8-4e37-fd56eef87522@gmail.com> Date: Mon, 5 Jul 2021 20:12:34 +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: <83zgv2gpdq.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12972 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) By mistake I sent the message below as private one at first. However it actually does not add anything new to my previous comments to the bug. On 04/07/2021 20:49, Eli Zaretskii wrote: >> From: Maxim Nikulin Date: Sun, 4 Jul 2021 20:37:24 +0700 > > Sorry, I'm not sure I understand what this is all about. Are you > still talking about the patch you proposed? Yes, I am. It is about proper way to a launch viewer in `mailcap-view-file'. Original `start-process-shell-command' with 'pty connection type prematurely kills children of kde-open5 or gio open. With 'pipe connection type it or `make-process' might make emacs CPU hungry if a child decides to close stdout and stderr: >> #!/bin/sh >> exec 1>&- >> exec 2>&- >> sleep 30 and finally `process-file-shell-command' does not allow to report failure. Moreover you suspect another secret compatibility problem with 'pipe. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 05 11:23:56 2021 Received: (at 12972) by debbugs.gnu.org; 5 Jul 2021 15:23:57 +0000 Received: from localhost ([127.0.0.1]:46467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QRw-00042t-N7 for submit@debbugs.gnu.org; Mon, 05 Jul 2021 11:23:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0QRu-00042d-VT for 12972@debbugs.gnu.org; Mon, 05 Jul 2021 11:23:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40806) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0QRp-0005Wk-MY; Mon, 05 Jul 2021 11:23:49 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1799 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0QRp-0003A2-9G; Mon, 05 Jul 2021 11:23:49 -0400 Date: Mon, 05 Jul 2021 18:23:54 +0300 Message-Id: <83eecchjhx.fsf@gnu.org> From: Eli Zaretskii To: Maxim Nikulin In-Reply-To: <16b88d78-de85-75d8-4e37-fd56eef87522@gmail.com> (message from Maxim Nikulin on Mon, 5 Jul 2021 20:12:34 +0700) Subject: Re: bug#12972: [PATCH] Avoid regression in mailcap-view-file similar to Bug#44824 References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <835yxtlw14.fsf__2546.8955327355$1625164803$gmane$org@gnu.org> <1ddf1c46-0a28-4a2d-cc40-094ff74ee0ac@gmail.com> <837di8ki24.fsf__46278.4886871063$1625229533$gmane$org@gnu.org> <831r8gk4m0.fsf__14172.0669272885$1625246977$gmane$org@gnu.org> <1825a6f3-0175-2d67-5608-41c9fb93889b@gmail.com> <83im1ripaz.fsf__31901.4239286602$1625313464$gmane$org@gnu.org> <83zgv2gpdq.fsf@gnu.org> <16b88d78-de85-75d8-4e37-fd56eef87522@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Maxim Nikulin > Date: Mon, 5 Jul 2021 20:12:34 +0700 > > It is about proper way to a launch viewer in > `mailcap-view-file'. Original `start-process-shell-command' with 'pty > connection type prematurely kills children of kde-open5 or gio open. > With 'pipe connection type it or `make-process' might make emacs CPU > hungry if a child decides to close stdout and stderr: > > >> #!/bin/sh > >> exec 1>&- > >> exec 2>&- > >> sleep 30 Is the above something a file viewer is likely to do? And if it does, how would you suggest to countermand that? > and finally `process-file-shell-command' does not allow to report > failure. The original code uses start-process-shell-command, and I don't think I understand why you wanted to call process-file-shell-command instead. Can you explain? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 30 08:01:38 2021 Received: (at 12972) by debbugs.gnu.org; 30 Jul 2021 12:01:38 +0000 Received: from localhost ([127.0.0.1]:59241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RCs-0000jk-Co for submit@debbugs.gnu.org; Fri, 30 Jul 2021 08:01:38 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RCq-0000eK-Tg for 12972@debbugs.gnu.org; Fri, 30 Jul 2021 08:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dr3Y+HQm6lHC4eu426UHkry8B5b9MMZaW7nreXtf69s=; b=X1eQrvflwT/zSbuJzPlY+yX9jb /Uh4D53dzjDM3Re2ftrNim7kd0BM/QjpIDDy1hmHXPZ5yCy6z9wBNuKmYGkfW6STLTVMUwzDeez2k Z6D1GfUo+VQb9yh8dYai4AkYPPpqC+OLvOFx48l3Speou9AHYMMqpFPaSdG5azvAkz5U=; Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9RCi-00078o-2V; Fri, 30 Jul 2021 14:01:30 +0200 From: Lars Ingebrigtsen To: Maxim Nikulin Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> Date: Fri, 30 Jul 2021 14:01:26 +0200 In-Reply-To: (Maxim Nikulin's message of "Fri, 2 Jul 2021 00:01:59 +0700") Message-ID: <87r1fgnh7t.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 30 08:01:50 2021 Received: (at control) by debbugs.gnu.org; 30 Jul 2021 12:01:50 +0000 Received: from localhost ([127.0.0.1]:59244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RD3-0000ue-Ow for submit@debbugs.gnu.org; Fri, 30 Jul 2021 08:01:49 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RD2-0000oA-2M for control@debbugs.gnu.org; Fri, 30 Jul 2021 08:01:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=y+pBTE24hBTYzZuhnLCU1qiUMvSbnDWVheu/y+bZFEU=; b=qnrtVgApIsdgiNfYRD/9qyDPQP SWCbL1cLDJ1D0EZF3OQ3t80lXIkGC/baWsuNi5XsNWwQCaIklyg4wS5pzwGuYQZ7CtITUE9n+ezQ1 /MGzNmBWCuuqkHLrjneOeLgwhOsQk5OykQG8XArECYs9bjinSE+2e5zpVQI0D9wTV8us=; Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9RCt-00078x-Us for control@debbugs.gnu.org; Fri, 30 Jul 2021 14:01:42 +0200 Date: Fri, 30 Jul 2021 14:01:33 +0200 Message-Id: <87pmv0nh7m.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12972 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 12972 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 12972 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 30 08:25:03 2021 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) Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode To: Lars Ingebrigtsen 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-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 30 08:42:31 2021 Received: (at 12972) by debbugs.gnu.org; 30 Jul 2021 12:42:31 +0000 Received: from localhost ([127.0.0.1]:59352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RqR-0004rC-5U for submit@debbugs.gnu.org; Fri, 30 Jul 2021 08:42:31 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9RqP-0004r0-PC for 12972@debbugs.gnu.org; Fri, 30 Jul 2021 08:42:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0RbW8s/JldeBXROBOWfweC2RGbimc/VCBllC3tJ1DJ8=; b=JzErcGNFgwsKY/lqD0kakwmo0B G/yeiA+GQlCjvoZE6YmxatyebS5Von5rglZTmLYEB3HFrToiAqWIcii1dRJ9WpzDCCWc36gRYpQtn 2GquHqGapLB6Jn6JUWc7LBUuFz7MBgDVwcDAJ9LM0DcR/bd2Wo2dsTUGvtXFSzyc4D7M=; Received: from 2.149.45.105.tmi.telenormobil.no ([2.149.45.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9RqH-0007V3-1a; Fri, 30 Jul 2021 14:42:23 +0200 From: Lars Ingebrigtsen To: Maxim Nikulin Subject: Re: bug#12972: 24.3.50; Move `org-open-file' and associated code out of Org mode References: <87r1hmdqek.fsf__16088.3597027109$1622530682$gmane$org@gnus.org> <87r1fgnh7t.fsf_-_@gnus.org> <631ca586-51ef-a967-f01b-410f69068aae@gmail.com> Date: Fri, 30 Jul 2021 14:42:19 +0200 In-Reply-To: <631ca586-51ef-a967-f01b-410f69068aae@gmail.com> (Maxim Nikulin's message of "Fri, 30 Jul 2021 19:24:47 +0700") Message-ID: <87bl6km0r8.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Maxim Nikulin writes: > Thanks for looking into this issue. Please, consider the following > additional change: Thanks; applied to Emacs 28. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 12972 Cc: 12972@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Maxim Nikulin writes: > Thanks for looking into this issue. Please, consider the following > additional change: Thanks; applied to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 22:44:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 28 Aug 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator