[PATCH 2/2] Emacs: Add variable to toggle thread indentation to notmuch-show

2011-07-19 Thread Felix Geller
Add customizable variable notmuch-show-indent-messages-in-thread
to toggle indentation of messages in a thread in a notmuch-show
buffer.
---
 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



[PATCH 1/2] Emacs: Test for turning off indentation of messages in threads

2011-07-19 Thread Felix Geller
In Emacs, notmuch indents messages according to their thread
depth. This leads to unused space and sometimes strange
formatting of paragraphs with long lines. Therefore I would like
to turn it off and have the message thread look more like a
conversation, as on GMail for example.

This commit contains a test for such functionality. It tests
notmuch-show for a message thread without the indentation to
indicate thread depth of messages.
---
 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.GU3165 at 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\\\" \""
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  (2009-11-17) (inbox signed)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch at 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 
+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 at notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov  (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: notmuch at 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 lars at 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 at notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Lars Kellogg-Stedman  (2009-11-17) (inbox signed 
unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: Mikhail Gusarov 
+Cc: notmuch at notmuchmail.org
+Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+> See the patch just posted here.
+
+Is the list archived anywhere?  The obvious archives
+(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+think I subscribed too late to get the patch (I only just saw the
+discussion about it).
+
+It doesn't look like the patch is in git yet.
+
+-- Lars
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman 
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ 

[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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110718/67930ee2/attachment.pgp>


[PATCH 2/2] Test for toggling message indentation

2011-07-18 Thread Felix Geller
---
 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.GU3165 at 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\\\" \""
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  (2009-11-17) (inbox signed)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch at 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 
+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 at notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov  (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: notmuch at 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 lars at 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 at notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Lars Kellogg-Stedman  (2009-11-17) (inbox signed 
unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: Mikhail Gusarov 
+Cc: notmuch at notmuchmail.org
+Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+> See the patch just posted here.
+
+Is the list archived anywhere?  The obvious archives
+(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+think I subscribed too late to get the patch (I only just saw the
+discussion about it).
+
+It doesn't look like the patch is in git yet.
+
+-- Lars
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman 
+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 at notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov  (2009-11-17) (inbox unread)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch at notmuchmail.org
+Date: Wed, 18 Nov 2009 02:50:48 +0600
+
+
+Twas brillig at 15:33:01 17.11.2009 UTC-05 

[PATCH 1/2] Added variable to toggle message indendation in Emacs' notmuch-show

2011-07-18 Thread Felix Geller
---
 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



[PATCH 2/2] Test for toggling message indentation

2011-07-18 Thread Felix Geller
---
 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 dotted...@dottedmag.net
+Cc: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+ See the patch just posted here.
+
+Is the list archived anywhere?  The obvious archives
+(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+think I subscribed too late to get the patch (I only just saw the
+discussion about it).
+
+It doesn't look like the patch is in git yet.
+
+-- Lars
+
+[ 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 unread)
+Subject: [notmuch] Working with Maildir 

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


[PATCH] Emacs: Toggle message indentation for threads in notmuch-show

2011-07-18 Thread Felix Geller
Yet another attempt at submitting a trivial patch for toggling message
indentation in Emacs' notmuch-show buffers and a test for such
functionality.

Signed-off-by: Felix Geller fgel...@gmail.com

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


[PATCH 1/2] Emacs: Test for turning off indentation of messages in threads

2011-07-18 Thread Felix Geller
In Emacs, notmuch indents messages according to their thread
depth. This leads to unused space and sometimes strange
formatting of paragraphs with long lines. Therefore I would like
to turn it off and have the message thread look more like a
conversation, as on GMail for example.

This commit contains a test for such functionality. It tests
notmuch-show for a message thread without the indentation to
indicate thread depth of messages.
---
 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 dotted...@dottedmag.net
+Cc: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+ See the patch just posted here.
+
+Is the list archived anywhere?  The obvious archives
+(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+think I subscribed too late to get the patch (I only just saw the
+discussion about it).
+
+It doesn't look like the patch is in git yet.
+
+-- Lars
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman l...@seas.harvard.edu
+Senior Technologist, Computing 

[PATCH 2/2] Emacs: Add variable to toggle thread indentation to notmuch-show

2011-07-18 Thread Felix Geller
Add customizable variable notmuch-show-indent-messages-in-thread
to toggle indentation of messages in a thread in a notmuch-show
buffer.
---
 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

___
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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110716/4fd2c2e3/attachment-0001.bin>
-- 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

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 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/n

[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: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110711/c06d16f6/attachment.pgp>


[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 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
http

Decryption fails

2011-06-02 Thread Felix Geller
On Thu, 02 Jun 2011 08:35:49 -0700, Jameson Graef Rollins  wrote:
Non-text part: multipart/signed

> Hey, Felix.  Yeah, I unfortunately don't have any other suggestions
> other than asking the gmime folks.

Jeff replied and sent me a working patch :) Not sure yet how he prefers
to publish the patch, but the problem is fixed.

> Interestingly, I see the following message in your crypto test output:
> 
>   Error: search term did not match precisely one message.
> 
> which seems to indicate that the desired message wasn't actually
> delivered properly, contrary to what the emacs delivery tests are
> stating.  Not sure how that could be related, though, since it looks
> like the trace that you show above definitely looks like gmime caught in
> a poll loop.

Just ran the tests with a "fixed" poll function and it seems that many
problems remain. Don't have the time at the moment to take a closer
look, but I attached the output.

Anyway, I'm a glad decrypting user now ;)


Cheers,
Felix

> jamie.
Non-text part: application/pgp-signature
-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: crypto.txt
URL: 

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



Re: Decryption fails

2011-06-02 Thread Felix Geller
On Thu, 02 Jun 2011 08:35:49 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
Non-text part: multipart/signed

 Hey, Felix.  Yeah, I unfortunately don't have any other suggestions
 other than asking the gmime folks.

Jeff replied and sent me a working patch :) Not sure yet how he prefers
to publish the patch, but the problem is fixed.
 
 Interestingly, I see the following message in your crypto test output:
 
   Error: search term did not match precisely one message.
 
 which seems to indicate that the desired message wasn't actually
 delivered properly, contrary to what the emacs delivery tests are
 stating.  Not sure how that could be related, though, since it looks
 like the trace that you show above definitely looks like gmime caught in
 a poll loop.

Just ran the tests with a fixed poll function and it seems that many
problems remain. Don't have the time at the moment to take a closer
look, but I attached the output.

Anyway, I'm a glad decrypting user now ;)


Cheers,
Felix

 jamie.
Non-text part: application/pgp-signature
crypto: Testing PGP/MIME signature verification and decryption
 PASS   emacs delivery of signed message
 FAIL   signature verification
--- crypto.2.expected   2011-06-02 16:46:27.0 +
+++ crypto.2.output 2011-06-02 16:46:27.0 +
@@ -1,23 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: [inbox,signed],
- headers: {Subject: test signed message 001,
- From: Notmuch Test Suite test_su...@notmuchmail.org,
- To: test_su...@notmuchmail.org,
- Cc: ,
- Bcc: ,
- Date: 01 Jan 2000 12:00:00 -},
- body: [{id: 1,
- sigstatus: [{status: good,
- fingerprint: 5AEAB11F5E33DCE875DDB75B6D92612D94E46381,
- created: 946728000}],
- content-type: multipart/signed,
- content: [{id: 2,
- content-type: text/plain,
- content: This is a test signed message.\n},
- {id: 3,
- content-type: application/pgp-signature}]}]},
- [
+[[[{id: X,n match: true,n filename: Y,n timestamp: 
946728000,n date_relative: 2000-01-01,n tags: [inbox,signed],n 
headers: {Subject: test signed message 001,n From: Notmuch Test Suite 
test_su...@notmuchmail.org,n To: test_su...@notmuchmail.org,n Cc: ,n 
Bcc: ,n Date: 01 Jan 2000 12:00:00 -},n body: [{id: 1,n 
sigstatus: [{status: good,n fingerprint: 
5AEAB11F5E33DCE875DDB75B6D92612D94E46381,n created: 946728000}],n 
content-type: multipart/signed,n content: [{id: 2,n content-type: 
text/plain,n content: This is a test signed message.\n},n {id: 3,n 
content-type: application/pgp-signature}]}]},n [
 FAIL   signature verification with full owner trust
--- crypto.3.expected   2011-06-02 16:46:27.0 +
+++ crypto.3.output 2011-06-02 16:46:27.0 +
@@ -1,24 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: [inbox,signed],
- headers: {Subject: test signed message 001,
- From: Notmuch Test Suite test_su...@notmuchmail.org,
- To: test_su...@notmuchmail.org,
- Cc: ,
- Bcc: ,
- Date: 01 Jan 2000 12:00:00 -},
- body: [{id: 1,
- sigstatus: [{status: good,
- fingerprint: 5AEAB11F5E33DCE875DDB75B6D92612D94E46381,
- created: 946728000,
- userid:  Notmuch Test Suite test_su...@notmuchmail.org 
(INSECURE!)}],
- content-type: multipart/signed,
- content: [{id: 2,
- content-type: text/plain,
- content: This is a test signed message.\n},
- {id: 3,
- content-type: application/pgp-signature}]}]},
- [
+[[[{id: X,n match: true,n filename: Y,n timestamp: 
946728000,n date_relative: 2000-01-01,n tags: [inbox,signed],n 
headers: {Subject: test signed message 001,n From: Notmuch Test Suite 
test_su...@notmuchmail.org,n To: test_su...@notmuchmail.org,n Cc: ,n 
Bcc: ,n Date: 01 Jan 2000 12:00:00 -},n body: [{id: 1,n 
sigstatus: [{status: good,n fingerprint: 
5AEAB11F5E33DCE875DDB75B6D92612D94E46381,n created: 946728000,n userid:  
Notmuch Test Suite test_su...@notmuchmail.org (INSECURE!)}],n 
content-type: multipart/signed,n content: [{id: 2,n content-type: 
text/plain,n content: This is a test signed message.\n},n {id: 3,n 
content-type: application/pgp-signature}]}]},n [
 FAIL   signature verification with signer key unavailable
--- crypto.4.expected   2011-06-02 16:46:28.0 +
+++ crypto.4.output 2011-06-02 16:46:28.0 +
@@ -1,23 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: 

Decryption fails

2011-05-31 Thread Felix Geller
On Tue, 31 May 2011 00:18:26 -0700, Jameson Graef Rollins  wrote:
> Hey, Felix.  As David said, all crypto tests should be passing with
> libgmime 2.4.24.  It would probably be instructive to know which crypto
> tests failed and why.  Maybe you could supply some output from the
> failed crypto tests.

Ok, so the following tests pass:

 PASS   emacs delivery of signed message
 PASS   emacs delivery of encrypted + signed message
 PASS   emacs delivery of encrypted message with attachment

I'm attaching the full output for the cypto tests.

I get the following trace when using show --decrypt to decrypt a
specific message (have to kill the process to actually get the trace):

#0  0x0001006121a6 in poll ()
#1  0x00010006d3d2 in gpg_ctx_op_step ()
#2  0x00010006e5c7 in gpg_decrypt ()
#3  0x0001000566cf in g_mime_multipart_encrypted_decrypt ()
#4  0x0001a413 in show_message_part (part=0x10606fc20,
#state=0x7fff5fbfd1c0, format=0x10002ef80, params=0x7fff5fbfd2c0,
#first=1) at show-message.c:71

So I guess it ends up looping or waiting in poll(), but I can't tell why
it would do that. I guess the next step is to post to the gmime mailing
list, or?


Cheers,
Felix


-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: crypto_tests.txt
URL: 

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



Re: Decryption fails

2011-05-31 Thread Felix Geller
On Tue, 31 May 2011 00:18:26 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
 Hey, Felix.  As David said, all crypto tests should be passing with
 libgmime 2.4.24.  It would probably be instructive to know which crypto
 tests failed and why.  Maybe you could supply some output from the
 failed crypto tests.

Ok, so the following tests pass:

 PASS   emacs delivery of signed message
 PASS   emacs delivery of encrypted + signed message
 PASS   emacs delivery of encrypted message with attachment

I'm attaching the full output for the cypto tests.

I get the following trace when using show --decrypt to decrypt a
specific message (have to kill the process to actually get the trace):

#0  0x0001006121a6 in poll ()
#1  0x00010006d3d2 in gpg_ctx_op_step ()
#2  0x00010006e5c7 in gpg_decrypt ()
#3  0x0001000566cf in g_mime_multipart_encrypted_decrypt ()
#4  0x0001a413 in show_message_part (part=0x10606fc20,
#state=0x7fff5fbfd1c0, format=0x10002ef80, params=0x7fff5fbfd2c0,
#first=1) at show-message.c:71

So I guess it ends up looping or waiting in poll(), but I can't tell why
it would do that. I guess the next step is to post to the gmime mailing
list, or?


Cheers,
Felix


crypto: Testing PGP/MIME signature verification and decryption
 PASS   emacs delivery of signed message
 FAIL   signature verification
--- crypto.2.expected   2011-05-31 17:30:47.0 +
+++ crypto.2.output 2011-05-31 17:30:47.0 +
@@ -1,23 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: [inbox,signed],
- headers: {Subject: test signed message 001,
- From: Notmuch Test Suite test_su...@notmuchmail.org,
- To: test_su...@notmuchmail.org,
- Cc: ,
- Bcc: ,
- Date: 01 Jan 2000 12:00:00 -},
- body: [{id: 1,
- sigstatus: [{status: good,
- fingerprint: 5AEAB11F5E33DCE875DDB75B6D92612D94E46381,
- created: 946728000}],
- content-type: multipart/signed,
- content: [{id: 2,
- content-type: text/plain,
- content: This is a test signed message.\n},
- {id: 3,
- content-type: application/pgp-signature}]}]},
- [
+[]
 FAIL   signature verification with full owner trust
--- crypto.3.expected   2011-05-31 17:30:47.0 +
+++ crypto.3.output 2011-05-31 17:30:47.0 +
@@ -1,24 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: [inbox,signed],
- headers: {Subject: test signed message 001,
- From: Notmuch Test Suite test_su...@notmuchmail.org,
- To: test_su...@notmuchmail.org,
- Cc: ,
- Bcc: ,
- Date: 01 Jan 2000 12:00:00 -},
- body: [{id: 1,
- sigstatus: [{status: good,
- fingerprint: 5AEAB11F5E33DCE875DDB75B6D92612D94E46381,
- created: 946728000,
- userid:  Notmuch Test Suite test_su...@notmuchmail.org 
(INSECURE!)}],
- content-type: multipart/signed,
- content: [{id: 2,
- content-type: text/plain,
- content: This is a test signed message.\n},
- {id: 3,
- content-type: application/pgp-signature}]}]},
- [
+[]
 FAIL   signature verification with signer key unavailable
--- crypto.4.expected   2011-05-31 17:30:47.0 +
+++ crypto.4.output 2011-05-31 17:30:47.0 +
@@ -1,23 +1 @@
-[[[{id: X,
- match: true,
- filename: Y,
- timestamp: 946728000,
- date_relative: 2000-01-01,
- tags: [inbox,signed],
- headers: {Subject: test signed message 001,
- From: Notmuch Test Suite test_su...@notmuchmail.org,
- To: test_su...@notmuchmail.org,
- Cc: ,
- Bcc: ,
- Date: 01 Jan 2000 12:00:00 -},
- body: [{id: 1,
- sigstatus: [{status: error,
- keyid: 6D92612D94E46381,
- errors: 2}],
- content-type: multipart/signed,
- content: [{id: 2,
- content-type: text/plain,
- content: This is a test signed message.\n},
- {id: 3,
- content-type: application/pgp-signature}]}]},
- [
+[]
 PASS   emacs delivery of encrypted message with attachment
 FAIL   decryption, --format=text
--- crypto.6.expected   2011-05-31 17:30:48.0 +
+++ crypto.6.output 2011-05-31 17:30:48.0 +
@@ -1,25 +1 @@
-message{ id:X depth:0 match:1 filename:X
-header{
-Notmuch Test Suite test_su...@notmuchmail.org (2000-01-01) 
(encrypted inbox)
-Subject: test encrypted message 001
-From: Notmuch Test Suite 

Decryption fails

2011-05-30 Thread Felix Geller
Hi all,

I'm using a version of notmuch based on cb84187 from the master branch
on notmuchmail.org/git/notmuch and am accessing it mostly through the
Emacs UI. Signature verification seems to work nicely, only decryption
fails for any message/thread that I've tried it on. The respective
notmuch process 
notmuch show --format=json --decrypt 'id:x' 
starts eating all my CPU and doesn't return. Doing it on the command
line using gpg directly or going through Emacs' epa works fine. Most of
the test cases in crypto fail as well, but I'm not sure which ones are
actually supposed to work.

My OS is MacOS X, which seems to be non-existent among notmuch
developers and therefore might at some level be the cause. However, I
built gmime 2.4.24 (through a little modification to MacPorts'
respective Portfile) as was recommended on IRC at some point and am not
aware of any other incompatibilities.

I'm not sure how to identify the cause for this problem, do you have any
hints where to start searching?


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] Change in increment_mtime for BSD compatibility of test suite

2011-05-30 Thread Felix Geller
Another try :)

[...]

Support for platform-specific test configuration
 - Platform-specific functionality is stored in test-config-PLATFORM.sh 
files
 - configure script creates a test/test-config.sh depending on the platform
 - test-lib.sh loads test-config.sh file
 - Some platform-specific functionality included for gnu/bsd:
   - Work-around for touch -d on BSD
   - Variable to store sed command for extended expressions

diff --git a/configure b/configure
index bbf30cd..053a4a1 100755
--- a/configure
+++ b/configure
@@ -16,6 +16,13 @@ if [ "$srcdir" != "." ]; then
 # whole thing into the build directory.
 cp -a "$srcdir"/test/* test

+# Platform specific test configuration
+if [ $platform = MACOSX ] ; then
+   cp test/test-config-bsd.sh test/test-config.sh
+else
+   cp test/test-config-gnu.sh test/test-config.sh
+fi
+
 # Emacs only likes to generate compiled files next to the .el files
 # by default so copy these as well (which is not ideal0.
 cp -a "$srcdir"/emacs/*.el emacs
diff --git a/test/basic b/test/basic
index 808c968..5fbedfe 100755
--- a/test/basic
+++ b/test/basic
@@ -54,13 +54,14 @@ test_begin_subtest 'Ensure that all available tests will be 
run by notmuch-test'
 eval $(sed -n -e '/^TESTS="$/,/^"$/p' notmuch-test ../notmuch-test)
 tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
 available=$(ls -1 ../ | \
-sed -r -e 
"/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \
-  -e 
"/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \
-  -e 
"/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)/d" \
-  -e "/^(test.expected-output|.*~)/d" \
-  -e "/^(gnupg-secret-key.asc)/d" \
-  -e "/^(gnupg-secret-key.NOTE)/d" \
-  | sort)
+$SED_EXTENDED -e 
"/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \
+ -e 
"/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \
+ -e 
"/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)/d" \
+ -e "/^(test.expected-output|.*~)/d" \
+ -e "/^(gnupg-secret-key.asc)/d" \
+ -e "/^(gnupg-secret-key.NOTE)/d" \
+ -e "/^(test-config*)/d" \
+ | sort)
 test_expect_equal "$tests_in_suite" "$available"

 EXPECTED=../test.expected-output
diff --git a/test/test-config-bsd.sh b/test/test-config-bsd.sh
new file mode 100644
index 000..e35d2fa
--- /dev/null
+++ b/test/test-config-bsd.sh
@@ -0,0 +1,23 @@
+# This file contains helper functions and other values that are
+# require platform-specific functionality (e.g., differing between GNU
+# and BSD). The configure script is used to identify the appropriate
+# file for a given platform, and copies the file test-config-FOO.sh to
+# test-config.sh, where FOO is the respective platform (bsd or gnu).
+#
+# This file is BSD-specific.
+
+# Syntax for extended expressions
+SED_EXTENDED="sed -E"
+
+# There is no touch -d on BSD, therefore we have to use a more tedious
+# version that uses date/stat to increment a date by a single second.
+increment_mtime_amount=0
+increment_mtime ()
+{
+dir="$1"
+
+last_mod_date=`date -j -f %Y%m%d%H%M%S \`stat -f %Sm -t %Y%m%d%H%M%S 
${dir}\` +%s`
+increment_mtime_amount=$((increment_mtime_amount + 1))
+new_date=`date -j -r ${last_mod_date} -v+${increment_mtime_amount}S 
+%Y%m%d%H%M.%S`
+touch -t ${new_date} ${dir}
+}
diff --git a/test/test-config-gnu.sh b/test/test-config-gnu.sh
new file mode 100644
index 000..596505a
--- /dev/null
+++ b/test/test-config-gnu.sh
@@ -0,0 +1,20 @@
+# This file contains helper functions and other values that are
+# require platform-specific functionality (e.g., differing between GNU
+# and BSD). The configure script is used to identify the appropriate
+# file for a given platform, and copies the file test-config-FOO.sh to
+# test-config.sh, where FOO is the respective platform (bsd or gnu).
+#
+# This file is GNU-specific.
+
+# Syntax for extended expressions
+SED_EXTENDED="sed -r"
+
+# Use touch to increment the modification date by a single second.
+increment_mtime_amount=0
+increment_mtime ()
+{
+dir="$1"
+
+increment_mtime_amount=$((increment_mtime_amount + 1))
+touch -d "+${increment_mtime_amount} seconds" "$dir"
+}
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 922b1ef..1aa3a1c 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -23,6 +23,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
 exit 1
 fi

+# Load platform-specific values
+. ./test-config.sh
+
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
 case "$GIT_TEST_TEE_STARTED, $* " in
@@ -214,14 +217,6 @@ remove_cr () {
 }

 # Notmuch helper functions
-increment_mtime_amount=0
-increment_mtime ()
-{
-dir="$1"
-
-

Re: [PATCH] Change in increment_mtime for BSD compatibility of test suite

2011-05-30 Thread Felix Geller
Another try :)

[...]

Support for platform-specific test configuration
 - Platform-specific functionality is stored in test-config-PLATFORM.sh 
files
 - configure script creates a test/test-config.sh depending on the platform
 - test-lib.sh loads test-config.sh file
 - Some platform-specific functionality included for gnu/bsd:
   - Work-around for touch -d on BSD
   - Variable to store sed command for extended expressions

diff --git a/configure b/configure
index bbf30cd..053a4a1 100755
--- a/configure
+++ b/configure
@@ -16,6 +16,13 @@ if [ $srcdir != . ]; then
 # whole thing into the build directory.
 cp -a $srcdir/test/* test
 
+# Platform specific test configuration
+if [ $platform = MACOSX ] ; then
+   cp test/test-config-bsd.sh test/test-config.sh
+else
+   cp test/test-config-gnu.sh test/test-config.sh
+fi
+
 # Emacs only likes to generate compiled files next to the .el files
 # by default so copy these as well (which is not ideal0.
 cp -a $srcdir/emacs/*.el emacs
diff --git a/test/basic b/test/basic
index 808c968..5fbedfe 100755
--- a/test/basic
+++ b/test/basic
@@ -54,13 +54,14 @@ test_begin_subtest 'Ensure that all available tests will be 
run by notmuch-test'
 eval $(sed -n -e '/^TESTS=$/,/^$/p' notmuch-test ../notmuch-test)
 tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
 available=$(ls -1 ../ | \
-sed -r -e 
/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d \
-  -e 
/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d \
-  -e 
/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)/d \
-  -e /^(test.expected-output|.*~)/d \
-  -e /^(gnupg-secret-key.asc)/d \
-  -e /^(gnupg-secret-key.NOTE)/d \
-  | sort)
+$SED_EXTENDED -e 
/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d \
+ -e 
/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d \
+ -e 
/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose)/d \
+ -e /^(test.expected-output|.*~)/d \
+ -e /^(gnupg-secret-key.asc)/d \
+ -e /^(gnupg-secret-key.NOTE)/d \
+ -e /^(test-config*)/d \
+ | sort)
 test_expect_equal $tests_in_suite $available
 
 EXPECTED=../test.expected-output
diff --git a/test/test-config-bsd.sh b/test/test-config-bsd.sh
new file mode 100644
index 000..e35d2fa
--- /dev/null
+++ b/test/test-config-bsd.sh
@@ -0,0 +1,23 @@
+# This file contains helper functions and other values that are
+# require platform-specific functionality (e.g., differing between GNU
+# and BSD). The configure script is used to identify the appropriate
+# file for a given platform, and copies the file test-config-FOO.sh to
+# test-config.sh, where FOO is the respective platform (bsd or gnu).
+#
+# This file is BSD-specific.
+
+# Syntax for extended expressions
+SED_EXTENDED=sed -E
+
+# There is no touch -d on BSD, therefore we have to use a more tedious
+# version that uses date/stat to increment a date by a single second.
+increment_mtime_amount=0
+increment_mtime ()
+{
+dir=$1
+
+last_mod_date=`date -j -f %Y%m%d%H%M%S \`stat -f %Sm -t %Y%m%d%H%M%S 
${dir}\` +%s`
+increment_mtime_amount=$((increment_mtime_amount + 1))
+new_date=`date -j -r ${last_mod_date} -v+${increment_mtime_amount}S 
+%Y%m%d%H%M.%S`
+touch -t ${new_date} ${dir}
+}
diff --git a/test/test-config-gnu.sh b/test/test-config-gnu.sh
new file mode 100644
index 000..596505a
--- /dev/null
+++ b/test/test-config-gnu.sh
@@ -0,0 +1,20 @@
+# This file contains helper functions and other values that are
+# require platform-specific functionality (e.g., differing between GNU
+# and BSD). The configure script is used to identify the appropriate
+# file for a given platform, and copies the file test-config-FOO.sh to
+# test-config.sh, where FOO is the respective platform (bsd or gnu).
+#
+# This file is GNU-specific.
+
+# Syntax for extended expressions
+SED_EXTENDED=sed -r
+
+# Use touch to increment the modification date by a single second.
+increment_mtime_amount=0
+increment_mtime ()
+{
+dir=$1
+
+increment_mtime_amount=$((increment_mtime_amount + 1))
+touch -d +${increment_mtime_amount} seconds $dir
+}
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 922b1ef..1aa3a1c 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -23,6 +23,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
 exit 1
 fi
 
+# Load platform-specific values
+. ./test-config.sh
+
 # if --tee was passed, write the output not only to the terminal, but
 # additionally to the file test-results/$BASENAME.out, too.
 case $GIT_TEST_TEE_STARTED, $*  in
@@ -214,14 +217,6 @@ remove_cr () {
 }
 
 # Notmuch helper functions
-increment_mtime_amount=0
-increment_mtime ()
-{
-dir=$1
-
-increment_mtime_amount=$((increment_mtime_amount + 1))
-touch -d 

Decryption fails

2011-05-30 Thread Felix Geller
Hi all,

I'm using a version of notmuch based on cb84187 from the master branch
on notmuchmail.org/git/notmuch and am accessing it mostly through the
Emacs UI. Signature verification seems to work nicely, only decryption
fails for any message/thread that I've tried it on. The respective
notmuch process 
notmuch show --format=json --decrypt 'id:x' 
starts eating all my CPU and doesn't return. Doing it on the command
line using gpg directly or going through Emacs' epa works fine. Most of
the test cases in crypto fail as well, but I'm not sure which ones are
actually supposed to work.

My OS is MacOS X, which seems to be non-existent among notmuch
developers and therefore might at some level be the cause. However, I
built gmime 2.4.24 (through a little modification to MacPorts'
respective Portfile) as was recommended on IRC at some point and am not
aware of any other incompatibilities.

I'm not sure how to identify the cause for this problem, do you have any
hints where to start searching?


Cheers,
Felix


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


[PATCH] Change in increment_mtime for BSD compatibility of test suite

2011-05-25 Thread Felix Geller
Use `-t' option rather than `-d' which is not supported by BSD's
touch. I'm not sure whether this is the cleanest way to do this, please
let me know if there is a better way. There are additional changes
(e.g., sed does not support `-r' but instead `-E') but they seem to be
incompatible between GNU and BSD. What's the recommended way to handle
this?

Cheers,
Felix


diff --git a/test/test-lib.sh b/test/test-lib.sh
index f536172..d2af857 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -218,9 +218,10 @@ increment_mtime_amount=0
 increment_mtime ()
 {
 dir="$1"
-
+last_mod_date=`date -j -f %Y%m%d%H%M%S \`stat -f %Sm -t %Y%m%d%H%M%S 
${dir}\` +%s`
 increment_mtime_amount=$((increment_mtime_amount + 1))
-touch -d "+${increment_mtime_amount} seconds" "$dir"
+new_date=`date -j -r ${last_mod_date} -v+${increment_mtime_amount}S 
+%Y%m%d%H%M.%S`
+touch -t ${new_date} ${dir}
 }

 # Generate a new message in the mail directory, with a unique message
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 202 bytes
Desc: not available
URL: