Subject: bug#9779: closed (Re: bug#9779: No usable browser found on Lubuntu)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 19 Oct 2011 09:16:02 +0000

Your bug report

#9779: No usable browser found on Lubuntu

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
9779: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9779
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#9779: No usable browser found on Lubuntu
From: Juri Linkov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], Jan Djärv <[email-masked]>
Date: Wed, 19 Oct 2011 12:10:48 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

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

Subject: No usable browser found on Lubuntu
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Tue, 18 Oct 2011 02:14:39 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

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