all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xavier Maillard <xma@gnu.org>
To: <emacs-devel@gnu.org>
Subject: [PATCH] New function to send a mail to the recipient at point
Date: Sat, 23 Feb 2008 01:25:03 +0100	[thread overview]
Message-ID: <200802232244.m1NMiK5I014327@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]


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 <xma@gnu.org>

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  <xma@gnu.org>
+
+	* mail/rmail.el (rmail-send-mail-at-point): New function. Send an email
+	to the recipient address at point.
+
 2008-02-22  Juanma Barranquero  <lekktu@gmail.com>
 
 	* 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"))))
 \f
 (defun rmail-summary-exists ()
   "Non-nil if in an RMAIL buffer and an associated summary buffer exists.

             reply	other threads:[~2008-02-23  0:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23  0:25 Xavier Maillard [this message]
2008-02-24  9:05 ` [PATCH] New function to send a mail to the recipient at point Reiner Steib
2008-02-24  9:56   ` Leo
2008-02-24 12:33     ` User-Agent header (was: [PATCH] New function to send a mail to the recipient at point) Reiner Steib
2008-02-24 17:49       ` User-Agent header Leo
2008-02-24 18:21       ` User-Agent header (was: [PATCH] New function to send a mail to the recipient at point) Stephen J. Turnbull
2008-02-24 18:41         ` User-Agent header Bill Wohler
2008-02-24 22:44           ` Stephen J. Turnbull
2008-02-26  2:00             ` Xavier Maillard
2008-02-26  2:00   ` [PATCH] New function to send a mail to the recipient at point Xavier Maillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802232244.m1NMiK5I014327@localhost.localdomain \
    --to=xma@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.