Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 345A1431FD0 for ; Thu, 26 May 2011 01:41:54 -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 a-7OM-em5ofT for ; Thu, 26 May 2011 01:41:53 -0700 (PDT) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 9B57D429E27 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 EA2A26A06AD; Thu, 26 May 2011 10:41:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1306399312; bh=M+6kTbGC+lLcGPCt4WnIeT7UGMgue7zyjkCZPAFHtC8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=jZuU8nkZNWYhSF5YqMqB/LWcBnM4B04r1BlyfKpg0IHtrLNaPymrm6lslA78fZ9Ai cJ3GKF0CBNXk6A0RlYSgI6DrTAT9DiTMjcH45aUqQUMRqHVWaQNz3DPwV3DIK9hj2K dy26C8Z4I81Y6n5qXlP2XRX3sZPS8htv+qdkjBJ8= From: Thomas Jost To: Carl Worth , Stewart Smith , notmuch Subject: [PATCH v2 2/4] emacs: Allow the user to choose the "From" address when composing a new message Date: Thu, 26 May 2011 10:41:31 +0200 Message-Id: <1306399293-22215-2-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:54 -0000 When pressing C-u m, the user will be prompted for the identity to use. --- emacs/notmuch-hello.el | 2 +- emacs/notmuch-mua.el | 11 +++++++++++ emacs/notmuch-show.el | 2 +- emacs/notmuch.el | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index e58dd24..ab06d3a 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -298,7 +298,7 @@ should be. Returns a cons cell `(tags-per-line width)'." (define-key map "=" 'notmuch-hello-update) (define-key map "G" 'notmuch-hello-poll-and-update) (define-key map (kbd "") 'widget-backward) - (define-key map "m" 'notmuch-mua-mail) + (define-key map "m" 'notmuch-mua-new-mail) (define-key map "s" 'notmuch-hello-goto-search) map) "Keymap for \"notmuch hello\" buffers.") diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 2baf6bd..74c9fc1 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -166,6 +166,17 @@ name and addresses configured in the notmuch configuration file." (ido-completing-read "Send mail From: " collection nil 'confirm nil 'notmuch-mua-sender-history (car collection)))) +(defun notmuch-mua-new-mail (&optional prompt-for-sender) + "Invoke the notmuch mail composition window. + +If PROMPT-FOR-SENDER is non-nil, the user will be prompted for +the From: address first." + (interactive "P") + (let ((other-headers + (when prompt-for-sender + (list (cons 'from (notmuch-mua-prompt-for-sender)))))) + (notmuch-mua-mail nil nil other-headers))) + (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 825988c..48d2926 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -847,7 +847,7 @@ function is used. " (define-key map (kbd "") 'notmuch-show-previous-button) (define-key map (kbd "TAB") 'notmuch-show-next-button) (define-key map "s" 'notmuch-search) - (define-key map "m" 'notmuch-mua-mail) + (define-key map "m" 'notmuch-mua-new-mail) (define-key map "f" 'notmuch-show-forward-message) (define-key map "r" 'notmuch-show-reply) (define-key map "|" 'notmuch-show-pipe-message) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 1d683f8..21e0314 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -204,7 +204,7 @@ For a mouse binding, return nil." (define-key map "p" 'notmuch-search-previous-thread) (define-key map "n" 'notmuch-search-next-thread) (define-key map "r" 'notmuch-search-reply-to-thread) - (define-key map "m" 'notmuch-mua-mail) + (define-key map "m" 'notmuch-mua-new-mail) (define-key map "s" 'notmuch-search) (define-key map "o" 'notmuch-search-toggle-order) (define-key map "c" 'notmuch-search-stash-map) -- 1.7.5.1