Re: [announce] Bower 0.4

2012-08-12 Thread David Froger
On Sun, 12 Aug 2012 15:22:58 +1000, Peter Wang  wrote:
> Hi,
> 
> Bower is yet another curses frontend for the Notmuch email system.
> I wrote it for me, but you might like it, too.
> 
>   https://github.com/wangp/bower
> 
> Bower 0.4 (2012-08-12)
> ==
> This release requires notmuch 0.13 for addressbook completion.
> 
> * Asynchronous tagging and polling in index view.
> * Highlight diff lines in quoted text.
> * Context-aware completion for tag names.
> * Completion for addressbook aliases.
> * post_sendmail configuration option.
> * Support Up/Down/PgUp/PgDn/Home/End keys in more views.
> * Better resize handling.
> * Improved URL detection.
> * Don't expand HTML alternative parts unnecessarily.

Hi,

Thanks Peter, nice to see this new release and these new functionnalies!

I'm using bower every day, both at home and at work, and it's really usefull for
me.

By the way, I have some questions:

1. To receive emails, I use a bash script that basically do:

while true
do
offlineimap
notmuch new
notmuch tag ...
sleep 60
done

Would it be possible to have a hook 'pollmails' that is triggered from the Index
view by pressing a key (p or P), which can be configure in 
~/.config/bower/bower.conf
like this:
pollmails=a_command.sh

So I can rewrite my bash script something like this:

while true
do
offlineimap
notmuch new
notmuch tag ...

before_enter_loop = `current date`

while true
do
   sleep 0.01
   now = `current date`
   if [ 'a_commmand.sh' has been called 
  or now > before_enter_loop + 60 seconds ]
   then 
   exit loop
   fi
done
done

2. I've notice that errors could happend if I modify tags from bower while my
bash script is also modifiny tags of the incoming emails. Do you see any
solution?

3. Would it be possible to have the feature 'kill a thread' like Sup have? (see
http://sup.rubyforge.org/README.txt).

4. postponed message doesn't work for me. When I postpone a message, it says
'message postponed', but when pressing R from Index view, it says 'No postponed
message'. Maybe I need to create a directory to store postponed messages?

5. When attaching a file, would it be possible to have '~' expanded to the 
$HOME directory?

6. In the index view, having the possiblity to scroll right and left (so one can
see the email tags in the line in too long)?

7. less important, having light colors for white console?

Thank you very much!

Best regards,

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


Re: [announce] Bower 0.4

2012-08-12 Thread Peter Wang
On Sun, 12 Aug 2012 14:40:23 +0200, David Froger  wrote:
> 
> Hi,

Hi David,

> 
> Thanks Peter, nice to see this new release and these new functionnalies!
> 
> I'm using bower every day, both at home and at work, and it's really usefull 
> for
> me.
> 
> By the way, I have some questions:
> 
> 1. To receive emails, I use a bash script that basically do:
> 
> while true
> do
> offlineimap
> notmuch new
> notmuch tag ...
> sleep 60
> done
> 
> Would it be possible to have a hook 'pollmails' that is triggered from the 
> Index
> view by pressing a key (p or P), which can be configure in 
> ~/.config/bower/bower.conf
> like this:
> pollmails=a_command.sh

Basically, run an arbitrary command when a key is pressed.  It would
be fairly easy to add, but I wonder if it would be easy to stop adding
more :-)  You could bind a shortcut key to your window manager or
desktop environment that runs the command instead.

> 2. I've notice that errors could happend if I modify tags from bower while my
> bash script is also modifiny tags of the incoming emails. Do you see any
> solution?

The asynchronous tagging will retry after 5 seconds.  The notmuch error
message will show and mess up your screen (press ^L), which I would like
to fix somehow.  Ultimately, I think notmuch should handle this more
gracefully.

