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 E6C23414B85
\r
6 for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 00:47:08 -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 FrBv2UjtS4nH for <notmuch@notmuchmail.org>;
\r
16 Tue, 31 Jan 2012 00:47:07 -0800 (PST)
\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
\r
18 [74.125.82.181]) (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 D106B41ED96
\r
21 for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 00:47:06 -0800 (PST)
\r
22 Received: by werb10 with SMTP id b10so4655480wer.26
\r
23 for <notmuch@notmuchmail.org>; Tue, 31 Jan 2012 00:47:05 -0800 (PST)
\r
24 Received: by 10.180.106.33 with SMTP id gr1mr32811069wib.6.1327999625532;
\r
25 Tue, 31 Jan 2012 00:47:05 -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 fr8sm60762217wib.10.2012.01.31.00.47.03
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Tue, 31 Jan 2012 00:47:03 -0800 (PST)
\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
32 id D36E4A02EC; Tue, 31 Jan 2012 08:47:01 +0000 (GMT)
\r
33 From: David Edmondson <dme@dme.org>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH 3/5] emacs: Allow the indentation of content to be toggled.
\r
36 Date: Tue, 31 Jan 2012 08:46:58 +0000
\r
37 Message-Id: <1327999620-14595-4-git-send-email-dme@dme.org>
\r
38 X-Mailer: git-send-email 1.7.8.3
\r
39 In-Reply-To: <1327999620-14595-1-git-send-email-dme@dme.org>
\r
40 References: <id:"1327486729-18052-1-git-send-email-dme@dme.org">
\r
41 <1327999620-14595-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: Tue, 31 Jan 2012 08:47:09 -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 77ba2dd..789b6d9 100644
\r
68 --- a/emacs/notmuch-show.el
\r
69 +++ b/emacs/notmuch-show.el
\r
70 @@ -140,6 +140,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 @@ -250,10 +254,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 @@ -881,7 +887,8 @@ current buffer, if possible."
\r
97 (setq notmuch-show-previous-subject bare-subject)
\r
99 (setq body-start (point-marker))
\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 @@ -889,7 +896,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 @@ -936,6 +944,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 @@ -1098,6 +1115,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