CVS update by simon packages/xemacs-packages/mail-lib ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Thu Oct 19 15:57:07 EDT 2006


  User: simon   
  Date: 06/10/19 21:57:07

  Modified:    packages/xemacs-packages/mail-lib browse-url.el ChangeLog
Log:
2006-09-12  Steve Youngs  <steve at 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.

Revision  Changes    Path
1.37      +93 -2     XEmacs/packages/xemacs-packages/mail-lib/browse-url.el

Index: browse-url.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/mail-lib/browse-url.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -r1.36 -r1.37
--- browse-url.el	2005/03/09 11:14:56	1.36
+++ browse-url.el	2006/10/19 19:57:06	1.37
@@ -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)



1.170     +15 -0     XEmacs/packages/xemacs-packages/mail-lib/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/mail-lib/ChangeLog,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -p -r1.169 -r1.170
--- ChangeLog	2006/07/17 05:25:56	1.169
+++ ChangeLog	2006/10/19 19:57:06	1.170
@@ -1,3 +1,18 @@
+2006-09-12  Steve Youngs  <steve at 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. 
+
 2006-07-17  Norbert Koch  <viteno at xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.77 released.





More information about the XEmacs-CVS mailing list