browse-url-firefox: update for firefox 36's removal of -remote
Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1080319 * lisp/net/browse-url.el (browse-url-firefox-startup-arguments): Make obsolete. (browse-url-firefox): Doc fix. Remove -remote. (browse-url-firefox-sentinel): Remove function. * etc/NEWS: Mention this. Fixes: debbugs:19921
This commit is contained in:
parent
18178922a8
commit
1b0ebbdb56
3 changed files with 37 additions and 53 deletions
2
etc/NEWS
2
etc/NEWS
|
@ -29,6 +29,8 @@ with a prefix argument or by typing C-u C-h C-n.
|
||||||
** `call-process-shell-command' and `process-file-shell-command' no longer
|
** `call-process-shell-command' and `process-file-shell-command' no longer
|
||||||
take "&rest args".
|
take "&rest args".
|
||||||
|
|
||||||
|
** The option `browse-url-firefox-startup-arguments' no longer has an effect.
|
||||||
|
|
||||||
** ERC
|
** ERC
|
||||||
|
|
||||||
*** New option `erc-rename-buffers'.
|
*** New option `erc-rename-buffers'.
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2015-02-24 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
|
* net/browse-url.el (browse-url-firefox-startup-arguments):
|
||||||
|
Make obsolete.
|
||||||
|
(browse-url-firefox): Doc fix. Remove -remote, which no longer
|
||||||
|
exists in Firefox 36. (Bug#19921)
|
||||||
|
(browse-url-firefox-sentinel): Remove function.
|
||||||
|
|
||||||
2015-02-23 Eli Zaretskii <eliz@gnu.org>
|
2015-02-23 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
* frame.el (blink-cursor-timer-function): Don't increment
|
* frame.el (blink-cursor-timer-function): Don't increment
|
||||||
|
|
|
@ -337,6 +337,9 @@ Defaults to the value of `browse-url-firefox-arguments' at the time
|
||||||
:type '(repeat (string :tag "Argument"))
|
:type '(repeat (string :tag "Argument"))
|
||||||
:group 'browse-url)
|
:group 'browse-url)
|
||||||
|
|
||||||
|
(make-obsolete-variable 'browse-url-firefox-startup-arguments
|
||||||
|
"it no longer has any effect." "24.5")
|
||||||
|
|
||||||
(defcustom browse-url-chromium-program
|
(defcustom browse-url-chromium-program
|
||||||
(let ((candidates '("chromium" "chromium-browser")))
|
(let ((candidates '("chromium" "chromium-browser")))
|
||||||
(while (and candidates (not (executable-find (car candidates))))
|
(while (and candidates (not (executable-find (car candidates))))
|
||||||
|
@ -1102,68 +1105,39 @@ used instead of `browse-url-new-window-flag'."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun browse-url-firefox (url &optional new-window)
|
(defun browse-url-firefox (url &optional new-window)
|
||||||
"Ask the Firefox WWW browser to load URL.
|
"Ask the Firefox WWW browser to load URL.
|
||||||
Default to the URL around or before point. The strings in
|
Defaults to the URL around or before point. Passes the strings
|
||||||
variable `browse-url-firefox-arguments' are also passed to
|
in the variable `browse-url-firefox-arguments' to Firefox.
|
||||||
Firefox.
|
|
||||||
|
|
||||||
When called interactively, if variable
|
Interactively, if the variable `browse-url-new-window-flag' is non-nil,
|
||||||
`browse-url-new-window-flag' is non-nil, load the document in a
|
loads the document in a new Firefox window. A non-nil prefix argument
|
||||||
new Firefox window, otherwise use a random existing one. A
|
reverses the effect of `browse-url-new-window-flag'.
|
||||||
non-nil interactive prefix argument reverses the effect of
|
|
||||||
`browse-url-new-window-flag'.
|
|
||||||
|
|
||||||
If `browse-url-firefox-new-window-is-tab' is non-nil, then
|
If `browse-url-firefox-new-window-is-tab' is non-nil, then
|
||||||
whenever a document would otherwise be loaded in a new window, it
|
whenever a document would otherwise be loaded in a new window, it
|
||||||
is loaded in a new tab in an existing window instead.
|
is loaded in a new tab in an existing window instead.
|
||||||
|
|
||||||
When called non-interactively, optional second argument
|
Non-interactively, this uses the optional second argument NEW-WINDOW
|
||||||
NEW-WINDOW is used instead of `browse-url-new-window-flag'.
|
instead of `browse-url-new-window-flag'.
|
||||||
|
|
||||||
On MS-Windows systems the optional `new-window' parameter is
|
On MS Windows, this ignores `browse-url-new-window-flag' and
|
||||||
ignored. Firefox for Windows does not support the \"-remote\"
|
`browse-url-firefox-new-window-is-tab', as well as the NEW-WINDOW argument.
|
||||||
command line parameter. Therefore, the
|
It always uses a new window."
|
||||||
`browse-url-new-window-flag' and `browse-url-firefox-new-window-is-tab'
|
|
||||||
are ignored as well. Firefox on Windows will always open the requested
|
|
||||||
URL in a new window."
|
|
||||||
(interactive (browse-url-interactive-arg "URL: "))
|
(interactive (browse-url-interactive-arg "URL: "))
|
||||||
(setq url (browse-url-encode-url url))
|
(setq url (browse-url-encode-url url))
|
||||||
(let* ((process-environment (browse-url-process-environment))
|
(let* ((process-environment (browse-url-process-environment)))
|
||||||
(use-remote
|
|
||||||
(not (memq system-type '(windows-nt ms-dos))))
|
|
||||||
(process
|
|
||||||
(apply 'start-process
|
(apply 'start-process
|
||||||
(concat "firefox " url) nil
|
(concat "firefox " url) nil
|
||||||
browse-url-firefox-program
|
browse-url-firefox-program
|
||||||
(append
|
(append
|
||||||
browse-url-firefox-arguments
|
browse-url-firefox-arguments
|
||||||
(if use-remote
|
;; FIXME someone should check if this limitation
|
||||||
(list "-remote"
|
;; still applies.
|
||||||
(concat
|
(unless (memq system-type '(windows-nt ms-dos))
|
||||||
"openURL("
|
|
||||||
url
|
|
||||||
(if (browse-url-maybe-new-window new-window)
|
(if (browse-url-maybe-new-window new-window)
|
||||||
(if browse-url-firefox-new-window-is-tab
|
(if browse-url-firefox-new-window-is-tab
|
||||||
",new-tab"
|
'("-new-tab")
|
||||||
",new-window"))
|
'("-new-window"))))
|
||||||
")"))
|
(list url)))))
|
||||||
(list url))))))
|
|
||||||
;; If we use -remote, the process exits with status code 2 if
|
|
||||||
;; Firefox is not already running. The sentinel runs firefox
|
|
||||||
;; directly if that happens.
|
|
||||||
(when use-remote
|
|
||||||
(set-process-sentinel process
|
|
||||||
`(lambda (process change)
|
|
||||||
(browse-url-firefox-sentinel process ,url))))))
|
|
||||||
|
|
||||||
(defun browse-url-firefox-sentinel (process url)
|
|
||||||
"Handle a change to the process communicating with Firefox."
|
|
||||||
(or (eq (process-exit-status process) 0)
|
|
||||||
(let* ((process-environment (browse-url-process-environment)))
|
|
||||||
;; Firefox is not running - start it
|
|
||||||
(message "Starting Firefox...")
|
|
||||||
(apply 'start-process (concat "firefox " url) nil
|
|
||||||
browse-url-firefox-program
|
|
||||||
(append browse-url-firefox-startup-arguments (list url))))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun browse-url-chromium (url &optional _new-window)
|
(defun browse-url-chromium (url &optional _new-window)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue