From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6CD1F431FD0 for ; Mon, 11 Jul 2011 03:09:27 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.789 X-Spam-Level: X-Spam-Status: No, score=-0.789 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, T_MIME_NO_TEXT=0.01] 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 7DQUSIwSMTkL for ; Mon, 11 Jul 2011 03:09:26 -0700 (PDT) Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4B75D431FB6 for ; Mon, 11 Jul 2011 03:09:26 -0700 (PDT) Received: by fxh19 with SMTP id 19so3802171fxh.19 for ; Mon, 11 Jul 2011 03:09:25 -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=V4d58422UJF6TlU6fkNS6r/s0Kqzdi5fW/G7hHCT6ss=; b=kc2YvoCi5m3vRILJQag1RaZ3PEinJ0EHm3YDU1rgSD9pevcAvv8pRqJJoaE3Vbk9C7 41GiX42gReI9WI9dd/62+0GMFS5vWF8nBJLOtlWGNElHg056ernFrFLTeaW1NAvY1uJH i0YRJzZxWEmqlTL7JtK7VAcoEzgGlzCZkpjqw= Received: by 10.223.101.204 with SMTP id d12mr3707858fao.89.1310378964857; Mon, 11 Jul 2011 03:09:24 -0700 (PDT) Received: from localhorst.example.com (brln-4dba66f4.pool.mediaWays.net [77.186.102.244]) by mx.google.com with ESMTPS id u20sm7062410fac.42.2011.07.11.03.09.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 03:09:23 -0700 (PDT) Received: by localhorst.example.com (Postfix, from userid 501) id F0D2C4673891; Mon, 11 Jul 2011 12:09:20 +0200 (CEST) From: Felix Geller To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread In-Reply-To: <877h7p16r7.fsf@gmail.com> References: <87mxgl19n3.fsf@gmail.com> <877h7p16r7.fsf@gmail.com> User-Agent: Emacs/23.3.1 (x86_64-apple-darwin10.7.0) Date: Mon, 11 Jul 2011 12:09:20 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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 10:09:27 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 11 Jul 2011 13:55:24 +0400, Dmitry Kurochkin wrote: > On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller wrot= e: > > Hi Dmitry, > >=20 > > thank you for the comments. I included an updated patch that also > > includes Daniel's comment regarding the default value.=20 > >=20 >=20 > Another thing that would be nice to have is a test for this feature. I'll look into it :) Cheers, Felix > >=20 > Regards, > Dmitry >=20 > > I didn't change the "when" though--not because of personal reasons > > ;)--but because it is used for determining indentation of multi-parts. > >=20 > >=20 > > Cheers, > > Felix > >=20 > >=20 > >=20 > > On Mon, 11 Jul 2011 12:53:04 +0400, Dmitry Kurochkin wrote: > > > Hi Felix. > > >=20 > > > On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller = wrote: > > > > Hi, > > > >=20 > > > > I added a variable to toggle message indentation in Emacs. > > > >=20 > > > > Please let me know what you think. > > > >=20 > > >=20 > > > I like the change. Though I do not think I would use it without > > > chronological sorting. > > >=20 > > > Comments on the code below. > > >=20 > > > Regards, > > > Dmitry > > >=20 > > > >=20 > > > > Cheers, > > > > Felix > > > >=20 > > > >=20 > > > > 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) > > > >=20=20 > > > > +(defcustom notmuch-show-indent-messages-in-thread nil > > > > + "Should the messages in a thread be indented according to their = respective depth in the thread?" > > >=20 > > > This line is too long and should be split. > > >=20 > > > > + :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) > > > > + "") > > >=20 > > > (if notmuch-show-indent-messages-in-thread > > > (insert (notmuch-show-spaces-n depth))) > > >=20 > > > Is cleaner and avoids useless empty string insert. > > >=20 > > > > (notmuch-show-clean-address (plist-get headers :From)) > > > > " (" > > > > date > > > > @@ -733,7 +740,8 @@ current buffer, if possible." > > > > (setq content-end (point-marker)) > > > >=20=20 > > > > ;; 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)) > > >=20 > > > Not a big deal, but I would prefer `if' instead of `when' here. > > >=20 > > > Regards, > > > Dmitry > > >=20 > > > >=20=20 > > > > (setq message-end (point-max-marker)) > > > >=20=20 > > > > _______________________________________________ > > > > notmuch mailing list > > > > notmuch@notmuchmail.org > > > > http://notmuchmail.org/mailman/listinfo/notmuch > >=20 > >=20 > > commit f90fafdc0545a825ea4b69db5e51c2e866a4ff5e > > Author: Felix Geller > > Date: Mon Jul 11 10:39:00 2011 +0200 > >=20 > > Added a variable to toggle message indentation for thread view in e= macs. > > - includes adjustments according to comments from ML > >=20 > > 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) > >=20=20 > > +(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)) > >=20=20 > > ;; 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)) > >=20=20 > > (setq message-end (point-max-marker)) > >=20=20 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iEYEARECAAYFAk4ay9AACgkQMxgKfMb9y5bacwCfbqEHGWRX8eEOCZ/vlqi7itOM uYcAoIih8mtDn3j+6c+gB+hQmPbtuqhj =96xt -----END PGP SIGNATURE----- --=-=-=--