> 3. Would it be possible to have the feature 'kill a thread' like Sup have? 
> (see
> http://sup.rubyforge.org/README.txt).

I haven't needed such a feature so I don't have a clear idea how it
should work.  There are some patches/ideas about muting threads using
notmuch generally around here.  I guess the simplest thing to do is hide
a thread if it has a certain tag, e.g. "muted" as suggested by notmuch
TODO file, unless you search for it explicitly.

> 4. postponed message doesn't work for me. When I postpone a message, it says
> 'message postponed', but when pressing R from Index view, it says 'No 
> postponed
> message'. Maybe I need to create a directory to store postponed messages?

The postponed message should be in Maildir/Drafts.  Can you see it with
`notmuch search tag:draft'?

> 
> 5. When attaching a file, would it be possible to have '~' expanded to the 
> $HOME directory?

Sure.

> 6. In the index view, having the possiblity to scroll right and left (so one 
> can
> see the email tags in the line in too long)?

I'm not sure that's a great solution.  Maybe have a key that popups up
an info box, which would have enough room to show the whole subject
line, the list of authors and the tags?

> 7. less important, having light colors for white console?

Maybe :-)

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


Re: [announce] Bower 0.4

2012-08-12 Thread David Froger
> Basically, run an arbitrary command when a key is pressed.  It would
> be fairly easy to add, but I wonder if it would be easy to stop adding
> more :-)  You could bind a shortcut key to your window manager or
> desktop environment that runs the command instead.
Yes of course, it's a lot simpler, why didn't I think to it...

> > 2. I've notice that errors could happend if I modify tags from bower while 
> > my
> > bash script is also modifiny tags of the incoming emails. Do you see any
> > solution?
> 
> The asynchronous tagging will retry after 5 seconds.  The notmuch error
> message will show and mess up your screen (press ^L), which I would like
> to fix somehow.  Ultimately, I think notmuch should handle this more
> gracefully.
Ok! Two times, this had made notmuch bug for me: notmuch displayed a message 
like "welcome to a new
version of notmuch", and then retagged all my emails, deleting old tags.
(now, I dump my tags every day, and I avoid to use bower while notmuch is 
running).

> > 3. Would it be possible to have the feature 'kill a thread' like Sup have? 
> > (see
> > http://sup.rubyforge.org/README.txt).
> 
> I haven't needed such a feature so I don't have a clear idea how it
> should work.  There are some patches/ideas about muting threads using
> notmuch generally around here.  I guess the simplest thing to do is hide
> a thread if it has a certain tag, e.g. "muted" as suggested by notmuch
> TODO file, unless you search for it explicitly.
I  like this  solution,  I will  use it (adding 'and not tag:mutted' at the end 
of my search).
When  I'm not  interessed with  a long discussion on a mailling list,  I like 
to  be able to 'kill'
the thread so it does not reappear with every new mail.

> > 4. postponed message doesn't work for me. When I postpone a message, it says
> > 'message postponed', but when pressing R from Index view, it says 'No 
> > postponed
> > message'. Maybe I need to create a directory to store postponed messages?
> 
> The postponed message should be in Maildir/Drafts.  Can you see it with
> `notmuch search tag:draft'?
No, `notmuch search tag:draft` returns 0.

> > 5. When attaching a file, would it be possible to have '~' expanded to the 
> > $HOME directory?
> 
> Sure.
Thanks!

> 
> > 6. In the index view, having the possiblity to scroll right and left (so 
> > one can
> > see the email tags in the line in too long)?
> 
> I'm not sure that's a great solution.  Maybe have a key that popups up
> an info box, which would have enough room to show the whole subject
> line, the list of authors and the tags?
Yes, that would be perfect.

> > 7. less important, having light colors for white console?
> 
> Maybe :-)
> 
> Peter

Thanks for you support!
David
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative

2012-08-12 Thread Jameson Graef Rollins
Fairly simple test that looks at a diff of test-emacs output from each
case.
---
As I mentioned, I really like this toggle view solution, so here's a
test for it.

 test/emacs-show |   47 +++
 1 file changed, 47 insertions(+)

