mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-18 20:00:36 -08:00
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.
This commit is contained in:
parent
b8577971b7
commit
e61d8515a5
1 changed files with 17 additions and 14 deletions
|
|
@ -222,7 +222,8 @@
|
||||||
;; Variables
|
;; Variables
|
||||||
|
|
||||||
(eval-when-compile (require 'thingatpt)
|
(eval-when-compile (require 'thingatpt)
|
||||||
(require 'term))
|
(require 'term)
|
||||||
|
(require 'w3-auto nil t))
|
||||||
|
|
||||||
(defgroup browse-url nil
|
(defgroup browse-url nil
|
||||||
"Use a web browser to look at a URL."
|
"Use a web browser to look at a URL."
|
||||||
|
|
@ -491,10 +492,12 @@ negation if a prefix argument was given."
|
||||||
(not (eq (null browse-url-new-window-p)
|
(not (eq (null browse-url-new-window-p)
|
||||||
(null current-prefix-arg)))))
|
(null current-prefix-arg)))))
|
||||||
|
|
||||||
(defun browse-url-maybe-new-window (arg interactive)
|
;; interactive-p needs to be called at a function's top-level, hence
|
||||||
(if interactive
|
;; the macro.
|
||||||
arg
|
(defmacro browse-url-maybe-new-window (arg)
|
||||||
browse-url-new-window-p))
|
`(if (interactive-p)
|
||||||
|
'arg
|
||||||
|
browse-url-new-window-p))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Browse current buffer
|
;; Browse current buffer
|
||||||
|
|
@ -713,7 +716,7 @@ used instead of `browse-url-new-window-p'."
|
||||||
(list "-remote"
|
(list "-remote"
|
||||||
(concat "openURL(" url
|
(concat "openURL(" url
|
||||||
(if (browse-url-maybe-new-window
|
(if (browse-url-maybe-new-window
|
||||||
new-window (interactive-p))
|
new-window)
|
||||||
",new-window")
|
",new-window")
|
||||||
")")))))))
|
")")))))))
|
||||||
(set-process-sentinel process
|
(set-process-sentinel process
|
||||||
|
|
@ -780,7 +783,7 @@ used instead of `browse-url-new-window-p'."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(find-file (format "/tmp/Mosaic.%d" pid))
|
(find-file (format "/tmp/Mosaic.%d" pid))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(insert (if (browse-url-maybe-new-window new-window (interactive-p))
|
(insert (if (browse-url-maybe-new-window new-window)
|
||||||
"newwin\n"
|
"newwin\n"
|
||||||
"goto\n")
|
"goto\n")
|
||||||
url "\n")
|
url "\n")
|
||||||
|
|
@ -847,8 +850,7 @@ used instead of `browse-url-new-window-p'."
|
||||||
;; Todo: start browser if fails
|
;; Todo: start browser if fails
|
||||||
(process-send-string "browse-url"
|
(process-send-string "browse-url"
|
||||||
(concat "get url (" url ") output "
|
(concat "get url (" url ") output "
|
||||||
(if (browse-url-maybe-new-window
|
(if (browse-url-maybe-new-window new-window)
|
||||||
new-window (interactive-p))
|
|
||||||
"new"
|
"new"
|
||||||
"current")
|
"current")
|
||||||
"\r\n"))
|
"\r\n"))
|
||||||
|
|
@ -880,8 +882,9 @@ prefix argument reverses the effect of `browse-url-new-window-p'.
|
||||||
When called non-interactively, optional second argument NEW-WINDOW is
|
When called non-interactively, optional second argument NEW-WINDOW is
|
||||||
used instead of `browse-url-new-window-p'."
|
used instead of `browse-url-new-window-p'."
|
||||||
(interactive (browse-url-interactive-arg "W3 URL: "))
|
(interactive (browse-url-interactive-arg "W3 URL: "))
|
||||||
(if (browse-url-maybe-new-window new-window (interactive-p))
|
(require 'w3) ; w3-fetch-other-window not autoloaded
|
||||||
(w3-fetch-other-window)
|
(if (browse-url-maybe-new-window new-window)
|
||||||
|
(w3-fetch-other-window url)
|
||||||
(w3-fetch url)))
|
(w3-fetch url)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
@ -929,13 +932,13 @@ used instead of `browse-url-new-window-p'."
|
||||||
(buf (get-buffer "*lynx*"))
|
(buf (get-buffer "*lynx*"))
|
||||||
(proc (and buf (get-buffer-process buf)))
|
(proc (and buf (get-buffer-process buf)))
|
||||||
(n browse-url-lynx-input-attempts))
|
(n browse-url-lynx-input-attempts))
|
||||||
(if (and (browse-url-maybe-new-window new-buffer (interactive-p)) buf)
|
(if (and (browse-url-maybe-new-window new-buffer) buf)
|
||||||
;; Rename away the OLD buffer. This isn't very polite, but
|
;; Rename away the OLD buffer. This isn't very polite, but
|
||||||
;; term insists on working in a buffer named *lynx* and would
|
;; term insists on working in a buffer named *lynx* and would
|
||||||
;; choke on *lynx*<1>
|
;; choke on *lynx*<1>
|
||||||
(progn (set-buffer buf)
|
(progn (set-buffer buf)
|
||||||
(rename-uniquely)))
|
(rename-uniquely)))
|
||||||
(if (or (browse-url-maybe-new-window new-buffer (interactive-p))
|
(if (or (browse-url-maybe-new-window new-buffer)
|
||||||
(not buf)
|
(not buf)
|
||||||
(not proc)
|
(not proc)
|
||||||
(not (memq (process-status proc) '(run stop))))
|
(not (memq (process-status proc) '(run stop))))
|
||||||
|
|
@ -1014,7 +1017,7 @@ used instead of `browse-url-new-window-p'."
|
||||||
(let ((to (if (string-match "^mailto:" url)
|
(let ((to (if (string-match "^mailto:" url)
|
||||||
(substring url 7)
|
(substring url 7)
|
||||||
url)))
|
url)))
|
||||||
(if (browse-url-maybe-new-window new-window (interactive-p))
|
(if (browse-url-maybe-new-window new-window)
|
||||||
(compose-mail-other-window to nil nil nil
|
(compose-mail-other-window to nil nil nil
|
||||||
(list 'insert-buffer (current-buffer)))
|
(list 'insert-buffer (current-buffer)))
|
||||||
(compose-mail to nil nil nil nil
|
(compose-mail to nil nil nil nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue