diff options
| author | Dave Love | 1999-01-06 14:57:58 +0000 |
|---|---|---|
| committer | Dave Love | 1999-01-06 14:57:58 +0000 |
| commit | e61d8515a54cc97035e37bb3887dbc9df0edb01c (patch) | |
| tree | a1ccf608e7e3240fcb8a6256927ee29779e7bcc2 | |
| parent | b8577971b7f5757ad5ec44fd50dc4a5c5e0b61c0 (diff) | |
| download | emacs-e61d8515a54cc97035e37bb3887dbc9df0edb01c.tar.gz emacs-e61d8515a54cc97035e37bb3887dbc9df0edb01c.zip | |
1999-01-06 Dave Love <fx@gnu.org>
* browse-url.el: Require (noerror) w3-auto when compiling.
(browse-url-maybe-new-window): Make it a macro and revert last
change to callers.
(browse-url-w3): Require w3 for w3-fetch-other-window.
1999-01-06 Markus Rost <markus.rost@mathematik.uni-regensburg.de>
* browse-url.el (browse-url-w3): Give w3-fetch-other-window the
argument.
| -rw-r--r-- | lisp/browse-url.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/browse-url.el b/lisp/browse-url.el index 86774d860cb..f7525b5a852 100644 --- a/lisp/browse-url.el +++ b/lisp/browse-url.el | |||
| @@ -222,7 +222,8 @@ | |||
| 222 | ;; Variables | 222 | ;; Variables |
| 223 | 223 | ||
| 224 | (eval-when-compile (require 'thingatpt) | 224 | (eval-when-compile (require 'thingatpt) |
| 225 | (require 'term)) | 225 | (require 'term) |
| 226 | (require 'w3-auto nil t)) | ||
| 226 | 227 | ||
| 227 | (defgroup browse-url nil | 228 | (defgroup browse-url nil |
| 228 | "Use a web browser to look at a URL." | 229 | "Use a web browser to look at a URL." |
| @@ -491,10 +492,12 @@ negation if a prefix argument was given." | |||
| 491 | (not (eq (null browse-url-new-window-p) | 492 | (not (eq (null browse-url-new-window-p) |
| 492 | (null current-prefix-arg))))) | 493 | (null current-prefix-arg))))) |
| 493 | 494 | ||
| 494 | (defun browse-url-maybe-new-window (arg interactive) | 495 | ;; interactive-p needs to be called at a function's top-level, hence |
| 495 | (if interactive | 496 | ;; the macro. |
| 496 | arg | 497 | (defmacro browse-url-maybe-new-window (arg) |
| 497 | browse-url-new-window-p)) | 498 | `(if (interactive-p) |
| 499 | 'arg | ||
| 500 | browse-url-new-window-p)) | ||
| 498 | 501 | ||
| 499 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 502 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 500 | ;; Browse current buffer | 503 | ;; Browse current buffer |
| @@ -713,7 +716,7 @@ used instead of `browse-url-new-window-p'." | |||
| 713 | (list "-remote" | 716 | (list "-remote" |
| 714 | (concat "openURL(" url | 717 | (concat "openURL(" url |
| 715 | (if (browse-url-maybe-new-window | 718 | (if (browse-url-maybe-new-window |
| 716 | new-window (interactive-p)) | 719 | new-window) |
| 717 | ",new-window") | 720 | ",new-window") |
| 718 | ")"))))))) | 721 | ")"))))))) |
| 719 | (set-process-sentinel process | 722 | (set-process-sentinel process |
| @@ -780,7 +783,7 @@ used instead of `browse-url-new-window-p'." | |||
| 780 | (save-excursion | 783 | (save-excursion |
| 781 | (find-file (format "/tmp/Mosaic.%d" pid)) | 784 | (find-file (format "/tmp/Mosaic.%d" pid)) |
| 782 | (erase-buffer) | 785 | (erase-buffer) |
| 783 | (insert (if (browse-url-maybe-new-window new-window (interactive-p)) | 786 | (insert (if (browse-url-maybe-new-window new-window) |
| 784 | "newwin\n" | 787 | "newwin\n" |
| 785 | "goto\n") | 788 | "goto\n") |
| 786 | url "\n") | 789 | url "\n") |
| @@ -847,8 +850,7 @@ used instead of `browse-url-new-window-p'." | |||
| 847 | ;; Todo: start browser if fails | 850 | ;; Todo: start browser if fails |
| 848 | (process-send-string "browse-url" | 851 | (process-send-string "browse-url" |
| 849 | (concat "get url (" url ") output " | 852 | (concat "get url (" url ") output " |
| 850 | (if (browse-url-maybe-new-window | 853 | (if (browse-url-maybe-new-window new-window) |
| 851 | new-window (interactive-p)) | ||
| 852 | "new" | 854 | "new" |
| 853 | "current") | 855 | "current") |
| 854 | "\r\n")) | 856 | "\r\n")) |
| @@ -880,8 +882,9 @@ prefix argument reverses the effect of `browse-url-new-window-p'. | |||
| 880 | When called non-interactively, optional second argument NEW-WINDOW is | 882 | When called non-interactively, optional second argument NEW-WINDOW is |
| 881 | used instead of `browse-url-new-window-p'." | 883 | used instead of `browse-url-new-window-p'." |
| 882 | (interactive (browse-url-interactive-arg "W3 URL: ")) | 884 | (interactive (browse-url-interactive-arg "W3 URL: ")) |
| 883 | (if (browse-url-maybe-new-window new-window (interactive-p)) | 885 | (require 'w3) ; w3-fetch-other-window not autoloaded |
| 884 | (w3-fetch-other-window) | 886 | (if (browse-url-maybe-new-window new-window) |
| 887 | (w3-fetch-other-window url) | ||
| 885 | (w3-fetch url))) | 888 | (w3-fetch url))) |
| 886 | 889 | ||
| 887 | ;;;###autoload | 890 | ;;;###autoload |
| @@ -929,13 +932,13 @@ used instead of `browse-url-new-window-p'." | |||
| 929 | (buf (get-buffer "*lynx*")) | 932 | (buf (get-buffer "*lynx*")) |
| 930 | (proc (and buf (get-buffer-process buf))) | 933 | (proc (and buf (get-buffer-process buf))) |
| 931 | (n browse-url-lynx-input-attempts)) | 934 | (n browse-url-lynx-input-attempts)) |
| 932 | (if (and (browse-url-maybe-new-window new-buffer (interactive-p)) buf) | 935 | (if (and (browse-url-maybe-new-window new-buffer) buf) |
| 933 | ;; Rename away the OLD buffer. This isn't very polite, but | 936 | ;; Rename away the OLD buffer. This isn't very polite, but |
| 934 | ;; term insists on working in a buffer named *lynx* and would | 937 | ;; term insists on working in a buffer named *lynx* and would |
| 935 | ;; choke on *lynx*<1> | 938 | ;; choke on *lynx*<1> |
| 936 | (progn (set-buffer buf) | 939 | (progn (set-buffer buf) |
| 937 | (rename-uniquely))) | 940 | (rename-uniquely))) |
| 938 | (if (or (browse-url-maybe-new-window new-buffer (interactive-p)) | 941 | (if (or (browse-url-maybe-new-window new-buffer) |
| 939 | (not buf) | 942 | (not buf) |
| 940 | (not proc) | 943 | (not proc) |
| 941 | (not (memq (process-status proc) '(run stop)))) | 944 | (not (memq (process-status proc) '(run stop)))) |
| @@ -1014,7 +1017,7 @@ used instead of `browse-url-new-window-p'." | |||
| 1014 | (let ((to (if (string-match "^mailto:" url) | 1017 | (let ((to (if (string-match "^mailto:" url) |
| 1015 | (substring url 7) | 1018 | (substring url 7) |
| 1016 | url))) | 1019 | url))) |
| 1017 | (if (browse-url-maybe-new-window new-window (interactive-p)) | 1020 | (if (browse-url-maybe-new-window new-window) |
| 1018 | (compose-mail-other-window to nil nil nil | 1021 | (compose-mail-other-window to nil nil nil |
| 1019 | (list 'insert-buffer (current-buffer))) | 1022 | (list 'insert-buffer (current-buffer))) |
| 1020 | (compose-mail to nil nil nil nil | 1023 | (compose-mail to nil nil nil nil |