| @@ -1,29 +1,110 @@ | | | @@ -1,29 +1,110 @@ |
1 | $NetBSD: patch-lisp_net_browse-url.el,v 1.1 2015/02/23 14:03:25 ryoon Exp $ | | 1 | $NetBSD: patch-lisp_net_browse-url.el,v 1.2 2015/03/03 13:47:14 ryoon Exp $ |
2 | | | 2 | |
3 | * Support firefox 36.0 or later. | | 3 | * Support firefox 36.0 or later. |
4 | https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19921 | | 4 | https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19921 |
5 | | | 5 | |
6 | --- lisp/net/browse-url.el.orig 2015-02-22 06:52:03.000000000 +0000 | | 6 | --- lisp/net/browse-url.el.orig 2014-05-14 02:59:18.000000000 +0000 |
7 | +++ lisp/net/browse-url.el | | 7 | +++ lisp/net/browse-url.el |
8 | @@ -1137,15 +1137,12 @@ URL in a new window." | | 8 | @@ -337,6 +337,9 @@ Defaults to the value of `browse-url-fir |
9 | (append | | 9 | :type '(repeat (string :tag "Argument")) |
10 | browse-url-firefox-arguments | | 10 | :group 'browse-url) |
11 | (if use-remote | | 11 | |
| | | 12 | +(make-obsolete-variable 'browse-url-firefox-startup-arguments |
| | | 13 | + "it no longer has any effect." "24.5") |
| | | 14 | + |
| | | 15 | (defcustom browse-url-chromium-program |
| | | 16 | (let ((candidates '("chromium" "chromium-browser"))) |
| | | 17 | (while (and candidates (not (executable-find (car candidates)))) |
| | | 18 | @@ -1102,68 +1105,39 @@ used instead of `browse-url-new-window-f |
| | | 19 | ;;;###autoload |
| | | 20 | (defun browse-url-firefox (url &optional new-window) |
| | | 21 | "Ask the Firefox WWW browser to load URL. |
| | | 22 | -Default to the URL around or before point. The strings in |
| | | 23 | -variable `browse-url-firefox-arguments' are also passed to |
| | | 24 | -Firefox. |
| | | 25 | +Defaults to the URL around or before point. Passes the strings |
| | | 26 | +in the variable `browse-url-firefox-arguments' to Firefox. |
| | | 27 | |
| | | 28 | -When called interactively, if variable |
| | | 29 | -`browse-url-new-window-flag' is non-nil, load the document in a |
| | | 30 | -new Firefox window, otherwise use a random existing one. A |
| | | 31 | -non-nil interactive prefix argument reverses the effect of |
| | | 32 | -`browse-url-new-window-flag'. |
| | | 33 | +Interactively, if the variable `browse-url-new-window-flag' is non-nil, |
| | | 34 | +loads the document in a new Firefox window. A non-nil prefix argument |
| | | 35 | +reverses the effect of `browse-url-new-window-flag'. |
| | | 36 | |
| | | 37 | If `browse-url-firefox-new-window-is-tab' is non-nil, then |
| | | 38 | whenever a document would otherwise be loaded in a new window, it |
| | | 39 | is loaded in a new tab in an existing window instead. |
| | | 40 | |
| | | 41 | -When called non-interactively, optional second argument |
| | | 42 | -NEW-WINDOW is used instead of `browse-url-new-window-flag'. |
| | | 43 | +Non-interactively, this uses the optional second argument NEW-WINDOW |
| | | 44 | +instead of `browse-url-new-window-flag'. |
| | | 45 | |
| | | 46 | -On MS-Windows systems the optional `new-window' parameter is |
| | | 47 | -ignored. Firefox for Windows does not support the \"-remote\" |
| | | 48 | -command line parameter. Therefore, the |
| | | 49 | -`browse-url-new-window-flag' and `browse-url-firefox-new-window-is-tab' |
| | | 50 | -are ignored as well. Firefox on Windows will always open the requested |
| | | 51 | -URL in a new window." |
| | | 52 | +On MS Windows, this ignores `browse-url-new-window-flag' and |
| | | 53 | +`browse-url-firefox-new-window-is-tab', as well as the NEW-WINDOW argument. |
| | | 54 | +It always uses a new window." |
| | | 55 | (interactive (browse-url-interactive-arg "URL: ")) |
| | | 56 | (setq url (browse-url-encode-url url)) |
| | | 57 | - (let* ((process-environment (browse-url-process-environment)) |
| | | 58 | - (use-remote |
| | | 59 | - (not (memq system-type '(windows-nt ms-dos)))) |
| | | 60 | - (process |
| | | 61 | - (apply 'start-process |
| | | 62 | - (concat "firefox " url) nil |
| | | 63 | - browse-url-firefox-program |
| | | 64 | - (append |
| | | 65 | - browse-url-firefox-arguments |
| | | 66 | - (if use-remote |
12 | - (list "-remote" | | 67 | - (list "-remote" |
13 | - (concat | | 68 | - (concat |
14 | - "openURL(" | | 69 | - "openURL(" |
15 | - url | | 70 | - url |
16 | - (if (browse-url-maybe-new-window new-window) | | 71 | - (if (browse-url-maybe-new-window new-window) |
17 | - (if browse-url-firefox-new-window-is-tab | | 72 | - (if browse-url-firefox-new-window-is-tab |
18 | - ",new-tab" | | 73 | - ",new-tab" |
19 | - ",new-window")) | | 74 | - ",new-window")) |
20 | - ")")) | | 75 | - ")")) |
21 | + (list | | 76 | - (list url)))))) |
22 | + (if (browse-url-maybe-new-window new-window) | | 77 | - ;; If we use -remote, the process exits with status code 2 if |
23 | + (if browse-url-firefox-new-window-is-tab | | 78 | - ;; Firefox is not already running. The sentinel runs firefox |
24 | + "--new-tab" | | 79 | - ;; directly if that happens. |
25 | + "--new-window")) | | 80 | - (when use-remote |
26 | + url) | | 81 | - (set-process-sentinel process |
27 | (list url)))))) | | 82 | - `(lambda (process change) |
28 | ;; If we use -remote, the process exits with status code 2 if | | 83 | - (browse-url-firefox-sentinel process ,url)))))) |
29 | ;; Firefox is not already running. The sentinel runs firefox | | 84 | - |
| | | 85 | -(defun browse-url-firefox-sentinel (process url) |
| | | 86 | - "Handle a change to the process communicating with Firefox." |
| | | 87 | - (or (eq (process-exit-status process) 0) |
| | | 88 | - (let* ((process-environment (browse-url-process-environment))) |
| | | 89 | - ;; Firefox is not running - start it |
| | | 90 | - (message "Starting Firefox...") |
| | | 91 | - (apply 'start-process (concat "firefox " url) nil |
| | | 92 | - browse-url-firefox-program |
| | | 93 | - (append browse-url-firefox-startup-arguments (list url)))))) |
| | | 94 | + (let* ((process-environment (browse-url-process-environment))) |
| | | 95 | + (apply 'start-process |
| | | 96 | + (concat "firefox " url) nil |
| | | 97 | + browse-url-firefox-program |
| | | 98 | + (append |
| | | 99 | + browse-url-firefox-arguments |
| | | 100 | + ;; FIXME someone should check if this limitation |
| | | 101 | + ;; still applies. |
| | | 102 | + (unless (memq system-type '(windows-nt ms-dos)) |
| | | 103 | + (if (browse-url-maybe-new-window new-window) |
| | | 104 | + (if browse-url-firefox-new-window-is-tab |
| | | 105 | + '("-new-tab") |
| | | 106 | + '("-new-window")))) |
| | | 107 | + (list url))))) |
| | | 108 | |
| | | 109 | ;;;###autoload |
| | | 110 | (defun browse-url-chromium (url &optional _new-window) |