diff --git a/test/emacs-show b/test/emacs-show
index e9a714f..695f929 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -36,4 +36,51 @@ test_begin_subtest "Bare subject #3"
 output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
 test_expect_equal "$output" '"the cure: fix the regexp"'
 
+test_begin_subtest "Toggle display multipart/alternative"
+cat < ${MAIL_DIR}/embedded_message
+From: Carl Worth 
+To: cwo...@cworth.org
+Subject: html message
+Date: Fri, 05 Jan 2001 15:42:57 +
+User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 
(i486-pc-linux-gnu)
+Message-ID: <87liy5ap01@yoom.home.cworth.org>
+MIME-Version: 1.0
+Content-Type: multipart/alternative; boundary="==-=-=="
+
+--==-=-==
+Content-Type: text/html
+
+This is the text/html part of a multipart/alternative.
+
+--==-=-==
+Content-Type: text/plain
+
+This is the text/plain part of a multipart/alternative.
+
+--==-=-==--
+EOF
+notmuch new > /dev/null
+test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
+  (notmuch-show \"id:87liy5ap01@yoom.home.cworth.org\")
+ (test-output))"
+mv OUTPUT{,.text}
+test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
+  (notmuch-show \"id:87liy5ap01@yoom.home.cworth.org\")
+  (notmuch-show-cycle-message-multipart)
+ (test-output))"
+mv OUTPUT{,.html}
+diff OUTPUT.{text,html} >OUTPUT.diff
+cat  [ text/html ]
+> This is the text/html part of a multipart/alternative.
+> 
+> [ text/plain (not shown) ]
+EOF
+test_expect_equal_file {OUTPUT,EXPECTED}.diff
+
 test_done
-- 
1.7.10.4

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


[PATCH 2/2] test: move all emacs show tests to emacs-show test script

2012-08-12 Thread Jameson Graef Rollins
No functional change.

Most notmuch-show mode tests were in the emacs script, while some were
in the emacs-show script.  This moves all the notmuch-show mode tests
to the emacs-show script, to make things a little more consistent.
---
This patch is not necessary, but I think it makes the emacs tests
clearer, by not having tests for show-mode split across multiple test
scripts.

 test/emacs  |  397 +
 test/emacs-show |  409 +++
 2 files changed, 410 insertions(+), 396 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..9cb5795 100755
--- a/test/emacs
+++ b/test/emacs
@@ -54,49 +54,6 @@ test_emacs '(notmuch-hello)
(test-output)'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
 
-test_begin_subtest "Basic notmuch-show view in emacs"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.gu3...@dottiness.seas.harvard.edu)
-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 default indentation"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.gu3...@dottiness.seas.harvard.edu)
-test_emacs "(let ((notmuch-show-indent-messages-width 1))
- (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-width 0))
- (notmuch-show \"$maildir_storage_thread\")
- (test-output))"
-test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
-
-test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.gu3...@dottiness.seas.harvard.edu)
-test_emacs "(let ((notmuch-show-indent-messages-width 4))
- (notmuch-show \"$maildir_storage_thread\")
- (test-output))"
-test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation
-
-test_begin_subtest "notmuch-show for message with invalid From"
-add_message "[subject]=\"message-with-invalid-from\"" \
-   "[from]=\"\\\"Invalid \\\" From\\\" \""
-thread=$(notmuch search --output=threads subject:message-with-invalid-from)
-test_emacs "(notmuch-show \"$thread\")
-   (test-output)"
-cat 

