From: Richard M. Stallman Date: Wed, 27 Aug 1997 21:20:47 +0000 (+0000) Subject: (browse-url-mail): Use compose-mail[-other-window], not always `mail'. X-Git-Tag: emacs-20.1~365 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=59966fb622614968b5faf8a006e2641772a628ba;p=emacs.git (browse-url-mail): Use compose-mail[-other-window], not always `mail'. --- diff --git a/lisp/browse-url.el b/lisp/browse-url.el index df5a04a0f25..2a53337cbe9 100644 --- a/lisp/browse-url.el +++ b/lisp/browse-url.el @@ -101,11 +101,17 @@ ;; (the latter with ;; development support for Java applets). -;; I recommend Nelson Minar 's excellent +;; I [Denis Howe] recommend Nelson Minar 's excellent ;; html-helper-mode.el for editing HTML and thank Nelson for ;; his many useful comments on this code. ;; +;; See also hm--html-menus . For composing correct HTML see also +;; PSGML the general SGML structure editor package +;; ; hm--html-menus can be used +;; with this. + ;; This package generalises function html-previewer-process in Marc ;; Andreessen 's html-mode (LCD ;; modes/html-mode.el.Z) and provides better versions of the URL @@ -169,6 +175,9 @@ ;; Browse URLs in Usenet messages by clicking mouse-2: ;; (eval-after-load "gnus" ;; '(define-key gnus-article-mode-map [mouse-2] 'browse-url-at-mouse)) +;; [The current version of Gnus provides a standard feature to +;; activate URLs in article buffers for invocation of browse-url with +;; mouse-2.] ;; Use the Emacs w3 browser when not running under X11: ;; (or (eq window-system 'x) @@ -852,17 +861,23 @@ Default to the URL around or before point." ;; --- mailto --- ;;;###autoload -(defun browse-url-mail (url) +(defun browse-url-mail (url &optional new-window) "Open a new mail message buffer within Emacs. -Default to the mailto URL around or before point." +Default to using the mailto: URL around or before point as the +recipient's address. Supplying a non-nil interactive prefix argument +will cause the mail to be composed in another window rather than the +current one." (interactive (browse-url-interactive-arg "Mailto URL: ")) (save-excursion - ;; open mail buffer, specifying TO and REPLYBUFFER - (mail nil (if (string-match "^mailto:" url) + (let ((func (if new-window + 'compose-mail-other-window + 'compose-mail)) + (to (if (string-match "^mailto:" url) (substring url 7) - url) - nil nil nil - (current-buffer)))) + url))) + (apply func + (list to nil nil nil nil nil (cons 'insert-buffer + (current-buffer))))))) ;; --- Random browser ---