]> code.delx.au - gnu-emacs/commitdiff
(browse-url-netscape-new-window-is-tab): New variable.
authorSimon Josefsson <jas@extundo.com>
Tue, 22 Feb 2005 14:11:48 +0000 (14:11 +0000)
committerSimon Josefsson <jas@extundo.com>
Tue, 22 Feb 2005 14:11:48 +0000 (14:11 +0000)
(browse-url-netscape): Use it.  Suggested by "Johann 'Myrkraverk'
Oskarsson" <myrkraverk@users.sourceforget.net>.

lisp/ChangeLog
lisp/net/browse-url.el

index c57b405388f0677e6beebe95a5d7d1993ff884da..26d9f63f2db2fc3444e585ae5490e0f0bcd2552b 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-22  Simon Josefsson  <jas@extundo.com>
+
+       * net/browse-url.el (browse-url-netscape-new-window-is-tab): New
+       variable.
+       (browse-url-netscape): Use it.  Suggested by "Johann 'Myrkraverk'
+       Oskarsson" <myrkraverk@users.sourceforget.net>.
+
 2005-02-22  Kim F. Storm  <storm@cua.dk>
 
        * mouse.el (mouse-on-link-p): If arg POS is a mouse event,
index 6e679876eef805a450463d90a9b119238c389d5f..78c8e976269e69776a3d1b04927147f82993c412 100644 (file)
@@ -1,6 +1,6 @@
 ;;; browse-url.el --- pass a URL to a WWW browser
 
-;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004
+;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004, 2005
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
@@ -387,6 +387,14 @@ If non-nil, then open the URL in a new tab rather than a new window if
   :type 'boolean
   :group 'browse-url)
 
+(defcustom browse-url-netscape-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-netscape' is asked to open it in a new
+window."
+  :type 'boolean
+  :group 'browse-url)
+
 (defcustom browse-url-new-window-flag nil
   "*If non-nil, always open a new browser window with appropriate browsers.
 Passing an interactive argument to \\[browse-url], or specific browser
@@ -834,6 +842,10 @@ non-nil, load the document in a new Netscape 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-netscape-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: "))
@@ -843,21 +855,24 @@ 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 "netscape " url) nil
-                        browse-url-netscape-program
-                        (append
-                         browse-url-netscape-arguments
-                         (if (eq window-system 'w32)
-                             (list url)
-                           (append
-                            (if new-window '("-noraise"))
-                            (list "-remote"
-                                  (concat "openURL(" url
-                                          (if (browse-url-maybe-new-window
-                                               new-window)
-                                              ",new-window")
-                                          ")"))))))))
+        (process
+         (apply 'start-process
+                (concat "netscape " url) nil
+                browse-url-netscape-program
+                (append
+                 browse-url-netscape-arguments
+                 (if (eq window-system 'w32)
+                     (list url)
+                   (append
+                    (if new-window '("-noraise"))
+                    (list "-remote"
+                          (concat "openURL(" url
+                                  (if (browse-url-maybe-new-window
+                                       new-window)
+                                      (if browse-url-netscape-new-window-is-tab
+                                          ",new-tab"
+                                        ",new-window"))
+                                  ")"))))))))
     (set-process-sentinel process
                          `(lambda (process change)
                             (browse-url-netscape-sentinel process ,url)))))