Re: [PATCH] emacs: Fix "not defined at runtime" warning

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Previously, the Emacs byte compiler produced the warning
>
> the function `remove-if-not' might not be defined at runtime.

pushed, 

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


Re: [PATCH v2] test: Add test for messages with missing headers

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Currently the JSON tests for search and show are broken because
> notmuch attempts to dereference a NULL pointer.

pushed, 

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


Re: [PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-12 Thread David Bremner
Mark Walters  writes:

> The string function in a sprinter may be called with a NULL string
> pointer (eg if a header is absent). This causes a segfault. We fix
> this by checking for a null pointer in the string functions 

pushed, 

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


Re: [PATCH v2] emacs: notmuch search bugfix

2012-08-12 Thread David Bremner
Mark Walters  writes:

> The recent change to use json for notmuch-search.el introduced a bug
> in the code for keeping position on refresh. The problem is a
> comparison between (plist-get result :thread) and a thread-id returned

pushed, 

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


Re: [PATCH] cli: Remove now-unused json.c

2012-08-12 Thread David Bremner
Austin Clements  writes:

> The string buffer quoting functions in json.c have been superseded by
> the new sprinter interface and are no longer used.  Remove them.

pushed,

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


Re: [PATCH] reply: Convert JSON format to use sprinter

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Almost all of reply was already being formatted using the sprinter.
> This patch converts the top-level dictionary to use the sprinter
> interface.

pushed,

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


Re: [PATCH] emacs: Make moving to the previous message move to the previous boundary

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Previously, notmuch-show-previous-message would move to the beginning
> of the message before the message containing point.  This patch makes
> it instead move to the previous message *boundary*.

pushed, 

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


Re: [announce] Bower 0.4

2012-08-12 Thread Patrick Totzke
Quoting David Froger (2012-08-12 16:53:43)
> > > 3. Would it be possible to have the feature 'kill a thread' like Sup 
> > > have? (see
> > > http://sup.rubyforge.org/README.txt).
> > 
> > I haven't needed such a feature so I don't have a clear idea how it
> > should work.  There are some patches/ideas about muting threads using
> > notmuch generally around here.  I guess the simplest thing to do is hide
> > a thread if it has a certain tag, e.g. "muted" as suggested by notmuch
> > TODO file, unless you search for it explicitly.
> I  like this  solution,  I will  use it (adding 'and not tag:mutted' at the 
> end of my search).
> When  I'm not  interessed with  a long discussion on a mailling list,  I like 
> to  be able to 'kill'
> the thread so it does not reappear with every new mail.

I'm not sure if this actually solves your problem, because
notmuch's search is message, not thread based:
If you search for threads that match "is:inbox and not is:muted", you will see 
threads
that contain messages which are tagged with "inbox" and not with "muted".
This means if you just tag one (or all) msg in a thread "muted" and there is a 
new response,
this thread will contain such a matching message again and show up in your 
result list.

To make this work, you need to set up your tagging script (that you run after 
'notmuch new')
so that it updates those new messages accordingly. If a msg belongs to a thread 
that has 
muted messages, also tag the new one muted.
I can pretty much recommend Justus' tagging script afew: 
https://github.com/teythoon/afew
One of the filters that it supports out of the box is exactly the "kill 
threads" function
you want.

HTH,
/p


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


[announce] Bower 0.4

2012-08-12 Thread Peter Wang
Hi,

Bower is yet another curses frontend for the Notmuch email system.
I wrote it for me, but you might like it, too.

https://github.com/wangp/bower

Bower 0.4 (2012-08-12)
==
This release requires notmuch 0.13 for addressbook completion.

* Asynchronous tagging and polling in index view.
* Highlight diff lines in quoted text.
* Context-aware completion for tag names.
* Completion for addressbook aliases.
* post_sendmail configuration option.
* Support Up/Down/PgUp/PgDn/Home/End keys in more views.
* Better resize handling.
* Improved URL detection.
* Don't expand HTML alternative parts unnecessarily.

Peter


[announce] Bower 0.4

2012-08-12 Thread David Froger
On Sun, 12 Aug 2012 15:22:58 +1000, Peter Wang  wrote:
> Hi,
> 
> Bower is yet another curses frontend for the Notmuch email system.
> I wrote it for me, but you might like it, too.
> 
>   https://github.com/wangp/bower
> 
> Bower 0.4 (2012-08-12)
> ==
> This release requires notmuch 0.13 for addressbook completion.
> 
> * Asynchronous tagging and polling in index view.
> * Highlight diff lines in quoted text.
> * Context-aware completion for tag names.
> * Completion for addressbook aliases.
> * post_sendmail configuration option.
> * Support Up/Down/PgUp/PgDn/Home/End keys in more views.
> * Better resize handling.
> * Improved URL detection.
> * Don't expand HTML alternative parts unnecessarily.

Hi,

Thanks Peter, nice to see this new release and these new functionnalies!

I'm using bower every day, both at home and at work, and it's really usefull for
me.

By the way, I have some questions:

1. To receive emails, I use a bash script that basically do:

while true
do
offlineimap
notmuch new
notmuch tag ...
sleep 60
done

Would it be possible to have a hook 'pollmails' that is triggered from the Index
view by pressing a key (p or P), which can be configure in 
~/.config/bower/bower.conf
like this:
pollmails=a_command.sh

So I can rewrite my bash script something like this:

while true
do
offlineimap
notmuch new
notmuch tag ...

before_enter_loop = `current date`

while true
do
   sleep 0.01
   now = `current date`
   if [ 'a_commmand.sh' has been called 
  or now > before_enter_loop + 60 seconds ]
   then 
   exit loop
   fi
done
done

2. I've notice that errors could happend if I modify tags from bower while my
bash script is also modifiny tags of the incoming emails. Do you see any
solution?

3. Would it be possible to have the feature 'kill a thread' like Sup have? (see
http://sup.rubyforge.org/README.txt).

4. postponed message doesn't work for me. When I postpone a message, it says
'message postponed', but when pressing R from Index view, it says 'No postponed
message'. Maybe I need to create a directory to store postponed messages?

5. When attaching a file, would it be possible to have '~' expanded to the 
$HOME directory?

6. In the index view, having the possiblity to scroll right and left (so one can
see the email tags in the line in too long)?

7. less important, having light colors for white console?

Thank you very much!

Best regards,

David


[announce] Bower 0.4

2012-08-12 Thread David Froger
> Basically, run an arbitrary command when a key is pressed.  It would
> be fairly easy to add, but I wonder if it would be easy to stop adding
> more :-)  You could bind a shortcut key to your window manager or
> desktop environment that runs the command instead.
Yes of course, it's a lot simpler, why didn't I think to it...

> > 2. I've notice that errors could happend if I modify tags from bower while 
> > my
> > bash script is also modifiny tags of the incoming emails. Do you see any
> > solution?
> 
> The asynchronous tagging will retry after 5 seconds.  The notmuch error
> message will show and mess up your screen (press ^L), which I would like
> to fix somehow.  Ultimately, I think notmuch should handle this more
> gracefully.
Ok! Two times, this had made notmuch bug for me: notmuch displayed a message 
like "welcome to a new
version of notmuch", and then retagged all my emails, deleting old tags.
(now, I dump my tags every day, and I avoid to use bower while notmuch is 
running).

> > 3. Would it be possible to have the feature 'kill a thread' like Sup have? 
> > (see
> > http://sup.rubyforge.org/README.txt).
> 
> I haven't needed such a feature so I don't have a clear idea how it
> should work.  There are some patches/ideas about muting threads using
> notmuch generally around here.  I guess the simplest thing to do is hide
> a thread if it has a certain tag, e.g. "muted" as suggested by notmuch
> TODO file, unless you search for it explicitly.
I  like this  solution,  I will  use it (adding 'and not tag:mutted' at the end 
of my search).
When  I'm not  interessed with  a long discussion on a mailling list,  I like 
to  be able to 'kill'
the thread so it does not reappear with every new mail.

> > 4. postponed message doesn't work for me. When I postpone a message, it says
> > 'message postponed', but when pressing R from Index view, it says 'No 
> > postponed
> > message'. Maybe I need to create a directory to store postponed messages?
> 
> The postponed message should be in Maildir/Drafts.  Can you see it with
> `notmuch search tag:draft'?
No, `notmuch search tag:draft` returns 0.

> > 5. When attaching a file, would it be possible to have '~' expanded to the 
> > $HOME directory?
> 
> Sure.
Thanks!

> 
> > 6. In the index view, having the possiblity to scroll right and left (so 
> > one can
> > see the email tags in the line in too long)?
> 
> I'm not sure that's a great solution.  Maybe have a key that popups up
> an info box, which would have enough room to show the whole subject
> line, the list of authors and the tags?
Yes, that would be perfect.

> > 7. less important, having light colors for white console?
> 
> Maybe :-)
> 
> Peter

Thanks for you support!
David


[PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative

2012-08-12 Thread Jameson Graef Rollins
Fairly simple test that looks at a diff of test-emacs output from each
case.
---
As I mentioned, I really like this toggle view solution, so here's a
test for it.

 test/emacs-show |   47 +++
 1 file changed, 47 insertions(+)

diff --git a/test/emacs-show b/test/emacs-show
index e9a714f..695f929 100755
--- a/test/emacs-show
+++ b/test/emacs-show
@@ -36,4 +36,51 @@ test_begin_subtest "Bare subject #3"
 output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
 test_expect_equal "$output" '"the cure: fix the regexp"'

+test_begin_subtest "Toggle display multipart/alternative"
+cat < ${MAIL_DIR}/embedded_message
+From: Carl Worth 
+To: cworth at cworth.org
+Subject: html message
+Date: Fri, 05 Jan 2001 15:42:57 +
+User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 
(i486-pc-linux-gnu)
+Message-ID: <87liy5ap01.fsf at yoom.home.cworth.org>
+MIME-Version: 1.0
+Content-Type: multipart/alternative; boundary="==-=-=="
+
+--==-=-==
+Content-Type: text/html
+
+This is the text/html part of a multipart/alternative.
+
+--==-=-==
+Content-Type: text/plain
+
+This is the text/plain part of a multipart/alternative.
+
+--==-=-==--
+EOF
+notmuch new > /dev/null
+test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
+  (notmuch-show \"id:87liy5ap01.fsf at yoom.home.cworth.org\")
+ (test-output))"
+mv OUTPUT{,.text}
+test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))
+  (notmuch-show \"id:87liy5ap01.fsf at yoom.home.cworth.org\")
+  (notmuch-show-cycle-message-multipart)
+ (test-output))"
+mv OUTPUT{,.html}
+diff OUTPUT.{text,html} >OUTPUT.diff
+cat  [ text/html ]
+> This is the text/html part of a multipart/alternative.
+> 
+> [ text/plain (not shown) ]
+EOF
+test_expect_equal_file {OUTPUT,EXPECTED}.diff
+
 test_done
