emacs's function special form
[notmuch-archives.git] / 77 / 007f98d9422d7a0a7577ead7e04effda9fd0e5
1 Return-Path: <jrollins@finestructure.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 E29C6431FB6\r
6         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:31 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 3G1Y1OxLVL59 for <notmuch@notmuchmail.org>;\r
16         Tue, 24 Jan 2012 16:06:31 -0800 (PST)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id 523D9431FBC\r
20         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:31 -0800 (PST)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id 1185266E0177\r
23         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:30 -0800 (PST)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (DHCP-123-180.caltech.edu [131.215.123.180])\r
26         (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 26EF266E014B\r
28         for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:29 -0800 (PST)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id DBB65344; Tue, 24 Jan 2012 16:06:27 -0800 (PST)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH v3 5/8] emacs: add option to show-next-{,\r
34         open-}message functions to pop out to parent buffer if at end\r
35 Date: Tue, 24 Jan 2012 16:06:20 -0800\r
36 Message-Id: <1327449983-23638-6-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.8.3\r
38 In-Reply-To: <1327449983-23638-5-git-send-email-jrollins@finestructure.net>\r
39 References: <87pqea24z0.fsf@servo.finestructure.net>\r
40         <1327449983-23638-1-git-send-email-jrollins@finestructure.net>\r
41         <1327449983-23638-2-git-send-email-jrollins@finestructure.net>\r
42         <1327449983-23638-3-git-send-email-jrollins@finestructure.net>\r
43         <1327449983-23638-4-git-send-email-jrollins@finestructure.net>\r
44         <1327449983-23638-5-git-send-email-jrollins@finestructure.net>\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Wed, 25 Jan 2012 00:06:32 -0000\r
58 \r
59 This will allow for keybindings that achieve a smoother message\r
60 processing flow by reducing the number of key presses needed for most\r
61 common operations.\r
62 ---\r
63  emacs/notmuch-show.el |   27 +++++++++++++++++++--------\r
64  1 files changed, 19 insertions(+), 8 deletions(-)\r
65 \r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
67 index 0dc594b..8837402 100644\r
68 --- a/emacs/notmuch-show.el\r
69 +++ b/emacs/notmuch-show.el\r
70 @@ -1358,14 +1358,19 @@ any effects from previous calls to\r
71    (with-current-notmuch-show-message\r
72     (notmuch-mua-new-forward-message prompt-for-sender)))\r
73  \r
74 -(defun notmuch-show-next-message ()\r
75 -  "Show the next message."\r
76 -  (interactive)\r
77 +(defun notmuch-show-next-message (&optional pop-at-end)\r
78 +  "Show the next message.\r
79 +\r
80 +If a prefix argument is given and this is the last message in the\r
81 +thread, navigate to the next thread in the parent search buffer."\r
82 +  (interactive "P")\r
83    (if (notmuch-show-goto-message-next)\r
84        (progn\r
85         (notmuch-show-mark-read)\r
86         (notmuch-show-message-adjust))\r
87 -    (goto-char (point-max))))\r
88 +    (if pop-at-end\r
89 +       (notmuch-show-next-thread)\r
90 +      (goto-char (point-max)))))\r
91  \r
92  (defun notmuch-show-previous-message ()\r
93    "Show the previous message."\r
94 @@ -1374,9 +1379,13 @@ any effects from previous calls to\r
95    (notmuch-show-mark-read)\r
96    (notmuch-show-message-adjust))\r
97  \r
98 -(defun notmuch-show-next-open-message ()\r
99 -  "Show the next message."\r
100 -  (interactive)\r
101 +(defun notmuch-show-next-open-message (&optional pop-at-end)\r
102 +  "Show the next open message.\r
103 +\r
104 +If a prefix argument is given and this is the last open message\r
105 +in the thread, navigate to the next thread in the parent search\r
106 +buffer."\r
107 +  (interactive "P")\r
108    (let (r)\r
109      (while (and (setq r (notmuch-show-goto-message-next))\r
110                 (not (notmuch-show-message-visible-p))))\r
111 @@ -1384,7 +1393,9 @@ any effects from previous calls to\r
112         (progn\r
113           (notmuch-show-mark-read)\r
114           (notmuch-show-message-adjust))\r
115 -      (goto-char (point-max)))))\r
116 +      (if pop-at-end\r
117 +         (notmuch-show-next-thread)\r
118 +       (goto-char (point-max))))))\r
119  \r
120  (defun notmuch-show-previous-open-message ()\r
121    "Show the previous message."\r
122 -- \r
123 1.7.8.3\r
124 \r