[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-18 Thread Felix Geller
On Mon, 18 Jul 2011 11:30:53 -0700, Jameson Graef Rollins  wrote:
Non-text part: multipart/signed
> On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller  wrote:
> > Ok, tried again :) 
> 
> Hey, Felix.  It looks like the two attachments to your email are
> actually the emails generated by format-patch that should have been sent
> to the list.  Instead of attaching them to other emails, send them to
> the list directly.  You might take a look at the git send-email command,
> which can handle sending them directly for you.

Used git send-email this time, did that turn out correctly? :)


Cheers, Felix

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: 



[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-18 Thread Jameson Graef Rollins
On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller  wrote:
> Ok, tried again :) 

Hey, Felix.  It looks like the two attachments to your email are
actually the emails generated by format-patch that should have been sent
to the list.  Instead of attaching them to other emails, send them to
the list directly.  You might take a look at the git send-email command,
which can handle sending them directly for you.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-18 Thread Jameson Graef Rollins
On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller fgel...@gmail.com wrote:
 Ok, tried again :) 

Hey, Felix.  It looks like the two attachments to your email are
actually the emails generated by format-patch that should have been sent
to the list.  Instead of attaching them to other emails, send them to
the list directly.  You might take a look at the git send-email command,
which can handle sending them directly for you.

jamie.


pgp7ZWerY0eAy.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-18 Thread Felix Geller
On Mon, 18 Jul 2011 11:30:53 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
Non-text part: multipart/signed
 On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller fgel...@gmail.com wrote:
  Ok, tried again :) 
 
 Hey, Felix.  It looks like the two attachments to your email are
 actually the emails generated by format-patch that should have been sent
 to the list.  Instead of attaching them to other emails, send them to
 the list directly.  You might take a look at the git send-email command,
 which can handle sending them directly for you.

Used git send-email this time, did that turn out correctly? :)


Cheers, Felix



pgpGwqLS6D18i.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-18 Thread David Bremner
On Mon, 18 Jul 2011 21:04:17 +0200, Felix Geller fgel...@gmail.com wrote:
 
 Used git send-email this time, did that turn out correctly? :)
 

It looks good, except you need some commit messages. Have a look at the
existing commits to get an idea of what the standards are. Particularly
look at cworth's commits and you'll know what he thinks ;)

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-16 Thread Felix Geller
On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller  wrote:

> 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...

Got the test suite to run on my machine and I fixed a editing typo of
the expected output. After that the test runs fine on my machine. The
patch that has the actual changes needs no changing. Let me know if
something's wrong/missing.


Cheers,
Felix

-- next part --
A non-text attachment was scrubbed...
Name: 0001-Test-for-toggling-message-indentation.patch
Type: text/x-patch
Size: 8991 bytes
Desc: not available
URL: 

-- next part --



>
> 
> 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
> 
> From 94570ada2eae1ff1a1feebbda5dff04d223da6b4 Mon Sep 17 00:00:00 2001
> From: Felix Geller 
> Date: Wed, 13 Jul 2011 01:30:51 +0200
> Subject: [PATCH 1/2] Added variable to toggle message indendation in Emacs'
>  notmuch-show
> 
> ---
>  emacs/notmuch-show.el |   13 ++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index f96743b..48df4c5 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))
>  
> -- 
> 1.7.6
> 
> From 016ee41930eed6b53e10c35c62c40fa6bb35b79e Mon Sep 17 00:00:00 2001
> From: Felix Geller 
> Date: Wed, 13 Jul 2011 01:32:14 +0200
> Subject: [PATCH 2/2] Test for toggling message indentation
> 
> ---
>  test/emacs |7 +
>  ...show-thread-maildir-storage-without-indentation |  215 
> 
>  2 files changed, 222 insertions(+), 0 deletions(-)
>  create mode 100644 
> test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
> 
> diff --git a/test/emacs b/test/emacs
> index 53f455a..c65d6d8 100755
> --- a/test/emacs
> +++ b/test/emacs
> @@ -55,6 +55,13 @@ test_emacs "(notmuch-show \"$maildir_storage_thread\")
>   (test-output)"
>  test_expect_equal_file OUTPUT 

Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-16 Thread Felix Geller
On Wed, 13 Jul 2011 01:46:24 +0200, Felix Geller fgel...@gmail.com wrote:

 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...

Got the test suite to run on my machine and I fixed a editing typo of
the expected output. After that the test runs fine on my machine. The
patch that has the actual changes needs no changing. Let me know if
something's wrong/missing.


Cheers,
Felix

From 3b3145ad0411dec9f1c6f93635184a1a308471a7 Mon Sep 17 00:00:00 2001
From: Felix Geller fgel...@gmail.com
Date: Wed, 13 Jul 2011 01:32:14 +0200
Subject: [PATCH] Test for toggling message indentation