-- 
1.7.10.4



[PATCH 2/2] test: move all emacs show tests to emacs-show test script

2012-08-12 Thread Jameson Graef Rollins
No functional change.

Most notmuch-show mode tests were in the emacs script, while some were
in the emacs-show script.  This moves all the notmuch-show mode tests
to the emacs-show script, to make things a little more consistent.
---
This patch is not necessary, but I think it makes the emacs tests
clearer, by not having tests for show-mode split across multiple test
scripts.

 test/emacs  |  397 +
 test/emacs-show |  409 +++
 2 files changed, 410 insertions(+), 396 deletions(-)

diff --git a/test/emacs b/test/emacs
index afe35ba..9cb5795 100755
--- a/test/emacs
+++ b/test/emacs
@@ -54,49 +54,6 @@ test_emacs '(notmuch-hello)
(test-output)'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox

-test_begin_subtest "Basic notmuch-show view in emacs"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.GU3165 at dottiness.seas.harvard.edu)
-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 default indentation"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.GU3165 at dottiness.seas.harvard.edu)
-test_emacs "(let ((notmuch-show-indent-messages-width 1))
- (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-width 0))
- (notmuch-show \"$maildir_storage_thread\")
- (test-output))"
-test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
-
-test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"
-maildir_storage_thread=$(notmuch search --output=threads 
id:20091117190054.GU3165 at dottiness.seas.harvard.edu)
-test_emacs "(let ((notmuch-show-indent-messages-width 4))
- (notmuch-show \"$maildir_storage_thread\")
- (test-output))"
-test_expect_equal_file OUTPUT 
$EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation
-
-test_begin_subtest "notmuch-show for message with invalid From"
-add_message "[subject]=\"message-with-invalid-from\"" \
-   "[from]=\"\\\"Invalid \\\" From\\\" \""
-thread=$(notmuch search --output=threads subject:message-with-invalid-from)
-test_emacs "(notmuch-show \"$thread\")
-   (test-output)"
-cat 

