Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / ed / c5a6a94d5b21beebfb9fdbf3971cbd1dbe1bf9
1 Return-Path: <dme@dme.org>\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 773274196F0\r
6         for <notmuch@notmuchmail.org>; Wed, 28 Apr 2010 04:18:20 -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: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id gvSeH-x0hq8U for <notmuch@notmuchmail.org>;\r
16         Wed, 28 Apr 2010 04:18:19 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181])\r
19         by olra.theworths.org (Postfix) with ESMTP id 7DC89431FC1\r
20         for <notmuch@notmuchmail.org>; Wed, 28 Apr 2010 04:18:19 -0700 (PDT)\r
21 Received: by wyj26 with SMTP id 26so2171769wyj.26\r
22         for <notmuch@notmuchmail.org>; Wed, 28 Apr 2010 04:18:18 -0700 (PDT)\r
23 Received: by 10.216.87.9 with SMTP id x9mr3822455wee.67.1272453498532;\r
24         Wed, 28 Apr 2010 04:18:18 -0700 (PDT)\r
25 Received: from ut.hh.sledj.net (gmp-ea-fw-1.sun.com [192.18.1.36])\r
26         by mx.google.com with ESMTPS id x14sm13313540wbs.6.2010.04.28.04.18.17\r
27         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
28         Wed, 28 Apr 2010 04:18:17 -0700 (PDT)\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
30         id EFFCD5940B0; Wed, 28 Apr 2010 12:18:34 +0100 (BST)\r
31 From: David Edmondson <dme@dme.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH] emacs: Usability improvements for `notmuch-hello'.\r
34 Date: Wed, 28 Apr 2010 12:18:32 +0100\r
35 Message-Id: <1272453512-10193-1-git-send-email-dme@dme.org>\r
36 X-Mailer: git-send-email 1.7.0\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Wed, 28 Apr 2010 11:18:20 -0000\r
50 \r
51 - If no saved searches exist or are displayed, don't signal an error,\r
52 - If no saved searches exist or are displayed, leave the cursor in the\r
53   search bar,\r
54 - Minor layout improvements.\r
55 ---\r
56  emacs/notmuch-hello.el |   36 +++++++++++++++++++-----------------\r
57  1 files changed, 19 insertions(+), 17 deletions(-)\r
58 \r
59 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
60 index 6a1c56e..1358387 100644\r
61 --- a/emacs/notmuch-hello.el\r
62 +++ b/emacs/notmuch-hello.el\r
63 @@ -273,7 +273,7 @@ diagonal."\r
64                                (notmuch-hello-update))\r
65                      :help-echo "Refresh"\r
66                      (car (process-lines notmuch-command "count")))\r
67 -      (widget-insert " messages (that's not much mail).\n\n"))\r
68 +      (widget-insert " messages (that's not much mail).\n"))\r
69  \r
70      (let ((found-target-pos nil)\r
71           (final-target-pos nil))\r
72 @@ -292,7 +292,7 @@ diagonal."\r
73              (widest (max saved-widest alltags-widest)))\r
74  \r
75         (when saved-alist\r
76 -         (widget-insert "Saved searches: ")\r
77 +         (widget-insert "\nSaved searches: ")\r
78           (widget-create 'push-button\r
79                          :notify (lambda (&rest ignore)\r
80                                    (customize-variable 'notmuch-saved-searches))\r
81 @@ -305,18 +305,16 @@ diagonal."\r
82                 (setq final-target-pos found-target-pos))\r
83             (indent-rigidly start (point) notmuch-hello-indent)))\r
84  \r
85 -       (let ((start (point)))\r
86 -         (widget-insert "\nSearch: ")\r
87 -         (setq notmuch-hello-search-bar-marker (point-marker))\r
88 -         (widget-create 'editable-field\r
89 -                        ;; Leave some space at the start and end of the\r
90 -                        ;; search boxes.\r
91 -                        :size (max 8 (- (window-width) (* 2 notmuch-hello-indent)\r
92 -                                        (length "Search: ")))\r
93 -                        :action (lambda (widget &rest ignore)\r
94 -                                  (notmuch-hello-search (widget-value widget))))\r
95 -         (widget-insert "\n")\r
96 -         (indent-rigidly start (point) notmuch-hello-indent))\r
97 +       (widget-insert "\nSearch: ")\r
98 +       (setq notmuch-hello-search-bar-marker (point-marker))\r
99 +       (widget-create 'editable-field\r
100 +                      ;; Leave some space at the start and end of the\r
101 +                      ;; search boxes.\r
102 +                      :size (max 8 (- (window-width) notmuch-hello-indent\r
103 +                                      (length "Search: ")))\r
104 +                      :action (lambda (widget &rest ignore)\r
105 +                                (notmuch-hello-search (widget-value widget))))\r
106 +       (widget-insert "\n")\r
107  \r
108         (when notmuch-hello-recent-searches\r
109           (widget-insert "\nRecent searches: ")\r
110 @@ -408,9 +406,13 @@ diagonal."\r
111  \r
112        (widget-setup)\r
113  \r
114 -      (goto-char final-target-pos)\r
115 -      (if (not (widget-at))\r
116 -         (widget-forward 1)))))\r
117 +      (when final-target-pos\r
118 +       (goto-char final-target-pos)\r
119 +       (unless (widget-at)\r
120 +         (widget-forward 1)))\r
121 +\r
122 +      (unless (widget-at)\r
123 +       (notmuch-hello-goto-search)))))\r
124  \r
125  ;;;###autoload\r
126  (defun notmuch-folder ()\r
127 -- \r
128 1.7.0\r
129 \r