unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Change From and Bcc when creating reply draft buffer
@ 2010-03-09 19:40 James Vasile
  2010-03-11 13:00 ` Michal Sojka
  0 siblings, 1 reply; 9+ messages in thread
From: James Vasile @ 2010-03-09 19:40 UTC (permalink / raw)
  To: notmuch

When notmuch creates a reply buffer, it guesses the From and Bcc
addresses.  The client is in a better position to guess these, and this
patch adjusts notmuch-reply accordingly.

diff --git a/notmuch.el b/notmuch.el
index ab56f48..07f957e 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -436,10 +436,20 @@ buffer."
   (message "Done"))
 
 (defun notmuch-reply (query-string)
+  "Prepare a reply draft buffer.
+
+Have notmuch create a reply buffer, then adjust the from and bcc
+headers to match our current user-full-name and
+user-mail-address."
   (switch-to-buffer (generate-new-buffer "notmuch-draft"))
   (call-process notmuch-command nil t nil "reply" query-string)
   (message-insert-signature)
   (goto-char (point-min))
+  (kill-line)
+  (insert (format "From: %s <%s>" user-full-name user-mail-address))
+  (re-search-forward "^Bcc: " nil t)
+  (kill-line)
+  (insert (format "%s <%s>" user-full-name user-mail-address))
   (if (re-search-forward "^$" nil t)
       (progn
        (insert "--text follows this line--")

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-12 16:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 19:40 [PATCH] Change From and Bcc when creating reply draft buffer James Vasile
2010-03-11 13:00 ` Michal Sojka
2010-03-11 14:45   ` James Vasile
2010-03-11 16:22     ` Michal Sojka
2010-03-11 19:45       ` James Vasile
2010-03-12  7:49         ` Michal Sojka
2010-03-12 15:01           ` James Vasile
2010-03-12 15:22           ` Jameson Rollins
2010-03-12 16:00             ` Sebastian Spaeth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).