[PATCH v2 4/9] emacs: Remove notmuch-search quit continuation
[notmuch-archives.git] / ab / e18f3a878405f6414fa2fa7760a1c774c9710a
1 Return-Path: <amdragon@mit.edu>\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 2B707431FDA\r
6         for <notmuch@notmuchmail.org>; Tue,  3 Sep 2013 14:46: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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 3GuWfVoA21Mj for <notmuch@notmuchmail.org>;\r
16         Tue,  3 Sep 2013 14:45:57 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id 18350431E64\r
20         for <notmuch@notmuchmail.org>; Tue,  3 Sep 2013 14:45:35 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7f078e000000937-7b-5226587ef2e4\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 46.6E.02359.E7856225; Tue,  3 Sep 2013 17:45:34 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r83LjU6D029444; \r
27         Tue, 3 Sep 2013 17:45:31 -0400\r
28 Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r83LjRKH026857\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 3 Sep 2013 17:45:28 -0400\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1VGyPe-0004xx-Tw; Tue, 03 Sep 2013 17:45:26 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v2 4/9] emacs: Remove notmuch-search quit continuation\r
40 Date: Tue,  3 Sep 2013 17:45:20 -0400\r
41 Message-Id: <1378244725-18846-5-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10.4\r
43 In-Reply-To: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
44 References: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
45 X-Brightmail-Tracker:\r
46  H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsUixCmqrFsXoRZksPCOukXTdGeL1XN5LK7f\r
47         nMnswOyxc9Zddo9b91+zezxbdYs5gDmKyyYlNSezLLVI3y6BK2Pf9tmsBaekK64eW8rWwNgi\r
48         3sXIySEhYCKxecp1VghbTOLCvfVsXYxcHEIC+xgl9s3oZgdJCAlsYJT4u5YNwj7MJHFtEg+E\r
49         PZdR4sG2XBCbTUBDYtv+5YwgtoiAtMTOu7PBhjILREscuTwDrFdYwE3ieN92MJtFQFXi172X\r
50         YDW8Ag4Siw7cgDpCUaL72QSwGk4BR4neBYugbnCQaFp5mX0CI/8CRoZVjLIpuVW6uYmZOcWp\r
51         ybrFyYl5ealFukZ6uZkleqkppZsYwWElybuD8d1BpUOMAhyMSjy8DI9Ug4RYE8uKK3MPMUpy\r
52         MCmJ8h4JVQsS4kvKT6nMSCzOiC8qzUktPsQowcGsJMKb4AOU401JrKxKLcqHSUlzsCiJ8z59\r
53         ejZQSCA9sSQ1OzW1ILUIJivDwaEkwVseDtQoWJSanlqRlplTgpBm4uAEGc4DNPxnGMjw4oLE\r
54         3OLMdIj8KUZFKXHe+SDNAiCJjNI8uF5Y3L9iFAd6RZi3B6SKB5gy4LpfAQ1mAhqc9lkVZHBJ\r
55         IkJKqoFRcN/v/f3PAlNsPq24vD6cQ2n27i6LuYe2ic0N0+M6xOOh+HGiiaQ0c8r9EqVvScaT\r
56         FNb923iaZYXcqyn3FszjLFx5LnjDMk2FA23vxB67rbBrWLR7t9dk2/wAAZ0WI72nZ6YoHdES\r
57         YZ+6nN2QdXZYwQp9R9cky3s75+pW33uXdmXPRLu8vaEblViKMxINtZiLihMBHzVPWtYCAAA=\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Tue, 03 Sep 2013 21:46:04 -0000\r
71 \r
72 Since notmuch-hello doesn't need this any more, we can remove this\r
73 hack.  This also eliminates `notmuch-search-quit', so now all modes\r
74 bind "q" to `notmuch-kill-this-buffer'.\r
75 ---\r
76  emacs/notmuch.el |   22 +++++-----------------\r
77  1 file changed, 5 insertions(+), 17 deletions(-)\r
78 \r
79 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
80 index c964186..00cf271 100644\r
81 --- a/emacs/notmuch.el\r
82 +++ b/emacs/notmuch.el\r
83 @@ -213,8 +213,8 @@ For a mouse binding, return nil."\r
84  (defvar notmuch-search-mode-map\r
85    (let ((map (make-sparse-keymap)))\r
86      (define-key map "?" 'notmuch-help)\r
87 -    (define-key map "q" 'notmuch-search-quit)\r
88 -    (define-key map "x" 'notmuch-search-quit)\r
89 +    (define-key map "q" 'notmuch-kill-this-buffer)\r
90 +    (define-key map "x" 'notmuch-kill-this-buffer)\r
91      (define-key map (kbd "<DEL>") 'notmuch-search-scroll-down)\r
92      (define-key map "b" 'notmuch-search-scroll-down)\r
93      (define-key map " " 'notmuch-search-scroll-up)\r
94 @@ -257,18 +257,9 @@ For a mouse binding, return nil."\r
95  (defvar notmuch-search-query-string)\r
96  (defvar notmuch-search-target-thread)\r
97  (defvar notmuch-search-target-line)\r
98 -(defvar notmuch-search-continuation)\r
99  \r
100  (defvar notmuch-search-disjunctive-regexp      "\\<[oO][rR]\\>")\r
101  \r
102 -(defun notmuch-search-quit ()\r
103 -  "Exit the search buffer, calling any defined continuation function."\r
104 -  (interactive)\r
105 -  (let ((continuation notmuch-search-continuation))\r
106 -    (notmuch-kill-this-buffer)\r
107 -    (when continuation\r
108 -      (funcall continuation))))\r
109 -\r
110  (defun notmuch-search-scroll-up ()\r
111    "Move forward through search results by one window's worth."\r
112    (interactive)\r
113 @@ -412,7 +403,6 @@ Complete list of currently available key bindings:\r
114    (make-local-variable 'notmuch-search-oldest-first)\r
115    (make-local-variable 'notmuch-search-target-thread)\r
116    (make-local-variable 'notmuch-search-target-line)\r
117 -  (set (make-local-variable 'notmuch-search-continuation) nil)\r
118    (set (make-local-variable 'scroll-preserve-screen-position) t)\r
119    (add-to-invisibility-spec (cons 'ellipsis t))\r
120    (use-local-map notmuch-search-mode-map)\r
121 @@ -896,7 +886,7 @@ PROMPT is the string to prompt with."\r
122                               'notmuch-search-history nil nil)))))\r
123  \r
124  ;;;###autoload\r
125 -(defun notmuch-search (&optional query oldest-first target-thread target-line continuation)\r
126 +(defun notmuch-search (&optional query oldest-first target-thread target-line)\r
127    "Run \"notmuch search\" with the given `query' and display results.\r
128  \r
129  If `query' is nil, it is read interactively from the minibuffer.\r
130 @@ -928,7 +918,6 @@ the configured default sort order."\r
131      (set 'notmuch-search-oldest-first oldest-first)\r
132      (set 'notmuch-search-target-thread target-thread)\r
133      (set 'notmuch-search-target-line target-line)\r
134 -    (set 'notmuch-search-continuation continuation)\r
135      (let ((proc (get-buffer-process (current-buffer)))\r
136           (inhibit-read-only t))\r
137        (if proc\r
138 @@ -965,10 +954,9 @@ same relative position within the new buffer."\r
139    (let ((target-line (line-number-at-pos))\r
140         (oldest-first notmuch-search-oldest-first)\r
141         (target-thread (notmuch-search-find-thread-id 'bare))\r
142 -       (query notmuch-search-query-string)\r
143 -       (continuation notmuch-search-continuation))\r
144 +       (query notmuch-search-query-string))\r
145      (notmuch-kill-this-buffer)\r
146 -    (notmuch-search query oldest-first target-thread target-line continuation)\r
147 +    (notmuch-search query oldest-first target-thread target-line)\r
148      (goto-char (point-min))))\r
149  \r
150  (defcustom notmuch-poll-script nil\r
151 -- \r
152 1.7.10.4\r
153 \r