I recently asked on this list wether you'd be interested in adding
goto-addr to XEmacs but got no reply. I went ahead and so now I'm
putting my mouth where the code is. :)
goto-addr.el is currently part of Emacs and uses overlays. I've made
the necessary changes in the source. If you are interested, I'll
submit the changes back to the Emacs maintainer. I got the latest
goto-addr.el from him to do exactly this, so I don't expect any
problems on the Emacs side.
In order to test, I've used a buffer with a mail address and a URL,
like this: alex(a)gnu.org and
http://www.gnus.org/ and I evaluated the
following code:
(load-file "~/elisp/goto-addr/goto-addr.el")
(goto-address)
(setq mail-user-agent 'sendmail-user-agent)
This allowed me to use mouse-2 or C-c RET to open Netscape (this
depends on your browse-url setup) or create a mail buffer (and this
depends on your compose-mail setup).
Beyond requiring 'overlay, there is other compatibility cruft as
well. Here's the entire list of XEmacs related code. I've tried to
find equivalents for line-beginning-position and line-end-position in
the XEmacs Lispref manual but couldn't find anything. A defalias
would be nicer, of course. And if you know of a simple workaround to
the mouse-2 / button2 problem, please let me know.
;; XEmacs needs the following definitions.
(unless (fboundp 'overlays-in)
(require 'overlay))
(unless (fboundp 'line-beginning-position)
(defun line-beginning-position ()
"Compatibility function."
(save-excursion
(beginning-of-line)
(point))))
(unless (fboundp 'line-end-position)
(defun line-end-position ()
"Compatibility function."
(save-excursion
(end-of-line)
(point))))
(unless (fboundp 'match-string-no-properties)
(defalias 'match-string-no-properties 'match-string))
(defvar goto-address-highlight-keymap
(let ((m (make-sparse-keymap)))
(if (featurep 'xemacs)
(define-key m (kbd "<button2>") 'goto-address-at-mouse)
(define-key m (kbd "<mouse-2>") 'goto-address-at-mouse))
(define-key m (kbd "C-c RET") 'goto-address-at-point)
m)
"keymap to hold goto-addr's mouse key defs under highlighted URLs.")
Anyway, I'd appreciate some feedback. I am not on the xemacs-beta
mailing list, so please include me in the CC. :)
Alex.