From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Jostein=20Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.devel Subject: Re: xdg-open in Emacs in Termux (Android) Date: Tue, 15 May 2018 10:20:51 +0200 Message-ID: <1526372451.2841468.1372442024.5516108F@webmail.messagingengine.com> References: Reply-To: jostein@kjonigsen.net NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_----------=_152637245128414680" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1526372344 8166 195.159.176.226 (15 May 2018 08:19:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 May 2018 08:19:04 +0000 (UTC) To: emacs-devel@gnu.org, Michael Brand Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 15 10:19:00 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fIVAg-0001tP-8r for ged-emacs-devel@m.gmane.org; Tue, 15 May 2018 10:18:58 +0200 Original-Received: from localhost ([::1]:51048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIVCn-0002gI-34 for ged-emacs-devel@m.gmane.org; Tue, 15 May 2018 04:21:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIVCb-0002fN-8K for emacs-devel@gnu.org; Tue, 15 May 2018 04:20:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIVCW-00078V-W7 for emacs-devel@gnu.org; Tue, 15 May 2018 04:20:57 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:56197) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIVCW-000782-RP for emacs-devel@gnu.org; Tue, 15 May 2018 04:20:52 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9D7862236A; Tue, 15 May 2018 04:20:51 -0400 (EDT) Original-Received: from web5 ([10.202.2.215]) by compute6.internal (MEProxy); Tue, 15 May 2018 04:20:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=m/s2Z6nJIfxc0/8m7MCQlfsp8UEwVQjbXxZvsIoSftU=; b=Xy4T5g0bI6cv dyu+zVZjCfLu7l0ewTxktbTHZ5eI0WClE846MDLGdJkD/5RaG4XvSMACu/RSG0Nj pCc8A2wrEW8j47ScURzD7SdinwOF4AYEthrfU5SFI88MEtJRrK57Yxt7oxnsm+7a Cw/21jbWE36alLpAttN+pZe0JeNoVA0cqievBzjxYR4rkuYhIcxrDuFLQaVR7WwA TNoNtEdR+9hVEyF73oAD+lr3ty8hBZUPGAhfZc6vmgyEShAsfnjqkbFr91d9jhhV oeR+ncOcQ0Fo7c//kHK+ybqICbPtLRPzq5jyZIAgwwDb7G+duSkrrp7E2IThhaYJ /k0y0yHwEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :reply-to:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=m/s2Z6nJIfxc0/8m7MCQlfsp8UEwVQjbXxZvsIoSftU=; b=eAZRgxmBQjDs zaeNrIpja6cbIoHhL8dpAnnxsdBthLzA+dJQ/N0E2TxM3bpJfmQ8W6ZxUz119atj O3NAtpsjheOPPhU4vzE3IrlCLZTog/ZlSiEHO1q8J1FIZWKnc2LALW1VB+WBQo/+ XS5vulKZer+Q21xQzJWKlvflvpMcmOG6+bjoXqR7JYV0craPHNuRHA+Zy1+NCAk4 Q8h1MhiLhPBt3zocrA5Q97eqUkNYV255xkvfeRuVKGHIqnOd8BPqdaqqhSB3Vate eZCsONliO8pkvF3DMfx2W8gDSMvOMhPgqvhYJKrafT8xQPkVKhEQp4GVSnJwrDOd NsTX7njKkw== X-ME-Sender: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 73BEA9E0DB; Tue, 15 May 2018 04:20:51 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface - ajax-29fe4c42 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.26 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225303 Archived-At: This is a multi-part message in MIME format. --_----------=_152637245128414680 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Sun, May 13, 2018, at 12:48 PM, Michael Brand wrote: > Hi all >=20 > With Emacs in Termux M-: (browse-url-xdg-open "http://gnu.org") opens> th= e URL in an Android browser. But M-: (browse-url-default-browser > "http://gnu.org") errors with "No usable browser found". This is > because even the most recent browse-url-can-use-xdg-open >=20 > #+begin_src emacs-lisp :eval no > (defun browse-url-can-use-xdg-open () > "[...]" > (and (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY")) > (executable-find "xdg-open"))) > #+end_src >=20 > returns nil because none of the environment variables is set. >=20 > Should browse-url-can-use-xdg-open be changed to detect the situation > of Termux?>=20 > Michael Having a termux-specific solution doesn't really sound ideal. What about Lill Debbie (Debian bootstrapper)? Linux Deploy? Termius on iOS? Are there another ways to detect a xdg-compliant runtime environment apart from these environment variables, which are also applicable to environments like Termux? If so we should apply something as general as possible. -- Regards Jostein Kj=C3=B8nigsen jostein@kjonigsen.net =F0=9F=8D=B5 jostein@gmail.com https://jostein.kjonigsen.net --_----------=_152637245128414680 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"
On Sun, May 13, 2018, at 12:48 PM, Michael Brand wrote:
Hi all

With Emacs in Termux M-: (browse-url-xdg-open "http://gnu.org") opens
the URL in an Android browser. But M-: (browse-url-default-browser
=
"http://gnu.org") errors with "No usabl= e browser found". This is
because even the most recent browse-url-can-use-xdg-open

#+begin_src emacs-lisp :eval no
  (defun browse-url-can-use-xdg-open ()
    "[...]"
    (and (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY"))<= br>
        (executable-find "xdg-open")))
#+end_src

returns nil because none of the environment variables is set.

Should browse-url-can-use-xdg-open be changed to detect the situation = of Termux?

Michael


Having a termux-specific solution doesn't really sound ideal. What abo= ut Lill Debbie (Debian bootstrapper)? Linux Deploy? Termius on iOS?

Are there another ways to detect a xdg-compliant runtime environment a= part from these environment variables, which are also applicable to environ= ments like Termux? If so we should apply something as general as possible.<= br>

--
Regard= s
Jostein Kj=C3=B8nigsen



--_----------=_152637245128414680--