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 E4B87431FD0 for ; Mon, 11 Jul 2011 02:25:13 -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 5TsPn5HD75qH for ; Mon, 11 Jul 2011 02:25:12 -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 765A4431FB6 for ; Mon, 11 Jul 2011 02:25:12 -0700 (PDT) Received: by fxh19 with SMTP id 19so3774435fxh.19 for ; Mon, 11 Jul 2011 02:25:11 -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=TNpHD8NBaa8ILoFhepkQLDJslmfXsiqGFfEpuFAfRK0=; b=X7gXhQ0JpyIt5bqCQ0DryDdhg8FMBCH3kSjeIVqJL5X7tNR1H6NgaG0AuQAgXPD4ZH OKTNtYip6SBtaIFvP/FCF0XtmCk02Ib6b9J8yoj4B0foF+AOI3NvnTwiceXmxUI7/Oa6 aEC58C86nrrsWyeHuZYuofWfRKpX8qNPVorhU= Received: by 10.223.17.6 with SMTP id q6mr7260554faa.96.1310376311141; Mon, 11 Jul 2011 02:25:11 -0700 (PDT) Received: from localhorst.example.com (brln-4dba66f4.pool.mediaWays.net [77.186.102.244]) by mx.google.com with ESMTPS id m5sm9183484fai.25.2011.07.11.02.25.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 02:25:09 -0700 (PDT) Received: by localhorst.example.com (Postfix, from userid 501) id 05C654672913; Mon, 11 Jul 2011 11:24:57 +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: <87mxgl19n3.fsf@gmail.com> References: <87mxgl19n3.fsf@gmail.com> User-Agent: Emacs/23.3.1 (x86_64-apple-darwin10.7.0) Date: Mon, 11 Jul 2011 11:24:57 +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 09:25:14 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable Hi Dmitry, thank you for the comments. I included an updated patch that also includes Daniel's comment regarding the default value.=20 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. >=20 > On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller wrot= e: > > 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 resp= ective 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 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 =2D-- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -90,6 +90,11 @@ any given message." :group 'notmuch :type 'boolean) =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))) =2D (insert (notmuch-show-spaces-n depth) =2D (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 ;; Indent according to the depth in the thread. =2D (indent-rigidly content-start content-end depth) + (when notmuch-show-indent-messages-in-thread + (indent-rigidly content-start content-end depth)) =20 (setq message-end (point-max-marker)) =20 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) iEYEARECAAYFAk4awWkACgkQMxgKfMb9y5b1UQCeIStWr0O4YjIiY9T5FCgfbyGS Oo4AoNaw+6QUL3j2i/MKLouvWR4XvPaV =YCfD -----END PGP SIGNATURE----- --=-=-=--