From d6da15ec7ba78a2c49f4fa4bc2de2d6aee379318 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Fri, 11 Oct 2002 17:17:10 +0000 Subject: [PATCH] * browse-url.el (browse-url-mozilla): Doc fix. * browse-url.el (browse-url-mozilla-new-window-is-tab): New. (browse-url-mozilla): Use it. --- lisp/ChangeLog | 9 +++++++++ lisp/net/browse-url.el | 36 ++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c362187e16..f2bf55ad6ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2002-10-10 Simon Josefsson + + * browse-url.el (browse-url-mozilla): Doc fix. + +2002-10-10 Steve Youngs + + * browse-url.el (browse-url-mozilla-new-window-is-tab): New. + (browse-url-mozilla): Use it. + 2002-10-11 Miles Bader * vc-cvs.el (vc-cvs-parse-entry): Don't barf when an `Entries' diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index cdda3ef98d7..8c2d4477df4 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -335,6 +335,13 @@ Defaults to the value of `browse-url-galeon-arguments' at the time :type '(repeat (string :tag "Argument")) :group 'browse-url) +(defcustom browse-url-mozilla-new-window-is-tab nil + "*Whether to open up new windows in a tab or a new window. +If non-nil, then open the URL in a new tab rather than a new window if +`browse-url-mozilla' is asked to open it in a new window." + :type 'boolean + :group 'browse-url) + (defcustom browse-url-galeon-new-window-is-tab nil "*Whether to open up new windows in a tab or a new window. If non-nil, then open the URL in a new tab rather than a new window if @@ -853,6 +860,10 @@ non-nil, load the document in a new Mozilla window, otherwise use a random existing one. A non-nil interactive prefix argument reverses the effect of `browse-url-new-window-flag'. +If `browse-url-mozilla-new-window-is-tab' is non-nil, then whenever a +document would otherwise be loaded in a new window, it is loaded in a +new tab in an existing window instead. + When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) @@ -862,16 +873,21 @@ used instead of `browse-url-new-window-flag'." (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) - (process (apply 'start-process - (concat "mozilla " url) nil - browse-url-mozilla-program - (append - browse-url-mozilla-arguments - (list "-remote" - (concat "openURL(" - url - (if new-window ",new-window") - ")")))))) + (process + (apply 'start-process + (concat "mozilla " url) nil + browse-url-mozilla-program + (append + browse-url-mozilla-arguments + (list "-remote" + (concat "openURL(" + url + (if (browse-url-maybe-new-window + new-window) + (if browse-url-mozilla-new-window-is-tab + ",new-tab") + ",new-window") + ")")))))) (set-process-sentinel process `(lambda (process change) (browse-url-mozilla-sentinel process ,url))))) -- 2.39.2