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 A72C0431FD0 for ; Mon, 11 Jul 2011 02:55:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 0KTfNzilJupv for ; Mon, 11 Jul 2011 02:55:31 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 79CBA431FB6 for ; Mon, 11 Jul 2011 02:55:31 -0700 (PDT) Received: by bwg12 with SMTP id 12so3551413bwg.26 for ; Mon, 11 Jul 2011 02:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=tubY19e63EfhvECg+QrXzSWfM1SkRwSX55FfwfdGbRc=; b=b7QMF4Ag8Vvep0+AXqDQROWyiEbURgHu8+uMY3Rog492/BxNo5D301is9JP0nW1OGy Ke9vQzwNcVLqKYHUJmZ9dQv00d825/W+K2/23SNpqoxInyGlALIXWocgk2K5MZqJrcEj xbo1U58Yms10WsAf3II0RHwmkTnRP+pUbr0Ew= Received: by 10.204.144.194 with SMTP id a2mr2467472bkv.93.1310378130098; Mon, 11 Jul 2011 02:55:30 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id o3sm976584bka.33.2011.07.11.02.55.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 02:55:29 -0700 (PDT) From: Dmitry Kurochkin To: Felix Geller , notmuch@notmuchmail.org Subject: Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread In-Reply-To: References: <87mxgl19n3.fsf@gmail.com> User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 11 Jul 2011 13:55:24 +0400 Message-ID: <877h7p16r7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Mon, 11 Jul 2011 09:55:32 -0000 On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller wrote: > Hi Dmitry, > > thank you for the comments. I included an updated patch that also > includes Daniel's comment regarding the default value. > Another thing that would be nice to have is a test for this feature. Regards, Dmitry > I didn't change the "when" though--not because of personal reasons > ;)--but because it is used for determining indentation of multi-parts. > > > Cheers, > Felix > > > > On Mon, 11 Jul 2011 12:53:04 +0400, Dmitry Kurochkin wrote: > > Hi Felix. > > > > On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller wrote: > > > Hi, > > > > > > I added a variable to toggle message indentation in Emacs. > > > > > > Please let me know what you think. > > > > > > > I like the change. Though I do not think I would use it without > > chronological sorting. > > > > Comments on the code below. > > > > Regards, > > Dmitry > > > > > > > > Cheers, > > > Felix > > > > > > > > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > > > index a433dec..8101c27 100644 > > > --- a/emacs/notmuch-show.el > > > +++ b/emacs/notmuch-show.el > > > @@ -90,6 +90,11 @@ any given message." > > > :group 'notmuch > > > :type 'boolean) > > > > > > +(defcustom notmuch-show-indent-messages-in-thread nil > > > + "Should the messages in a thread be indented according to their respective depth in the thread?" > > > > This line is too long and should be split. > > > > > + :group 'notmuch > > > + :type 'boolean) > > > + > > > (defcustom notmuch-show-indent-multipart nil > > > "Should the sub-parts of a multipart/* part be indented?" > > > ;; dme: Not sure which is a good default. > > > @@ -237,7 +242,9 @@ 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 (if notmuch-show-indent-messages-in-thread > > > + (notmuch-show-spaces-n depth) > > > + "") > > > > (if notmuch-show-indent-messages-in-thread > > (insert (notmuch-show-spaces-n depth))) > > > > Is cleaner and avoids useless empty string insert. > > > > > (notmuch-show-clean-address (plist-get headers :From)) > > > " (" > > > date > > > @@ -733,7 +740,8 @@ current buffer, if possible." > > > (setq content-end (point-marker)) > > > > > > ;; Indent according to the depth in the thread. > > > - (indent-rigidly content-start content-end depth) > > > + (when notmuch-show-indent-messages-in-thread > > > + (indent-rigidly content-start content-end depth)) > > > > Not a big deal, but I would prefer `if' instead of `when' here. > > > > Regards, > > Dmitry > > > > > > > > (setq message-end (point-max-marker)) > > > > > > _______________________________________________ > > > notmuch mailing list > > > notmuch@notmuchmail.org > > > http://notmuchmail.org/mailman/listinfo/notmuch > > > commit f90fafdc0545a825ea4b69db5e51c2e866a4ff5e > Author: Felix Geller > Date: Mon Jul 11 10:39:00 2011 +0200 > > Added a variable to toggle message indentation for thread view in emacs. > - includes adjustments according to comments from ML > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index a433dec..1834066 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -90,6 +90,11 @@ any given message." > :group 'notmuch > :type 'boolean) > > +(defcustom notmuch-show-indent-messages-in-thread t > + "Should messages be indented according to their depth in a thread?" > + :group 'notmuch > + :type 'boolean) > + > (defcustom notmuch-show-indent-multipart nil > "Should the sub-parts of a multipart/* part be indented?" > ;; dme: Not sure which is a good default. > @@ -237,8 +242,9 @@ 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) > - (notmuch-show-clean-address (plist-get headers :From)) > + (when notmuch-show-indent-messages-in-thread > + (insert (notmuch-show-spaces-n depth))) > + (insert (notmuch-show-clean-address (plist-get headers :From)) > " (" > date > ") (" > @@ -733,7 +739,8 @@ current buffer, if possible." > (setq content-end (point-marker)) > > ;; Indent according to the depth in the thread. > - (indent-rigidly content-start content-end depth) > + (when notmuch-show-indent-messages-in-thread > + (indent-rigidly content-start content-end depth)) > > (setq message-end (point-max-marker)) >