1 Return-Path: <bremner@pivot.cs.unb.ca>
\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 8FFA9431FC2
\r
6 for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 12:09:37 -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 a6T7w7XiPBgE for <notmuch@notmuchmail.org>;
\r
11 Fri, 25 Dec 2009 12:09:36 -0800 (PST)
\r
12 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 154CB431FC3
\r
14 for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 12:09:35 -0800 (PST)
\r
16 fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net
\r
17 ([142.167.182.194] helo=localhost)
\r
18 by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
\r
19 (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)
\r
20 id 1NOGTe-0004og-Ml; Fri, 25 Dec 2009 16:09:34 -0400
\r
21 Received: from bremner by localhost with local (Exim 4.71)
\r
22 (envelope-from <bremner@pivot.cs.unb.ca>)
\r
23 id 1NOGTZ-0006B8-C4; Fri, 25 Dec 2009 16:09:29 -0400
\r
24 From: david@tethera.net
\r
25 To: notmuch@notmuchmail.org
\r
26 Date: Fri, 25 Dec 2009 16:09:08 -0400
\r
27 Message-Id: <1261771748-23687-3-git-send-email-david@tethera.net>
\r
28 X-Mailer: git-send-email 1.6.5.7
\r
29 In-Reply-To: <1261771748-23687-2-git-send-email-david@tethera.net>
\r
30 References: <87my17965l.fsf@anar.kanru.info>
\r
31 <1261771748-23687-1-git-send-email-david@tethera.net>
\r
32 <1261771748-23687-2-git-send-email-david@tethera.net>
\r
33 X-Sender-Verified: bremner@pivot.cs.unb.ca
\r
34 Cc: David Bremner <bremner@unb.ca>
\r
35 Subject: [notmuch] [PATCH 2/2] notmuch.el: show some of citation even when
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.12
\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: Fri, 25 Dec 2009 20:09:38 -0000
\r
51 From: David Bremner <bremner@unb.ca>
\r
53 - rename notmuch-show-citation-lines-min to n-s-c-l-prefix
\r
54 - call forward-line with the appropriate parameter to adjust
\r
55 region to be hidden.
\r
56 - change citation button text so that it makes (some) sense when citation is shown
\r
58 notmuch.el | 18 ++++++++++++------
\r
59 1 files changed, 12 insertions(+), 6 deletions(-)
\r
61 diff --git a/notmuch.el b/notmuch.el
\r
62 index 8a51d27..c280411 100644
\r
65 @@ -99,7 +99,7 @@ pattern can still test against the entire line).")
\r
66 Can use up to one integer format parameter, i.e. %d")
\r
68 (defvar notmuch-show-citation-button-format
\r
69 - "[ %d-line hidden citation. Click/Enter to show ]"
\r
70 + "[ %d more citation lines. Click/Enter to toggle visibility. ]"
\r
71 "String used to construct button text for hidden citations.
\r
73 Can use up to one integer format parameter, i.e. %d")
\r
74 @@ -107,8 +107,11 @@ Can use up to one integer format parameter, i.e. %d")
\r
75 (defvar notmuch-show-signature-lines-max 12
\r
76 "Maximum length of signature that will be hidden by default.")
\r
78 -(defvar notmuch-show-citation-lines-min 4
\r
79 - "Minimum length of citation that will be hidden.")
\r
80 +(defvar notmuch-show-citation-lines-prefix 4
\r
81 + "Always show at least this many lines of a citation.
\r
83 +If there is one more line, show that, otherwise collapse
\r
84 +remaining lines into a button.")
\r
86 (defvar notmuch-command "notmuch"
\r
87 "Command to run the notmuch binary.")
\r
88 @@ -660,12 +663,15 @@ is what to put on the button."
\r
89 (let* ((cite-start (match-beginning 0))
\r
90 (cite-end (match-end 0))
\r
91 (cite-lines (count-lines cite-start cite-end)))
\r
92 - (if (>= cite-lines notmuch-show-citation-lines-min)
\r
93 + (when (> cite-lines (1+ notmuch-show-citation-lines-prefix))
\r
94 + (goto-char cite-start)
\r
95 + (forward-line notmuch-show-citation-lines-prefix)
\r
96 (notmuch-show-region-to-button
\r
97 - cite-start cite-end
\r
101 - (format notmuch-show-citation-button-format cite-lines)
\r
102 + (format notmuch-show-citation-button-format
\r
103 + (- cite-lines notmuch-show-citation-lines-prefix))
\r
105 (if (and (< (point) end)
\r
106 (re-search-forward signature-regexp end t))
\r