diff options
| author | Kelvin White | 2016-01-24 14:37:38 -0500 |
|---|---|---|
| committer | l3thal | 2016-01-24 14:47:28 -0500 |
| commit | 05a630484fd652f67ce06679fb3f890f5fdd65ea (patch) | |
| tree | e4e5461c4604f0bd0734170a63b5fa754c88da61 | |
| parent | 3772f444228a07404c5af1fdf67a220025d37645 (diff) | |
| download | emacs-05a630484fd652f67ce06679fb3f890f5fdd65ea.tar.gz emacs-05a630484fd652f67ce06679fb3f890f5fdd65ea.zip | |
browse-url.el: Add 'google-chrome' to supported browsers.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 35 |
2 files changed, 38 insertions, 0 deletions
| @@ -1121,6 +1121,9 @@ make the new option `eshell-destroy-buffer-when-process-dies' non-nil. | |||
| 1121 | ** Browse-url | 1121 | ** Browse-url |
| 1122 | 1122 | ||
| 1123 | --- | 1123 | --- |
| 1124 | *** Support for the Google Chrome web browser. | ||
| 1125 | |||
| 1126 | --- | ||
| 1124 | *** Support for the Conkeror web browser. | 1127 | *** Support for the Conkeror web browser. |
| 1125 | 1128 | ||
| 1126 | --- | 1129 | --- |
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 2bda97f95d0..edf91ab6000 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | ;; Function Browser Earliest version | 36 | ;; Function Browser Earliest version |
| 37 | ;; browse-url-mozilla Mozilla Don't know | 37 | ;; browse-url-mozilla Mozilla Don't know |
| 38 | ;; browse-url-firefox Firefox Don't know (tried with 1.0.1) | 38 | ;; browse-url-firefox Firefox Don't know (tried with 1.0.1) |
| 39 | ;; browse-url-chrome Chrome 47.0.2526.111 | ||
| 39 | ;; browse-url-chromium Chromium 3.0 | 40 | ;; browse-url-chromium Chromium 3.0 |
| 40 | ;; browse-url-epiphany Epiphany Don't know | 41 | ;; browse-url-epiphany Epiphany Don't know |
| 41 | ;; browse-url-conkeror Conkeror Don't know | 42 | ;; browse-url-conkeror Conkeror Don't know |
| @@ -147,6 +148,7 @@ regexp should probably be \".\" to specify a default browser." | |||
| 147 | (function-item :tag "eww" :value eww-browse-url) | 148 | (function-item :tag "eww" :value eww-browse-url) |
| 148 | (function-item :tag "Mozilla" :value browse-url-mozilla) | 149 | (function-item :tag "Mozilla" :value browse-url-mozilla) |
| 149 | (function-item :tag "Firefox" :value browse-url-firefox) | 150 | (function-item :tag "Firefox" :value browse-url-firefox) |
| 151 | (function-item :tag "Google Chrome" :value browse-url-chrome) | ||
| 150 | (function-item :tag "Chromium" :value browse-url-chromium) | 152 | (function-item :tag "Chromium" :value browse-url-chromium) |
| 151 | (function-item :tag "Epiphany" :value browse-url-epiphany) | 153 | (function-item :tag "Epiphany" :value browse-url-epiphany) |
| 152 | (function-item :tag "Conkeror" :value browse-url-conkeror) | 154 | (function-item :tag "Conkeror" :value browse-url-conkeror) |
| @@ -259,6 +261,22 @@ Defaults to the value of `browse-url-firefox-arguments' at the time | |||
| 259 | (make-obsolete-variable 'browse-url-firefox-startup-arguments | 261 | (make-obsolete-variable 'browse-url-firefox-startup-arguments |
| 260 | "it no longer has any effect." "24.5") | 262 | "it no longer has any effect." "24.5") |
| 261 | 263 | ||
| 264 | (defcustom browse-url-chrome-program | ||
| 265 | (let ((candidates '("google-chrome-stable" "google-chrome"))) | ||
| 266 | (while (and candidates (not (executable-find (car candidates)))) | ||
| 267 | (setq candidates (cdr candidates))) | ||
| 268 | (or (car candidates) "chromium")) | ||
| 269 | "The name by which to invoke Chromium." | ||
| 270 | :type 'string | ||
| 271 | :version "24.1" | ||
| 272 | :group 'browse-url) | ||
| 273 | |||
| 274 | (defcustom browse-url-chrome-arguments nil | ||
| 275 | "A list of strings to pass to Google Chrome as arguments." | ||
| 276 | :type '(repeat (string :tag "Argument")) | ||
| 277 | :version "24.1" | ||
| 278 | :group 'browse-url) | ||
| 279 | |||
| 262 | (defcustom browse-url-chromium-program | 280 | (defcustom browse-url-chromium-program |
| 263 | (let ((candidates '("chromium" "chromium-browser"))) | 281 | (let ((candidates '("chromium" "chromium-browser"))) |
| 264 | (while (and candidates (not (executable-find (car candidates)))) | 282 | (while (and candidates (not (executable-find (car candidates)))) |
| @@ -902,6 +920,7 @@ instead of `browse-url-new-window-flag'." | |||
| 902 | ((browse-url-can-use-xdg-open) 'browse-url-xdg-open) | 920 | ((browse-url-can-use-xdg-open) 'browse-url-xdg-open) |
| 903 | ;;; ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) | 921 | ;;; ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) |
| 904 | ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) | 922 | ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) |
| 923 | ((executable-find browse-url-chrome-program) 'browse-url-chrome) | ||
| 905 | ((executable-find browse-url-firefox-program) 'browse-url-firefox) | 924 | ((executable-find browse-url-firefox-program) 'browse-url-firefox) |
| 906 | ((executable-find browse-url-chromium-program) 'browse-url-chromium) | 925 | ((executable-find browse-url-chromium-program) 'browse-url-chromium) |
| 907 | ;;; ((executable-find browse-url-galeon-program) 'browse-url-galeon) | 926 | ;;; ((executable-find browse-url-galeon-program) 'browse-url-galeon) |
| @@ -1126,6 +1145,22 @@ The optional argument NEW-WINDOW is not used." | |||
| 1126 | browse-url-chromium-arguments | 1145 | browse-url-chromium-arguments |
| 1127 | (list url))))) | 1146 | (list url))))) |
| 1128 | 1147 | ||
| 1148 | (defun browse-url-chrome (url &optional _new-window) | ||
| 1149 | "Ask the Google Chrome WWW browser to load URL. | ||
| 1150 | Default to the URL around or before point. The strings in | ||
| 1151 | variable `browse-url-chrome-arguments' are also passed to | ||
| 1152 | Google Chrome. | ||
| 1153 | The optional argument NEW-WINDOW is not used." | ||
| 1154 | (interactive (browse-url-interactive-arg "URL: ")) | ||
| 1155 | (setq url (browse-url-encode-url url)) | ||
| 1156 | (let* ((process-environment (browse-url-process-environment))) | ||
| 1157 | (apply 'start-process | ||
| 1158 | (concat "google-chrome " url) nil | ||
| 1159 | browse-url-chrome-program | ||
| 1160 | (append | ||
| 1161 | browse-url-chrome-arguments | ||
| 1162 | (list url))))) | ||
| 1163 | |||
| 1129 | ;;;###autoload | 1164 | ;;;###autoload |
| 1130 | (defun browse-url-galeon (url &optional new-window) | 1165 | (defun browse-url-galeon (url &optional new-window) |
| 1131 | "Ask the Galeon WWW browser to load URL. | 1166 | "Ask the Galeon WWW browser to load URL. |