Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 73 / ee82f22ca52c9e153504991804700febdecc0b
1 Return-Path: <jani@nikula.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 DFDD7429E5B\r
6         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 09:29:22 -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: 0.612\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.612 tagged_above=-999 required=5\r
12         tests=[GAPPY_SUBJECT=1.312, 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 nYdwTu3KBJIk for <notmuch@notmuchmail.org>;\r
16         Tue, 31 Jan 2012 09:29:12 -0800 (PST)\r
17 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
18         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id AFA4E429E25\r
21         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 09:29:11 -0800 (PST)\r
22 Received: by lahd3 with SMTP id d3so155817lah.26\r
23         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 09:29:10 -0800 (PST)\r
24 Received: by 10.112.100.200 with SMTP id fa8mr5664250lbb.99.1328030950130;\r
25         Tue, 31 Jan 2012 09:29:10 -0800 (PST)\r
26 Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
27         [84.248.80.253])\r
28         by mx.google.com with ESMTPS id w8sm17644479lbm.8.2012.01.31.09.29.07\r
29         (version=SSLv3 cipher=OTHER); Tue, 31 Jan 2012 09:29:08 -0800 (PST)\r
30 From: Jani Nikula <jani@nikula.org>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [RFC PATCH v2] emacs: make show view a/A/x/X key bindings more\r
33         consistent\r
34 Date: Tue, 31 Jan 2012 19:29:06 +0200\r
35 Message-Id: <1328030946-9793-1-git-send-email-jani@nikula.org>\r
36 X-Mailer: git-send-email 1.7.5.4\r
37 In-Reply-To: <id:1328022235-8400-1-git-send-email-jani@nikula.org>\r
38 References: <id:1328022235-8400-1-git-send-email-jani@nikula.org>\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Tue, 31 Jan 2012 17:29:23 -0000\r
52 \r
53 Modify the show view key bindings as follows to make them more\r
54 consistent:\r
55 \r
56 'a' = Archive current message, then move to next message, or show next\r
57 thread from search if at the last message in thread.\r
58 \r
59 'A' = Archive each message in thread, then show next thread from\r
60 search.\r
61 \r
62 'x' = Archive current message, then move to next message, or exit back\r
63 to search results if at the last message in thread.\r
64 \r
65 'X' = Archive each message in thread, then exit back to search\r
66 results.\r
67 \r
68 The changes make the key bindings more consistent in two ways:\r
69 1) 'a'/'A' both advance to the next thread like 'a' used to.\r
70 2) 'x' operates on messages and 'X' on threads like 'a'/'A'.\r
71 \r
72 ---\r
73 \r
74 The original proposal with some discussion is at\r
75 http://titanpad.com/SA39EbNezU.\r
76 \r
77 This v2 is merely a slightly polished version of the original. There\r
78 will be no further contributions on the subject from me.\r
79 ---\r
80  emacs/notmuch-show.el |   28 ++++++++++++++++++++++------\r
81  1 files changed, 22 insertions(+), 6 deletions(-)\r
82 \r
83 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
84 index de9421e..57830b6 100644\r
85 --- a/emacs/notmuch-show.el\r
86 +++ b/emacs/notmuch-show.el\r
87 @@ -1075,9 +1075,10 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
88         (define-key map "h" 'notmuch-show-toggle-headers)\r
89         (define-key map "-" 'notmuch-show-remove-tag)\r
90         (define-key map "+" 'notmuch-show-add-tag)\r
91 -       (define-key map "x" 'notmuch-show-archive-thread-then-exit)\r
92 -       (define-key map "a" 'notmuch-show-archive-message-then-next)\r
93 +       (define-key map "X" 'notmuch-show-archive-thread-then-exit)\r
94 +       (define-key map "x" 'notmuch-show-archive-message-then-next-or-exit)\r
95         (define-key map "A" 'notmuch-show-archive-thread-then-next)\r
96 +       (define-key map "a" 'notmuch-show-archive-message-then-next-or-next-thread)\r
97         (define-key map "N" 'notmuch-show-next-message)\r
98         (define-key map "P" 'notmuch-show-previous-message)\r
99         (define-key map "n" 'notmuch-show-next-open-message)\r
100 @@ -1417,7 +1418,8 @@ thread, navigate to the next thread in the parent search buffer."\r
101  \r
102  If a prefix argument is given and this is the last open message\r
103  in the thread, navigate to the next thread in the parent search\r
104 -buffer."\r
105 +buffer. Return t if there was a next open message in the thread\r
106 +to show, nil otherwise."\r
107    (interactive "P")\r
108    (let (r)\r
109      (while (and (setq r (notmuch-show-goto-message-next))\r
110 @@ -1428,7 +1430,8 @@ buffer."\r
111           (notmuch-show-message-adjust))\r
112        (if pop-at-end\r
113           (notmuch-show-next-thread)\r
114 -       (goto-char (point-max))))))\r
115 +       (goto-char (point-max))))\r
116 +    r))\r
117  \r
118  (defun notmuch-show-previous-open-message ()\r
119    "Show the previous open message."\r
120 @@ -1645,12 +1648,25 @@ removed)."\r
121        (notmuch-show-add-tag "inbox")\r
122      (notmuch-show-remove-tag "inbox")))\r
123  \r
124 -(defun notmuch-show-archive-message-then-next ()\r
125 -  "Archive the current message, then show the next open message in the current thread."\r
126 +(defun notmuch-show-archive-message-then-next-or-exit ()\r
127 +  "Archive the current message, then show the next open message in the current thread.\r
128 +\r
129 +If at the last open message in the current thread, then exit back\r
130 +to search results."\r
131    (interactive)\r
132    (notmuch-show-archive-message)\r
133    (notmuch-show-next-open-message t))\r
134  \r
135 +(defun notmuch-show-archive-message-then-next-or-next-thread ()\r
136 +  "Archive the current message, then show the next open message in the current thread.\r
137 +\r
138 +If at the last open message in the current thread, then show next\r
139 +thread from search."\r
140 +  (interactive)\r
141 +  (notmuch-show-archive-message)\r
142 +  (unless (notmuch-show-next-open-message)\r
143 +    (notmuch-show-next-thread t)))\r
144 +\r
145  (defun notmuch-show-stash-cc ()\r
146    "Copy CC field of current message to kill-ring."\r
147    (interactive)\r
148 -- \r
149 1.7.5.4\r
150 \r