* lisp/net/browse-url.el (browse-url-can-use-xdg-open): Support LXDE

by checking environment variables "DESKTOP_SESSION" and
"XDG_CURRENT_DESKTOP".

Fixes: debbugs:9779
This commit is contained in:
Juri Linkov 2011-10-19 12:10:10 +03:00
parent 195f8db97d
commit 5214e501a2
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2011-10-19 Juri Linkov <juri@jurta.org>
* net/browse-url.el (browse-url-can-use-xdg-open): Support LXDE
by checking environment variables "DESKTOP_SESSION" and
"XDG_CURRENT_DESKTOP". (Bug#9779)
2011-10-19 Juri Linkov <juri@jurta.org>
* net/browse-url.el (browse-url-browser-function): Add "Chromium".

View file

@ -48,6 +48,7 @@
;; browse-url-generic arbitrary
;; browse-url-default-windows-browser MS-Windows browser
;; browse-url-default-macosx-browser Mac OS X browser
;; browse-url-xdg-open Free Desktop xdg-open on Gnome, KDE, Xfce4, LXDE
;; browse-url-gnome-moz GNOME interface to Mozilla
;; browse-url-kde KDE konqueror (kfm)
;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT)
@ -943,12 +944,13 @@ used instead of `browse-url-new-window-flag'."
url args))
(defun browse-url-can-use-xdg-open ()
"Check if xdg-open can be used, i.e. we are on Gnome, KDE or xfce4."
"Check if xdg-open can be used, i.e. we are on 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.
;; 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.
@ -966,7 +968,9 @@ used instead of `browse-url-new-window-flag'."
"/bin/sh" nil nil nil
"-c"
"xprop -root _DT_SAVE_MODE|grep xfce4"))
(error nil)))))
(error nil))
(member (getenv "DESKTOP_SESSION") '("LXDE" "Lubuntu"))
(equal (getenv "XDG_CURRENT_DESKTOP") "LXDE"))))
;;;###autoload