[ I think this was lost in the great ML crash of '06 ]
You know what they say... A Mozilla by any other name is still a
SeaMonkey.
This adds SeaMonkey to the available browser choices in browse-url.
Tested here, works fine.
mail-lib patch:
ChangeLog files diff command: cvs -q diff -U 0
Files affected: ChangeLog
Source files diff command: cvs -q diff -uN
Files affected: browse-url.el
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/mail-lib/ChangeLog,v
retrieving revision 1.169
diff -u -p -U0 -r1.169 ChangeLog
--- ChangeLog 17 Jul 2006 05:25:56 -0000 1.169
+++ ChangeLog 18 Oct 2006 00:25:13 -0000
@@ -0,0 +1,15 @@
+2006-09-12 Steve Youngs <steve(a)sxemacs.org>
+
+ * browse-url.el (browse-url-browser-function): Add item for
+ SeaMonkey.
+ (browse-url-seamonkey-program): New.
+ (browse-url-seamonkey-arguments): New.
+ (browse-url-seamonkey-startup-arguments): New.
+ (browse-url-seamonkey-new-window-is-tab): New.
+ (browse-url-default-browser): Add SeaMonkey.
+ (browse-url-seamonkey): New.
+ (browse-url-seamonkey-sentinel): New.
+
+ This adds SeaMonkey to the available browser choices in
+ browse-url.
+
Index: browse-url.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/mail-lib/browse-url.el,v
retrieving revision 1.36
diff -u -p -u -r1.36 browse-url.el
--- browse-url.el 9 Mar 2005 11:14:56 -0000 1.36
+++ browse-url.el 18 Oct 2006 00:25:04 -0000
@@ -39,6 +39,7 @@
;; some of them probably now obsolete:
;; Function Browser Earliest version
+;; browse-url-seamonkey SeaMonkey 1st tried with 1.0.4
;; browse-url-mozilla Mozilla Don't know
;; browse-url-firefox Firefox Don't know (1st tried with 1.0.1)
;; browse-url-galeon Galeon Don't know
@@ -266,6 +267,7 @@ regexp should probably be \".\" to speci
(function-item :tag "Emacs W3M" :value browse-url-w3)
(function-item :tag "W3M in another Emacs via `gnudoit'"
:value browse-url-w3-gnudoit)
+ (function-item :tag "SeaMonkey" :value browse-url-seamonkey)
(function-item :tag "Mozilla" :value browse-url-mozilla)
(function-item :tag "Firefox" :value browse-url-firefox)
(function-item :tag "Galeon" :value browse-url-galeon)
@@ -332,6 +334,24 @@ Defaults to the value of `browse-url-net
:group 'browse-url)
;;;###autoload
+(defcustom browse-url-seamonkey-program "seamonkey"
+ "*The name by which to invoke SeaMonkey."
+:type 'string
+:group 'browse-url)
+
+(defcustom browse-url-seamonkey-arguments nil
+ "*A list of strings to pass to SeaMonkey as arguments."
+:type '(repeat (string :tag "Argument"))
+:group 'browse-url)
+
+(defcustom browse-url-seamonkey-startup-arguments browse-url-seamonkey-arguments
+ "*A list of strings to pass to SeaMonkey when it starts up.
+Defaults to the value of `browse-url-seamonkey-arguments' at the time
+`browse-url' is loaded."
+:type '(repeat (string :tag "Argument"))
+:group 'browse-url)
+
+;;;###autoload
(defcustom browse-url-mozilla-program "mozilla"
"*The name by which to invoke Mozilla."
:type 'string
@@ -402,6 +422,13 @@ Defaults to the value of `browse-url-epi
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
+(defcustom browse-url-seamonkey-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-seamonkey' is asked to open it in a new window."
+:type 'boolean
+: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
@@ -868,13 +895,14 @@ When called non-interactively, optional
used instead of `browse-url-new-window-flag'.
The order attempted is emacs-w3m, gnome-moz-remote, Mozilla, Firefox,
-Galeon, Konqueror, Netscape, Opera, Mosaic, IXI Mosaic, Lynx in an
-xterm, MMM, and then W3."
+SeaMonkey, Galeon, Konqueror, Netscape, Opera, Mosaic, IXI Mosaic,
+Lynx in an xterm, MMM, and then W3."
(apply
(cond
((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
((executable-find browse-url-firefox-program) 'browse-url-firefox)
+ ((executable-find browse-url-seamonkey-program) 'browse-url-seamonkey)
((executable-find browse-url-galeon-program) 'browse-url-galeon)
((executable-find browse-url-kde-program) 'browse-url-kde)
((executable-find browse-url-netscape-program) 'browse-url-netscape)
@@ -960,6 +988,69 @@ How depends on `browse-url-netscape-vers
browse-url-netscape-program
(append browse-url-netscape-arguments
(list "-remote" command)))))
+
+;;;###autoload
+(defun browse-url-seamonkey (url &optional new-window)
+ "Ask the SeaMonkey WWW browser to load URL.
+Default to the URL around or before point. The strings in variable
+`browse-url-seamonkey-arguments' are also passed to SeaMonkey.
+
+When called interactively, if variable `browse-url-new-window-flag' is
+non-nil, load the document in a new SeaMonkey 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-seamonkey-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'.
+
+On MS-Windows systems the optional `new-window' parameter is ignored.
+SeaMonkey for Windows does not support the \"-remote\" command line
+parameter. Therefore the `browse-url-new-window-flag',
+`browse-url-new-window-flag' and `browse-url-seamonkey-new-window-is-tab'
+are ignored as well. SeaMonkey on Windows will always open the
+requested URL in a new window."
+ (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)
+ (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 "seamonkey " url) nil
+ browse-url-seamonkey-program
+ (append
+ browse-url-seamonkey-arguments
+ (if (or (featurep 'dos-w32)
+ (string-match "win32" system-configuration))
+ (list url)
+ (list "-remote"
+ (concat "openURL("
+ url
+ (if (browse-url-maybe-new-window
+ new-window)
+ (if browse-url-seamonkey-new-window-is-tab
+ ",new-tab"
+ ",new-window"))
+ ")")))))))
+ (set-process-sentinel process
+ `(lambda (process change)
+ (browse-url-seamonkey-sentinel process ,url)))))
+
+(defun browse-url-seamonkey-sentinel (process url)
+ "Handle a change to the process communicating with SeaMonkey."
+ (or (eq (process-exit-status process) 0)
+ (let* ((process-environment (browse-url-process-environment)))
+ ;; SeaMonkey is not running - start it
+ (message "Starting SeaMonkey...")
+ (apply 'start-process (concat "seamonkey " url) nil
+ browse-url-seamonkey-program
+ (append browse-url-seamonkey-startup-arguments (list url))))))
;;;###autoload
(defun browse-url-mozilla (url &optional new-window)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| SXEmacs - The only _______ you'll ever need. |
| Fill in the blank, yes, it's THAT good! |
|------------------------------------<steve(a)sxemacs.org>---|
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches