Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BD2CB429E25 for ; Thu, 24 Nov 2011 14:05:30 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D3W6tPps07nK for ; Thu, 24 Nov 2011 14:05:30 -0800 (PST) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by olra.theworths.org (Postfix) with SMTP id 9800D431FB6 for ; Thu, 24 Nov 2011 14:05:29 -0800 (PST) Received: (qmail invoked by alias); 24 Nov 2011 22:05:28 -0000 Received: from p54BE4A18.dip.t-dialin.net (EHLO shi.workgroup) [84.190.74.24] by mail.gmx.net (mp005) with SMTP; 24 Nov 2011 23:05:28 +0100 X-Authenticated: #19296480 X-Provags-ID: V01U2FsdGVkX1/5DMkFpwn5yMz5H//0c1ej+t1oaE2DQ2iM/TDsOu uSfCZBbExOjWyP Received: from grfz by shi.workgroup with local (Exim 4.77) (envelope-from ) id 1RThOw-0001vz-Mv; Thu, 24 Nov 2011 23:04:14 +0100 From: Gregor Zattler To: notmuch@notmuchmail.org Subject: [PATCH 1/4] emacs: make message indentation width customisable Date: Thu, 24 Nov 2011 23:03:21 +0100 Message-Id: <1322172204-6677-2-git-send-email-telegraph@gmx.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1322172204-6677-1-git-send-email-telegraph@gmx.net> References: <87d3ch8xz1.fsf@zancas.localnet> <1322172204-6677-1-git-send-email-telegraph@gmx.net> X-Y-GMX-Trusted: 0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2011 22:05:31 -0000 Till now Emacs UI indents messages according to their respecive depth of neting in the thread. The actual width of indentation per level is hardcoded to `1' space. This patch makes message indentation customisable by introducing a variable `notmuch-indent-messages-width' which defaults to `1', which is the same as before. Felix could set this variable to `0' in order to disable indentation, I tested it with a value of `4' for a clearer separation of messages in a thread. --- emacs/notmuch-show.el | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 7be88f8..d7fbbca 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -91,6 +91,16 @@ any given message." :group 'notmuch :type 'boolean) +(defcustom notmuch-indent-messages-width 1 + "Width of message indentation in threads. + +Messages are shown indented according to their depth in a thread. +This variable determines the width of this indentation measured +in number of blanks. Defaults to `1', choose `0' to disable +indentation." + :group 'notmuch + :type 'integer) + (defcustom notmuch-show-indent-multipart nil "Should the sub-parts of a multipart/* part be indented?" ;; dme: Not sure which is a good default. @@ -238,7 +248,7 @@ unchanged ADDRESS if parsing fails." "Insert a notmuch style headerline based on HEADERS for a message at DEPTH in the current thread." (let ((start (point))) - (insert (notmuch-show-spaces-n depth) + (insert (notmuch-show-spaces-n (* notmuch-indent-messages-width depth)) (notmuch-show-clean-address (plist-get headers :From)) " (" date @@ -739,7 +749,7 @@ current buffer, if possible." (setq content-end (point-marker)) ;; Indent according to the depth in the thread. - (indent-rigidly content-start content-end depth) + (indent-rigidly content-start content-end (* notmuch-indent-messages-width depth)) (setq message-end (point-max-marker)) -- 1.7.7.3