diff options
| author | Chong Yidong | 2011-08-20 21:01:12 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-08-20 21:01:12 -0400 |
| commit | a3f2468a08e81b44491322c275f94c8c7d87c6db (patch) | |
| tree | 42e7bbf9f2b542b4ee800195df7be77bb488ea06 /lisp | |
| parent | c21a496aed7c1b0a40312197ca4ccb7376e2d96f (diff) | |
| download | emacs-a3f2468a08e81b44491322c275f94c8c7d87c6db.tar.gz emacs-a3f2468a08e81b44491322c275f94c8c7d87c6db.zip | |
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')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 34 |
2 files changed, 25 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c655c4968df..06dd2bf1198 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-08-21 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * net/browse-url.el (browse-url-firefox): Don't call | ||
| 4 | browse-url-firefox-sentinel unless using -remote (Bug#9328). | ||
| 5 | |||
| 1 | 2011-08-20 Glenn Morris <rgm@gnu.org> | 6 | 2011-08-20 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * tutorial.el (help-with-tutorial): Avoid an error on short screens. | 8 | * tutorial.el (help-with-tutorial): Avoid an error on short screens. |
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." | |||
| 1103 | (interactive (browse-url-interactive-arg "URL: ")) | 1103 | (interactive (browse-url-interactive-arg "URL: ")) |
| 1104 | (setq url (browse-url-encode-url url)) | 1104 | (setq url (browse-url-encode-url url)) |
| 1105 | (let* ((process-environment (browse-url-process-environment)) | 1105 | (let* ((process-environment (browse-url-process-environment)) |
| 1106 | (use-remote | ||
| 1107 | (not (memq system-type '(windows-nt ms-dos)))) | ||
| 1106 | (process | 1108 | (process |
| 1107 | (apply 'start-process | 1109 | (apply 'start-process |
| 1108 | (concat "firefox " url) nil | 1110 | (concat "firefox " url) nil |
| 1109 | browse-url-firefox-program | 1111 | browse-url-firefox-program |
| 1110 | (append | 1112 | (append |
| 1111 | browse-url-firefox-arguments | 1113 | browse-url-firefox-arguments |
| 1112 | (if (memq system-type '(windows-nt ms-dos)) | 1114 | (if use-remote |
| 1113 | (list url) | 1115 | (list "-remote" |
| 1114 | (list "-remote" | 1116 | (concat |
| 1115 | (concat "openURL(" | 1117 | "openURL(" |
| 1116 | url | 1118 | url |
| 1117 | (if (browse-url-maybe-new-window | 1119 | (if (browse-url-maybe-new-window new-window) |
| 1118 | new-window) | 1120 | (if browse-url-firefox-new-window-is-tab |
| 1119 | (if browse-url-firefox-new-window-is-tab | 1121 | ",new-tab" |
| 1120 | ",new-tab" | 1122 | ",new-window")) |
| 1121 | ",new-window")) | 1123 | ")")) |
| 1122 | ")"))))))) | 1124 | (list url)))))) |
| 1123 | (set-process-sentinel process | 1125 | ;; If we use -remote, the process exits with status code 2 if |
| 1124 | `(lambda (process change) | 1126 | ;; Firefox is not already running. The sentinel runs firefox |
| 1125 | (browse-url-firefox-sentinel process ,url))))) | 1127 | ;; directly if that happens. |
| 1128 | (when use-remote | ||
| 1129 | (set-process-sentinel process | ||
| 1130 | `(lambda (process change) | ||
| 1131 | (browse-url-firefox-sentinel process ,url)))))) | ||
| 1126 | 1132 | ||
| 1127 | (defun browse-url-firefox-sentinel (process url) | 1133 | (defun browse-url-firefox-sentinel (process url) |
| 1128 | "Handle a change to the process communicating with Firefox." | 1134 | "Handle a change to the process communicating with Firefox." |