(browse-url-new-window-flag): Renamed from

browse-url-new-window-p.
This commit is contained in:
Gerd Moellmann 2001-04-18 12:48:36 +00:00
parent daa66f34f7
commit 408d5219ee

View file

@ -1,6 +1,7 @@
;;; browse-url.el --- Pass a URL to a WWW browser ;;; browse-url.el --- Pass a URL to a WWW browser
;; Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. ;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001
;; Free Software Foundation, Inc.
;; Author: Denis Howe <dbh@doc.ic.ac.uk> ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
;; Maintainer: Dave Love <fx@gnu.org> ;; Maintainer: Dave Love <fx@gnu.org>
@ -297,7 +298,7 @@ Defaults to the value of `browse-url-netscape-arguments' at the time
:group 'browse-url) :group 'browse-url)
;;;###autoload ;;;###autoload
(defcustom browse-url-new-window-p nil (defcustom browse-url-new-window-flag nil
"*If non-nil, always open a new browser window with appropriate browsers. "*If non-nil, always open a new browser window with appropriate browsers.
Passing an interactive argument to \\[browse-url], or specific browser Passing an interactive argument to \\[browse-url], or specific browser
commands reverses the effect of this variable. Requires Netscape version commands reverses the effect of this variable. Requires Netscape version
@ -494,12 +495,12 @@ down (this *won't* always work)."
"Read a URL from the minibuffer, prompting with PROMPT. "Read a URL from the minibuffer, prompting with PROMPT.
Default to the URL at or before point. If invoked with a mouse button, Default to the URL at or before point. If invoked with a mouse button,
set point to the position clicked first. Return a list for use in set point to the position clicked first. Return a list for use in
`interactive' containing the URL and `browse-url-new-window-p' or its `interactive' containing the URL and `browse-url-new-window-flag' or its
negation if a prefix argument was given." negation if a prefix argument was given."
(let ((event (elt (this-command-keys) 0))) (let ((event (elt (this-command-keys) 0)))
(and (listp event) (mouse-set-point event))) (and (listp event) (mouse-set-point event)))
(list (read-string prompt (browse-url-url-at-point)) (list (read-string prompt (browse-url-url-at-point))
(not (eq (null browse-url-new-window-p) (not (eq (null browse-url-new-window-flag)
(null current-prefix-arg))))) (null current-prefix-arg)))))
;; interactive-p needs to be called at a function's top-level, hence ;; interactive-p needs to be called at a function's top-level, hence
@ -507,7 +508,7 @@ negation if a prefix argument was given."
(defmacro browse-url-maybe-new-window (arg) (defmacro browse-url-maybe-new-window (arg)
`(if (interactive-p) `(if (interactive-p)
,arg ,arg
browse-url-new-window-p)) browse-url-new-window-flag))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Browse current buffer ;; Browse current buffer
@ -610,7 +611,7 @@ Prompts for a URL, defaulting to the URL at or before point. Variable
`browse-url-browser-function' says which browser to use." `browse-url-browser-function' says which browser to use."
(interactive (browse-url-interactive-arg "URL: ")) (interactive (browse-url-interactive-arg "URL: "))
(unless (interactive-p) (unless (interactive-p)
(setq args (or args (list browse-url-new-window-p)))) (setq args (or args (list browse-url-new-window-flag))))
(if (functionp browse-url-browser-function) (if (functionp browse-url-browser-function)
(apply browse-url-browser-function url args) (apply browse-url-browser-function url args)
;; The `function' can be an alist; look down it for first match ;; The `function' can be an alist; look down it for first match
@ -632,8 +633,8 @@ Doesn't let you edit the URL like `browse-url'. Variable
(let ((url (browse-url-url-at-point))) (let ((url (browse-url-url-at-point)))
(if url (if url
(browse-url url (if arg (browse-url url (if arg
(not browse-url-new-window-p) (not browse-url-new-window-flag)
browse-url-new-window-p)) browse-url-new-window-flag))
(error "No URL found")))) (error "No URL found"))))
;;;###autoload ;;;###autoload
@ -646,7 +647,7 @@ to use."
(interactive "e") (interactive "e")
(save-excursion (save-excursion
(mouse-set-point event) (mouse-set-point event)
(browse-url-at-point browse-url-new-window-p))) (browse-url-at-point browse-url-new-window-flag)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Browser-specific commands ;; Browser-specific commands
@ -685,13 +686,13 @@ one showing the selected frame."
Default to the URL around or before point. The strings in variable Default to the URL around or before point. The strings in variable
`browse-url-netscape-arguments' are also passed to Netscape. `browse-url-netscape-arguments' are also passed to Netscape.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new Netscape window, otherwise use a non-nil, load the document in a new Netscape window, otherwise use a
random existing one. A non-nil interactive prefix argument reverses random existing one. A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-p'. the effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "URL: ")) (interactive (browse-url-interactive-arg "URL: "))
;; URL encode any `confusing' characters in the URL. This needs to ;; URL encode any `confusing' characters in the URL. This needs to
;; include at least commas; presumably also close parens. ;; include at least commas; presumably also close parens.
@ -760,13 +761,13 @@ How depends on `browse-url-netscape-version'."
Default to the URL around or before point. The strings in variable Default to the URL around or before point. The strings in variable
`browse-url-gnome-moz-arguments' are also passed. `browse-url-gnome-moz-arguments' are also passed.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new browser window, otherwise use an non-nil, load the document in a new browser window, otherwise use an
existing one. A non-nil interactive prefix argument reverses the existing one. A non-nil interactive prefix argument reverses the
effect of `browse-url-new-window-p'. effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "URL: ")) (interactive (browse-url-interactive-arg "URL: "))
(apply 'start-process (concat "gnome-moz-remote " url) (apply 'start-process (concat "gnome-moz-remote " url)
nil nil
@ -788,13 +789,13 @@ Default to the URL around or before point. The strings in variable
program is invoked according to the variable program is invoked according to the variable
`browse-url-mosaic-program'. `browse-url-mosaic-program'.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new Mosaic window, otherwise use a non-nil, load the document in a new Mosaic window, otherwise use a
random existing one. A non-nil interactive prefix argument reverses random existing one. A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-p'. the effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "Mosaic URL: ")) (interactive (browse-url-interactive-arg "Mosaic URL: "))
(let ((pidfile (expand-file-name "~/.mosaicpid")) (let ((pidfile (expand-file-name "~/.mosaicpid"))
pid) pid)
@ -862,13 +863,13 @@ This function only works for XMosaic version 2.5 or later. You must
select `CCI' from XMosaic's File menu, set the CCI Port Address to the select `CCI' from XMosaic's File menu, set the CCI Port Address to the
value of variable `browse-url-CCI-port', and enable `Accept requests'. value of variable `browse-url-CCI-port', and enable `Accept requests'.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new browser window, otherwise use a non-nil, load the document in a new browser window, otherwise use a
random existing one. A non-nil interactive prefix argument reverses random existing one. A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-p'. the effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "Mosaic URL: ")) (interactive (browse-url-interactive-arg "Mosaic URL: "))
(open-network-stream "browse-url" " *browse-url*" (open-network-stream "browse-url" " *browse-url*"
browse-url-CCI-host browse-url-CCI-port) browse-url-CCI-host browse-url-CCI-port)
@ -900,12 +901,12 @@ Default to the URL around or before point."
"Ask the w3 WWW browser to load URL. "Ask the w3 WWW browser to load URL.
Default to the URL around or before point. Default to the URL around or before point.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new window. A non-nil interactive non-nil, load the document in a new window. A non-nil interactive
prefix argument reverses the effect of `browse-url-new-window-p'. prefix argument reverses the effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "W3 URL: ")) (interactive (browse-url-interactive-arg "W3 URL: "))
(require 'w3) ; w3-fetch-other-window not autoloaded (require 'w3) ; w3-fetch-other-window not autoloaded
(if (browse-url-maybe-new-window new-window) (if (browse-url-maybe-new-window new-window)
@ -947,13 +948,13 @@ with possible additional arguments `browse-url-xterm-args'."
Default to the URL around or before point. With a prefix argument, run Default to the URL around or before point. With a prefix argument, run
a new Lynx process in a new buffer. a new Lynx process in a new buffer.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new lynx in a new term window, non-nil, load the document in a new lynx in a new term window,
otherwise use any existing one. A non-nil interactive prefix argument otherwise use any existing one. A non-nil interactive prefix argument
reverses the effect of `browse-url-new-window-p'. reverses the effect of `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "Lynx URL: ")) (interactive (browse-url-interactive-arg "Lynx URL: "))
(let* ((system-uses-terminfo t) ; Lynx uses terminfo (let* ((system-uses-terminfo t) ; Lynx uses terminfo
;; (term-term-name "vt100") ; ?? ;; (term-term-name "vt100") ; ??
@ -1034,13 +1035,13 @@ recipient's address. Supplying a non-nil interactive prefix argument
will cause the mail to be composed in another window rather than the will cause the mail to be composed in another window rather than the
current one. current one.
When called interactively, if variable `browse-url-new-window-p' is When called interactively, if variable `browse-url-new-window-flag' is
non-nil use `compose-mail-other-window', otherwise `compose-mail'. A non-nil use `compose-mail-other-window', otherwise `compose-mail'. A
non-nil interactive prefix argument reverses the effect of non-nil interactive prefix argument reverses the effect of
`browse-url-new-window-p'. `browse-url-new-window-flag'.
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-flag'."
(interactive (browse-url-interactive-arg "Mailto URL: ")) (interactive (browse-url-interactive-arg "Mailto URL: "))
(save-excursion (save-excursion
(let ((to (if (string-match "^mailto:" url) (let ((to (if (string-match "^mailto:" url)