Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 01 / e12084111d898160963c87182aefa29bac94aa
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 D7333429E5B\r
6         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:05 -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 Bk0FF8gkklVw for <notmuch@notmuchmail.org>;\r
16         Tue, 31 Jan 2012 07:04:04 -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 65FAD429E25\r
21         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:04 -0800 (PST)\r
22 Received: by lahd3 with SMTP id d3so46149lah.26\r
23         for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 07:04:01 -0800 (PST)\r
24 Received: by 10.152.148.106 with SMTP id tr10mr11481837lab.41.1328022241085;\r
25         Tue, 31 Jan 2012 07:04:01 -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 l19sm17298864lbv.12.2012.01.31.07.03.58\r
29         (version=SSLv3 cipher=OTHER); Tue, 31 Jan 2012 07:03:59 -0800 (PST)\r
30 From: Jani Nikula <jani@nikula.org>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [RFC PATCH] emacs: make show view a/A/x/X key bindings more\r
33  consistent\r
34 Date: Tue, 31 Jan 2012 17:03:55 +0200\r
35 Message-Id: <1328022235-8400-1-git-send-email-jani@nikula.org>\r
36 X-Mailer: git-send-email 1.7.5.4\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: Tue, 31 Jan 2012 15:04:06 -0000\r
50 \r
51 Proposal for show view a/A/x/X key bindings, according to\r
52 http://titanpad.com/SA39EbNezU and IRC discussion:\r
53 \r
54 'a' = Archive current message, then move to next message, or show next\r
55 thread from search if at the last message in thread.\r
56 \r
57 'A' = Archive each message in thread, then show next thread from\r
58 search.\r
59 \r
60 'x' = Archive current message, then move to next message, or exit back\r
61 to search results if at the last message in thread.\r
62 \r
63 'X' = Archive each message in thread, then exit back to search\r
64 results.\r
65 \r
66 IMHO these changes would make the current implementation more\r
67 consistent in two ways: 1) 'a'/'A' would advance to next thread like\r
68 'a' used to do, 2) 'x' would operate on messages and 'X' on threads\r
69 like 'a'/'A' do now.\r
70 \r
71 The implementation here is hacky at best, and I agree with dme that\r
72 notmuch-show.el could use some code cleanup and provide\r
73 non-interactive primitives. However I won't have the time and energy\r
74 for that right now.\r
75 ---\r
76  emacs/notmuch-show.el |   26 ++++++++++++++++++++------\r
77  1 files changed, 20 insertions(+), 6 deletions(-)\r
78 \r
79 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
80 index de9421e..62f3664 100644\r
81 --- a/emacs/notmuch-show.el\r
82 +++ b/emacs/notmuch-show.el\r
83 @@ -1075,9 +1075,10 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
84         (define-key map "h" 'notmuch-show-toggle-headers)\r
85         (define-key map "-" 'notmuch-show-remove-tag)\r
86         (define-key map "+" 'notmuch-show-add-tag)\r
87 -       (define-key map "x" 'notmuch-show-archive-thread-then-exit)\r
88 -       (define-key map "a" 'notmuch-show-archive-message-then-next)\r
89 +       (define-key map "X" 'notmuch-show-archive-thread-then-exit)\r
90 +       (define-key map "x" 'notmuch-show-archive-message-then-next-then-exit)\r
91         (define-key map "A" 'notmuch-show-archive-thread-then-next)\r
92 +       (define-key map "a" 'notmuch-show-archive-message-then-next-then-next)\r
93         (define-key map "N" 'notmuch-show-next-message)\r
94         (define-key map "P" 'notmuch-show-previous-message)\r
95         (define-key map "n" 'notmuch-show-next-open-message)\r
96 @@ -1425,10 +1426,12 @@ buffer."\r
97      (if r\r
98         (progn\r
99           (notmuch-show-mark-read)\r
100 -         (notmuch-show-message-adjust))\r
101 +         (notmuch-show-message-adjust)\r
102 +         t)\r
103        (if pop-at-end\r
104           (notmuch-show-next-thread)\r
105 -       (goto-char (point-max))))))\r
106 +       (goto-char (point-max))\r
107 +       nil))))\r
108  \r
109  (defun notmuch-show-previous-open-message ()\r
110    "Show the previous open message."\r
111 @@ -1645,12 +1648,23 @@ removed)."\r
112        (notmuch-show-add-tag "inbox")\r
113      (notmuch-show-remove-tag "inbox")))\r
114  \r
115 -(defun notmuch-show-archive-message-then-next ()\r
116 -  "Archive the current message, then show the next open message in the current thread."\r
117 +(defun notmuch-show-archive-message-then-next-then-exit ()\r
118 +  "Archive the current message, then show the next open message in the current thread.\r
119 +\r
120 +If at the last message in thread, then exit back to search results."\r
121    (interactive)\r
122    (notmuch-show-archive-message)\r
123    (notmuch-show-next-open-message t))\r
124  \r
125 +(defun notmuch-show-archive-message-then-next-then-next ()\r
126 +  "Archive the current message, then show the next open message in the current thread.\r
127 +\r
128 +If at the last message in thread, then show next thread from search."\r
129 +  (interactive)\r
130 +  (notmuch-show-archive-message)\r
131 +  (unless (notmuch-show-next-open-message)\r
132 +    (notmuch-show-next-thread t)))\r
133 +\r
134  (defun notmuch-show-stash-cc ()\r
135    "Copy CC field of current message to kill-ring."\r
136    (interactive)\r
137 -- \r
138 1.7.5.4\r
139 \r