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 23495431FD0 for ; Thu, 26 May 2011 01:41:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled 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 A7icfLCdxj5D for ; Thu, 26 May 2011 01:41:54 -0700 (PDT) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id D79AD429E2A for ; Thu, 26 May 2011 01:41:52 -0700 (PDT) Received: from localhost.localdomain (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 2BF566A06AE; Thu, 26 May 2011 10:41:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1306399312; bh=+2CzJhgxw0A4gsYD0gsa7WXaz25Oxn6fCO/8XjTOF2s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=ODzmGnSviUV0BCLjaBvdo688lXnVYHut131iNW6P3vH39D/M6Q+1DM8NKgVDfGewd pM/J0/WdsxwkE1+LlGYip9nC9TDycS2Ac0CtIxu0XO+0g4YCy37YweE6C9Yyl5EG8b MGz64+mKbd6fgfSx/rcxPoMQ7o/QNpsFKUMb7K6I= From: Thomas Jost To: Carl Worth , Stewart Smith , notmuch Subject: [PATCH v2 3/4] emacs: Allow the user to choose the "From" address when forwarding a message Date: Thu, 26 May 2011 10:41:32 +0200 Message-Id: <1306399293-22215-3-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1306399293-22215-1-git-send-email-schnouki@schnouki.net> References: <87hb8hlush.fsf@thor.loria.fr> <1306399293-22215-1-git-send-email-schnouki@schnouki.net> 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: Thu, 26 May 2011 08:41:55 -0000 When pressing C-u f, the user will be prompted for the identity to use. --- emacs/notmuch-mua.el | 14 ++++++++++++++ emacs/notmuch-show.el | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 74c9fc1..1b777d9 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -177,6 +177,20 @@ the From: address first." (list (cons 'from (notmuch-mua-prompt-for-sender)))))) (notmuch-mua-mail nil nil other-headers))) +(defun notmuch-mua-new-forward-message (&optional prompt-for-sender) + "Invoke the notmuch message forwarding window. + +If PROMPT-FOR-SENDER is non-nil, the user will be prompted for +the From: address first." + (interactive "P") + (if prompt-for-sender + (let* ((sender (notmuch-mua-prompt-for-sender)) + (address-components (mail-extract-address-components sender)) + (user-full-name (car address-components)) + (user-mail-address (cadr address-components))) + (notmuch-mua-forward-message)) + (notmuch-mua-forward-message))) + (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") (message-send-and-exit arg)) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 48d2926..7e493e9 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1158,11 +1158,11 @@ any effects from previous calls to (interactive) (notmuch-mua-reply (notmuch-show-get-message-id))) -(defun notmuch-show-forward-message () +(defun notmuch-show-forward-message (&optional prompt-for-sender) "Forward the current message." - (interactive) + (interactive "P") (with-current-notmuch-show-message - (notmuch-mua-forward-message))) + (notmuch-mua-new-forward-message prompt-for-sender))) (defun notmuch-show-next-message () "Show the next message." -- 1.7.5.1