From: Florian Lindner <mailinglists@xgm.de>
To: help-gnu-emacs@gnu.org
Subject: browse-url default browser
Date: Wed, 5 Apr 2017 09:51:47 +0200 [thread overview]
Message-ID: <oc27mc$2fd$1@blaine.gmane.org> (raw)
Hello,
(browse-url "http://xgm.de") opens firefox, albeit my default broweser is chromium.
xdg-open "http://xgm.de" opens chromium, even when executed within Emacs eshell, all other applications do so, too.
browse-url calls browse-url-browser-function which defaults to browse-url-default-browser which uses xdg-open if
browse-url-can-use-xdg-open if true. And there I think is the problem.
(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 child
;; to finish. This child may then be killed when the parent dies.
;; Use nohup to work around. See bug#7166, bug#8917, bug#9779 and
;; http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html
(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=org.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"))))
Why is xdg-open only used in Gnome, KDE, Xfce or LXDE? I'm using i3 and xdg-open works like it should.
Of course, I can set (setq browse-url-browser-function 'browse-url-default-browser) but I wonder why the defaults are
that way?
Thanks,
Florian
next reply other threads:[~2017-04-05 7:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 7:51 Florian Lindner [this message]
2017-04-05 15:50 ` browse-url default browser Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='oc27mc$2fd$1@blaine.gmane.org' \
--to=mailinglists@xgm.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.