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 D3F4F40DAC7
\r
6 for <notmuch@notmuchmail.org>; Mon, 8 Nov 2010 02:45:24 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] 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 mdHNGTRPjUHe for <notmuch@notmuchmail.org>;
\r
16 Mon, 8 Nov 2010 02:45:14 -0800 (PST)
\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id 51AF840DAC2
\r
20 for <notmuch@notmuchmail.org>; Mon, 8 Nov 2010 02:45:14 -0800 (PST)
\r
21 Received: by wyb40 with SMTP id 40so5745544wyb.26
\r
22 for <notmuch@notmuchmail.org>; Mon, 08 Nov 2010 02:45:13 -0800 (PST)
\r
23 Received: by 10.216.179.81 with SMTP id g59mr4084696wem.35.1289213113406;
\r
24 Mon, 08 Nov 2010 02:45:13 -0800 (PST)
\r
25 Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com
\r
27 by mx.google.com with ESMTPS id e12sm2991684wer.36.2010.11.08.02.45.11
\r
28 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
29 Mon, 08 Nov 2010 02:45:12 -0800 (PST)
\r
30 Received: by ut.hh.sledj.net (Postfix, from userid 1000)
\r
31 id 9854259405B; Mon, 8 Nov 2010 10:44:09 +0000 (GMT)
\r
32 From: David Edmondson <dme@dme.org>
\r
33 To: notmuch@notmuchmail.org
\r
34 Subject: [PATCH] emacs: Elide the display of repeated subjects in thread
\r
36 Date: Mon, 8 Nov 2010 10:44:08 +0000
\r
37 Message-Id: <1289213048-24332-1-git-send-email-dme@dme.org>
\r
38 X-Mailer: git-send-email 1.7.2.3
\r
39 In-Reply-To: <878w17psjr.fsf@yoom.home.cworth.org>
\r
40 References: <878w17psjr.fsf@yoom.home.cworth.org>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Mon, 08 Nov 2010 10:45:25 -0000
\r
55 Collapsed messages do not show a "Subject:" line if the subject is the
\r
56 same as that of the previous message.
\r
59 Remove the preference setting.
\r
61 emacs/notmuch-show.el | 34 ++++++++++++++++++++++++----------
\r
62 1 files changed, 24 insertions(+), 10 deletions(-)
\r
64 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
65 index 7ec6aa5..13964c2 100644
\r
66 --- a/emacs/notmuch-show.el
\r
67 +++ b/emacs/notmuch-show.el
\r
68 @@ -381,17 +381,24 @@ current buffer, if possible."
\r
69 (defun notmuch-show-make-symbol (type)
\r
70 (make-symbol (concat "notmuch-show-" type)))
\r
72 +(defun notmuch-show-strip-re (string)
\r
73 + (replace-regexp-in-string "^\\([Rr]e: *\\)+" "" string))
\r
75 +(defvar notmuch-show-previous-subject "")
\r
76 +(make-variable-buffer-local 'notmuch-show-previous-subject)
\r
78 (defun notmuch-show-insert-msg (msg depth)
\r
79 "Insert the message MSG at depth DEPTH in the current thread."
\r
80 - (let ((headers (plist-get msg :headers))
\r
81 - ;; Indentation causes the buffer offset of the start/end
\r
82 - ;; points to move, so we must use markers.
\r
83 - message-start message-end
\r
84 - content-start content-end
\r
85 - headers-start headers-end
\r
86 - body-start body-end
\r
87 - (headers-invis-spec (notmuch-show-make-symbol "header"))
\r
88 - (message-invis-spec (notmuch-show-make-symbol "message")))
\r
89 + (let* ((headers (plist-get msg :headers))
\r
90 + ;; Indentation causes the buffer offset of the start/end
\r
91 + ;; points to move, so we must use markers.
\r
92 + message-start message-end
\r
93 + content-start content-end
\r
94 + headers-start headers-end
\r
95 + body-start body-end
\r
96 + (headers-invis-spec (notmuch-show-make-symbol "header"))
\r
97 + (message-invis-spec (notmuch-show-make-symbol "message"))
\r
98 + (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
\r
100 ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
\r
101 ;; removing items from `buffer-invisibility-spec' (which is what
\r
102 @@ -428,10 +435,17 @@ current buffer, if possible."
\r
105 (goto-char content-start)
\r
107 + ;; If the subject of this message is the same as that of the
\r
108 + ;; previous message, don't display it when this message is
\r
110 + (when (not (string= notmuch-show-previous-subject
\r
112 + (forward-line 1))
\r
113 (setq headers-start (point-marker)))
\r
114 (setq headers-end (point-marker))
\r
116 + (setq notmuch-show-previous-subject bare-subject)
\r
118 (setq body-start (point-marker))
\r
119 (notmuch-show-insert-body msg (plist-get msg :body) depth)
\r
120 ;; Ensure that the body ends with a newline.
\r