Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / ee / 8a82af5ce189934773546dbbfd5d50aef10d3e
1 Return-Path: <kanru@anar.kanru.info>\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 EF5B2431FAE\r
6         for <notmuch@notmuchmail.org>; Mon, 30 Nov 2009 22:14:49 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id vC87C2GoroB0 for <notmuch@notmuchmail.org>;\r
11         Mon, 30 Nov 2009 22:14:49 -0800 (PST)\r
12 Received: from msr35.hinet.net (msr35.hinet.net [168.95.4.135])\r
13         by olra.theworths.org (Postfix) with ESMTP id 787B0431FBC\r
14         for <notmuch@notmuchmail.org>; Mon, 30 Nov 2009 22:14:48 -0800 (PST)\r
15 Received: from anar.kanru.info ([203.74.21.24])\r
16         by msr35.hinet.net (8.9.3/8.9.3) with ESMTP id OAA14282\r
17         for <notmuch@notmuchmail.org>; Tue, 1 Dec 2009 14:14:45 +0800 (CST)\r
18 Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 1da0\r
19         by anar.kanru.info (DragonFly Mail Agent)\r
20         Tue, 01 Dec 2009 14:14:35 +0800\r
21 From: Kan-Ru Chen <kanru@kanru.info>\r
22 To: notmuch@notmuchmail.org\r
23 Date: Tue,  1 Dec 2009 14:13:51 +0800\r
24 Message-Id: <1259648033-30653-1-git-send-email-kanru@kanru.info>\r
25 X-Mailer: git-send-email 1.6.5.3\r
26 Subject: [notmuch] [PATCH 1/3] notmuch.el: Add keybinding to toggle display\r
27         of message body and headers.\r
28 X-BeenThere: notmuch@notmuchmail.org\r
29 X-Mailman-Version: 2.1.12\r
30 Precedence: list\r
31 List-Id: "Use and development of the notmuch mail system."\r
32         <notmuch.notmuchmail.org>\r
33 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
34         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
35 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
36 List-Post: <mailto:notmuch@notmuchmail.org>\r
37 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
38 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
40 X-List-Received-Date: Tue, 01 Dec 2009 06:14:50 -0000\r
41 \r
42 I really missed this feature. Added notmuch-show-toggle-current-body and\r
43 notmuch-show-toggle-current-header and bind them to 'b' and 'h'.\r
44 \r
45 Signed-off-by: Kan-Ru Chen <kanru@kanru.info>\r
46 ---\r
47  notmuch.el |   22 ++++++++++++++++++++++\r
48  1 files changed, 22 insertions(+), 0 deletions(-)\r
49 \r
50 diff --git a/notmuch.el b/notmuch.el\r
51 index 65473ba..2526020 100644\r
52 --- a/notmuch.el\r
53 +++ b/notmuch.el\r
54 @@ -62,7 +62,9 @@\r
55      ; overlays-at to query and manipulate the current overlay.\r
56      (define-key map "a" 'notmuch-show-archive-thread)\r
57      (define-key map "A" 'notmuch-show-mark-read-then-archive-thread)\r
58 +    (define-key map "b" 'notmuch-show-toggle-current-body)\r
59      (define-key map "f" 'notmuch-show-forward-current)\r
60 +    (define-key map "h" 'notmuch-show-toggle-current-header)\r
61      (define-key map "m" 'message-mail)\r
62      (define-key map "n" 'notmuch-show-next-message)\r
63      (define-key map "N" 'notmuch-show-mark-read-then-next-open-message)\r
64 @@ -560,6 +562,26 @@ which this thread was originally shown."\r
65    (force-window-update)\r
66    (redisplay t))\r
67  \r
68 +(defun notmuch-show-toggle-current-body ()\r
69 +  "Toggle the current message body."\r
70 +  (interactive)\r
71 +  (save-excursion\r
72 +    (notmuch-show-move-to-current-message-summary-line)\r
73 +    (unless (button-at (point))\r
74 +      (notmuch-show-next-button))\r
75 +    (push-button))\r
76 +  )\r
77 +\r
78 +(defun notmuch-show-toggle-current-header ()\r
79 +  (interactive)\r
80 +  (save-excursion\r
81 +    (notmuch-show-move-to-current-message-summary-line)\r
82 +    (next-line)\r
83 +    (unless (button-at (point))\r
84 +      (notmuch-show-next-button))\r
85 +    (push-button))\r
86 +  )\r
87 +\r
88  (define-button-type 'notmuch-button-invisibility-toggle-type 'action 'notmuch-toggle-invisible-action 'follow-link t)\r
89  (define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation"\r
90    :supertype 'notmuch-button-invisibility-toggle-type)\r
91 -- \r
92 1.6.5.3\r
93 \r