[PATCH] Emacs: Add variable to toggle message indentation in a thread
Felix Geller
fgeller at gmail.com
Tue Jul 12 16:46:24 PDT 2011
On Mon, 11 Jul 2011 09:32:45 -0700, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller <fgeller at gmail.com> wrote:
> > I added a variable to toggle message indentation in Emacs.
>
> Hi, Felix. Thanks for submitting this patch. I think it's a good idea.
> I have a couple of comments below, a couple of which echo what Dmitry
> has already pointed out.
>
> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>
> This patch doesn't include a commit log, which is something we generally
> require. The preferred way to send patches is with git format-patch or
> send-email, both of which format patches in such a way that they can be
> immediately applied to a git repo, including with the commit log.
Ok, tried again :)
I attached two commits. One that includes the changes (which have most
comments incorporated, only that I stick to when rather than if) and one
that includes a test. I still can't run the tests myself, I attached an
excerpt of what errors come up for the emacs subset, so I haven't tested
the test itself :( However, it is a simple copy of an existing one, but
I use a let to change the value of the new variable and adapted one of
the existing expected outputs to lack indentation. I'd be grateful if
someone could test it...
Didn't know about format-patch, thanks :)
Cheers,
Felix
>
>
> > +(defcustom notmuch-show-indent-messages-in-thread nil
> > + "Should the messages in a thread be indented according to their respective depth in the thread?"
> > + :group 'notmuch
> > + :type 'boolean)
>
> I agres with Dmitry that this should default to 't', to be consistent
> with the current default behavior.
>
> > - (insert (notmuch-show-spaces-n depth)
> > + (insert (if notmuch-show-indent-messages-in-thread
> > + (notmuch-show-spaces-n depth)
> > + "")
>
> I also agree with Dmitry's suggestion here to use the following slightly
> simpler construct:
>
> (if notmuch-show-indent-messages-in-thread
> (insert (notmuch-show-spaces-n depth)))
>
> Finally, as Dmitry also points out, you'll almost certainly need to
> construct a test for this feature, since it constitutes a pretty big
> formatting change. It should probably test for both cases of the
> customization variable. Check out the tests in tests/emacs for
> guidance.
>
> hth.
>
> jamie.
Non-text part: application/pgp-signature
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-variable-to-toggle-message-indendation-in-Emac.patch
Type: text/x-patch
Size: 1731 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110713/d0883b22/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Test-for-toggling-message-indentation.patch
Type: text/x-patch
Size: 8956 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110713/d0883b22/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110713/d0883b22/attachment-0001.pgp>
More information about the notmuch
mailing list