Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread
authorFelix Geller <fgeller@gmail.com>
Mon, 11 Jul 2011 10:09:20 +0000 (12:09 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:04 +0000 (09:39 -0800)
57/987ab5337881bb1a070ebf13dbbb63bcaaa0eb [new file with mode: 0644]

diff --git a/57/987ab5337881bb1a070ebf13dbbb63bcaaa0eb b/57/987ab5337881bb1a070ebf13dbbb63bcaaa0eb
new file mode 100644 (file)
index 0000000..00a00f3
--- /dev/null
@@ -0,0 +1,245 @@
+Return-Path: <fgeller@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6CD1F431FD0\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 03:09:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.789\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.789 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7DQUSIwSMTkL for <notmuch@notmuchmail.org>;\r
+       Mon, 11 Jul 2011 03:09:26 -0700 (PDT)\r
+Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com\r
+       [209.85.161.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4B75D431FB6\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 03:09:26 -0700 (PDT)\r
+Received: by fxh19 with SMTP id 19so3802171fxh.19\r
+       for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 03:09:25 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=V4d58422UJF6TlU6fkNS6r/s0Kqzdi5fW/G7hHCT6ss=;\r
+       b=kc2YvoCi5m3vRILJQag1RaZ3PEinJ0EHm3YDU1rgSD9pevcAvv8pRqJJoaE3Vbk9C7\r
+       41GiX42gReI9WI9dd/62+0GMFS5vWF8nBJLOtlWGNElHg056ernFrFLTeaW1NAvY1uJH\r
+       i0YRJzZxWEmqlTL7JtK7VAcoEzgGlzCZkpjqw=\r
+Received: by 10.223.101.204 with SMTP id d12mr3707858fao.89.1310378964857;\r
+       Mon, 11 Jul 2011 03:09:24 -0700 (PDT)\r
+Received: from localhorst.example.com (brln-4dba66f4.pool.mediaWays.net\r
+       [77.186.102.244])\r
+       by mx.google.com with ESMTPS id u20sm7062410fac.42.2011.07.11.03.09.22\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 11 Jul 2011 03:09:23 -0700 (PDT)\r
+Received: by localhorst.example.com (Postfix, from userid 501)\r
+       id F0D2C4673891; Mon, 11 Jul 2011 12:09:20 +0200 (CEST)\r
+From: Felix Geller <fgeller@gmail.com>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Emacs: Add variable to toggle message indentation in a\r
+       thread\r
+In-Reply-To: <877h7p16r7.fsf@gmail.com>\r
+References: <m2r55xi4yr.fsf@gmail.com> <87mxgl19n3.fsf@gmail.com>\r
+       <m2aaclkw46.fsf@gmail.com> <877h7p16r7.fsf@gmail.com>\r
+User-Agent: Emacs/23.3.1 (x86_64-apple-darwin10.7.0)\r
+Date: Mon, 11 Jul 2011 12:09:20 +0200\r
+Message-ID: <m24o2t163z.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 11 Jul 2011 10:09:27 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Mon, 11 Jul 2011 13:55:24 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmai=\r
+l.com> wrote:\r
+> On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller <fgeller@gmail.com> wrot=\r
+e:\r
+> > Hi Dmitry,\r
+> >=20\r
+> > thank you for the comments. I included an updated patch that also\r
+> > includes Daniel's comment regarding the default value.=20\r
+> >=20\r
+>=20\r
+> Another thing that would be nice to have is a test for this feature.\r
+\r
+I'll look into it :)\r
+\r
+Cheers,\r
+Felix\r
+\r
+>\r
+>=20\r
+> Regards,\r
+>   Dmitry\r
+>=20\r
+> > I didn't change the "when" though--not because of personal reasons\r
+> > ;)--but because it is used for determining indentation of multi-parts.\r
+> >=20\r
+> >=20\r
+> > Cheers,\r
+> > Felix\r
+> >=20\r
+> >=20\r
+> >=20\r
+> > On Mon, 11 Jul 2011 12:53:04 +0400, Dmitry Kurochkin <dmitry.kurochkin@=\r
+gmail.com> wrote:\r
+> > > Hi Felix.\r
+> > >=20\r
+> > > On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller <fgeller@gmail.com> =\r
+wrote:\r
+> > > > Hi,\r
+> > > >=20\r
+> > > > I added a variable to toggle message indentation in Emacs.\r
+> > > >=20\r
+> > > > Please let me know what you think.\r
+> > > >=20\r
+> > >=20\r
+> > > I like the change.  Though I do not think I would use it without\r
+> > > chronological sorting.\r
+> > >=20\r
+> > > Comments on the code below.\r
+> > >=20\r
+> > > Regards,\r
+> > >   Dmitry\r
+> > >=20\r
+> > > >=20\r
+> > > > Cheers,\r
+> > > > Felix\r
+> > > >=20\r
+> > > >=20\r
+> > > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> > > > index a433dec..8101c27 100644\r
+> > > > --- a/emacs/notmuch-show.el\r
+> > > > +++ b/emacs/notmuch-show.el\r
+> > > > @@ -90,6 +90,11 @@ any given message."\r
+> > > >    :group 'notmuch\r
+> > > >    :type 'boolean)\r
+> > > >=20=20\r
+> > > > +(defcustom notmuch-show-indent-messages-in-thread nil\r
+> > > > +  "Should the messages in a thread be indented according to their =\r
+respective depth in the thread?"\r
+> > >=20\r
+> > > This line is too long and should be split.\r
+> > >=20\r
+> > > > +  :group 'notmuch\r
+> > > > +  :type 'boolean)\r
+> > > > +\r
+> > > >  (defcustom notmuch-show-indent-multipart nil\r
+> > > >    "Should the sub-parts of a multipart/* part be indented?"\r
+> > > >    ;; dme: Not sure which is a good default.\r
+> > > > @@ -237,7 +242,9 @@ unchanged ADDRESS if parsing fails."\r
+> > > >    "Insert a notmuch style headerline based on HEADERS for a\r
+> > > >  message at DEPTH in the current thread."\r
+> > > >    (let ((start (point)))\r
+> > > > -    (insert (notmuch-show-spaces-n depth)\r
+> > > > +    (insert (if notmuch-show-indent-messages-in-thread\r
+> > > > +              (notmuch-show-spaces-n depth)\r
+> > > > +            "")\r
+> > >=20\r
+> > > (if notmuch-show-indent-messages-in-thread\r
+> > >     (insert (notmuch-show-spaces-n depth)))\r
+> > >=20\r
+> > > Is cleaner and avoids useless empty string insert.\r
+> > >=20\r
+> > > >            (notmuch-show-clean-address (plist-get headers :From))\r
+> > > >            " ("\r
+> > > >            date\r
+> > > > @@ -733,7 +740,8 @@ current buffer, if possible."\r
+> > > >      (setq content-end (point-marker))\r
+> > > >=20=20\r
+> > > >      ;; Indent according to the depth in the thread.\r
+> > > > -    (indent-rigidly content-start content-end depth)\r
+> > > > +    (when notmuch-show-indent-messages-in-thread\r
+> > > > +      (indent-rigidly content-start content-end depth))\r
+> > >=20\r
+> > > Not a big deal, but I would prefer `if' instead of `when' here.\r
+> > >=20\r
+> > > Regards,\r
+> > >   Dmitry\r
+> > >=20\r
+> > > >=20=20\r
+> > > >      (setq message-end (point-max-marker))\r
+> > > >=20=20\r
+> > > > _______________________________________________\r
+> > > > notmuch mailing list\r
+> > > > notmuch@notmuchmail.org\r
+> > > > http://notmuchmail.org/mailman/listinfo/notmuch\r
+> >=20\r
+> >=20\r
+> > commit f90fafdc0545a825ea4b69db5e51c2e866a4ff5e\r
+> > Author: Felix Geller <fgeller@gmail.com>\r
+> > Date:   Mon Jul 11 10:39:00 2011 +0200\r
+> >=20\r
+> >     Added a variable to toggle message indentation for thread view in e=\r
+macs.\r
+> >      - includes adjustments according to comments from ML\r
+> >=20\r
+> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> > index a433dec..1834066 100644\r
+> > --- a/emacs/notmuch-show.el\r
+> > +++ b/emacs/notmuch-show.el\r
+> > @@ -90,6 +90,11 @@ any given message."\r
+> >    :group 'notmuch\r
+> >    :type 'boolean)\r
+> >=20=20\r
+> > +(defcustom notmuch-show-indent-messages-in-thread t\r
+> > +  "Should messages be indented according to their depth in a thread?"\r
+> > +  :group 'notmuch\r
+> > +  :type 'boolean)\r
+> > +\r
+> >  (defcustom notmuch-show-indent-multipart nil\r
+> >    "Should the sub-parts of a multipart/* part be indented?"\r
+> >    ;; dme: Not sure which is a good default.\r
+> > @@ -237,8 +242,9 @@ unchanged ADDRESS if parsing fails."\r
+> >    "Insert a notmuch style headerline based on HEADERS for a\r
+> >  message at DEPTH in the current thread."\r
+> >    (let ((start (point)))\r
+> > -    (insert (notmuch-show-spaces-n depth)\r
+> > -      (notmuch-show-clean-address (plist-get headers :From))\r
+> > +    (when notmuch-show-indent-messages-in-thread\r
+> > +      (insert (notmuch-show-spaces-n depth)))\r
+> > +    (insert (notmuch-show-clean-address (plist-get headers :From))\r
+> >        " ("\r
+> >        date\r
+> >        ") ("\r
+> > @@ -733,7 +739,8 @@ current buffer, if possible."\r
+> >      (setq content-end (point-marker))\r
+> >=20=20\r
+> >      ;; Indent according to the depth in the thread.\r
+> > -    (indent-rigidly content-start content-end depth)\r
+> > +    (when notmuch-show-indent-messages-in-thread\r
+> > +      (indent-rigidly content-start content-end depth))\r
+> >=20=20\r
+> >      (setq message-end (point-max-marker))\r
+> >=20=20\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG/MacGPG2 v2.0.17 (Darwin)\r
+\r
+iEYEARECAAYFAk4ay9AACgkQMxgKfMb9y5bacwCfbqEHGWRX8eEOCZ/vlqi7itOM\r
+uYcAoIih8mtDn3j+6c+gB+hQmPbtuqhj\r
+=96xt\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r