From 195f8db97df38608481a4497cbaf86d8acc9aa55 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 19 Oct 2011 12:03:39 +0300 Subject: [PATCH] * lisp/net/browse-url.el (browse-url-browser-function): Add "Chromium". (browse-url-chromium-program, browse-url-chromium-arguments): New defcustoms. (browse-url-default-browser): Check for `browse-url-chromium' and call `browse-url-chromium-program'. (browse-url-chromium): New command. Fixes: debbugs:9779 --- lisp/ChangeLog | 9 +++++++++ lisp/net/browse-url.el | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e058f387a93..a2197503492 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2011-10-19 Juri Linkov + + * net/browse-url.el (browse-url-browser-function): Add "Chromium". + (browse-url-chromium-program, browse-url-chromium-arguments): + New defcustoms. + (browse-url-default-browser): Check for `browse-url-chromium' and + call `browse-url-chromium-program'. + (browse-url-chromium): New command. (Bug#9779) + 2011-10-18 Juanma Barranquero * facemenu.el (list-colors-duplicates): On Windows, detect more diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index f9bc13e1e25..1b42000dfc6 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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 +231,7 @@ regexp should probably be \".\" to specify a default browser." :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 +338,22 @@ Defaults to the value of `browse-url-firefox-arguments' at the time :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 +931,7 @@ used instead of `browse-url-new-window-flag'." ((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) @@ -1140,6 +1159,22 @@ URL in a new window." browse-url-firefox-program (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. -- 2.39.2