Re: Plans for the 0.2 release (this week)
[notmuch-archives.git] / f4 / d44e3892a3ce6288f3980e961e6c40383baa78
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 D53A8431FBC\r
6         for <notmuch@notmuchmail.org>; Wed, 17 Feb 2010 02:52:19 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.269\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.269 tagged_above=-999 required=5 tests=[AWL=0.330,\r
12         BAYES_00=-2.599] autolearn=ham\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 mcZO8SnqADNn for <notmuch@notmuchmail.org>;\r
16         Wed, 17 Feb 2010 02:52:19 -0800 (PST)\r
17 Received: from mail-ew0-f220.google.com (mail-ew0-f220.google.com\r
18         [209.85.219.220])\r
19         by olra.theworths.org (Postfix) with ESMTP id C299B431FAE\r
20         for <notmuch@notmuchmail.org>; Wed, 17 Feb 2010 02:52:18 -0800 (PST)\r
21 Received: by ewy20 with SMTP id 20so7755306ewy.0\r
22         for <notmuch@notmuchmail.org>; Wed, 17 Feb 2010 02:52:17 -0800 (PST)\r
23 Received: by 10.213.100.68 with SMTP id x4mr5030922ebn.33.1266403937508;\r
24         Wed, 17 Feb 2010 02:52:17 -0800 (PST)\r
25 Received: from aw.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])\r
26         by mx.google.com with ESMTPS id 28sm20514400eye.31.2010.02.17.02.52.16\r
27         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
28         Wed, 17 Feb 2010 02:52:16 -0800 (PST)\r
29 Received: by aw.hh.sledj.net (Postfix, from userid 1000)\r
30         id C543D3A099; Wed, 17 Feb 2010 10:51:59 +0000 (GMT)\r
31 From: David Edmondson <dme@dme.org>\r
32 To: notmuch@notmuchmail.org\r
33 Date: Wed, 17 Feb 2010 10:51:51 +0000\r
34 Message-Id: <1266403911-16567-1-git-send-email-dme@dme.org>\r
35 X-Mailer: git-send-email 1.6.6.1\r
36 Subject: [notmuch] [PATCH] notmuch.el: Allow citation suffixes to be shown\r
37         as well as prefixes.\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Wed, 17 Feb 2010 10:52:20 -0000\r
51 \r
52 In many conversations the last few lines of a citation are more\r
53 interesting than the first few lines, hence allow those to be shown if\r
54 desired.\r
55 \r
56 Modify the face used for the citation button to distinguish it from\r
57 the surrounding citation.\r
58 ---\r
59  notmuch.el |   37 +++++++++++++++++++++++++------------\r
60  1 files changed, 25 insertions(+), 12 deletions(-)\r
61 \r
62 diff --git a/notmuch.el b/notmuch.el\r
63 index 20e5144..ab71b5e 100644\r
64 --- a/notmuch.el\r
65 +++ b/notmuch.el\r
66 @@ -111,10 +111,20 @@ Can use up to one integer format parameter, i.e. %d")\r
67    "Maximum length of signature that will be hidden by default.")\r
68  \r
69  (defvar notmuch-show-citation-lines-prefix 4\r
70 -  "Always show at least this many lines of a citation.\r
71 +  "Always show at least this many lines at the start of a citation.\r
72  \r
73 -If there is one more line, show that, otherwise collapse\r
74 -remaining lines into a button.")\r
75 +If there is one more line than the sum of\r
76 +`notmuch-show-citation-lines-prefix' and\r
77 +`notmuch-show-citation-lines-suffix', show that, otherwise\r
78 +collapse remaining lines into a button.")\r
79 +\r
80 +(defvar notmuch-show-citation-lines-suffix 0\r
81 +  "Always show at least this many lines at the end of a citation.\r
82 +\r
83 +If there is one more line than the sum of\r
84 +`notmuch-show-citation-lines-prefix' and\r
85 +`notmuch-show-citation-lines-suffix', show that, otherwise\r
86 +collapse remaining lines into a button.")\r
87  \r
88  (defvar notmuch-command "notmuch"\r
89    "Command to run the notmuch binary.")\r
90 @@ -643,7 +653,7 @@ which this thread was originally shown."\r
91  (define-button-type 'notmuch-button-invisibility-toggle-type\r
92    'action 'notmuch-toggle-invisible-action\r
93    'follow-link t\r
94 -  'face 'font-lock-comment-face)\r
95 +  'face 'font-lock-comment-delimiter-face)\r
96  (define-button-type 'notmuch-button-citation-toggle-type 'help-echo "mouse-1, RET: Show citation"\r
97    :supertype 'notmuch-button-invisibility-toggle-type)\r
98  (define-button-type 'notmuch-button-signature-toggle-type 'help-echo "mouse-1, RET: Show signature"\r
99 @@ -711,16 +721,19 @@ is what to put on the button."\r
100              (cite-end  (match-end 0))\r
101              (cite-lines (count-lines cite-start cite-end)))\r
102         (overlay-put (make-overlay cite-start cite-end) 'face 'message-cited-text-face)\r
103 -       (when (> cite-lines (1+ notmuch-show-citation-lines-prefix))\r
104 +       (when (> cite-lines (1+ (+ notmuch-show-citation-lines-prefix notmuch-show-citation-lines-suffix)))\r
105           (goto-char cite-start)\r
106           (forward-line notmuch-show-citation-lines-prefix)\r
107 -         (notmuch-show-region-to-button\r
108 -          (point) cite-end\r
109 -          "citation"\r
110 -          indent\r
111 -          (format notmuch-show-citation-button-format\r
112 -                  (- cite-lines notmuch-show-citation-lines-prefix))\r
113 -          ))))\r
114 +         (let ((hidden-start (point)))\r
115 +           (goto-char cite-end)\r
116 +           (forward-line (- notmuch-show-citation-lines-suffix))\r
117 +           (notmuch-show-region-to-button\r
118 +            hidden-start (point)\r
119 +            "citation"\r
120 +            indent\r
121 +            (format notmuch-show-citation-button-format\r
122 +                    (- cite-lines notmuch-show-citation-lines-prefix notmuch-show-citation-lines-suffix))\r
123 +            )))))\r
124      (if (and (< (point) end)\r
125              (re-search-forward signature-regexp end t))\r
126         (let* ((sig-start (match-beginning 0))\r
127 -- \r
128 1.6.6.1\r
129 \r