1 Return-Path: <dme@dme.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 CEE7F431FC7
\r
6 for <notmuch@notmuchmail.org>; Wed, 8 Feb 2012 00:02:41 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 nkkeO5+SfZIw for <notmuch@notmuchmail.org>;
\r
16 Wed, 8 Feb 2012 00:02:39 -0800 (PST)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 4A147431FCF for <notmuch@notmuchmail.org>; Wed, 8 Feb 2012 00:02:32 -0800
\r
22 Received: by wgbdt12 with SMTP id dt12so226268wgb.2
\r
23 for <notmuch@notmuchmail.org>; Wed, 08 Feb 2012 00:02:31 -0800 (PST)
\r
24 Received: by 10.180.99.100 with SMTP id ep4mr39223440wib.7.1328688150958;
\r
25 Wed, 08 Feb 2012 00:02:30 -0800 (PST)
\r
26 Received: from hotblack-desiato.hh.sledj.net
\r
27 (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])
\r
28 by mx.google.com with ESMTPS id dr5sm719950wib.0.2012.02.08.00.02.27
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Wed, 08 Feb 2012 00:02:29 -0800 (PST)
\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
32 id 4B2F6A3801; Wed, 8 Feb 2012 08:02:21 +0000 (GMT)
\r
33 From: David Edmondson <dme@dme.org>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH v8 3/8] emacs: Allow the indentation of content to be toggled.
\r
36 Date: Wed, 8 Feb 2012 08:02:14 +0000
\r
37 Message-Id: <1328688139-3865-6-git-send-email-dme@dme.org>
\r
38 X-Mailer: git-send-email 1.7.8.3
\r
39 In-Reply-To: <1328688139-3865-1-git-send-email-dme@dme.org>
\r
40 References: <1327486729-18052-1-git-send-email-dme@dme.org>
\r
41 <1328688139-3865-1-git-send-email-dme@dme.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Wed, 08 Feb 2012 08:02:42 -0000
\r
56 Very deeply indented content is sometimes difficult to
\r
57 read (particular for something like patches). Allow the indentation of
\r
58 the content to be toggled with '<'.
\r
60 Indentation of the header lines is not affected, so it remains
\r
61 possible to see the structure of the thread.
\r
63 emacs/notmuch-show.el | 26 ++++++++++++++++++++++----
\r
64 1 files changed, 22 insertions(+), 4 deletions(-)
\r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
67 index cd5de8f..8a792e9 100644
\r
68 --- a/emacs/notmuch-show.el
\r
69 +++ b/emacs/notmuch-show.el
\r
70 @@ -145,6 +145,10 @@ indentation."
\r
71 (make-variable-buffer-local 'notmuch-show-elide-non-matching-messages)
\r
72 (put 'notmuch-show-elide-non-matching-messages 'permanent-local t)
\r
74 +(defvar notmuch-show-indent-content t)
\r
75 +(make-variable-buffer-local 'notmuch-show-indent-content)
\r
76 +(put 'notmuch-show-indent-content 'permanent-local t)
\r
78 (defmacro with-current-notmuch-show-message (&rest body)
\r
79 "Evaluate body with current buffer set to the text of current message"
\r
81 @@ -255,10 +259,12 @@ operation on the contents of the current buffer."
\r
82 (all (buffer-substring (notmuch-show-message-top)
\r
83 (notmuch-show-message-bottom)))
\r
85 - (props (notmuch-show-get-message-properties)))
\r
86 + (props (notmuch-show-get-message-properties))
\r
87 + (indenting notmuch-show-indent-content))
\r
90 - (indent-rigidly (point-min) (point-max) (- depth))
\r
92 + (indent-rigidly (point-min) (point-max) (- depth)))
\r
93 ;; Remove the original header.
\r
94 (goto-char (point-min))
\r
95 (re-search-forward "^$" (point-max) nil)
\r
96 @@ -899,7 +905,8 @@ current buffer, if possible."
\r
97 (setq body-start (point-marker))
\r
98 ;; A blank line between the headers and the body.
\r
100 - (notmuch-show-insert-body msg (plist-get msg :body) depth)
\r
101 + (notmuch-show-insert-body msg (plist-get msg :body)
\r
102 + (if notmuch-show-indent-content depth 0))
\r
103 ;; Ensure that the body ends with a newline.
\r
106 @@ -907,7 +914,8 @@ current buffer, if possible."
\r
107 (setq content-end (point-marker))
\r
109 ;; Indent according to the depth in the thread.
\r
110 - (indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth))
\r
111 + (if notmuch-show-indent-content
\r
112 + (indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth)))
\r
114 (setq message-end (point-max-marker))
\r
116 @@ -954,6 +962,15 @@ current buffer, if possible."
\r
117 "Showing all messages."))
\r
118 (notmuch-show-refresh-view))
\r
120 +(defun notmuch-show-toggle-thread-indentation ()
\r
121 + "Toggle the indentation of threads."
\r
123 + (setq notmuch-show-indent-content (not notmuch-show-indent-content))
\r
124 + (message (if notmuch-show-indent-content
\r
125 + "Content is indented."
\r
126 + "Content is not indented."))
\r
127 + (notmuch-show-refresh-view))
\r
129 (defun notmuch-show-insert-tree (tree depth)
\r
130 "Insert the message tree TREE at depth DEPTH in the current thread."
\r
131 (let ((msg (car tree))
\r
132 @@ -1116,6 +1133,7 @@ Refreshes the current view, observing changes in cryptographic preferences."
\r
133 (define-key map "#" 'notmuch-show-print-message)
\r
134 (define-key map "!" 'notmuch-show-toggle-elide-non-matching)
\r
135 (define-key map "$" 'notmuch-show-toggle-process-crypto)
\r
136 + (define-key map "<" 'notmuch-show-toggle-thread-indentation)
\r
138 "Keymap for \"notmuch show\" buffers.")
\r
139 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
\r