From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 293E449168F for ; Tue, 9 Mar 2010 11:41:18 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.101 X-Spam-Level: X-Spam-Status: No, score=0.101 tagged_above=-999 required=5 tests=[BAYES_50=0.001, RDNS_DYNAMIC=0.1] autolearn=no Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gisWoB097BJd for ; Tue, 9 Mar 2010 11:41:17 -0800 (PST) Received: from hackervisions.org (67-207-143-141.slicehost.net [67.207.143.141]) by olra.theworths.org (Postfix) with ESMTP id B168B476B9A for ; Tue, 9 Mar 2010 11:41:17 -0800 (PST) Received: from ool-4572a809.dyn.optonline.net ([69.114.168.9] helo=localhost) by hv with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Np5Ib-0006AW-83 for notmuch@notmuchmail.org; Tue, 09 Mar 2010 14:41:01 -0500 From: James Vasile To: notmuch@notmuchmail.org Date: Tue, 09 Mar 2010 14:40:59 -0500 Message-ID: <87aauhp9kk.fsf@hackervisions.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [PATCH] Change From and Bcc when creating reply draft buffer X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 19:41:18 -0000 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--")