[PATCH 1/4] emacs: make message indentation width customisable
[notmuch-archives.git] / de / 4a935b8ae6004a8400684036effc9904771879
1 Return-Path: <error4me@gmx.de>\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 BD2CB429E25\r
6         for <notmuch@notmuchmail.org>; Thu, 24 Nov 2011 14:05:30 -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: 0.001\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
12         tests=[FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]\r
13         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 D3W6tPps07nK for <notmuch@notmuchmail.org>;\r
17         Thu, 24 Nov 2011 14:05:30 -0800 (PST)\r
18 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23])\r
19         by olra.theworths.org (Postfix) with SMTP id 9800D431FB6\r
20         for <notmuch@notmuchmail.org>; Thu, 24 Nov 2011 14:05:29 -0800 (PST)\r
21 Received: (qmail invoked by alias); 24 Nov 2011 22:05:28 -0000\r
22 Received: from p54BE4A18.dip.t-dialin.net (EHLO shi.workgroup) [84.190.74.24]\r
23         by mail.gmx.net (mp005) with SMTP; 24 Nov 2011 23:05:28 +0100\r
24 X-Authenticated: #19296480\r
25 X-Provags-ID: V01U2FsdGVkX1/5DMkFpwn5yMz5H//0c1ej+t1oaE2DQ2iM/TDsOu\r
26         uSfCZBbExOjWyP\r
27 Received: from grfz by shi.workgroup with local (Exim 4.77)\r
28         (envelope-from <error4me@gmx.de>)\r
29         id 1RThOw-0001vz-Mv; Thu, 24 Nov 2011 23:04:14 +0100\r
30 From: Gregor Zattler <telegraph@gmx.net>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [PATCH 1/4] emacs: make message indentation width customisable\r
33 Date: Thu, 24 Nov 2011 23:03:21 +0100\r
34 Message-Id: <1322172204-6677-2-git-send-email-telegraph@gmx.net>\r
35 X-Mailer: git-send-email 1.7.7.3\r
36 In-Reply-To: <1322172204-6677-1-git-send-email-telegraph@gmx.net>\r
37 References: <87d3ch8xz1.fsf@zancas.localnet>\r
38         <1322172204-6677-1-git-send-email-telegraph@gmx.net>\r
39 X-Y-GMX-Trusted: 0\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Thu, 24 Nov 2011 22:05:31 -0000\r
53 \r
54 Till now Emacs UI indents messages according to their respecive\r
55 depth of neting in the thread.  The actual width of indentation\r
56 per level is hardcoded to `1' space.\r
57 This patch makes message indentation customisable by introducing\r
58 a variable `notmuch-indent-messages-width' which defaults to `1',\r
59 which is the same as before.  Felix could set this variable to\r
60 `0' in order to disable indentation, I tested it with a value of\r
61 `4' for a clearer separation of messages in a thread.\r
62 ---\r
63  emacs/notmuch-show.el |   14 ++++++++++++--\r
64  1 files changed, 12 insertions(+), 2 deletions(-)\r
65 \r
66 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
67 index 7be88f8..d7fbbca 100644\r
68 --- a/emacs/notmuch-show.el\r
69 +++ b/emacs/notmuch-show.el\r
70 @@ -91,6 +91,16 @@ any given message."\r
71    :group 'notmuch\r
72    :type 'boolean)\r
73  \r
74 +(defcustom notmuch-indent-messages-width 1\r
75 +  "Width of message indentation in threads.\r
76 +\r
77 +Messages are shown indented according to their depth in a thread.\r
78 +This variable determines the width of this indentation measured\r
79 +in number of blanks.  Defaults to `1', choose `0' to disable\r
80 +indentation."\r
81 +  :group 'notmuch\r
82 +  :type 'integer)\r
83 +\r
84  (defcustom notmuch-show-indent-multipart nil\r
85    "Should the sub-parts of a multipart/* part be indented?"\r
86    ;; dme: Not sure which is a good default.\r
87 @@ -238,7 +248,7 @@ unchanged ADDRESS if parsing fails."\r
88    "Insert a notmuch style headerline based on HEADERS for a\r
89  message at DEPTH in the current thread."\r
90    (let ((start (point)))\r
91 -    (insert (notmuch-show-spaces-n depth)\r
92 +    (insert (notmuch-show-spaces-n (* notmuch-indent-messages-width depth))\r
93             (notmuch-show-clean-address (plist-get headers :From))\r
94             " ("\r
95             date\r
96 @@ -739,7 +749,7 @@ current buffer, if possible."\r
97      (setq content-end (point-marker))\r
98  \r
99      ;; Indent according to the depth in the thread.\r
100 -    (indent-rigidly content-start content-end depth)\r
101 +    (indent-rigidly content-start content-end (* notmuch-indent-messages-width depth))\r
102  \r
103      (setq message-end (point-max-marker))\r
104  \r
105 -- \r
106 1.7.7.3\r
107 \r