[PATCH] emacs: Fix "not defined at runtime" warning

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Previously, the Emacs byte compiler produced the warning
>
> the function `remove-if-not' might not be defined at runtime.

pushed, 

d


[PATCH v2] test: Add test for messages with missing headers

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Currently the JSON tests for search and show are broken because
> notmuch attempts to dereference a NULL pointer.

pushed, 

d


[PATCH] sprinters: bugfix when NULL passed for a string.

2012-08-12 Thread David Bremner
Mark Walters  writes:

> The string function in a sprinter may be called with a NULL string
> pointer (eg if a header is absent). This causes a segfault. We fix
> this by checking for a null pointer in the string functions 

pushed, 

d


[PATCH v2] emacs: notmuch search bugfix

2012-08-12 Thread David Bremner
Mark Walters  writes:

> The recent change to use json for notmuch-search.el introduced a bug
> in the code for keeping position on refresh. The problem is a
> comparison between (plist-get result :thread) and a thread-id returned

pushed, 

d


[PATCH] cli: Remove now-unused json.c

2012-08-12 Thread David Bremner
Austin Clements  writes:

> The string buffer quoting functions in json.c have been superseded by
> the new sprinter interface and are no longer used.  Remove them.

pushed,

d


[PATCH] reply: Convert JSON format to use sprinter

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Almost all of reply was already being formatted using the sprinter.
> This patch converts the top-level dictionary to use the sprinter
> interface.

pushed,

d


[PATCH] emacs: Make moving to the previous message move to the previous boundary

2012-08-12 Thread David Bremner
Austin Clements  writes:

> Previously, notmuch-show-previous-message would move to the beginning
> of the message before the message containing point.  This patch makes
> it instead move to the previous message *boundary*.

pushed, 

d


[announce] Bower 0.4

2012-08-12 Thread Patrick Totzke
Quoting David Froger (2012-08-12 16:53:43)
> > > 3. Would it be possible to have the feature 'kill a thread' like Sup 
> > > have? (see
> > > http://sup.rubyforge.org/README.txt).
> > 
> > I haven't needed such a feature so I don't have a clear idea how it
> > should work.  There are some patches/ideas about muting threads using
> > notmuch generally around here.  I guess the simplest thing to do is hide
> > a thread if it has a certain tag, e.g. "muted" as suggested by notmuch
> > TODO file, unless you search for it explicitly.
> I  like this  solution,  I will  use it (adding 'and not tag:mutted' at the 
> end of my search).
> When  I'm not  interessed with  a long discussion on a mailling list,  I like 
> to  be able to 'kill'
> the thread so it does not reappear with every new mail.

I'm not sure if this actually solves your problem, because
notmuch's search is message, not thread based:
If you search for threads that match "is:inbox and not is:muted", you will see 
threads
that contain messages which are tagged with "inbox" and not with "muted".
This means if you just tag one (or all) msg in a thread "muted" and there is a 
new response,
this thread will contain such a matching message again and show up in your 
result list.

To make this work, you need to set up your tagging script (that you run after 
'notmuch new')
so that it updates those new messages accordingly. If a msg belongs to a thread 
that has 
muted messages, also tag the new one muted.
I can pretty much recommend Justus' tagging script afew: 
https://github.com/teythoon/afew
One of the filters that it supports out of the box is exactly the "kill 
threads" function
you want.

HTH,
/p
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120812/161081a7/attachment.pgp>