1 Return-Path: <daniel@schoepe.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 79D5B429E42
\r
6 for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 10:34:53 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id bZ1sqR3LN4bt for <notmuch@notmuchmail.org>;
\r
17 Fri, 17 Feb 2012 10:34:51 -0800 (PST)
\r
18 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com
\r
19 [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 165EA431FB6
\r
22 for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 10:34:50 -0800 (PST)
\r
23 Received: by eaak14 with SMTP id k14so1918814eaa.26
\r
24 for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 10:34:49 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schoepe.org; s=google;
\r
26 h=mime-version:from:to:cc:subject:date:message-id:x-mailer;
\r
27 bh=h2BZOCeEi4RdB8abW5q+FRqFt6+u6k/HBd0HVQJtmCg=;
\r
28 b=XzWraVQ+JS6/huf5AUuopkaX3oFTaH3Bs63Vtf6VoaQj4YqECcyhuMugFxpcsw+3kq
\r
29 e77hZbNsqEkTwGRiOZ71Fhjmkpj/tSonA+9OWLHMdIQ3qjVcKiFsB61mcGwZQaNLkAmD
\r
30 YMBk6lvHVkxMTc+M3fVRfGPs9xpZvHLzAtw5o=
\r
32 Received: by 10.14.200.196 with SMTP id z44mr4154759een.116.1329503689606;
\r
33 Fri, 17 Feb 2012 10:34:49 -0800 (PST)
\r
34 Received: from localhost (p4FC797C1.dip0.t-ipconnect.de. [79.199.151.193])
\r
35 by mx.google.com with ESMTPS id y14sm11927538eef.10.2012.02.17.10.34.47
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Fri, 17 Feb 2012 10:34:48 -0800 (PST)
\r
38 From: Daniel Schoepe <daniel@schoepe.org>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH] emacs: Add configurable wrapping width for
\r
41 notmuch-wash-wrap-long-lines
\r
42 Date: Fri, 17 Feb 2012 19:34:44 +0100
\r
43 Message-Id: <1329503684-31289-1-git-send-email-daniel@schoepe.org>
\r
44 X-Mailer: git-send-email 1.7.9
\r
46 ALoCoQkg5cReXLQl+bOZJPssM8xhW3J9d8hVxnidXPsBhYvtrj9+cL582CzGEGibwQCDZxVrut1r
\r
47 X-BeenThere: notmuch@notmuchmail.org
\r
48 X-Mailman-Version: 2.1.13
\r
50 List-Id: "Use and development of the notmuch mail system."
\r
51 <notmuch.notmuchmail.org>
\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
55 List-Post: <mailto:notmuch@notmuchmail.org>
\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
59 X-List-Received-Date: Fri, 17 Feb 2012 18:34:53 -0000
\r
61 This introduces a variable to control after how many characters a line
\r
62 is wrapped by notmuch-wash-wrap-long-lines (still wrapping at the
\r
63 window width if it is lower).
\r
65 emacs/notmuch-wash.el | 36 ++++++++++++++++++++++++++----------
\r
66 1 files changed, 26 insertions(+), 10 deletions(-)
\r
68 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
\r
69 index 56981d0..7d003a2 100644
\r
70 --- a/emacs/notmuch-wash.el
\r
71 +++ b/emacs/notmuch-wash.el
\r
72 @@ -87,6 +87,14 @@ If there is one more line than the sum of
\r
73 `notmuch-wash-citation-lines-suffix', show that, otherwise
\r
74 collapse the remaining lines into a button.")
\r
76 +(defvar notmuch-wash-wrap-lines-length nil
\r
77 + "Wrap line after at most this many characters.
\r
79 +If this is nil, lines in messages will be wrapped to fit in the
\r
80 +current window. If this is a number, lines will be wrapped after
\r
81 +this many characters or at the window width (whichever one is
\r
84 (defun notmuch-wash-toggle-invisible-action (cite-button)
\r
85 (let ((invis-spec (button-get cite-button 'invisibility-spec)))
\r
86 (if (invisible-p invis-spec)
\r
87 @@ -276,16 +284,24 @@ Perform several transformations on the message body:
\r
90 (defun notmuch-wash-wrap-long-lines (msg depth)
\r
91 - "Wrap any long lines in the message to the width of the window.
\r
93 -When doing so, maintaining citation leaders in the wrapped text."
\r
95 - (let ((coolj-wrap-follows-window-size nil)
\r
96 - (fill-column (- (window-width)
\r
98 - ;; 2 to avoid poor interaction with
\r
101 + "Wrap long lines in the message.
\r
103 +If `notmuch-wash-wrap-lines-length' is a number, this will wrap
\r
104 +the message lines to the minimum of the width of the window or
\r
105 +its value. Otherwise, this function will wrap long lines in the
\r
106 +message at the window width. When doing so, citation leaders in
\r
107 +the wrapped text are maintained."
\r
109 + (let* ((coolj-wrap-follows-window-size nil)
\r
110 + (limit (if (numberp notmuch-wash-wrap-lines-length)
\r
111 + (min notmuch-wash-wrap-lines-length
\r
114 + (fill-column (- limit
\r
116 + ;; 2 to avoid poor interaction with
\r
119 (coolj-wrap-region (point-min) (point-max))))
\r