emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] New function to send a mail to the recipient at point


From: Xavier Maillard
Subject: [PATCH] New function to send a mail to the recipient at point
Date: Sat, 23 Feb 2008 01:25:03 +0100
User-agent: Rmail in GNU Emacs 23.0.60.2 on GNU/Linux

here is a very small function I find very convenient. If it can
be of any help/interest to the project, fell free to install it.


Signed-off-by: Xavier Maillard <address@hidden>

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7d3ba62..4fd162a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-23  Xavier Maillard  <address@hidden>
+
+       * mail/rmail.el (rmail-send-mail-at-point): New function. Send an email
+       to the recipient address at point.
+
 2008-02-22  Juanma Barranquero  <address@hidden>
 
        * faces.el (font-weight-table): Fix value of `semi-light'.
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index e36b988..679ee56 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -775,7 +775,7 @@ isn't provided."
 by setting `rmail-enable-mime' to non-nil, the required feature
 `%s' (the value of `rmail-mime-feature')
 is not available in the current session.
-So, the MIME support is turned off for the moment." 
+So, the MIME support is turned off for the moment."
                rmail-mime-feature))
        (setq rmail-enable-mime nil)))))
 
@@ -4022,6 +4022,15 @@ specifying headers which should not be copied into the 
new message."
                    (insert "BCC: " (user-login-name) "\n"))))
            (goto-char (point-min))
            (mail-position-on-field (if resending "Resent-To" "To") t))))))
+
+(defun rmail-send-mail-at-point ()
+  "Edit a mail message to the recipient found at point."
+  (interactive)
+  (require 'thingatpt)
+  (let ((to (thing-at-point 'email)))
+    (if to
+       (mail nil to)
+      (error "No email found at point"))))
 
 (defun rmail-summary-exists ()
   "Non-nil if in an RMAIL buffer and an associated summary buffer exists.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]