changeset 47844:d289d703471d

* browse-url.el (browse-url-mozilla): Doc fix. * browse-url.el (browse-url-mozilla-new-window-is-tab): New. (browse-url-mozilla): Use it.
author Simon Josefsson <jas@extundo.com>
date Fri, 11 Oct 2002 17:16:24 +0000
parents 5b72c640e8d7
children d29cf71f0e89
files lisp/net/browse-url.el
diffstat 1 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/browse-url.el	Fri Oct 11 09:45:24 2002 +0000
+++ b/lisp/net/browse-url.el	Fri Oct 11 17:16:24 2002 +0000
@@ -335,6 +335,13 @@
   :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 @@
 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 @@
     (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)))))