unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9779: No usable browser found on Lubuntu
@ 2011-10-17 23:14 Juri Linkov
  2011-10-18  1:53 ` Stefan Monnier
  2011-10-18  5:37 ` Jan Djärv
  0 siblings, 2 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-17 23:14 UTC (permalink / raw)
  To: 9779

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






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-17 23:14 bug#9779: No usable browser found on Lubuntu Juri Linkov
@ 2011-10-18  1:53 ` Stefan Monnier
  2011-10-18  6:55   ` Juri Linkov
  2011-10-18  5:37 ` Jan Djärv
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2011-10-18  1:53 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779

> 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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-17 23:14 bug#9779: No usable browser found on Lubuntu Juri Linkov
  2011-10-18  1:53 ` Stefan Monnier
@ 2011-10-18  5:37 ` Jan Djärv
  2011-10-18  6:57   ` Juri Linkov
  1 sibling, 1 reply; 21+ messages in thread
From: Jan Djärv @ 2011-10-18  5:37 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779

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.








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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  1:53 ` Stefan Monnier
@ 2011-10-18  6:55   ` Juri Linkov
  2011-10-18  8:12     ` Lawrence Mitchell
                       ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-18  6:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9779

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  5:37 ` Jan Djärv
@ 2011-10-18  6:57   ` Juri Linkov
  2011-10-18 13:16     ` Stefan Monnier
  2011-10-20 14:47     ` Nix
  0 siblings, 2 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-18  6:57 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 9779

> 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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:55   ` Juri Linkov
@ 2011-10-18  8:12     ` Lawrence Mitchell
  2011-10-18  9:09       ` Juri Linkov
  2011-10-18  9:53       ` Jan Djärv
  2011-10-18  9:04     ` Juri Linkov
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 21+ messages in thread
From: Lawrence Mitchell @ 2011-10-18  8:12 UTC (permalink / raw)
  To: 9779

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@gmx.li>






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:55   ` Juri Linkov
  2011-10-18  8:12     ` Lawrence Mitchell
@ 2011-10-18  9:04     ` Juri Linkov
  2011-10-18 10:06       ` Jan Djärv
  2011-10-18  9:58     ` Jan Djärv
  2011-10-18 13:17     ` Stefan Monnier
  3 siblings, 1 reply; 21+ messages in thread
From: Juri Linkov @ 2011-10-18  9:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9779

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  8:12     ` Lawrence Mitchell
@ 2011-10-18  9:09       ` Juri Linkov
  2011-10-18  9:53       ` Jan Djärv
  1 sibling, 0 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-18  9:09 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: 9779

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  8:12     ` Lawrence Mitchell
  2011-10-18  9:09       ` Juri Linkov
@ 2011-10-18  9:53       ` Jan Djärv
  1 sibling, 0 replies; 21+ messages in thread
From: Jan Djärv @ 2011-10-18  9:53 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: 9779

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.






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:55   ` Juri Linkov
  2011-10-18  8:12     ` Lawrence Mitchell
  2011-10-18  9:04     ` Juri Linkov
@ 2011-10-18  9:58     ` Jan Djärv
  2011-10-19  9:12       ` Juri Linkov
  2011-10-18 13:17     ` Stefan Monnier
  3 siblings, 1 reply; 21+ messages in thread
From: Jan Djärv @ 2011-10-18  9:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779


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.






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  9:04     ` Juri Linkov
@ 2011-10-18 10:06       ` Jan Djärv
  0 siblings, 0 replies; 21+ messages in thread
From: Jan Djärv @ 2011-10-18 10:06 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779


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.






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:57   ` Juri Linkov
@ 2011-10-18 13:16     ` Stefan Monnier
  2011-10-19  9:10       ` Juri Linkov
  2011-10-20 14:47     ` Nix
  1 sibling, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2011-10-18 13:16 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779

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

I guess it's OK,


        Stefan





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:55   ` Juri Linkov
                       ` (2 preceding siblings ...)
  2011-10-18  9:58     ` Jan Djärv
@ 2011-10-18 13:17     ` Stefan Monnier
  3 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2011-10-18 13:17 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18 13:16     ` Stefan Monnier
@ 2011-10-19  9:10       ` Juri Linkov
  0 siblings, 0 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-19  9:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9779-done

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  9:58     ` Jan Djärv
@ 2011-10-19  9:12       ` Juri Linkov
  2011-10-19 14:52         ` Jan Djärv
  0 siblings, 1 reply; 21+ messages in thread
From: Juri Linkov @ 2011-10-19  9:12 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 9779

>> 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"?





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-19  9:12       ` Juri Linkov
@ 2011-10-19 14:52         ` Jan Djärv
  2011-10-19 22:42           ` Juri Linkov
  0 siblings, 1 reply; 21+ messages in thread
From: Jan Djärv @ 2011-10-19 14:52 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779@debbugs.gnu.org

Hi. 


19 okt 2011 kl. 11:12 skrev Juri Linkov <juri@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. 






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

* bug#9779: No usable browser found on Lubuntu
  2011-10-19 14:52         ` Jan Djärv
@ 2011-10-19 22:42           ` Juri Linkov
  0 siblings, 0 replies; 21+ messages in thread
From: Juri Linkov @ 2011-10-19 22:42 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 9779

>>>> 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 :)





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-18  6:57   ` Juri Linkov
  2011-10-18 13:16     ` Stefan Monnier
@ 2011-10-20 14:47     ` Nix
  2011-10-20 18:41       ` Stefan Monnier
  1 sibling, 1 reply; 21+ messages in thread
From: Nix @ 2011-10-20 14:47 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 9779

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)





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-20 14:47     ` Nix
@ 2011-10-20 18:41       ` Stefan Monnier
  2011-10-20 20:08         ` Nix
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2011-10-20 18:41 UTC (permalink / raw)
  To: Nix; +Cc: 9779

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





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-20 18:41       ` Stefan Monnier
@ 2011-10-20 20:08         ` Nix
  2011-10-21 11:25           ` Richard Stallman
  0 siblings, 1 reply; 21+ messages in thread
From: Nix @ 2011-10-20 20:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9779

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)





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

* bug#9779: No usable browser found on Lubuntu
  2011-10-20 20:08         ` Nix
@ 2011-10-21 11:25           ` Richard Stallman
  0 siblings, 0 replies; 21+ messages in thread
From: Richard Stallman @ 2011-10-21 11:25 UTC (permalink / raw)
  To: Nix; +Cc: 9779

    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/





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

end of thread, other threads:[~2011-10-21 11:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 23:14 bug#9779: No usable browser found on Lubuntu Juri Linkov
2011-10-18  1:53 ` Stefan Monnier
2011-10-18  6:55   ` Juri Linkov
2011-10-18  8:12     ` Lawrence Mitchell
2011-10-18  9:09       ` Juri Linkov
2011-10-18  9:53       ` Jan Djärv
2011-10-18  9:04     ` Juri Linkov
2011-10-18 10:06       ` Jan Djärv
2011-10-18  9:58     ` Jan Djärv
2011-10-19  9:12       ` Juri Linkov
2011-10-19 14:52         ` Jan Djärv
2011-10-19 22:42           ` Juri Linkov
2011-10-18 13:17     ` Stefan Monnier
2011-10-18  5:37 ` Jan Djärv
2011-10-18  6:57   ` Juri Linkov
2011-10-18 13:16     ` Stefan Monnier
2011-10-19  9:10       ` Juri Linkov
2011-10-20 14:47     ` Nix
2011-10-20 18:41       ` Stefan Monnier
2011-10-20 20:08         ` Nix
2011-10-21 11:25           ` Richard Stallman

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