From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 18:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25778@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148735542430385 (code B ref -1); Fri, 17 Feb 2017 18:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Feb 2017 18:17:04 +0000 Received: from localhost ([127.0.0.1]:43801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cen5b-0007u1-PE for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:17:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cen5Y-0007tR-5c for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:17:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cen5R-0003Af-HW for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:16:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cen5R-0003Ab-EC for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:16:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cen5P-000065-TQ for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cen5O-00039o-KY for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:51 -0500 Received: from mail-ot0-x22e.google.com ([2607:f8b0:4003:c0f::22e]:35212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cen5O-00039h-CN for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:50 -0500 Received: by mail-ot0-x22e.google.com with SMTP id 45so36584178otd.2 for ; Fri, 17 Feb 2017 10:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PpZMjqlOBzr4/qJtyzIv9c35jl8SG2U+GvtxEVzszp8=; b=XPPaLOpUW2bgi1IM0n+jamn3/i3ylP5gUwBayIGaAN3E1HxIZqOwqHkw/ZGvsqx3ip CzMUjoROmeUhwqXEkX0xi7y7MLW87E7ZhaBzr+kL0Zcr6Tgeb/4W7MmsugZtItsXlfDt Qg0s+UGNk+9PI368lP7e/aVoy9nD8nE7EWNHgXJll6I2VahtEqDy11odzt3Bm2yxSo/d FDQ1z2ekP/SbLrzYBOchLSopSpk+WeuCzTkztXBpaciZMA83PQfiGz8/+6m2+asyTN/U eArVyMsQwDimCzN8h9fgnaYnTPGHaZHWcs0F7Dkd+ENi5EDP1m1f1c8V4Gpu+XO1+XOw 0iqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PpZMjqlOBzr4/qJtyzIv9c35jl8SG2U+GvtxEVzszp8=; b=aW3h1Mi6d8nTtM12J+6w6tR7Wgaap0A9gEhYJVP+SRwrU42Yp+WYU3X6YT8zt1RNah AzgSyGmxQDazGPASGHvj0XejedPMJMYfgjkm/VwGqLmX7OWDTKra/sfEjQLjIgJh2eoZ p9DU0KOnGw1xnHc7GoiN5Gg6yJf03B5Sl8Eo6nPLjEKmYUyTuY4yqkpyAAgjuRsUDr9E 6+D+wWi3I+Q0UUMTSG6yaNqTh8j2Wub4HSenQgfxiECskNdAzvpI9F0Z104rmQZt1rmG R4qF/MFB7FhPrCUteiWVh9rSY7h90sj2mSNrOuNsoqsfZksieqjTlEJQlL5yWUL2RuQp TrdA== X-Gm-Message-State: AMke39mI6cYUSDuHsg0xxD21yKvTBwGhwi006lbdXHtpfLcuE4LAcbQcOSQndCFGa0Ijl5tlRKO7kIioLXSxAA== X-Received: by 10.157.48.51 with SMTP id d48mr4787879otc.207.1487355409243; Fri, 17 Feb 2017 10:16:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.0.34 with HTTP; Fri, 17 Feb 2017 10:16:48 -0800 (PST) From: Vasilij Schneidermann Date: Fri, 17 Feb 2017 19:16:48 +0100 Message-ID: Content-Type: multipart/mixed; boundary=001a113e3a74d2d2450548bdea21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) --001a113e3a74d2d2450548bdea21 Content-Type: text/plain; charset=UTF-8 A user on #emacs brought it to my attention that the xdg-open detection for browse-url is more complex than it should be and fails detecting their Linux desktop. Looking at the definition of `browse-url-can-use-xdg-open' reveals that it replicates the desktop environment check as done by `xdg-open` (which is done to detect the DE-specific default browser setting, not to prevent people not using a popular desktop environment from using xdg-open). As enumerating all possible kinds of Linux desktop is a futile endeavor, I've completely eliminated this check from it so that the only ones left are whether we're in a graphical session (by checking $DISPLAY) and whether `xdg-open` has been found on $PATH. --001a113e3a74d2d2450548bdea21 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Drastically-simplify-check-for-xdg-open.patch" Content-Disposition: attachment; filename="0001-Drastically-simplify-check-for-xdg-open.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iza507as0 RnJvbSA2Yzk5ZTdhY2UzMTEwYjczYTViMjEyMjAzYWNjNzI4MTY1YmUwOTJiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBWYXNpbGlqIFNjaG5laWRlcm1hbm4gPHYuc2NobmVpZGVybWFu bkBnbWFpbC5jb20+CkRhdGU6IEZyaSwgMTcgRmViIDIwMTcgMTk6MDg6NTQgKzAxMDAKU3ViamVj dDogW1BBVENIXSBEcmFzdGljYWxseSBzaW1wbGlmeSBjaGVjayBmb3IgeGRnLW9wZW4KCiogYnJv d3NlLXVybC5lbCAoYnJvd3NlLXVybC1jYW4tdXNlLXhkZy1vcGVuKTogU2ltcGxpZnkgeGRnLW9w ZW4gY2hlY2sKLS0tCiBsaXNwL25ldC9icm93c2UtdXJsLmVsIHwgMzQgKysrLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDMgaW5zZXJ0aW9ucygrKSwgMzEg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9uZXQvYnJvd3NlLXVybC5lbCBiL2xpc3Av bmV0L2Jyb3dzZS11cmwuZWwKaW5kZXggYTdjODc5Y2JmYi4uYmY3NTYxMzA2YyAxMDA2NDQKLS0t IGEvbGlzcC9uZXQvYnJvd3NlLXVybC5lbAorKysgYi9saXNwL25ldC9icm93c2UtdXJsLmVsCkBA IC00NSw3ICs0NSw3IEBACiA7OyBicm93c2UtdXJsLWdlbmVyaWMgICAgICAgICAgICAgICAgIGFy Yml0cmFyeQogOzsgYnJvd3NlLXVybC1kZWZhdWx0LXdpbmRvd3MtYnJvd3NlciBNUy1XaW5kb3dz IGJyb3dzZXIKIDs7IGJyb3dzZS11cmwtZGVmYXVsdC1tYWNvc3gtYnJvd3NlciAgbWFjT1MgYnJv d3NlcgotOzsgYnJvd3NlLXVybC14ZGctb3BlbiAgICAgICAgICAgICAgICBGcmVlIERlc2t0b3Ag eGRnLW9wZW4gb24gR25vbWUsIEtERSwgWGZjZTQsIExYREUKKzs7IGJyb3dzZS11cmwteGRnLW9w ZW4gICAgICAgICAgICAgICAgRnJlZSBEZXNrdG9wIHhkZy1vcGVuCiA7OyBicm93c2UtdXJsLWtk ZSAgICAgICAgICAgICAgICAgICAgIEtERSBrb25xdWVyb3IgKGtmbSkKIDs7IGJyb3dzZS11cmwt ZWxpbmtzICAgICAgICAgICAgICAgICAgRWxpbmtzICAgICAgRG9uJ3Qga25vdyAodHJpZWQgd2l0 aCAwLjEyLkdJVCkKIApAQCAtOTQ0LDM2ICs5NDQsOCBAQCBpbnN0ZWFkIG9mIGBicm93c2UtdXJs LW5ldy13aW5kb3ctZmxhZycuIgogCiAoZGVmdW4gYnJvd3NlLXVybC1jYW4tdXNlLXhkZy1vcGVu ICgpCiAgICJSZXR1cm4gbm9uLW5pbCBpZiB0aGUgXCJ4ZGctb3BlblwiIHByb2dyYW0gY2FuIGJl IHVzZWQuCi14ZGctb3BlbiBpcyBhIGRlc2t0b3AgdXRpbGl0eSB0aGF0IGNhbGxzIHlvdXIgcHJl ZmVycmVkIHdlYiBicm93c2VyLgotVGhpcyByZXF1aXJlcyB5b3UgdG8gYmUgcnVubmluZyBlaXRo ZXIgR25vbWUsIEtERSwgWGZjZTQgb3IgTFhERS4iCi0gIChhbmQgKGdldGVudiAiRElTUExBWSIp Ci0gICAgICAgKGV4ZWN1dGFibGUtZmluZCAieGRnLW9wZW4iKQotICAgICAgIDs7IHhkZy1vcGVu IG1heSBjYWxsIGdub21lLW9wZW4gYW5kIHRoYXQgZG9lcyBub3Qgd2FpdCBmb3IgaXRzIGNoaWxk Ci0gICAgICAgOzsgdG8gZmluaXNoLiAgVGhpcyBjaGlsZCBtYXkgdGhlbiBiZSBraWxsZWQgd2hl biB0aGUgcGFyZW50IGRpZXMuCi0gICAgICAgOzsgVXNlIG5vaHVwIHRvIHdvcmsgYXJvdW5kLiAg U2VlIGJ1ZyM3MTY2LCBidWcjODkxNywgYnVnIzk3NzkgYW5kCi0gICAgICAgOzsgaHR0cDovL2xp c3RzLmdudS5vcmcvYXJjaGl2ZS9odG1sL2VtYWNzLWRldmVsLzIwMDktMDcvbXNnMDAyNzkuaHRt bAotICAgICAgIChleGVjdXRhYmxlLWZpbmQgIm5vaHVwIikKLSAgICAgICAob3IgKGdldGVudiAi R05PTUVfREVTS1RPUF9TRVNTSU9OX0lEIikKLQkgICA7OyBHTk9NRV9ERVNLVE9QX1NFU1NJT05f SUQgaXMgZGVwcmVjYXRlZCwgY2hlY2sgb24gRGJ1cyBhbHNvLgotCSAgIChjb25kaXRpb24tY2Fz ZSBuaWwKLQkgICAgICAgKGVxIDAgKGNhbGwtcHJvY2VzcwotCQkgICAgICAiZGJ1cy1zZW5kIiBu aWwgbmlsIG5pbAotCQkJCSAgIi0tZGVzdD1vcmcuZ25vbWUuU2Vzc2lvbk1hbmFnZXIiCi0JCQkJ ICAiLS1wcmludC1yZXBseSIKLQkJCQkgICIvb3JnL2dub21lL1Nlc3Npb25NYW5hZ2VyIgotCQkJ CSAgIm9yZy5nbm9tZS5TZXNzaW9uTWFuYWdlci5DYW5TaHV0ZG93biIpKQotCSAgICAgKGVycm9y IG5pbCkpCi0JICAgKGVxdWFsIChnZXRlbnYgIktERV9GVUxMX1NFU1NJT04iKSAidHJ1ZSIpCi0J ICAgKGNvbmRpdGlvbi1jYXNlIG5pbAotCSAgICAgICAoZXEgMCAoY2FsbC1wcm9jZXNzCi0JCSAg ICAgICIvYmluL3NoIiBuaWwgbmlsIG5pbAotCQkgICAgICAiLWMiCi0JCSAgICAgIDs7IEZJWE1F IHVzZSBzdHJpbmctbWF0Y2ggcmF0aGVyIHRoYW4gZ3JlcC4KLQkJICAgICAgInhwcm9wIC1yb290 IF9EVF9TQVZFX01PREV8Z3JlcCB4ZmNlNCIpKQotCSAgICAgKGVycm9yIG5pbCkpCi0JICAgKG1l bWJlciAoZ2V0ZW52ICJERVNLVE9QX1NFU1NJT04iKSAnKCJMWERFIiAiTHVidW50dSIpKQotCSAg IChlcXVhbCAoZ2V0ZW52ICJYREdfQ1VSUkVOVF9ERVNLVE9QIikgIkxYREUiKSkpKQotCit4ZGct b3BlbiBpcyBhIGRlc2t0b3AgdXRpbGl0eSB0aGF0IGNhbGxzIHlvdXIgcHJlZmVycmVkIHdlYiBi cm93c2VyLiIKKyAgKGFuZCAoZ2V0ZW52ICJESVNQTEFZIikgKGV4ZWN1dGFibGUtZmluZCAieGRn LW9wZW4iKSkpCiAKIDs7OyMjI2F1dG9sb2FkCiAoZGVmdW4gYnJvd3NlLXVybC14ZGctb3BlbiAo dXJsICZvcHRpb25hbCBpZ25vcmVkKQotLSAKMi4xMS4wCgo= --001a113e3a74d2d2450548bdea21-- From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 18:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vasilij Schneidermann Cc: 25778@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148735670532256 (code B ref 25778); Fri, 17 Feb 2017 18:39:02 +0000 Received: (at 25778) by debbugs.gnu.org; 17 Feb 2017 18:38:25 +0000 Received: from localhost ([127.0.0.1]:43809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cenQG-0008OB-OD for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:38:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cenQF-0008Ny-7b for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 13:38:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cenQ7-0005iG-2W for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 13:38:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cenQ6-0005iC-VP; Fri, 17 Feb 2017 13:38:15 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4088 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cenQ6-0003DS-9H; Fri, 17 Feb 2017 13:38:14 -0500 Date: Fri, 17 Feb 2017 20:38:42 +0200 Message-Id: <83shncr7bh.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Vasilij Schneidermann on Fri, 17 Feb 2017 19:16:48 +0100) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) > From: Vasilij Schneidermann > Date: Fri, 17 Feb 2017 19:16:48 +0100 > > A user on #emacs brought it to my attention that the xdg-open detection > for browse-url is more complex than it should be and fails detecting > their Linux desktop. Looking at the definition of > `browse-url-can-use-xdg-open' reveals that it replicates the desktop > environment check as done by `xdg-open` (which is done to detect the > DE-specific default browser setting, not to prevent people not using a > popular desktop environment from using xdg-open). As enumerating all > possible kinds of Linux desktop is a futile endeavor, I've completely > eliminated this check from it so that the only ones left are whether > we're in a graphical session (by checking $DISPLAY) and whether > `xdg-open` has been found on $PATH. First, checking $DISPLAY doesn't yet mean you are in a GUI frame. We have display-graphic-p for that. And second, I don't understand what will happen with all the bugs mentioned in the comments if we remove the code that was supposed to avoid hitting them. Maybe I'm missing something obvious. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 18:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.14873577231241 (code B ref 25778); Fri, 17 Feb 2017 18:56:01 +0000 Received: (at 25778) by debbugs.gnu.org; 17 Feb 2017 18:55:23 +0000 Received: from localhost ([127.0.0.1]:43813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cengh-0000Jw-7j for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:55:23 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cengg-0000Jg-0d for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 13:55:22 -0500 Received: by mail-wm0-f67.google.com with SMTP id u63so4039874wmu.2 for <25778@debbugs.gnu.org>; Fri, 17 Feb 2017 10:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rTDyhwfUroiTNQzRU8k64u5Ph0t7iTK4oEzAmYDAEyw=; b=LVGaGZKkcjwfBPAJiPctbby1ftfqSnTsd5O138hSniqMZeTH3Nqm5cCOva+N4aX0nn qfy4/CdQe7+Tzf+zv+Xe6M53gnavx4bGyH5ANIfTHL18BlqSal+LRb+kwQPGii/CNqAZ 8/HeQCMtDjNTOv9BwWlmj2c2f1p6uyJel9EsYDjWkbq4Gb6eWuQA5nfqBAPymk59fWXH ohy+m5cBf+SWm9CsO40A1Dt1yZDVvROOPzdTam3vwe6/yizrZzkJtjX3J5eA3zB/FNdD J+kO/VCDViuyRThWZdTddzy9DfdfPeOcWvVhlVZr4l4vKZbQ8f1e20kSmrKlSiXwShDu b7Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rTDyhwfUroiTNQzRU8k64u5Ph0t7iTK4oEzAmYDAEyw=; b=s/ve6s1rfioz3YcmVoWWzvQfJykwNAfL3EeQz47bpnxUzqPYeRlFwqpTcTGAeYvluk KE2tS1lPQ234m3KnZ/Q4bnOadIxcogSwMUaLxet2NcqwqQ6JgnrvtqwYWzZAjlokRh0z 1NdfaTa/ZrXBvgibxfIBUfp1b2bZbV25YMzz7ZcwHYA9ufzY3EfbKFbLa0Z6CO42hn0r j8c/VbJIAaBitsJTPB4ir/D5iLp7v4Mi292Tq17s7S/xSsP9FHg+T4tbv8il3tHxFs4j G6p57dah7iwLHOIAw85Oz3IxfKdQPN5X94y3SAVvExdX6tyUkfS3EahA0uqm/3SBwvvH AsTA== X-Gm-Message-State: AMke39nM35V8KY7wlIyIb8RBqPyWDJ4aQU/N5lWef3FZrq1j7fSj5ZFzoo9TlpYtb9GiXA== X-Received: by 10.28.61.136 with SMTP id k130mr3041168wma.128.1487357716216; Fri, 17 Feb 2017 10:55:16 -0800 (PST) Received: from localhost ([31.212.48.161]) by smtp.gmail.com with ESMTPSA id x39sm14020851wrb.3.2017.02.17.10.55.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Feb 2017 10:55:15 -0800 (PST) Date: Fri, 17 Feb 2017 19:55:14 +0100 From: Vasilij Schneidermann Message-ID: <20170217185514.GA599@odonien.localdomain> References: <83shncr7bh.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <83shncr7bh.fsf@gnu.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: 0.5 (/) 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.5 (/) > First, checking $DISPLAY doesn't yet mean you are in a GUI frame. We > have display-graphic-p for that. The assumption that you need to be in a GUI frame is incorrect. If I run `emacs -nw` in a graphical terminal emulator, why would that prevent me from opening a graphical browser? The only way I see to detect whether a graphical browser can be opened is by checking for X with $DISPLAY. > And second, I don't understand what will happen with all the bugs > mentioned in the comments if we remove the code that was supposed to > avoid hitting them. Maybe I'm missing something obvious. OK, I'll go through them all for completeness' sake: - bug#7166: This one arises from using /bin/sh in combination with `nohup` for launching xdg-open, resulting in a lack of shell quoting. As `xdg-open` is launched directly, it's no longer relevant and only mentioned because of `nohup` (which is no longer used either). - bug#8917: The old usage of `call-process` has made `nohup` obsolete. Irrelevant as `nohup` isn't used any longer. - bug#9779: Extension of the now removed xdg-open DE detection logic, together with some discussion whether nohup is still necessary. Some voices in favor of not doing any unnecessary detection. - The linked emacs-devel thread: Sighting of a possible bug in gnome-open. As `nohup` is no longer used, there's no way this could have been worked around with its usage Summary: All linked bugs are related to `nohup` which is only checked for, but not actually used. Therefore they can be disregarded. Do you have any actual objections based on a situation where one would *not* want to use xdg-open, even though it's installed and the user in a X11 session? From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 03:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vasilij Schneidermann Cc: 25778@debbugs.gnu.org, Eli Zaretskii Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148738920115984 (code B ref 25778); Sat, 18 Feb 2017 03:40:02 +0000 Received: (at 25778) by debbugs.gnu.org; 18 Feb 2017 03:40:01 +0000 Received: from localhost ([127.0.0.1]:44032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cevsP-00049k-Ho for submit@debbugs.gnu.org; Fri, 17 Feb 2017 22:40:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cevsO-00049Y-1H for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 22:40:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cevsH-0004jL-TV for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 22:39:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cevsG-0004it-E9; Fri, 17 Feb 2017 22:39:52 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cevsF-0005Oj-9y; Fri, 17 Feb 2017 22:39:51 -0500 From: Glenn Morris References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> X-Spook: Breach Abu Sayyaf Freeh 22nd SAS Ft. Meade Botnet ASPIC X-Ran: A|HL0\UFM3+#T=D$5Y+3_QF@*=VIrK2L3|I2H&/is~GBDcg>sSB9d!|&!Hu>a~_%yHqB+F X-Hue: brightyellow X-Attribution: GM Date: Fri, 17 Feb 2017 22:39:51 -0500 In-Reply-To: <20170217185514.GA599@odonien.localdomain> (Vasilij Schneidermann's message of "Fri, 17 Feb 2017 19:55:14 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) The area seems a mess, but: 1) nohup was removed from browse-url-xdg-open in 1c0f1a199ca, with no explanation and as part of a change that seems unrelated. 2) In https://debbugs.gnu.org/9779#20, the author of that change said I note that since 22-Jun-2011 browse-url-xdg-open no longer uses nohup. This is either a mistake on my part (I didn't read the comment in browse-url-can-use-xdg-open) or it is indeed unnecessary and therefore isn't a requirement for xdg-open. 3) In reply, Jan said in https://debbugs.gnu.org/9779#29 See discussion at http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html. nohup is still needed for xdg-open. And AFAICS that was the last comment about nohup. No-one ever seems to have followed up Jan's comment. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 03:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vasilij Schneidermann Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148738957516583 (code B ref 25778); Sat, 18 Feb 2017 03:47:02 +0000 Received: (at 25778) by debbugs.gnu.org; 18 Feb 2017 03:46:15 +0000 Received: from localhost ([127.0.0.1]:44038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cevyR-0004JP-8F for submit@debbugs.gnu.org; Fri, 17 Feb 2017 22:46:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cevyP-0004JC-Sx for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 22:46:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cevyJ-00081h-Lp for 25778@debbugs.gnu.org; Fri, 17 Feb 2017 22:46:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cevyI-00080r-BM; Fri, 17 Feb 2017 22:46:06 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cevyG-00011z-6w; Fri, 17 Feb 2017 22:46:04 -0500 From: Glenn Morris References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> X-Spook: Violence rail gun Narco banners MS-13 Incident event X-Ran: ?)8Xfm+=L$BNy,B]B[Q({ag+I'u|'+AIBu3crG[KZS]^b\y0ABG X-Hue: brightwhite X-Attribution: GM Date: Fri, 17 Feb 2017 22:46:03 -0500 In-Reply-To: (Glenn Morris's message of "Fri, 17 Feb 2017 22:39:51 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) PS Maybe you are just saying that since no-one (?) complained since then, nohup can't have been needed after all. It would be better to test it, though. It seems difficult to test all the possibilities for xdg-open. Ref https://debbugs.gnu.org/25234 From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 07:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vasilij Schneidermann Cc: 25778@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.14874046846524 (code B ref 25778); Sat, 18 Feb 2017 07:59:01 +0000 Received: (at 25778) by debbugs.gnu.org; 18 Feb 2017 07:58:04 +0000 Received: from localhost ([127.0.0.1]:44105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cezu8-0001hA-7r for submit@debbugs.gnu.org; Sat, 18 Feb 2017 02:58:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cezu6-0001gg-IU for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 02:58:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cezty-0005uS-7A for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 02:57:57 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cezty-0005uC-3V; Sat, 18 Feb 2017 02:57:54 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4523 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ceztu-0002fR-Kq; Sat, 18 Feb 2017 02:57:52 -0500 Date: Sat, 18 Feb 2017 09:58:18 +0200 Message-Id: <83r32wq6at.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20170217185514.GA599@odonien.localdomain> (message from Vasilij Schneidermann on Fri, 17 Feb 2017 19:55:14 +0100) References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) > Date: Fri, 17 Feb 2017 19:55:14 +0100 > From: Vasilij Schneidermann > Cc: 25778@debbugs.gnu.org > > > First, checking $DISPLAY doesn't yet mean you are in a GUI frame. We > > have display-graphic-p for that. > > The assumption that you need to be in a GUI frame is incorrect. If I > run `emacs -nw` in a graphical terminal emulator, why would that prevent > me from opening a graphical browser? The only way I see to detect > whether a graphical browser can be opened is by checking for X with > $DISPLAY. In that case, maybe we shouldn't test $DISPLAY at all? Why restrict this to X if xdg-open is already tested for availability? > Do you have any actual objections based on a situation where one would > *not* want to use xdg-open, even though it's installed and the user in a > X11 session? See Glenn's response about that. I think we should be more careful with these issues, and at least do some more research of them before we can be sure they are no longer relevant. If you could follow up on that, it would be great. Thanks. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148740783411049 (code B ref 25778); Sat, 18 Feb 2017 08:51:01 +0000 Received: (at 25778) by debbugs.gnu.org; 18 Feb 2017 08:50:34 +0000 Received: from localhost ([127.0.0.1]:44129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf0iw-0002s8-CO for submit@debbugs.gnu.org; Sat, 18 Feb 2017 03:50:34 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf0iu-0002ru-Rq for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 03:50:33 -0500 Received: by mail-wm0-f41.google.com with SMTP id r141so23756062wmg.1 for <25778@debbugs.gnu.org>; Sat, 18 Feb 2017 00:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BBRa8mFmEODcrn/oM7rkDzm7dG8txVIGN3/PYPJzMso=; b=nh5mYB5kV6eiLVBr03bOFucYZqWCo4ae3EAvNlmB7I2jiiwZkeqPgGC2b1lzHOQCUA TJSwFPoZhyYW2YelxwjrMLgtXA70ydVnLtEbJw2WigZwfFZ+0D6+WLNHb3PmYwtnt77E 2wpEDVTOQ7rDvQvxAmyKjKElczLPu2Jx/zTIVTn6NS7PfO0qdkG4jrlpwzFmbrcEF0Vi 7bTpJOwy3kbXoC8IHbJTvS7fyA3lmwgoFYhWklkdShSj27Y2IOmgVALYOOoZoGU4+bRd URl7wBhE8mqCJlq1/+eZ4d020M9MuMWgcqqWT1jBDqx7uyg4DMJHT+87H/5GmZRXntY0 9Jhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BBRa8mFmEODcrn/oM7rkDzm7dG8txVIGN3/PYPJzMso=; b=gp7/vnMBIJBS79uk7R0YJ+sIunrkTq0WbkwKCLXJq3ifDX82JnrgkMPNWaV2iR6OcE vU5Oeu6FmgJm/9C8ux6RhIEQW0nRq1kzWeP5rg64dpABRIx3ArFO2r0qwyAZ/ksnYbA7 gllpOP013jCbIFemJBPSGBYie5r+mcP7XgYtR8EOy4BZrWnMsWaVILPLIoRxbnNEw1rv 3J8C7eSo0wG+Bfj3NABBjeQp8piEU8zuUtPybFTnrlmQlk3yJjMqnib2aOv5ihUR1icZ 5vfOkLu3qnXH4A31scGmkqewFRF1rkdkz7EAg6SnRzhU+jAHvpeQkYd9CglDDo+RREyN LWBw== X-Gm-Message-State: AMke39mD2D3Q1gMBRXnDLpHvzGS4JgNB4LHwK8P6ssgxqR5p9ttVAF4Jxf2aIrfTFzxvAA== X-Received: by 10.28.228.213 with SMTP id b204mr8330180wmh.59.1487407827100; Sat, 18 Feb 2017 00:50:27 -0800 (PST) Received: from localhost (dslb-084-063-143-045.084.063.pools.vodafone-ip.de. [84.63.143.45]) by smtp.gmail.com with ESMTPSA id g23sm4678397wme.27.2017.02.18.00.50.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Feb 2017 00:50:26 -0800 (PST) Date: Sat, 18 Feb 2017 09:50:25 +0100 From: Vasilij Schneidermann Message-ID: <20170218085025.GA607@odonien.localdomain> References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> <83r32wq6at.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <83r32wq6at.fsf@gnu.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: -0.0 (/) 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.0 (/) > In that case, maybe we shouldn't test $DISPLAY at all? Why restrict > this to X if xdg-open is already tested for availability? To quote its man page: "xdg-open is for use inside a desktop session only.". If you attempt using it outside one (like, on the Linux console), M-x browse-url fails silently. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2017 08:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Glenn Morris Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148740813911502 (code B ref 25778); Sat, 18 Feb 2017 08:56:02 +0000 Received: (at 25778) by debbugs.gnu.org; 18 Feb 2017 08:55:39 +0000 Received: from localhost ([127.0.0.1]:44133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf0nq-0002zS-Vz for submit@debbugs.gnu.org; Sat, 18 Feb 2017 03:55:39 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cf0np-0002zE-23 for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 03:55:37 -0500 Received: by mail-wr0-f194.google.com with SMTP id z61so6533193wrc.3 for <25778@debbugs.gnu.org>; Sat, 18 Feb 2017 00:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5Wwu0ICx4wbofmNZsunY1xqVybFebYuqkJl8dg4BH1I=; b=FEZFsN6uY02wHNbk6+TGejl91pDdNWxfI+gMLwzMCHq1qhlo3sO8gvKhjVvAHvGVml 9t9eZ81RGiJCR/7OtoW9n22ZUk/a4QdG65ZvP14udb/3Zcn1wL0L6AAJWD1Dph1nkAED NV2msqaVBAnWmhrUqUO8k+REmRkLc5fxLNifLtDS2gCrbNyWgpVtuu7tCAGk0QxyxfiX vk1zHYCwpizmDcUJVgzXN+qxW8o30TmSIgASfMp/LV5zo8TOzsphvc43r40iCG4rXlSN h3m13/PoiB1l5Ug6Ak/d+ZIa8OqHse5CbhyzHvesTN9xVWb9aUb/Ym/Y9sEQk+UpILCg 1yag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5Wwu0ICx4wbofmNZsunY1xqVybFebYuqkJl8dg4BH1I=; b=U23IVvzpxgsuKximyFIrEKanUn+gjQbwTp4AEWnlxJ+dFM7Gl2rJF0LKEH8Pi5Mdwu lcs+W4FkhvT61bgbk6QAEDzSG8vkTo1aTpfCIU08QhZLozMyhQf6J9CUu8KdfO5W5PeX aBdcCk03EyBhTTLMGYnqJlA0S3cn0ftj8yDftDHEPuQeg2bEdUVRnn/X/fch7Iv4PVL4 faEVV9g3i1d1Vb+MZIx1NsJ8a6fv7MwttiQU+wZ3DB/GY1b21sgNq+XU1EXyWNuRSR04 TwbxMkLIp4iL/w9ivsyinfaad9U3V/Pcpf5AwVf4VxOipcUH+6vATF+mEoU4Z5OO5w8Z nRLg== X-Gm-Message-State: AMke39kzCIe1okLGalagAWl/0CU8aZZ0DEQrQvgABgEUQYzDIWnJgzh8ZGiDwDo6AjNwqQ== X-Received: by 10.223.164.151 with SMTP id g23mr9453242wrb.86.1487408130961; Sat, 18 Feb 2017 00:55:30 -0800 (PST) Received: from localhost (dslb-084-063-143-045.084.063.pools.vodafone-ip.de. [84.63.143.45]) by smtp.gmail.com with ESMTPSA id e74sm4875047wmd.2.2017.02.18.00.55.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Feb 2017 00:55:30 -0800 (PST) Date: Sat, 18 Feb 2017 09:55:29 +0100 From: Vasilij Schneidermann Message-ID: <20170218085529.GB607@odonien.localdomain> References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: -2.8 (--) 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: -2.8 (--) > PS Maybe you are just saying that since no-one (?) complained since > then, nohup can't have been needed after all. Pretty much. Note that `gnome-open` belongs to GNOME 2 which last release has been in 2010. Only Debian Squeeze is offering it in its package archives and as that one has been EOL'd, I don't see any reason to pursue it any further. If `gvfs-open` exhibits the same behavior, maybe, but I still consider it upstream's fault if they have weird open behavior, not an area of Emacs to clumsily work around. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Feb 2017 00:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Vasilij Schneidermann Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.148746432019753 (code B ref 25778); Sun, 19 Feb 2017 00:32:02 +0000 Received: (at 25778) by debbugs.gnu.org; 19 Feb 2017 00:32:00 +0000 Received: from localhost ([127.0.0.1]:45473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfFPz-00058K-VN for submit@debbugs.gnu.org; Sat, 18 Feb 2017 19:32:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfFPw-00052X-U3 for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 19:31:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfFPq-0001ub-Hi for 25778@debbugs.gnu.org; Sat, 18 Feb 2017 19:31:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfFPo-0001u8-Tj; Sat, 18 Feb 2017 19:31:48 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cfFPn-0006XF-CR; Sat, 18 Feb 2017 19:31:47 -0500 From: Glenn Morris References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> <20170218085529.GB607@odonien.localdomain> X-Spook: Nigeria cypherpunk kibo Environmental terrorist FAMS Abu X-Ran: '|_Z/vD_b[H^fqHBWh-,=FvU)nxz\/^yD%PkOy>Z# (Vasilij Schneidermann's message of "Sat, 18 Feb 2017 09:55:29 +0100") Message-ID: <4ak28nyqa5.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) Vasilij Schneidermann wrote: > If `gvfs-open` exhibits the same behavior, It does. https://bugzilla.gnome.org/show_bug.cgi?id=652262 And https://debbugs.gnu.org/25234, as previously mentioned. > maybe, but I still consider it upstream's fault As you can see from that above report, they don't show any signs of fixing it. > if they have weird open behavior, not an area of Emacs to clumsily > work around. The people who implemented support for xdg-open in Emacs disagreed. From unknown Sun Jun 22 01:00:38 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Feb 2017 13:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25778 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Glenn Morris Cc: 25778@debbugs.gnu.org Received: via spool by 25778-submit@debbugs.gnu.org id=B25778.14875096201047 (code B ref 25778); Sun, 19 Feb 2017 13:07:01 +0000 Received: (at 25778) by debbugs.gnu.org; 19 Feb 2017 13:07:00 +0000 Received: from localhost ([127.0.0.1]:45657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfRCd-0000Go-Ts for submit@debbugs.gnu.org; Sun, 19 Feb 2017 08:07:00 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfRCb-0000GZ-Ds for 25778@debbugs.gnu.org; Sun, 19 Feb 2017 08:06:57 -0500 Received: by mail-wr0-f194.google.com with SMTP id 89so2768182wrr.1 for <25778@debbugs.gnu.org>; Sun, 19 Feb 2017 05:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=r+wa6iUnx+0hiWQZJVdhxynsrwUUmwb+4QQbRzI15SM=; b=nI+4Sa5TA0Dm6WxQhmWKMEJwYBt48t9rXSlO3onjruTeLfz+ILAMfwyveCfNQndzhm Nbikulo3JGhMpuyewExsW+riOg80pC+Ux5HHsI2l1jZHBAy1+Ts9EmbbRBzLWDw/YNcc M2YSMaFOAwUy1MmzvPUEZpcsAUiR1AWXAXfShIKa2aK0vmnL7+5rvZ+SYs2095p8r7+D bUdhRWuMK0cVrmfBy6YGnkWbD9ODhspf5kU9p+5rTTMWK47OgfoessC74sZbjIMRzZY2 OYky2uusbvLYXgHGZkdYHJRKXFQrh/QpwNjCc5gOHi1MBPdWv4qBq0g7pqx6iBJcmTKp f1gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=r+wa6iUnx+0hiWQZJVdhxynsrwUUmwb+4QQbRzI15SM=; b=iEsAwToC/RTUSUFsXiHqo1uKJIC3txgsW2tdz8TC+hNzlWkindk1MCmAMu+D80834F mfQXDq3lz6WIxvrXBJKsnojrYrdvI5IFAzg5+fn+HFE8yBH9gB0oAw+0SU3JbWMj+Hzs 6sCYOVcL7M1S7zLEcrKftQ1h6j0O2jqNuX35nYruaVxAMkZFNlClWkS02QQAlFIimaCY 6yMexKxFK0bLtNtraw/cJg3EHs2siFlbIQjRjWi57qjhZp1QvpTO0fEFl8RAnhaQP7zD SqcvGsRpMNrDGjyaAXk0zGp/+LJNkiOA0EDVKgrJqmcvQK/hnkMBrRuKJPrghkS1unv9 7xoQ== X-Gm-Message-State: AMke39lw+NNMvwEfhk9F7i50v+nGiq9gIa/cUnTdNiRjyhTMy1wZj6LEXrp26msAD5gZZQ== X-Received: by 10.223.130.204 with SMTP id 70mr12049289wrc.128.1487509611671; Sun, 19 Feb 2017 05:06:51 -0800 (PST) Received: from localhost (dslb-092-073-091-084.092.073.pools.vodafone-ip.de. [92.73.91.84]) by smtp.gmail.com with ESMTPSA id v196sm9421168wmv.5.2017.02.19.05.06.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 Feb 2017 05:06:51 -0800 (PST) Date: Sun, 19 Feb 2017 14:06:50 +0100 From: Vasilij Schneidermann Message-ID: <20170219130650.GA647@odonien.localdomain> References: <83shncr7bh.fsf@gnu.org> <20170217185514.GA599@odonien.localdomain> <20170218085529.GB607@odonien.localdomain> <4ak28nyqa5.fsf@fencepost.gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4ak28nyqa5.fsf@fencepost.gnu.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: -2.8 (--) 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: -2.8 (--) > As you can see from that above report, they don't show any signs of > fixing it. Well, fine. I'm sorry for not noticing a five year old piece of code that got mistakenly removed without anyone complaining. What I don't understand is why my patch (removing IMHO unnecessary DE detection) is related to using nohup to work around a problem with xdg-open and gnome-open/gvfs-open. If you consider fixing the nohup problem a prerequisite before this patch can be applied, OK, do that then, I can wait until that's done and recommence discussion on the other issue. That aside, I cannot reproduce any weird behavior, be it with or without nohup and gvfs-open. Both `(call-process "gvfs-open" nil 0 nil "foo.pdf")` and `(call-process "nohup" nil 0 nil "gvfs-open" "foo.pdf")` spawn my PDF reader successfully and don't do anything weird after closing it. Same if I pass "http://ix.de/" as last argument. I therefore consider the nohup issue a case of cargo-culting and would like to drop its discussion entirely as it does not help with the current issue. From unknown Sun Jun 22 01:00:38 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vasilij Schneidermann Subject: bug#25778: closed (Re: 25.1; [PATCH] Drastically simplify xdg-open check) Message-ID: References: <71da2828-56f3-2c5d-9326-08fb952657a0@cs.ucla.edu> X-Gnu-PR-Message: they-closed 25778 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 25778@debbugs.gnu.org Date: Fri, 10 Mar 2017 03:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1489115642-19304-1" This is a multi-part message in MIME format... ------------=_1489115642-19304-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25778: 25.1; [PATCH] Drastically simplify xdg-open check which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25778@debbugs.gnu.org. --=20 25778: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25778 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1489115642-19304-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25778-done) by debbugs.gnu.org; 10 Mar 2017 03:13:34 +0000 Received: from localhost ([127.0.0.1]:48257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmAzl-000509-MU for submit@debbugs.gnu.org; Thu, 09 Mar 2017 22:13:34 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmAzj-0004zj-Cz for 25778-done@debbugs.gnu.org; Thu, 09 Mar 2017 22:13:32 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8959D160069; Thu, 9 Mar 2017 19:13:25 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vnOIayqARkwq; Thu, 9 Mar 2017 19:13:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 06FAB160079; Thu, 9 Mar 2017 19:13:24 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id x4oVmZNkCif1; Thu, 9 Mar 2017 19:13:23 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DA54F160069; Thu, 9 Mar 2017 19:13:23 -0800 (PST) To: Vasilij Schneidermann From: Paul Eggert Subject: Re: 25.1; [PATCH] Drastically simplify xdg-open check Organization: UCLA Computer Science Department Message-ID: <71da2828-56f3-2c5d-9326-08fb952657a0@cs.ucla.edu> Date: Thu, 9 Mar 2017 19:13:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F1833AC51374AB44DB69F9C0" X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: Thanks for the bug report. I installed the attached somewhat-more-ambitious patch that works along the line that you suggested. Although every heuristic in this area will be wrong sometimes, I think nowadays we're probably better off simply using xdg-open if it's available and if there's a display. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [131.179.128.68 listed in list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 3.7 FAKE_REPLY_A1 No description available. X-Debbugs-Envelope-To: 25778-done Cc: 25778-done@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.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: Thanks for the bug report. I installed the attached somewhat-more-ambitious patch that works along the line that you suggested. Although every heuristic in this area will be wrong sometimes, I think nowadays we're probably better off simply using xdg-open if it's available and if there's a display. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [131.179.128.68 listed in list.dnswl.org] -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 3.7 FAKE_REPLY_A1 No description available. This is a multi-part message in MIME format. --------------F1833AC51374AB44DB69F9C0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Thanks for the bug report. I installed the attached somewhat-more-ambitio= us=20 patch that works along the line that you suggested. Although every heuris= tic in=20 this area will be wrong sometimes, I think nowadays we're probably better= off=20 simply using xdg-open if it's available and if there's a display. It turns out that nohup is ineffective on xdg-open, as xdg-open's child d= oes a=20 'signal (SIGHUP, SIG_DFL)' before it execs (!). This may help to explain = why=20 nobody noticed when Emacs stopped using nohup. Although nohup may have be= en=20 needed for ancient GNOME versions, I don't think we need to worry about t= hese=20 old GNOME versions in future Emacs releases. I'm closing the bug report as I think the bug is fixed. We can reopen it = if I'm=20 wrong. --------------F1833AC51374AB44DB69F9C0 Content-Type: text/x-diff; name="0001-Simplify-checks-for-xdg-open-and-xdg-email.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Simplify-checks-for-xdg-open-and-xdg-email.patch" =46rom 095e7d126ee1fc56cb1ec0f9ab1a9cdd6417a232 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 9 Mar 2017 19:01:19 -0800 Subject: [PATCH] Simplify checks for xdg-open and xdg-email browse-url's xdg-open detection was too picky on some GNU/Linux desktops; see Bug#25778. Simplify the code by assuming xdg-open works if it is executable, as nowadays this is more likely to be correct than trying to use heuristics from a few years ago. Don't test for nohup: it is ineffective nowadays, as xdg-open's child uses the default action for SIGHUP even if xdg-open's invoker ignores SIGHUP. While we're at it, allow for Wayland here, as "emacs -nw" might be running in a non-X Wayland terminal. * lisp/mail/emacsbug.el (report-emacs-bug-can-use-xdg-email): * lisp/net/browse-url.el (browse-url-can-use-xdg-open): Simplify to a test for DISPLAY and whether the helper program is executable. Allow WAYLAND_DISPLAY as an option. --- lisp/mail/emacsbug.el | 29 ++++------------------------- lisp/net/browse-url.el | 40 +++++++++------------------------------- 2 files changed, 13 insertions(+), 56 deletions(-) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index ecb7db6..c1aec69 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -77,33 +77,12 @@ report-emacs-bug-can-use-osx-open (equal (executable-find "open") "/usr/bin/open") (memq system-type '(darwin)))) =20 -;; FIXME this duplicates much of the logic from browse-url-can-use-xdg-o= pen. (defun report-emacs-bug-can-use-xdg-email () "Return non-nil if the \"xdg-email\" command can be used. -xdg-email is a desktop utility that calls your preferred mail client. -This requires you to be running either Gnome, KDE, or Xfce4." - (and (getenv "DISPLAY") - (executable-find "xdg-email") - (or (getenv "GNOME_DESKTOP_SESSION_ID") - ;; GNOME_DESKTOP_SESSION_ID is deprecated, check on Dbus also. - (condition-case nil - (eq 0 (call-process - "dbus-send" nil nil nil - "--dest=3Dorg.gnome.SessionManager" - "--print-reply" - "/org/gnome/SessionManager" - "org.gnome.SessionManager.CanShutdown")) - (error nil)) - (equal (getenv "KDE_FULL_SESSION") "true") - ;; FIXME? browse-url-can-use-xdg-open also accepts LXDE. - ;; Is that no good here, or just overlooked? - (condition-case nil - (eq 0 (call-process - "/bin/sh" nil nil nil - "-c" - ;; FIXME use string-match rather than grep. - "xprop -root _DT_SAVE_MODE|grep xfce4")) - (error nil))))) +xdg-email is a desktop utility that calls your preferred mail client." + (and ;; See browse-url-can-use-xdg-open. + (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY")) + (executable-find "xdg-email"))) =20 (defun report-emacs-bug-insert-to-mailer () "Send the message to your preferred mail client. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 04b49c4..20ae072 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -45,7 +45,7 @@ ;; browse-url-generic arbitrary ;; browse-url-default-windows-browser MS-Windows browser ;; browse-url-default-macosx-browser macOS browser -;; browse-url-xdg-open Free Desktop xdg-open on Gnome, KD= E, Xfce4, LXDE +;; browse-url-xdg-open freedesktop.org xdg-open ;; browse-url-kde KDE konqueror (kfm) ;; browse-url-elinks Elinks Don't know (tried with= 0.12.GIT) =20 @@ -944,36 +944,14 @@ browse-url-default-browser =20 (defun browse-url-can-use-xdg-open () "Return non-nil if the \"xdg-open\" program can be used. -xdg-open is a desktop utility that calls your preferred web browser. -This requires you to be running either Gnome, KDE, Xfce4 or LXDE." - (and (getenv "DISPLAY") - (executable-find "xdg-open") - ;; xdg-open may call gnome-open and that does not wait for its ch= ild - ;; to finish. This child may then be killed when the parent dies= =2E - ;; Use nohup to work around. See bug#7166, bug#8917, bug#9779 an= d - ;; http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279= =2Ehtml - (executable-find "nohup") - (or (getenv "GNOME_DESKTOP_SESSION_ID") - ;; GNOME_DESKTOP_SESSION_ID is deprecated, check on Dbus also. - (condition-case nil - (eq 0 (call-process - "dbus-send" nil nil nil - "--dest=3Dorg.gnome.SessionManager" - "--print-reply" - "/org/gnome/SessionManager" - "org.gnome.SessionManager.CanShutdown")) - (error nil)) - (equal (getenv "KDE_FULL_SESSION") "true") - (condition-case nil - (eq 0 (call-process - "/bin/sh" nil nil nil - "-c" - ;; FIXME use string-match rather than grep. - "xprop -root _DT_SAVE_MODE|grep xfce4")) - (error nil)) - (member (getenv "DESKTOP_SESSION") '("LXDE" "Lubuntu")) - (equal (getenv "XDG_CURRENT_DESKTOP") "LXDE")))) - +xdg-open is a desktop utility that calls your preferred web browser." + ;; The exact set of situations where xdg-open works is complicated, + ;; and it would be a pain to duplicate xdg-open's situation-specific + ;; code here, as the code is a moving target. So assume that + ;; xdg-open will work if there is a graphical display; this should + ;; be good enough for platforms Emacs is likely to be running on. + (and (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY")) + (executable-find "xdg-open"))) =20 ;;;###autoload (defun browse-url-xdg-open (url &optional ignored) --=20 2.7.4 --------------F1833AC51374AB44DB69F9C0-- ------------=_1489115642-19304-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Feb 2017 18:17:04 +0000 Received: from localhost ([127.0.0.1]:43801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cen5b-0007u1-PE for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:17:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cen5Y-0007tR-5c for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:17:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cen5R-0003Af-HW for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:16:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cen5R-0003Ab-EC for submit@debbugs.gnu.org; Fri, 17 Feb 2017 13:16:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cen5P-000065-TQ for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cen5O-00039o-KY for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:51 -0500 Received: from mail-ot0-x22e.google.com ([2607:f8b0:4003:c0f::22e]:35212) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cen5O-00039h-CN for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:16:50 -0500 Received: by mail-ot0-x22e.google.com with SMTP id 45so36584178otd.2 for ; Fri, 17 Feb 2017 10:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PpZMjqlOBzr4/qJtyzIv9c35jl8SG2U+GvtxEVzszp8=; b=XPPaLOpUW2bgi1IM0n+jamn3/i3ylP5gUwBayIGaAN3E1HxIZqOwqHkw/ZGvsqx3ip CzMUjoROmeUhwqXEkX0xi7y7MLW87E7ZhaBzr+kL0Zcr6Tgeb/4W7MmsugZtItsXlfDt Qg0s+UGNk+9PI368lP7e/aVoy9nD8nE7EWNHgXJll6I2VahtEqDy11odzt3Bm2yxSo/d FDQ1z2ekP/SbLrzYBOchLSopSpk+WeuCzTkztXBpaciZMA83PQfiGz8/+6m2+asyTN/U eArVyMsQwDimCzN8h9fgnaYnTPGHaZHWcs0F7Dkd+ENi5EDP1m1f1c8V4Gpu+XO1+XOw 0iqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PpZMjqlOBzr4/qJtyzIv9c35jl8SG2U+GvtxEVzszp8=; b=aW3h1Mi6d8nTtM12J+6w6tR7Wgaap0A9gEhYJVP+SRwrU42Yp+WYU3X6YT8zt1RNah AzgSyGmxQDazGPASGHvj0XejedPMJMYfgjkm/VwGqLmX7OWDTKra/sfEjQLjIgJh2eoZ p9DU0KOnGw1xnHc7GoiN5Gg6yJf03B5Sl8Eo6nPLjEKmYUyTuY4yqkpyAAgjuRsUDr9E 6+D+wWi3I+Q0UUMTSG6yaNqTh8j2Wub4HSenQgfxiECskNdAzvpI9F0Z104rmQZt1rmG R4qF/MFB7FhPrCUteiWVh9rSY7h90sj2mSNrOuNsoqsfZksieqjTlEJQlL5yWUL2RuQp TrdA== X-Gm-Message-State: AMke39mI6cYUSDuHsg0xxD21yKvTBwGhwi006lbdXHtpfLcuE4LAcbQcOSQndCFGa0Ijl5tlRKO7kIioLXSxAA== X-Received: by 10.157.48.51 with SMTP id d48mr4787879otc.207.1487355409243; Fri, 17 Feb 2017 10:16:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.0.34 with HTTP; Fri, 17 Feb 2017 10:16:48 -0800 (PST) From: Vasilij Schneidermann Date: Fri, 17 Feb 2017 19:16:48 +0100 Message-ID: Subject: 25.1; [PATCH] Drastically simplify xdg-open check To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary=001a113e3a74d2d2450548bdea21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -4.0 (----) --001a113e3a74d2d2450548bdea21 Content-Type: text/plain; charset=UTF-8 A user on #emacs brought it to my attention that the xdg-open detection for browse-url is more complex than it should be and fails detecting their Linux desktop. Looking at the definition of `browse-url-can-use-xdg-open' reveals that it replicates the desktop environment check as done by `xdg-open` (which is done to detect the DE-specific default browser setting, not to prevent people not using a popular desktop environment from using xdg-open). As enumerating all possible kinds of Linux desktop is a futile endeavor, I've completely eliminated this check from it so that the only ones left are whether we're in a graphical session (by checking $DISPLAY) and whether `xdg-open` has been found on $PATH. --001a113e3a74d2d2450548bdea21 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Drastically-simplify-check-for-xdg-open.patch" Content-Disposition: attachment; filename="0001-Drastically-simplify-check-for-xdg-open.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iza507as0 RnJvbSA2Yzk5ZTdhY2UzMTEwYjczYTViMjEyMjAzYWNjNzI4MTY1YmUwOTJiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBWYXNpbGlqIFNjaG5laWRlcm1hbm4gPHYuc2NobmVpZGVybWFu bkBnbWFpbC5jb20+CkRhdGU6IEZyaSwgMTcgRmViIDIwMTcgMTk6MDg6NTQgKzAxMDAKU3ViamVj dDogW1BBVENIXSBEcmFzdGljYWxseSBzaW1wbGlmeSBjaGVjayBmb3IgeGRnLW9wZW4KCiogYnJv d3NlLXVybC5lbCAoYnJvd3NlLXVybC1jYW4tdXNlLXhkZy1vcGVuKTogU2ltcGxpZnkgeGRnLW9w ZW4gY2hlY2sKLS0tCiBsaXNwL25ldC9icm93c2UtdXJsLmVsIHwgMzQgKysrLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDMgaW5zZXJ0aW9ucygrKSwgMzEg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9uZXQvYnJvd3NlLXVybC5lbCBiL2xpc3Av bmV0L2Jyb3dzZS11cmwuZWwKaW5kZXggYTdjODc5Y2JmYi4uYmY3NTYxMzA2YyAxMDA2NDQKLS0t IGEvbGlzcC9uZXQvYnJvd3NlLXVybC5lbAorKysgYi9saXNwL25ldC9icm93c2UtdXJsLmVsCkBA IC00NSw3ICs0NSw3IEBACiA7OyBicm93c2UtdXJsLWdlbmVyaWMgICAgICAgICAgICAgICAgIGFy Yml0cmFyeQogOzsgYnJvd3NlLXVybC1kZWZhdWx0LXdpbmRvd3MtYnJvd3NlciBNUy1XaW5kb3dz IGJyb3dzZXIKIDs7IGJyb3dzZS11cmwtZGVmYXVsdC1tYWNvc3gtYnJvd3NlciAgbWFjT1MgYnJv d3NlcgotOzsgYnJvd3NlLXVybC14ZGctb3BlbiAgICAgICAgICAgICAgICBGcmVlIERlc2t0b3Ag eGRnLW9wZW4gb24gR25vbWUsIEtERSwgWGZjZTQsIExYREUKKzs7IGJyb3dzZS11cmwteGRnLW9w ZW4gICAgICAgICAgICAgICAgRnJlZSBEZXNrdG9wIHhkZy1vcGVuCiA7OyBicm93c2UtdXJsLWtk ZSAgICAgICAgICAgICAgICAgICAgIEtERSBrb25xdWVyb3IgKGtmbSkKIDs7IGJyb3dzZS11cmwt ZWxpbmtzICAgICAgICAgICAgICAgICAgRWxpbmtzICAgICAgRG9uJ3Qga25vdyAodHJpZWQgd2l0 aCAwLjEyLkdJVCkKIApAQCAtOTQ0LDM2ICs5NDQsOCBAQCBpbnN0ZWFkIG9mIGBicm93c2UtdXJs LW5ldy13aW5kb3ctZmxhZycuIgogCiAoZGVmdW4gYnJvd3NlLXVybC1jYW4tdXNlLXhkZy1vcGVu ICgpCiAgICJSZXR1cm4gbm9uLW5pbCBpZiB0aGUgXCJ4ZGctb3BlblwiIHByb2dyYW0gY2FuIGJl IHVzZWQuCi14ZGctb3BlbiBpcyBhIGRlc2t0b3AgdXRpbGl0eSB0aGF0IGNhbGxzIHlvdXIgcHJl ZmVycmVkIHdlYiBicm93c2VyLgotVGhpcyByZXF1aXJlcyB5b3UgdG8gYmUgcnVubmluZyBlaXRo ZXIgR25vbWUsIEtERSwgWGZjZTQgb3IgTFhERS4iCi0gIChhbmQgKGdldGVudiAiRElTUExBWSIp Ci0gICAgICAgKGV4ZWN1dGFibGUtZmluZCAieGRnLW9wZW4iKQotICAgICAgIDs7IHhkZy1vcGVu IG1heSBjYWxsIGdub21lLW9wZW4gYW5kIHRoYXQgZG9lcyBub3Qgd2FpdCBmb3IgaXRzIGNoaWxk Ci0gICAgICAgOzsgdG8gZmluaXNoLiAgVGhpcyBjaGlsZCBtYXkgdGhlbiBiZSBraWxsZWQgd2hl biB0aGUgcGFyZW50IGRpZXMuCi0gICAgICAgOzsgVXNlIG5vaHVwIHRvIHdvcmsgYXJvdW5kLiAg U2VlIGJ1ZyM3MTY2LCBidWcjODkxNywgYnVnIzk3NzkgYW5kCi0gICAgICAgOzsgaHR0cDovL2xp c3RzLmdudS5vcmcvYXJjaGl2ZS9odG1sL2VtYWNzLWRldmVsLzIwMDktMDcvbXNnMDAyNzkuaHRt bAotICAgICAgIChleGVjdXRhYmxlLWZpbmQgIm5vaHVwIikKLSAgICAgICAob3IgKGdldGVudiAi R05PTUVfREVTS1RPUF9TRVNTSU9OX0lEIikKLQkgICA7OyBHTk9NRV9ERVNLVE9QX1NFU1NJT05f SUQgaXMgZGVwcmVjYXRlZCwgY2hlY2sgb24gRGJ1cyBhbHNvLgotCSAgIChjb25kaXRpb24tY2Fz ZSBuaWwKLQkgICAgICAgKGVxIDAgKGNhbGwtcHJvY2VzcwotCQkgICAgICAiZGJ1cy1zZW5kIiBu aWwgbmlsIG5pbAotCQkJCSAgIi0tZGVzdD1vcmcuZ25vbWUuU2Vzc2lvbk1hbmFnZXIiCi0JCQkJ ICAiLS1wcmludC1yZXBseSIKLQkJCQkgICIvb3JnL2dub21lL1Nlc3Npb25NYW5hZ2VyIgotCQkJ CSAgIm9yZy5nbm9tZS5TZXNzaW9uTWFuYWdlci5DYW5TaHV0ZG93biIpKQotCSAgICAgKGVycm9y IG5pbCkpCi0JICAgKGVxdWFsIChnZXRlbnYgIktERV9GVUxMX1NFU1NJT04iKSAidHJ1ZSIpCi0J ICAgKGNvbmRpdGlvbi1jYXNlIG5pbAotCSAgICAgICAoZXEgMCAoY2FsbC1wcm9jZXNzCi0JCSAg ICAgICIvYmluL3NoIiBuaWwgbmlsIG5pbAotCQkgICAgICAiLWMiCi0JCSAgICAgIDs7IEZJWE1F IHVzZSBzdHJpbmctbWF0Y2ggcmF0aGVyIHRoYW4gZ3JlcC4KLQkJICAgICAgInhwcm9wIC1yb290 IF9EVF9TQVZFX01PREV8Z3JlcCB4ZmNlNCIpKQotCSAgICAgKGVycm9yIG5pbCkpCi0JICAgKG1l bWJlciAoZ2V0ZW52ICJERVNLVE9QX1NFU1NJT04iKSAnKCJMWERFIiAiTHVidW50dSIpKQotCSAg IChlcXVhbCAoZ2V0ZW52ICJYREdfQ1VSUkVOVF9ERVNLVE9QIikgIkxYREUiKSkpKQotCit4ZGct b3BlbiBpcyBhIGRlc2t0b3AgdXRpbGl0eSB0aGF0IGNhbGxzIHlvdXIgcHJlZmVycmVkIHdlYiBi cm93c2VyLiIKKyAgKGFuZCAoZ2V0ZW52ICJESVNQTEFZIikgKGV4ZWN1dGFibGUtZmluZCAieGRn LW9wZW4iKSkpCiAKIDs7OyMjI2F1dG9sb2FkCiAoZGVmdW4gYnJvd3NlLXVybC14ZGctb3BlbiAo dXJsICZvcHRpb25hbCBpZ25vcmVkKQotLSAKMi4xMS4wCgo= --001a113e3a74d2d2450548bdea21-- ------------=_1489115642-19304-1-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 14 21:14:12 2018 Received: (at control) by debbugs.gnu.org; 15 Feb 2018 02:14:12 +0000 Received: from localhost ([127.0.0.1]:43513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em93r-0000j7-Uk for submit@debbugs.gnu.org; Wed, 14 Feb 2018 21:14:12 -0500 Received: from mail-it0-f48.google.com ([209.85.214.48]:33324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1em93q-0000ir-3c; Wed, 14 Feb 2018 21:14:10 -0500 Received: by mail-it0-f48.google.com with SMTP id 140so8179203iti.0; Wed, 14 Feb 2018 18:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=9n7hCRSx/wUhgdSPg/skKLneHmB8981Bjt6lNwkV5wc=; b=UXgf/urlAvTULYyQokLBrN0fFi0UGqVaF2kGfJdLIZbuCDtzmPziWD3fv2xwqFt5kl u76O1cgp2trfBQVVAw0FBJVPA/QP0zwmcGWU9tFdkOgGBzU1NDOZuQ7Nc1LcvjFxOQ3C WOzEQL9QaghK/w6C+r6vU/obNfuEblYwW4EeDkHAUAXiwcloBs59ARNwXwSG75JUg3pr fCyb6+OQ4aiQhogVYVh9t7t2ix+l8jqmvUejzO/DSO+RmjRUaepcvSCa/Wnhq6Q0/eqI 1hWmks3F24wkILeBTdRmv9sOre6BJP3zMWYgCLDD4PZ5tEsE80AT5oNrc4Yy5rS3yPQh VGOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9n7hCRSx/wUhgdSPg/skKLneHmB8981Bjt6lNwkV5wc=; b=HWrARihBS+xzKLHt8uculE/OXidK0Zt1xxWvrWek7bJy62+UDB9aiCJSHvr0g7WG87 yMUMBllpsap4SHluudgNdic5La97wZqXgKi6V67b/uA1BQSXWXXYC+99JdlOdU+qjsm4 fhIEI/8u+c3QQg1aZvKRjamzYuHrAVeLWp8KrLGMOdRpVFYqz7HUrmxlN9XYsw9k2Vzw mt5r+JELSrwC0l6c4dLRHCDyu6r5Hl14iM1vQeCmASYssuhZGAj/31GCh9cUd8+rCCHA ayUfGwp92BbQmBnsrKr+s2J9Fx2KfbaKpq+4LU5JhASIDg/k7Wf0UmvUMAnpeWyAe+QJ n3fw== X-Gm-Message-State: APf1xPB6OvvyzENijY0Kk9oVyfidYsnIiVyWx6rItbUZPCWAtNqmZett so9twoRFnA1O+I0c6W5crWWmYA== X-Google-Smtp-Source: AH8x224tGTUtGZ/t7mejhbL3eX8OyLYH4zxTHB/UNBRHc6vYCgASI6SXXFvG+uVpa+O9uNGutN86Hw== X-Received: by 10.36.69.133 with SMTP id c5mr1485293itd.135.1518660844491; Wed, 14 Feb 2018 18:14:04 -0800 (PST) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id s70sm15241631itb.0.2018.02.14.18.14.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2018 18:14:03 -0800 (PST) From: Noam Postavsky To: Pierre Neidhardt Subject: Re: bug#18986: #18986 Design bug in browse-url.el: browse-url-can-use-xdg-open's logic uses overly strict assumption References: <85lhnnw9t7.fsf@bertrandrussell.Speedport_W_723V_1_36_000> <87a7wep475.fsf@gmail.com> <83h8qmyu9u.fsf@gnu.org> <877erip040.fsf@gmail.com> <838tbyyrq7.fsf@gnu.org> <87tvujp7lw.fsf@gmail.com> Date: Wed, 14 Feb 2018 21:14:02 -0500 In-Reply-To: <87tvujp7lw.fsf@gmail.com> (Pierre Neidhardt's message of "Wed, 14 Feb 2018 22:46:35 +0100") Message-ID: <871shn80et.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control Cc: 18986@debbugs.gnu.org, Eli Zaretskii 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.0 (/) tag 18986 - notabug wontfix fixed 18986 26.1 unarchive 25778 merge 18986 25778 quit Pierre Neidhardt writes: >> Can you look at the latest pretest of 26.1? It's on alpha.gnu.org. > > I will as soon as possible. >From what I can tell, the Emacs 26 code is pretty close to what Florian suggested, you can see it also in Bug#25778 which I've merged.