Re: [PATCH v2] emacs: bad regexp @ `notmuch-search-process-filter'

2011-07-19 Thread servilio
What about encoding in notmuch the elements composing the line, print
the elements with a separator that would be encoded if it appears in
an element, then do the reverse in emacs. One such encoding might be
URL-encoding.

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


notmuch.el: bind 'd' to new function notmuch-search-delete-thread-or-region

2011-07-19 Thread Matthieu Lemerre
On Fri, 15 Jul 2011 00:11:29 -0400, anarcat  wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> I can confirm this patch works for me.
> 
> I think this would be a great addition to notmuch, and I could add it
> directly to Debian's 0.6 package install.
> 

I also strongly in favor for the addition of this patch, having a
similar one in my own branch.

Matthieu


configure indentation width instead? (was: Re: [PATCH 2/2] Emacs: Add variable to toggle thread indentation to notmuch-show)

2011-07-19 Thread Gregor Zattler
Hi Felix, notmuch develpers,

Felix introduces a boolean configuration variable in order to
disable/enable indentation.   Wouldn't it be more helpful and
powerful to customise the indentation width with "0" meaning no
indentation, "1" being the current behaviour, "2" meaning double
indentation, "3" threefold indentation ...  ?

Just my 2 Euro-cents, Gregor


Re: notmuch.el: bind 'd' to new function notmuch-search-delete-thread-or-region

2011-07-19 Thread Matthieu Lemerre
On Fri, 15 Jul 2011 00:11:29 -0400, anarcat  wrote:
Non-text part: multipart/mixed
Non-text part: multipart/signed
> I can confirm this patch works for me.
> 
> I think this would be a great addition to notmuch, and I could add it
> directly to Debian's 0.6 package install.
> 

I also strongly in favor for the addition of this patch, having a
similar one in my own branch.

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


configure indentation width instead? (was: Re: [PATCH 2/2] Emacs: Add variable to toggle thread indentation to notmuch-show)

2011-07-19 Thread Gregor Zattler
Hi Felix, notmuch develpers,

Felix introduces a boolean configuration variable in order to
disable/enable indentation.   Wouldn't it be more helpful and
powerful to customise the indentation width with "0" meaning no
indentation, "1" being the current behaviour, "2" meaning double
indentation, "3" threefold indentation ...  ?

Just my 2 Euro-cents, Gregor
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[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
+
+[ application/pgp

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

2011-07-19 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