diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-08-20 21:01:12 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-08-20 21:01:12 -0400 |
commit | a3f2468a08e81b44491322c275f94c8c7d87c6db (patch) | |
tree | 42e7bbf9f2b542b4ee800195df7be77bb488ea06 /lisp/net/browse-url.el | |
parent | c21a496aed7c1b0a40312197ca4ccb7376e2d96f (diff) | |
download | emacs-a3f2468a08e81b44491322c275f94c8c7d87c6db.tar.gz |
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
Diffstat (limited to 'lisp/net/browse-url.el')
-rw-r--r-- | lisp/net/browse-url.el | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index e18b42a275f..f9bc13e1e25 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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." |