GNU bug report logs - #9779
No usable browser found on Lubuntu

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Mon, 17 Oct 2011 23:19:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9779 in the body.
You can then email your comments to 9779 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Mon, 17 Oct 2011 23:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 17 Oct 2011 23:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 02:14:39 +0300
Clicking on a link doesn't open a Web browser as expected
but fails with the error message "No usable browser found"
on Lubuntu 11.10 (Ubuntu + LXDE) since its default web browser
is Chromium, but Chromium is still not supported by browse-url.

The following patch will add its support to browse-url.el.  This code
is basically like used for Firefox, but since there are no official
command line switches like "-remote", "-new-window", "-new-tab",
so tab/window/startup related options can't be used for Chromium.

=== modified file 'lisp/net/browse-url.el'
--- lisp/net/browse-url.el	2011-08-21 01:01:12 +0000
+++ lisp/net/browse-url.el	2011-10-17 23:10:30 +0000
@@ -36,6 +36,7 @@
 ;; Function                           Browser     Earliest version
 ;; browse-url-mozilla                 Mozilla     Don't know
 ;; browse-url-firefox                 Firefox     Don't know (tried with 1.0.1)
+;; browse-url-chromium                Chromium    3.0
 ;; browse-url-galeon                  Galeon      Don't know
 ;; browse-url-epiphany                Epiphany    Don't know
 ;; browse-url-netscape                Netscape    1.1b1
@@ -230,6 +232,7 @@ (defcustom browse-url-browser-function
 			 :value  browse-url-w3-gnudoit)
 	  (function-item :tag "Mozilla" :value  browse-url-mozilla)
 	  (function-item :tag "Firefox" :value browse-url-firefox)
+	  (function-item :tag "Chromium" :value browse-url-chromium)
 	  (function-item :tag "Galeon" :value  browse-url-galeon)
 	  (function-item :tag "Epiphany" :value  browse-url-epiphany)
 	  (function-item :tag "Netscape" :value  browse-url-netscape)
@@ -336,6 +340,22 @@ (defcustom browse-url-firefox-startup-ar
   :type '(repeat (string :tag "Argument"))
   :group 'browse-url)
 
+(defcustom browse-url-chromium-program
+  (let ((candidates '("chromium" "chromium-browser" "chrome")))
+    (while (and candidates (not (executable-find (car candidates))))
+      (setq candidates (cdr candidates)))
+    (or (car candidates) "chromium"))
+  "The name by which to invoke Chromium."
+  :type 'string
+  :version "24.1"
+  :group 'browse-url)
+
+(defcustom browse-url-chromium-arguments nil
+  "A list of strings to pass to Chromium as arguments."
+  :type '(repeat (string :tag "Argument"))
+  :version "24.1"
+  :group 'browse-url)
+
 (defcustom browse-url-galeon-program "galeon"
   "The name by which to invoke Galeon."
   :type 'string
@@ -913,6 +933,7 @@ (defun browse-url-default-browser (url &
     ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
     ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
     ((executable-find browse-url-firefox-program) 'browse-url-firefox)
+    ((executable-find browse-url-chromium-program) 'browse-url-chromium)
     ((executable-find browse-url-galeon-program) 'browse-url-galeon)
     ((executable-find browse-url-kde-program) 'browse-url-kde)
     ((executable-find browse-url-netscape-program) 'browse-url-netscape)
@@ -1141,6 +1162,22 @@ (defun browse-url-firefox-sentinel (proc
 	       (append browse-url-firefox-startup-arguments (list url))))))
 
 ;;;###autoload
+(defun browse-url-chromium (url &optional new-window)
+  "Ask the Chromium WWW browser to load URL.
+Default to the URL around or before point.  The strings in
+variable `browse-url-chromium-arguments' are also passed to
+Chromium."
+  (interactive (browse-url-interactive-arg "URL: "))
+  (setq url (browse-url-encode-url url))
+  (let* ((process-environment (browse-url-process-environment)))
+    (apply 'start-process
+	   (concat "chromium " url) nil
+	   browse-url-chromium-program
+	   (append
+	    browse-url-chromium-arguments
+	    (list url)))))
+
+;;;###autoload
 (defun browse-url-galeon (url &optional new-window)
   "Ask the Galeon WWW browser to load URL.
 Default to the URL around or before point.  The strings in variable





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 01:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Mon, 17 Oct 2011 21:53:39 -0400
> Clicking on a link doesn't open a Web browser as expected
> but fails with the error message "No usable browser found"
> on Lubuntu 11.10 (Ubuntu + LXDE) since its default web browser
> is Chromium, but Chromium is still not supported by browse-url.

Better would be if we can use xdg-open.  Could you check if xdg-open
works, and if so, how to adjust browse-url-can-use-xdg-open accordingly?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 05:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 07:37:25 +0200
Hello.

18 okt 2011 kl. 01:14 skrev Juri Linkov:

> Clicking on a link doesn't open a Web browser as expected
> but fails with the error message "No usable browser found"
> on Lubuntu 11.10 (Ubuntu + LXDE) since its default web browser
> is Chromium, but Chromium is still not supported by browse-url.
> 
> The following patch will add its support to browse-url.el.  This code
> is basically like used for Firefox, but since there are no official
> command line switches like "-remote", "-new-window", "-new-tab",
> so tab/window/startup related options can't be used for Chromium.
> 
> 

> 
> +(defcustom browse-url-chromium-program
> +  (let ((candidates '("chromium" "chromium-browser" "chrome")))

Chrome also goes by the name google-chrome.  Since chromium and chrome isn't the same thing and you can have both installed, browse-url-chromium-program is not really the right name for it if it also tries chrome.

	Jan D.







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 07:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 09:55:03 +0300
> Better would be if we can use xdg-open.  Could you check if xdg-open
> works, and if so, how to adjust browse-url-can-use-xdg-open accordingly?

`browse-url-can-use-xdg-open' returns nil.  Below are expressions
from this function and results of their evaluation:

(getenv "DISPLAY")
=> ":0"

(executable-find "xdg-open")
=> "/usr/bin/xdg-open"

(executable-find "nohup")
=> "/usr/bin/nohup"

(getenv "GNOME_DESKTOP_SESSION_ID")
=> nil

(call-process "dbus-send" nil nil nil
              "--dest=org.gnome.SessionManager"
              "--print-reply"
              "/org/gnome/SessionManager"
              "org.gnome.SessionManager.CanShutdown")
=> 1

(getenv "KDE_FULL_SESSION")
=> nil

(call-process "/bin/sh" nil nil nil
              "-c"
              "xprop -root _DT_SAVE_MODE|grep xfce4")
=> 1

The latest is used to check for Xfce4, but it doesn't work for LXDE,
and I can't find a reliable value specific to LXDE or Lubuntu in the output
of `xprop -root' or among environment variables.

There are two desktop session modes: "Lubuntu" (with look&feel of Ubuntu)
and "LXDE" (pure LXDE desktop).

Some relevant environment variables when logged in as "Lubuntu":

DEFAULTS_PATH=/usr/share/gconf/Lubuntu.default.path
DESKTOP_SESSION=Lubuntu
GTK_MODULES=canberra-gtk-module:canberra-gtk-module
SAL_USE_VCLPLUGIN=gtk
UPSTART_JOB=lxdm
XDG_CONFIG_DIRS=/etc/xdg/lubuntu/:/etc/xdg/xdg-Lubuntu:/etc/xdg:/etc/xdg
XDG_CURRENT_DESKTOP=LXDE
XDG_MENU_PREFIX=lxde-

Some relevant environment variables when logged in as "LXDE":

DEFAULTS_PATH=/usr/share/gconf/LXDE.default.path
DESKTOP_SESSION=LXDE
GTK_MODULES=canberra-gtk-module:canberra-gtk-module
SAL_USE_VCLPLUGIN=gtk
UPSTART_JOB=lxdm
XDG_CONFIG_DIRS=/etc/xdg/xdg-LXDE:/etc/xdg
XDG_CURRENT_DESKTOP=LXDE
XDG_MENU_PREFIX=lxde-

The value of "DESKTOP_SESSION" looks like an arbitrary name of the
current session (the same string as displayed on the Login menu).

It seems that "XDG_CURRENT_DESKTOP" is the most reliable variable
to determine whether the current desktop is LXDE.

So I propose the following patch (that also adds a missing customizable
option for `browse-url-xdg-open' in `browse-url-browser-function'):

=== modified file 'lisp/net/browse-url.el'
--- lisp/net/browse-url.el	2011-08-21 01:01:12 +0000
+++ lisp/net/browse-url.el	2011-10-18 06:54:01 +0000
@@ -247,6 +249,8 @@ (defcustom browse-url-browser-function
 			 :value browse-url-default-windows-browser)
 	  (function-item :tag "Default Mac OS X browser"
 			 :value browse-url-default-macosx-browser)
+	  (function-item :tag "Preferred by xdg-open from Free Desktop"
+			 :value browse-url-xdg-open)
 	  (function-item :tag "GNOME invoking Mozilla"
 			 :value browse-url-gnome-moz)
 	  (function-item :tag "Default browser"
@@ -924,7 +946,7 @@ (defun browse-url-default-browser (url &
    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
@@ -947,7 +969,8 @@ (defun browse-url-can-use-xdg-open ()
 		      "/bin/sh" nil nil nil
 		      "-c"
 		      "xprop -root _DT_SAVE_MODE|grep xfce4"))
-	     (error nil)))))
+	     (error nil))
+	   (equal (getenv "XDG_CURRENT_DESKTOP") "LXDE"))))
 
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 07:16:02 GMT) Full text and rfc822 format available.

Message #17 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 09:57:54 +0300
> Chrome also goes by the name google-chrome.  Since chromium and chrome
> isn't the same thing and you can have both installed,
> browse-url-chromium-program is not really the right name for it if it
> also tries chrome.

Unlike partially proprietary Chrome, Chromium is free software,
so it deserves to be added to browse-url.el.

I agree that we should not search for the executable "chrome"
which is not free software.  So below is a new patch
that supports only free software version "Chromium".

I propose to add it independently of xdg-open for systems
that have Chromium but not xdg-open.

=== modified file 'lisp/net/browse-url.el'
--- lisp/net/browse-url.el	2011-08-21 01:01:12 +0000
+++ lisp/net/browse-url.el	2011-10-18 06:57:02 +0000
@@ -36,6 +36,7 @@
 ;; Function                           Browser     Earliest version
 ;; browse-url-mozilla                 Mozilla     Don't know
 ;; browse-url-firefox                 Firefox     Don't know (tried with 1.0.1)
+;; browse-url-chromium                Chromium    3.0
 ;; browse-url-galeon                  Galeon      Don't know
 ;; browse-url-epiphany                Epiphany    Don't know
 ;; browse-url-netscape                Netscape    1.1b1
@@ -230,6 +232,7 @@ (defcustom browse-url-browser-function
 			 :value  browse-url-w3-gnudoit)
 	  (function-item :tag "Mozilla" :value  browse-url-mozilla)
 	  (function-item :tag "Firefox" :value browse-url-firefox)
+	  (function-item :tag "Chromium" :value browse-url-chromium)
 	  (function-item :tag "Galeon" :value  browse-url-galeon)
 	  (function-item :tag "Epiphany" :value  browse-url-epiphany)
 	  (function-item :tag "Netscape" :value  browse-url-netscape)
@@ -336,6 +341,22 @@ (defcustom browse-url-firefox-startup-ar
   :type '(repeat (string :tag "Argument"))
   :group 'browse-url)
 
+(defcustom browse-url-chromium-program
+  (let ((candidates '("chromium" "chromium-browser")))
+    (while (and candidates (not (executable-find (car candidates))))
+      (setq candidates (cdr candidates)))
+    (or (car candidates) "chromium"))
+  "The name by which to invoke Chromium."
+  :type 'string
+  :version "24.1"
+  :group 'browse-url)
+
+(defcustom browse-url-chromium-arguments nil
+  "A list of strings to pass to Chromium as arguments."
+  :type '(repeat (string :tag "Argument"))
+  :version "24.1"
+  :group 'browse-url)
+
 (defcustom browse-url-galeon-program "galeon"
   "The name by which to invoke Galeon."
   :type 'string
@@ -913,6 +934,7 @@ (defun browse-url-default-browser (url &
     ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
     ((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
     ((executable-find browse-url-firefox-program) 'browse-url-firefox)
+    ((executable-find browse-url-chromium-program) 'browse-url-chromium)
     ((executable-find browse-url-galeon-program) 'browse-url-galeon)
     ((executable-find browse-url-kde-program) 'browse-url-kde)
     ((executable-find browse-url-netscape-program) 'browse-url-netscape)
@@ -1141,6 +1164,22 @@ (defun browse-url-firefox-sentinel (proc
 	       (append browse-url-firefox-startup-arguments (list url))))))
 
 ;;;###autoload
+(defun browse-url-chromium (url &optional new-window)
+  "Ask the Chromium WWW browser to load URL.
+Default to the URL around or before point.  The strings in
+variable `browse-url-chromium-arguments' are also passed to
+Chromium."
+  (interactive (browse-url-interactive-arg "URL: "))
+  (setq url (browse-url-encode-url url))
+  (let* ((process-environment (browse-url-process-environment)))
+    (apply 'start-process
+	   (concat "chromium " url) nil
+	   browse-url-chromium-program
+	   (append
+	    browse-url-chromium-arguments
+	    (list url)))))
+
+;;;###autoload
 (defun browse-url-galeon (url &optional new-window)
   "Ask the Galeon WWW browser to load URL.
 Default to the URL around or before point.  The strings in variable




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 08:14:01 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lawrence Mitchell <wence <at> gmx.li>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 09:12:21 +0100
Juri Linkov wrote:

>> Better would be if we can use xdg-open.  Could you check if xdg-open
>> works, and if so, how to adjust browse-url-can-use-xdg-open accordingly?

> `browse-url-can-use-xdg-open' returns nil.  Below are expressions
> from this function and results of their evaluation:

> (getenv "DISPLAY")
> => ":0"

> (executable-find "xdg-open")
> => "/usr/bin/xdg-open"

> (executable-find "nohup")
> => "/usr/bin/nohup"

I note that since 22-Jun-2011 browse-url-xdg-open no longer uses
nohup.  This is either a mistake on my part (I didn't read the
comment in browse-url-can-use-xdg-open) or it is indeed
unnecessary and therefore isn't a requirement for xdg-open.

Lawrence
-- 
Lawrence Mitchell <wence <at> gmx.li>





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 09:14:02 GMT) Full text and rfc822 format available.

Message #23 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 12:04:10 +0300
> Some relevant environment variables when logged in as "Lubuntu":
>
> DESKTOP_SESSION=Lubuntu
> XDG_CURRENT_DESKTOP=LXDE
>
> Some relevant environment variables when logged in as "LXDE":
>
> DESKTOP_SESSION=LXDE
> XDG_CURRENT_DESKTOP=LXDE
>
> The value of "DESKTOP_SESSION" looks like an arbitrary name of the
> current session (the same string as displayed on the Login menu).
>
> It seems that "XDG_CURRENT_DESKTOP" is the most reliable variable
> to determine whether the current desktop is LXDE.

I discovered that /usr/bin/xdg-open contains the following function:

# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase
detectDE()
{
    if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
    elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
    elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde;
    else DE=""
    fi
}

But actually checking for "DESKTOP_SESSION" fails when logged in as "Lubuntu".
So we have two options: implement the same checks (using "DESKTOP_SESSION")
or check for "XDG_CURRENT_DESKTOP" that is more reliable than "DESKTOP_SESSION".

Another problem is that when all checks fail in /usr/bin/xdg-open,
it falls back to `open_generic'.  But `browse-url-can-use-xdg-open'
doesn't take into account the case of using `open_generic' in /usr/bin/xdg-open.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 09:14:02 GMT) Full text and rfc822 format available.

Message #26 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Lawrence Mitchell <wence <at> gmx.li>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 12:09:22 +0300
>> (executable-find "nohup")
>> => "/usr/bin/nohup"
>
> I note that since 22-Jun-2011 browse-url-xdg-open no longer uses
> nohup.  This is either a mistake on my part (I didn't read the
> comment in browse-url-can-use-xdg-open) or it is indeed
> unnecessary and therefore isn't a requirement for xdg-open.

Do you think it should be removed with its comment that says:

       ;; 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 09:55:01 GMT) Full text and rfc822 format available.

Message #29 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Lawrence Mitchell <wence <at> gmx.li>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 11:53:10 +0200
Hi.

18 okt 2011 kl. 10:12 skrev Lawrence Mitchell:

> Juri Linkov wrote:
> 
>>> Better would be if we can use xdg-open.  Could you check if xdg-open
>>> works, and if so, how to adjust browse-url-can-use-xdg-open accordingly?
> 
>> `browse-url-can-use-xdg-open' returns nil.  Below are expressions
>> from this function and results of their evaluation:
> 
>> (getenv "DISPLAY")
>> => ":0"
> 
>> (executable-find "xdg-open")
>> => "/usr/bin/xdg-open"
> 
>> (executable-find "nohup")
>> => "/usr/bin/nohup"
> 
> I note that since 22-Jun-2011 browse-url-xdg-open no longer uses
> nohup.  This is either a mistake on my part (I didn't read the
> comment in browse-url-can-use-xdg-open) or it is indeed
> unnecessary and therefore isn't a requirement for xdg-open.
> 

See discussion at http://lists.gnu.org/archive/html/emacs-devel/2009-07/msg00279.html.
nohup is still needed for xdg-open.

	Jan D.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 10:01:02 GMT) Full text and rfc822 format available.

Message #32 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Juri Linkov <juri <at> jurta.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 11:58:56 +0200
18 okt 2011 kl. 08:55 skrev Juri Linkov:

>> Better would be if we can use xdg-open.  Could you check if xdg-open
>> works, and if so, how to adjust browse-url-can-use-xdg-open accordingly?
> 
> 
> It seems that "XDG_CURRENT_DESKTOP" is the most reliable variable
> to determine whether the current desktop is LXDE.
> 
> So I propose the following patch (that also adds a missing customizable
> option for `browse-url-xdg-open' in `browse-url-browser-function'):
> 
> === modified file 'lisp/net/browse-url.el'
> --- lisp/net/browse-url.el	2011-08-21 01:01:12 +0000
> +++ lisp/net/browse-url.el	2011-10-18 06:54:01 +0000
> @@ -247,6 +249,8 @@ (defcustom browse-url-browser-function
> 			 :value browse-url-default-windows-browser)
> 	  (function-item :tag "Default Mac OS X browser"
> 			 :value browse-url-default-macosx-browser)
> +	  (function-item :tag "Preferred by xdg-open from Free Desktop"
> +			 :value browse-url-xdg-open)
> 	  (function-item :tag "GNOME invoking Mozilla"
> 			 :value browse-url-gnome-moz)
> 	  (function-item :tag "Default browser"

This part of the patch is redundant.  browse-url-xdg-open is called by browse-url-default-browser.

	Jan D.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 10:08:01 GMT) Full text and rfc822 format available.

Message #35 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Juri Linkov <juri <at> jurta.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 12:06:36 +0200
18 okt 2011 kl. 11:04 skrev Juri Linkov:

> Another problem is that when all checks fail in /usr/bin/xdg-open,
> it falls back to `open_generic'.  But `browse-url-can-use-xdg-open'
> doesn't take into account the case of using `open_generic' in /usr/bin/xdg-open.
> 

That may end up starting a non-X (i.e command line) program.  We don't want to do that.

	Jan D.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 13:18:02 GMT) Full text and rfc822 format available.

Message #38 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 09:16:47 -0400
> I propose to add it independently of xdg-open for systems
> that have Chromium but not xdg-open.

I guess it's OK,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Tue, 18 Oct 2011 13:19:02 GMT) Full text and rfc822 format available.

Message #41 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Tue, 18 Oct 2011 09:17:21 -0400
>  (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
> @@ -947,7 +969,8 @@ (defun browse-url-can-use-xdg-open ()
>  		      "/bin/sh" nil nil nil
>  		      "-c"
>  		      "xprop -root _DT_SAVE_MODE|grep xfce4"))
> -	     (error nil)))))
> +	     (error nil))
> +	   (equal (getenv "XDG_CURRENT_DESKTOP") "LXDE"))))
 
Thanks, please install,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Wed, 19 Oct 2011 09:16:01 GMT) Full text and rfc822 format available.

Message #44 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Wed, 19 Oct 2011 12:12:23 +0300
>> So I propose the following patch (that also adds a missing customizable
>> option for `browse-url-xdg-open' in `browse-url-browser-function'):
>>
>> === modified file 'lisp/net/browse-url.el'
>> --- lisp/net/browse-url.el	2011-08-21 01:01:12 +0000
>> +++ lisp/net/browse-url.el	2011-10-18 06:54:01 +0000
>> @@ -247,6 +249,8 @@ (defcustom browse-url-browser-function
>> 			 :value browse-url-default-windows-browser)
>> 	  (function-item :tag "Default Mac OS X browser"
>> 			 :value browse-url-default-macosx-browser)
>> +	  (function-item :tag "Preferred by xdg-open from Free Desktop"
>> +			 :value browse-url-xdg-open)
>> 	  (function-item :tag "GNOME invoking Mozilla"
>> 			 :value browse-url-gnome-moz)
>> 	  (function-item :tag "Default browser"
>
> This part of the patch is redundant.  browse-url-xdg-open is called by
> browse-url-default-browser.

`browse-url-default-browser' is just one of possible values of
`browse-url-browser-function'.  Like users might want to customize it
to e.g. "Default Windows browser", is it likely that some users might want
to customize it to "Default Free Desktop browser" selected by "xdg-open"?




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Wed, 19 Oct 2011 09:16:02 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Wed, 19 Oct 2011 09:16:02 GMT) Full text and rfc822 format available.

Message #49 received at 9779-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9779-done <at> debbugs.gnu.org,
	Jan Djärv <jan.h.d <at> swipnet.se>
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Wed, 19 Oct 2011 12:10:48 +0300
>> I propose to add it independently of xdg-open for systems
>> that have Chromium but not xdg-open.
>
> I guess it's OK,

Added.

>> +	   (equal (getenv "XDG_CURRENT_DESKTOP") "LXDE"))))
>
> Thanks, please install,

Installed with checks for both environment variables
"DESKTOP_SESSION" and "XDG_CURRENT_DESKTOP"
that is twice more reliable.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Wed, 19 Oct 2011 14:54:02 GMT) Full text and rfc822 format available.

Message #52 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Juri Linkov <juri <at> jurta.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
	"9779 <at> debbugs.gnu.org" <9779 <at> debbugs.gnu.org>
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Wed, 19 Oct 2011 16:52:29 +0200
Hi. 


19 okt 2011 kl. 11:12 skrev Juri Linkov <juri <at> jurta.org>:

>>> So I propose the following patch (that also adds a missing customizable
>>> option for `browse-url-xdg-open' in `browse-url-browser-function'):
>>> 
>>> === modified file 'lisp/net/browse-url.el'
>>> --- lisp/net/browse-url.el    2011-08-21 01:01:12 +0000
>>> +++ lisp/net/browse-url.el    2011-10-18 06:54:01 +0000
>>> @@ -247,6 +249,8 @@ (defcustom browse-url-browser-function
>>>             :value browse-url-default-windows-browser)
>>>      (function-item :tag "Default Mac OS X browser"
>>>             :value browse-url-default-macosx-browser)
>>> +      (function-item :tag "Preferred by xdg-open from Free Desktop"
>>> +             :value browse-url-xdg-open)
>>>      (function-item :tag "GNOME invoking Mozilla"
>>>             :value browse-url-gnome-moz)
>>>      (function-item :tag "Default browser"
>> 
>> This part of the patch is redundant.  browse-url-xdg-open is called by
>> browse-url-default-browser.
> 
> `browse-url-default-browser' is just one of possible values of
> `browse-url-browser-function'.  Like users might want to customize it
> to e.g. "Default Windows browser", is it likely that some users might want
> to customize it to "Default Free Desktop browser" selected by "xdg-open"?

I don't get it. That is the default, so what is the point of customizing it to the default value?

    Jan D. 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Wed, 19 Oct 2011 22:49:02 GMT) Full text and rfc822 format available.

Message #55 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Thu, 20 Oct 2011 01:42:02 +0300
>>>> So I propose the following patch (that also adds a missing customizable
>>>> option for `browse-url-xdg-open' in `browse-url-browser-function'):
>>>>
>>>> === modified file 'lisp/net/browse-url.el'
>>>> --- lisp/net/browse-url.el    2011-08-21 01:01:12 +0000
>>>> +++ lisp/net/browse-url.el    2011-10-18 06:54:01 +0000
>>>> @@ -247,6 +249,8 @@ (defcustom browse-url-browser-function
>>>>             :value browse-url-default-windows-browser)
>>>>      (function-item :tag "Default Mac OS X browser"
>>>>             :value browse-url-default-macosx-browser)
>>>> +      (function-item :tag "Preferred by xdg-open from Free Desktop"
>>>> +             :value browse-url-xdg-open)
>>>>      (function-item :tag "GNOME invoking Mozilla"
>>>>             :value browse-url-gnome-moz)
>>>>      (function-item :tag "Default browser"
>>>
>>> This part of the patch is redundant.  browse-url-xdg-open is called by
>>> browse-url-default-browser.
>>
>> `browse-url-default-browser' is just one of possible values of
>> `browse-url-browser-function'.  Like users might want to customize it
>> to e.g. "Default Windows browser", is it likely that some users might want
>> to customize it to "Default Free Desktop browser" selected by "xdg-open"?
>
> I don't get it. That is the default, so what is the point of customizing it to the default value?

There is no point doing this now with the current implementation of
`browse-url-default-browser' where one of the first things it does
is to try to use `browse-url-xdg-open', so perhaps no one might want
to customize it to `browse-url-xdg-open'.  I proposed to add it just
for completeness.  But there is no urgent need to do this and anyway,
this bug report is already closed :)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Thu, 20 Oct 2011 14:49:01 GMT) Full text and rfc822 format available.

Message #58 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Nix <nix <at> esperi.org.uk>
To: Juri Linkov <juri <at> jurta.org>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Thu, 20 Oct 2011 15:47:25 +0100
On 18 Oct 2011, Juri Linkov said:
> I agree that we should not search for the executable "chrome"
> which is not free software.  So below is a new patch
> that supports only free software version "Chromium".

If you build Chromium yourself from source code, it actually
creates only an executable called 'chrome' and a manpage
'chrome.1': i.e., even the free version calls itself after
the non-free version. (Of course, since Chromium doesn't
contain an installation target, everyone has to write their own, and
maybe everyone has chosen to create such a symlink. But this
doesn't seem like something that it is safe to rely on.)

-- 
NULL && (void)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Thu, 20 Oct 2011 20:09:02 GMT) Full text and rfc822 format available.

Message #61 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Nix <nix <at> esperi.org.uk>
Cc: Juri Linkov <juri <at> jurta.org>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Thu, 20 Oct 2011 14:41:41 -0400
>> I agree that we should not search for the executable "chrome"
>> which is not free software.  So below is a new patch
>> that supports only free software version "Chromium".

> If you build Chromium yourself from source code, it actually
> creates only an executable called 'chrome' and a manpage
> 'chrome.1': i.e., even the free version calls itself after
> the non-free version. (Of course, since Chromium doesn't
> contain an installation target, everyone has to write their own, and
> maybe everyone has chosen to create such a symlink. But this
> doesn't seem like something that it is safe to rely on.)

I prefer not to look for `chrome'.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Thu, 20 Oct 2011 20:10:02 GMT) Full text and rfc822 format available.

Message #64 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Nix <nix <at> esperi.org.uk>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Juri Linkov <juri <at> jurta.org>, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Thu, 20 Oct 2011 21:08:20 +0100
On 20 Oct 2011, Stefan Monnier uttered the following:

>> If you build Chromium yourself from source code, it actually
>> creates only an executable called 'chrome' and a manpage
>> 'chrome.1': i.e., even the free version calls itself after
>> the non-free version. (Of course, since Chromium doesn't
>> contain an installation target, everyone has to write their own, and
>> maybe everyone has chosen to create such a symlink. But this
>> doesn't seem like something that it is safe to rely on.)
>
> I prefer not to look for `chrome'.

I guess we'll have to hope that everyone renamed the browser the same
way as Debian, then (even though this is highly unlikely to be the
case).

-- 
NULL && (void)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9779; Package emacs. (Fri, 21 Oct 2011 11:28:02 GMT) Full text and rfc822 format available.

Message #67 received at 9779 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Nix <nix <at> esperi.org.uk>
Cc: monnier <at> IRO.UMontreal.CA, 9779 <at> debbugs.gnu.org
Subject: Re: bug#9779: No usable browser found on Lubuntu
Date: Fri, 21 Oct 2011 07:25:47 -0400
    I guess we'll have to hope that everyone renamed the browser the same
    way as Debian, then (even though this is highly unlikely to be the
    case).

Our policy can encourage people to do so.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 18 Nov 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.