Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 5f / 140313c4cc87a2dd6c2fb738e01c19680c8c7a
1 Return-Path: <schnouki@schnouki.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 53929429E2A\r
6         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 06:23:04 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.1\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id DNkLjAZBaxZr for <notmuch@notmuchmail.org>;\r
17         Wed, 25 May 2011 06:23:03 -0700 (PDT)\r
18 Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222])\r
19         by olra.theworths.org (Postfix) with ESMTP id 05828429E25\r
20         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 06:23:03 -0700 (PDT)\r
21 Received: from localhost.localdomain (thor.loria.fr [152.81.12.250])\r
22         by ks3536.kimsufi.com (Postfix) with ESMTPSA id 5B8C86A06AD;\r
23         Wed, 25 May 2011 15:23:02 +0200 (CEST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net;\r
25         s=key-schnouki; t=1306329782;\r
26         bh=KjrheITkPEpwwgePerUJgm7T1mq00vUBtbxJzG9cc+c=;\r
27         h=From:To:Subject:Date:Message-Id:In-Reply-To:References;\r
28         b=d3ms/MR2k5LOGTtPGRDkwuCLi2G8rB81nsTznOJGaZkV+k25uwchzEmciZbppU1eA\r
29         nWksV0mPh/51cIvG9usQ3NrS9hnxBDSUc1nZGCdIZ1MlWj8ojBMHqebWLgA/vJ9fIA\r
30         FuaMC1KcKKhuJ/ioY1DM5xA7s2w74p2fNiMaTlW0=\r
31 From: Thomas Jost <schnouki@schnouki.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH 2/4] emacs: Move the "prompt for sender" code to a new\r
34         function.\r
35 Date: Wed, 25 May 2011 15:22:38 +0200\r
36 Message-Id: <1306329760-16665-2-git-send-email-schnouki@schnouki.net>\r
37 X-Mailer: git-send-email 1.7.5.1\r
38 In-Reply-To: <1306329760-16665-1-git-send-email-schnouki@schnouki.net>\r
39 References: <87lixu7w71.fsf@thor.loria.fr>\r
40         <1306329760-16665-1-git-send-email-schnouki@schnouki.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Wed, 25 May 2011 13:23:04 -0000\r
54 \r
55 This allows the code to be reused in different functions without duplicating it.\r
56 ---\r
57  emacs/notmuch-mua.el |   15 +++++++++------\r
58  1 files changed, 9 insertions(+), 6 deletions(-)\r
59 \r
60 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
61 index cd4d75d..0bde02c 100644\r
62 --- a/emacs/notmuch-mua.el\r
63 +++ b/emacs/notmuch-mua.el\r
64 @@ -157,21 +157,24 @@ name and addresses configured in the notmuch configuration file."\r
65               (concat (notmuch-user-name) " <" address ">"))\r
66             (cons (notmuch-user-primary-email) (notmuch-user-other-email)))))\r
67  \r
68 +(defvar notmuch-mua-sender-history nil)\r
69 +\r
70 +(defun notmuch-mua-prompt-for-sender ()\r
71 +  (interactive)\r
72 +  (let ((collection (notmuch-mua-sender-collection)))\r
73 +    (ido-completing-read "Send mail From: " collection\r
74 +                        nil 'confirm nil 'notmuch-mua-sender-history (car collection))))\r
75 +\r
76  (defun notmuch-mua-new-mail-from (&optional sender)\r
77    (if sender\r
78        (notmuch-mua-mail nil nil (list (cons 'from sender)))\r
79      (notmuch-mua-mail)))\r
80  \r
81 -(defvar notmuch-mua-sender-history nil)\r
82 -\r
83  (defun notmuch-mua-new-mail (&optional prompt-for-sender)\r
84    "Begin composing a new email with notmuch."\r
85    (interactive "P")\r
86    (if prompt-for-sender\r
87 -      (let* ((collection (notmuch-mua-sender-collection))\r
88 -            (sender (ido-completing-read "Send mail From: " collection\r
89 -                                         nil 'confirm nil 'notmuch-mua-sender-history (car collection))))\r
90 -       (notmuch-mua-new-mail-from sender))\r
91 +      (notmuch-mua-new-mail-from (notmuch-mua-prompt-for-sender))\r
92      (notmuch-mua-mail)))\r
93  \r
94  (defun notmuch-mua-new-mail-prompt-for-sender ()\r
95 -- \r
96 1.7.5.1\r
97 \r