unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* xdg-open in Emacs in Termux (Android)
@ 2018-05-13 10:48 Michael Brand
  2018-05-15  8:20 ` Jostein Kjønigsen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Brand @ 2018-05-13 10:48 UTC (permalink / raw)
  To: emacs-devel

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 usable 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"))
         (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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xdg-open in Emacs in Termux (Android)
  2018-05-13 10:48 xdg-open in Emacs in Termux (Android) Michael Brand
@ 2018-05-15  8:20 ` Jostein Kjønigsen
  2018-05-15 16:04   ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Jostein Kjønigsen @ 2018-05-15  8:20 UTC (permalink / raw)
  To: emacs-devel, Michael Brand

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

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 usable 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"))
>         (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 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ønigsen

jostein@kjonigsen.net 🍵 jostein@gmail.com
https://jostein.kjonigsen.net



[-- Attachment #2: Type: text/html, Size: 2299 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xdg-open in Emacs in Termux (Android)
  2018-05-15  8:20 ` Jostein Kjønigsen
@ 2018-05-15 16:04   ` Paul Eggert
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Eggert @ 2018-05-15 16:04 UTC (permalink / raw)
  To: jostein, emacs-devel, Michael Brand

On 05/15/2018 01:20 AM, Jostein Kjønigsen wrote:
>
> 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 there is such a way, it isn't supported by xdg-utils. See, for example:

https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-utils-common.in

which uses the same method Emacs does in browse-url-can-use-xdg-open.

Perhaps Emacs could examine the value of the XDG_SESSION_TYPE 
environment variable, or something like that. But this should be 
coordinated with Termux and/or xdg-utils.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-15 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-13 10:48 xdg-open in Emacs in Termux (Android) Michael Brand
2018-05-15  8:20 ` Jostein Kjønigsen
2018-05-15 16:04   ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).