1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix for browse-url-firefox on Windows.

* lisp/net/browse-url.el (browse-url-firefox): Don't call
browse-url-firefox-sentinel unless using -remote.

Fixes: debbugs:9328
This commit is contained in:
Chong Yidong 2011-08-20 21:01:12 -04:00
parent c21a496aed
commit a3f2468a08
2 changed files with 25 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2011-08-21 Chong Yidong <cyd@stupidchicken.com>
* net/browse-url.el (browse-url-firefox): Don't call
browse-url-firefox-sentinel unless using -remote (Bug#9328).
2011-08-20 Glenn Morris <rgm@gnu.org>
* tutorial.el (help-with-tutorial): Avoid an error on short screens.

View file

@ -1103,26 +1103,32 @@ URL in a new window."
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(let* ((process-environment (browse-url-process-environment))
(use-remote
(not (memq system-type '(windows-nt ms-dos))))
(process
(apply 'start-process
(concat "firefox " url) nil
browse-url-firefox-program
(append
browse-url-firefox-arguments
(if (memq system-type '(windows-nt ms-dos))
(list url)
(list "-remote"
(concat "openURL("
url
(if (browse-url-maybe-new-window
new-window)
(if browse-url-firefox-new-window-is-tab
",new-tab"
",new-window"))
")")))))))
(set-process-sentinel process
`(lambda (process change)
(browse-url-firefox-sentinel process ,url)))))
(if use-remote
(list "-remote"
(concat
"openURL("
url
(if (browse-url-maybe-new-window new-window)
(if browse-url-firefox-new-window-is-tab
",new-tab"
",new-window"))
")"))
(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."