From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#25778: 25.1; [PATCH] Drastically simplify xdg-open check Date: Fri, 17 Feb 2017 19:16:48 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113e3a74d2d2450548bdea21 X-Trace: blaine.gmane.org 1487355493 9542 195.159.176.226 (17 Feb 2017 18:18:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Feb 2017 18:18:13 +0000 (UTC) To: 25778@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 17 19:18:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cen6e-00022g-Sk for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 19:18:09 +0100 Original-Received: from localhost ([::1]:55154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cen6k-0000yg-KA for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 13:18:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cen6a-0000xH-7C for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:18:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cen6Y-0003P5-El for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:18:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cen6Y-0003P1-CI for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cen6Y-0007vB-7w for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 13:18:02 -0500 X-Loop: help-debbugs@gnu.org 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 X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148735542430385 (code B ref -1); Fri, 17 Feb 2017 18:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Feb 2017 18:17:04 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-Received: by 10.157.0.34 with HTTP; Fri, 17 Feb 2017 10:16:48 -0800 (PST) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129458 Archived-At: --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 IC00NSw3ICs0NSw3IEBACiA7OyBicm93c2UtdXJsLWdlb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