changeset 32245:d35dba8183fd

(browse-url-gnome-moz-arguments): New option. (browse-url-gnome-moz): New function. Suggested by Colin Walters <walters@cis.ohio-state.edu>.
author Dave Love <fx@gnu.org>
date Sat, 07 Oct 2000 17:58:33 +0000
parents 21f9c710e2df
children 851690316add
files lisp/net/browse-url.el
diffstat 1 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/browse-url.el	Sat Oct 07 12:00:26 2000 +0000
+++ b/lisp/net/browse-url.el	Sat Oct 07 17:58:33 2000 +0000
@@ -678,7 +678,6 @@
 ;;;###autoload
 (defun browse-url-netscape (url &optional new-window)
   "Ask the Netscape WWW browser to load URL.
-
 Default to the URL around or before point.  The strings in variable
 `browse-url-netscape-arguments' are also passed to Netscape.
 
@@ -689,7 +688,7 @@
 
 When called non-interactively, optional second argument NEW-WINDOW is
 used instead of `browse-url-new-window-p'."
-  (interactive (browse-url-interactive-arg "Netscape URL: "))
+  (interactive (browse-url-interactive-arg "URL: "))
   ;; URL encode any `confusing' characters in the URL.  This needs to
   ;; include at least commas; presumably also close parens.
   (while (string-match "[,)]" url)
@@ -743,6 +742,36 @@
            (append browse-url-netscape-arguments
                    (list "-remote" command)))))
 
+;; GNOME means of invoking either Mozilla or Netrape.
+
+(defcustom browse-url-gnome-moz-arguments '()
+  "A list of strings passed to the GNOME mozilla viewer as arguments."
+  :version "21.1"
+  :type '(repeat (string :tag "Argument"))
+  :group 'browse-url)
+
+(defun browse-url-gnome-moz (url &optional new-window)
+  "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'.
+Default to the URL around or before point.  The strings in variable
+`browse-url-gnome-moz-arguments' are also passed.
+
+When called interactively, if variable `browse-url-new-window-p' is
+non-nil, load the document in a new browser window, otherwise use an
+existing one.  A non-nil interactive prefix argument reverses the
+effect of `browse-url-new-window-p'.
+
+When called non-interactively, optional second argument NEW-WINDOW is
+used instead of `browse-url-new-window-p'."
+  (interactive (browse-url-interactive-arg "URL: "))  
+  (apply 'start-process (concat "gnome-moz-remote " url)
+	 nil
+	 "gnome-moz-remote"
+	 (append
+	  browse-url-gnome-moz-arguments
+	  (if (browse-url-maybe-new-window new-window)
+	    '("--newwin"))
+	  (list "--raise" url))))
+
 ;; --- Mosaic ---
 
 ;;;###autoload