Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 61 / 8b2c09b378afc2f5660d6743a9f79a8e61ca4d
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 A3D75431FC0\r
6         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 05:14:40 -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 BXaIFYICpJWz for <notmuch@notmuchmail.org>;\r
16         Sat, 25 May 2013 05:14:35 -0700 (PDT)\r
17 Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com\r
18         [209.85.217.175]) (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 EC048431FAE\r
21         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 05:14:34 -0700 (PDT)\r
22 Received: by mail-lb0-f175.google.com with SMTP id v10so5418781lbd.6\r
23         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 05:14:33 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;\r
27         bh=QpxUoUUwYPDGP0jq+OoVm3QqyOgw9TnoF6tpgn1JP9g=;\r
28         b=aCPpDAo++a3/LIvrUf/I+foFu3Vwfh0HWoCi7p+ADDcxVTVo3DQjHl191MvRKR5UF/\r
29         Hen3UqhZ40Rn+AZayV5bc5fKIuK31NWBzT7834yzvCdw5HvloQCzSrc6i7cVzxVRka6r\r
30         ccmKGubMGO1hEL1g7aDBCOKOtjwQ7/FlkmnPfj8asKZtgtnWXh77lI33iQcz/KGQ3Ulb\r
31         nXe4ly0spAIMEkLAV8Grq5zr8v204FltwIFzm8wWHaQxX71IIP1rQrsZV+BgLLPJuqZO\r
32         yqTwPt4lV/DYShbb9VRULfGsrkR0DQDooz+5mBMaW7DzD/lB36RJfiBWDiY4blnafuJg\r
33         H9mA==\r
34 X-Received: by 10.112.6.6 with SMTP id w6mr10674028lbw.123.1369484073512;\r
35         Sat, 25 May 2013 05:14:33 -0700 (PDT)\r
36 Received: from localhost (dsl-hkibrasgw2-58c376-211.dhcp.inet.fi.\r
37         [88.195.118.211])\r
38         by mx.google.com with ESMTPSA id a3sm2066492lbg.2.2013.05.25.05.14.31\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sat, 25 May 2013 05:14:32 -0700 (PDT)\r
42 From: Jani Nikula <jani@nikula.org>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 1/2] emacs: add show view bindings to move to previous/next\r
45         thread\r
46 Date: Sat, 25 May 2013 15:14:25 +0300\r
47 Message-Id: <1369484066-20228-1-git-send-email-jani@nikula.org>\r
48 X-Mailer: git-send-email 1.7.10.4\r
49 X-Gm-Message-State:\r
50  ALoCoQluMlsR7kGShc9ari8IneeLsJQv4cmLpuC6qyHBzlEBygn7Uy7J/m8vlZ+WzSUblhRIKMHr\r
51 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Sat, 25 May 2013 12:14:40 -0000\r
65 \r
66 We have most of the plumbing in place, add the bindings M-n and M-p.\r
67 \r
68 ---\r
69 \r
70 v2: reduce duplication by adding PREVIOUS argument to\r
71     notmuch-show-next-thread instead of adding a separate function for\r
72     moving to previous thread (Mark)\r
73 ---\r
74  emacs/notmuch-show.el |   28 ++++++++++++++++++++++++----\r
75  1 file changed, 24 insertions(+), 4 deletions(-)\r
76 \r
77 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
78 index d56154e..a903395 100644\r
79 --- a/emacs/notmuch-show.el\r
80 +++ b/emacs/notmuch-show.el\r
81 @@ -39,6 +39,7 @@\r
82  \r
83  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))\r
84  (declare-function notmuch-search-next-thread "notmuch" nil)\r
85 +(declare-function notmuch-search-previous-thread "notmuch" nil)\r
86  (declare-function notmuch-search-show-thread "notmuch" nil)\r
87  \r
88  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
89 @@ -1273,6 +1274,8 @@ reset based on the original query."\r
90         (define-key map "P" 'notmuch-show-previous-message)\r
91         (define-key map "n" 'notmuch-show-next-open-message)\r
92         (define-key map "p" 'notmuch-show-previous-open-message)\r
93 +       (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)\r
94 +       (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)\r
95         (define-key map (kbd "DEL") 'notmuch-show-rewind)\r
96         (define-key map " " 'notmuch-show-advance-and-archive)\r
97         (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)\r
98 @@ -1834,17 +1837,34 @@ argument, hide all of the messages."\r
99    (interactive)\r
100    (backward-button 1))\r
101  \r
102 -(defun notmuch-show-next-thread (&optional show-next)\r
103 -  "Move to the next item in the search results, if any."\r
104 +(defun notmuch-show-next-thread (&optional show previous)\r
105 +  "Move to the next item in the search results, if any.\r
106 +\r
107 +If SHOW is non-nil, open the next item in a show\r
108 +buffer. Otherwise just highlight the next item in the search\r
109 +buffer. If PREVIOUS is non-nil, move to the previous item in the\r
110 +search results instead."\r
111    (interactive "P")\r
112    (let ((parent-buffer notmuch-show-parent-buffer))\r
113      (notmuch-kill-this-buffer)\r
114      (when (buffer-live-p parent-buffer)\r
115        (switch-to-buffer parent-buffer)\r
116 -      (notmuch-search-next-thread)\r
117 -      (if show-next\r
118 +      (if previous\r
119 +         (notmuch-search-previous-thread)\r
120 +       (notmuch-search-next-thread))\r
121 +      (if show\r
122           (notmuch-search-show-thread)))))\r
123  \r
124 +(defun notmuch-show-next-thread-show ()\r
125 +  "Show the next thread in the search results, if any."\r
126 +  (interactive)\r
127 +  (notmuch-show-next-thread t))\r
128 +\r
129 +(defun notmuch-show-previous-thread-show ()\r
130 +  "Show the previous thread in the search results, if any."\r
131 +  (interactive)\r
132 +  (notmuch-show-next-thread t t))\r
133 +\r
134  (defun notmuch-show-archive-thread (&optional unarchive)\r
135    "Archive each message in thread.\r
136  \r
137 -- \r
138 1.7.10.4\r
139 \r