---
 test/emacs |7 +
 ...show-thread-maildir-storage-without-indentation |  215 
 2 files changed, 222 insertions(+), 0 deletions(-)
 create mode 100644 test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation

diff --git a/test/emacs b/test/emacs
index 53f455a..c65d6d8 100755
--- a/test/emacs
+++ b/test/emacs
@@ -55,6 +55,13 @@ test_emacs (notmuch-show \$maildir_storage_thread\)
 	(test-output)
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
 
+test_begin_subtest Basic notmuch-show view in emacs without indentation
+maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.gu3...@dottiness.seas.harvard.edu)
+test_emacs (let ((notmuch-show-indent-messages-in-thread nil))
+	  (notmuch-show \$maildir_storage_thread\)
+	  (test-output))
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
+
 test_begin_subtest notmuch-show for message with invalid From
 add_message [subject]=\message-with-invalid-from\ \
 	[from]=Invalid \\\ From\\\ test_su...@notmuchmail.org\
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
new file mode 100644
index 000..00bd006
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
@@ -0,0 +1,215 @@
+Lars Kellogg-Stedman l...@seas.harvard.edu (2009-11-17) (inbox signed)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 14:00:54 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+I saw the LWN article and decided to take a look at notmuch.  I'm
+currently using mutt and mairix to index and read a collection of
+Maildir mail folders (around 40,000 messages total).
+
+notmuch indexed the messages without complaint, but my attempt at
+searching bombed out. Running, for example:
+
+  notmuch search storage
+
+Resulted in 4604 lines of errors along the lines of:
+
+  Error opening
+  /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+  Too many open files
+
+I'm curious if this is expected behavior (i.e., notmuch does not work
+with Maildir) or if something else is going on.
+
+Cheers,
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman l...@seas.harvard.edu
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+___
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov dotted...@dottedmag.net (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Wed, 18 Nov 2009 01:02:38 +0600
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+
+Twas brillig at 14:00:54 17.11.2009 UTC-05 when l...@seas.harvard.edu did gyre and gimble:
+
+ LK Resulted in 4604 lines of errors along the lines of:
+
+ LK   Error opening
+ LK   /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+ LK   Too many open files
+
+See the patch just posted here.
+
+[ 2-line signature. Click/Enter to show. ]
+-- 
+  http://fossarchy.blogspot.com/
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+___
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Lars Kellogg-Stedman l...@seas.harvard.edu (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: Mikhail Gusarov 

[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Dmitry Kurochkin
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  gmail.com> 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 at 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))
>  


[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Dmitry Kurochkin
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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Felix Geller
On Mon, 11 Jul 2011 13:55:24 +0400, Dmitry Kurochkin  wrote:
> 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.

I'll look into it :)

Cheers,
Felix

>
> 
> 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  > gmail.com> 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 at 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.
> > -

[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Felix Geller
Hi Dmitry,

thank you for the comments. I included an updated patch that also
includes Daniel's comment regarding the default value. 

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 at 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))

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: 



[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Daniel Schoepe
Hi Felix,

On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller  wrote:
> +(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 think this should default to t, so it doesn't change the current
default behavior (which I find quite helpful).

Cheers,
Daniel
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Felix Geller
Hi,

I added a variable to toggle message indentation in Emacs.

Please let me know what you think.


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?"
+  :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)
+ "")
(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))

 (setq message-end (point-max-marker))

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: 



Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Felix Geller
Hi Dmitry,

thank you for the comments. I included an updated patch that also
includes Daniel's comment regarding the default value. 

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 
dmitry.kuroch...@gmail.com wrote:
 Hi Felix.
 
 On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller fgel...@gmail.com 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 fgel...@gmail.com
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))
 


pgpdREPCSjov8.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Dmitry Kurochkin
On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller fgel...@gmail.com 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 
 dmitry.kuroch...@gmail.com wrote:
  Hi Felix.
  
  On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller fgel...@gmail.com 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 fgel...@gmail.com
 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))
  
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Felix Geller
On Mon, 11 Jul 2011 13:55:24 +0400, Dmitry Kurochkin 
dmitry.kuroch...@gmail.com wrote:
 On Mon, 11 Jul 2011 11:24:57 +0200, Felix Geller fgel...@gmail.com 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.

I'll look into it :)

Cheers,
Felix


 
 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 
  dmitry.kuroch...@gmail.com wrote:
   Hi Felix.
   
   On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller fgel...@gmail.com 
   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 fgel...@gmail.com
  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))
   


pgpVHp5jY4Ut2.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org

Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread

2011-07-11 Thread Jameson Graef Rollins
On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller fgel...@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.

 +(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.


pgppuz9I0bLcm.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch