[notmuch] [PATCH] Further improvements to tag-based coloring in search.

2010-02-06 Thread Aaron Ecay
Makes the following improvements:
- fix up doc strings
- suppress the creation of unnecessary let-bindings
- create overlays lazily (to avoid creating many overlays for threads
  that do not get colored)

Signed-off-by: Aaron Ecay 
---
 notmuch.el |   29 ++---
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 46159af..fff2192 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -1257,8 +1257,7 @@ This function advances the next thread when finished."
   '(("delete" . (:foreground "DarkGrey")))
   "Tag/face mapping for line highlighting in notmuch-search.

-Here is an example of how to color search results based on tags.
-(the following text would be placed in your ~/.emacs file):
+Here is an example of how to color search results based on tags:

 (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"))
  (\"unread\" . (:foreground \"green\"
@@ -1269,19 +1268,19 @@ matching will be applied."
   :group 'notmuch)

 (defun notmuch-search-color-line (start end line-tag-list)
-  "Colorize lines in notmuch-search based on tags"
-  (if notmuch-search-line-faces
-  (let ((overlay (make-overlay start end))
-   (tags-faces (copy-alist notmuch-search-line-faces)))
-   (while tags-faces
- (let* ((tag-face (car tags-faces))
-(tag (car tag-face))
-(face (cdr tag-face)))
-   (cond ((member tag line-tag-list)
-  (overlay-put overlay 'face face)
-  (setq tags-faces nil))
- (t
-  (setq tags-faces (cdr tags-faces)
+  "Colorize lines in notmuch-search based on tags.
+
+Uses the tag/face mappings found in `notmuch-search-line-faces'."
+  (when notmuch-search-line-faces
+(let ((tags-faces notmuch-search-line-faces))
+  (while tags-faces
+(let ((tag (caar tags-faces))
+  (face (cdar tags-faces)))
+  (cond ((member tag line-tag-list)
+ (overlay-put (make-overlay start end) 'face face)
+ (setq tags-faces nil))
+(t
+ (setq tags-faces (cdr tags-faces)

 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
-- 
1.6.6



[notmuch] hack to retag a directory

2010-02-06 Thread David Bremner
On Fri, 05 Feb 2010 17:41:48 -0800, Carl Worth  wrote:

[talking about gitmuch, a simple wrapper around notmuch dump && git commit]
> 
> And it's interesting that this script might be just good enough for the
> synchronization needs of some people. It's not integrated, and might
> require manual fixup of any resulting git conflicts, but it might be
> handy for some.
> 

I have to say that merge conflicts are not very much fun. I tend to do a
certain amount of oh, take all the changes from the server.  I wonder if
the approach that someone else mentioned of keeping a file
tags/message-id with the appropriate tags in it might make merging less
painful.

> The biggest problem I see is that if I were to read some messages
> locally, and then run "gitmuch restore" then this would wipe out the
> local changes I had made. So we'll definitely want a more integrated
> solution to eliminate the chance of problems like this.

Yeah, the footgun potential is definitely there.

> One easy answer is to just make "notmuch restore" do nothing for
> messages where the existing tags are the same as the tags mentioned in
> the input file. I just pushed a change to implement this, (along with
> new tests for "notmuch dump" and "notmuch restore" of course).

Heh, I think I later posted a patch to do that as well.

d



[notmuch] [PATCH] Further improvements to tag-based coloring in search.

2010-02-06 Thread Aaron Ecay
Makes the following improvements:
- fix up doc strings
- suppress the creation of unnecessary let-bindings
- create overlays lazily (to avoid creating many overlays for threads
  that do not get colored)

Signed-off-by: Aaron Ecay 
---
 notmuch.el |   29 ++---
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 46159af..fff2192 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -1257,8 +1257,7 @@ This function advances the next thread when finished."
   '(("delete" . (:foreground "DarkGrey")))
   "Tag/face mapping for line highlighting in notmuch-search.
 
-Here is an example of how to color search results based on tags.
-(the following text would be placed in your ~/.emacs file):
+Here is an example of how to color search results based on tags:
 
 (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"))
  (\"unread\" . (:foreground \"green\"
@@ -1269,19 +1268,19 @@ matching will be applied."
   :group 'notmuch)
 
 (defun notmuch-search-color-line (start end line-tag-list)
-  "Colorize lines in notmuch-search based on tags"
-  (if notmuch-search-line-faces
-  (let ((overlay (make-overlay start end))
-   (tags-faces (copy-alist notmuch-search-line-faces)))
-   (while tags-faces
- (let* ((tag-face (car tags-faces))
-(tag (car tag-face))
-(face (cdr tag-face)))
-   (cond ((member tag line-tag-list)
-  (overlay-put overlay 'face face)
-  (setq tags-faces nil))
- (t
-  (setq tags-faces (cdr tags-faces)
+  "Colorize lines in notmuch-search based on tags.
+
+Uses the tag/face mappings found in `notmuch-search-line-faces'."
+  (when notmuch-search-line-faces
+(let ((tags-faces notmuch-search-line-faces))
+  (while tags-faces
+(let ((tag (caar tags-faces))
+  (face (cdar tags-faces)))
+  (cond ((member tag line-tag-list)
+ (overlay-put (make-overlay start end) 'face face)
+ (setq tags-faces nil))
+(t
+ (setq tags-faces (cdr tags-faces)
 
 (defun notmuch-search-process-filter (proc string)
   "Process and filter the output of \"notmuch search\""
-- 
1.6.6

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


Re: [notmuch] hack to retag a directory

2010-02-06 Thread martin f krafft
also sprach David Bremner  [2010.02.07.1238 +1300]:
> I have to say that merge conflicts are not very much fun. I tend
> to do a certain amount of oh, take all the changes from the
> server.  I wonder if the approach that someone else mentioned of
> keeping a file tags/message-id with the appropriate tags in it
> might make merging less painful.

Merge conflicts at the file level are even less fun. This reminds me
of my plan to introduce .gitignore.d/*:

http://kerneltrap.org/mailarchive/git/2007/10/1/326425

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"there was silence for a moment, and then out of the scrambled mess
 of arthur's brain crawled some words."
 -- hitchhiker's guide to the galaxy
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] hack to retag a directory

2010-02-06 Thread David Bremner
On Fri, 05 Feb 2010 17:41:48 -0800, Carl Worth  wrote:

[talking about gitmuch, a simple wrapper around notmuch dump && git commit]
> 
> And it's interesting that this script might be just good enough for the
> synchronization needs of some people. It's not integrated, and might
> require manual fixup of any resulting git conflicts, but it might be
> handy for some.
> 

I have to say that merge conflicts are not very much fun. I tend to do a
certain amount of oh, take all the changes from the server.  I wonder if
the approach that someone else mentioned of keeping a file
tags/message-id with the appropriate tags in it might make merging less
painful.

> The biggest problem I see is that if I were to read some messages
> locally, and then run "gitmuch restore" then this would wipe out the
> local changes I had made. So we'll definitely want a more integrated
> solution to eliminate the chance of problems like this.

Yeah, the footgun potential is definitely there.

> One easy answer is to just make "notmuch restore" do nothing for
> messages where the existing tags are the same as the tags mentioned in
> the input file. I just pushed a change to implement this, (along with
> new tests for "notmuch dump" and "notmuch restore" of course).

Heh, I think I later posted a patch to do that as well.

d

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


Re: [notmuch] Git commit mails (was: New wiki instance on the notmuchmail.org website)

2010-02-06 Thread martin f krafft
also sprach Carl Worth  [2010.02.07.1156 +1300]:
> > Sorry to burden you, but since you want to continue maintaining
> > the infrastructure, that's just what I have to do. ;)
> 
> No burden at all. I don't really care to do everything alone.
> I just want to ensure we keep things centralized enough that
> people can actually find things easily.

This is what DNS was designed for, right? ;)

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
to err is human - to moo, bovine
 
spamtraps: madduck.bo...@madduck.net


digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] A functional (but rudimentary) test suite for notmuch

2010-02-06 Thread Oliver Charles
On Thu, Feb 4, 2010 at 11:29 PM, Carl Worth  wrote:
> Looking at TAP, one thing I don't like is that it prints the
> success/failure of the test first, before the description of the
> test. That's not so nice in the case of a long-running (perhaps
> infinitely running) test where you might need to interrupt it, but you'd
> still want to know *what* was running for so long.

Ah, the way this works for Test::Harness in Perl is that while a test
suite is running the output is of the form:

t/edit_artist_add_alias.t .. 1/?

And then when it completes it will change to:

t/edit_artist_add_alias.t .. OK

So you can see stuff that's failing to terminate (as I just found
while running my test suites ;))

-- 
Oliver Charles / aCiD2


Re: [notmuch] Git commit mails (was: New wiki instance on the notmuchmail.org website)

2010-02-06 Thread Carl Worth
On Thu, 4 Feb 2010 19:38:07 +1300, martin f krafft  wrote:
> Carl, could you set up notmuch-comm...@notmuchmail.org and enable
> the commit and enable the mail hook as per

Doing that now.

> Sorry to burden you, but since you want to continue maintaining the
> infrastructure, that's just what I have to do. ;)

No burden at all. I don't really care to do everything alone. I just
want to ensure we keep things centralized enough that people can
actually find things easily.

I'm glad to have admin help, so thanks for volunteering!

-Carl


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


[notmuch] Git commit mails (was: New wiki instance on the notmuchmail.org website)

2010-02-06 Thread Carl Worth
On Thu, 4 Feb 2010 19:38:07 +1300, martin f krafft  
wrote:
> Carl, could you set up notmuch-commits at notmuchmail.org and enable
> the commit and enable the mail hook as per

Doing that now.

> Sorry to burden you, but since you want to continue maintaining the
> infrastructure, that's just what I have to do. ;)

No burden at all. I don't really care to do everything alone. I just
want to ensure we keep things centralized enough that people can
actually find things easily.

I'm glad to have admin help, so thanks for volunteering!

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100206/318d01ae/attachment.pgp>


Re: [notmuch] notmuch new: Memory problem (with uuencoded content)

2010-02-06 Thread Carl Worth
On Sat, 6 Feb 2010 11:40:18 +0100, Michal Sojka  wrote:
> I've just looked at your notmuch-test commits. Did you noticed my patches 
> which port Git's test framework for use with notmuch?

Hi Michal,

Ah, my mistake!

That's what I get for working through my backlog chronologically. ;-)

> That framework has the 
> same spirit as yours (shell scripting, easy to use) but compared to your 
> current test script it has some nice features:

All of these features do sound very nice.

> It is straightforward to convert your current test script to Git's framework. 
> If you are interested I'll do it.

Yes, I'd be quite interested in seeing that. Thanks for your
contributions, and sorry I missed (or haven't yet gotten to) the patch
you sent earlier.

-Carl


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


[notmuch] notmuch new: Memory problem (with uuencoded content)

2010-02-06 Thread Carl Worth
On Sat, 6 Feb 2010 11:40:18 +0100, Michal Sojka  wrote:
> I've just looked at your notmuch-test commits. Did you noticed my patches 
> which port Git's test framework for use with notmuch?

Hi Michal,

Ah, my mistake!

That's what I get for working through my backlog chronologically. ;-)

> That framework has the 
> same spirit as yours (shell scripting, easy to use) but compared to your 
> current test script it has some nice features:

All of these features do sound very nice.

> It is straightforward to convert your current test script to Git's framework. 
> If you are interested I'll do it.

Yes, I'd be quite interested in seeing that. Thanks for your
contributions, and sorry I missed (or haven't yet gotten to) the patch
you sent earlier.

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100206/76d12d11/attachment.pgp>


[notmuch] notmuch new: Memory problem (with uuencoded content)

2010-02-06 Thread Michal Sojka
On Friday 05 of February 2010 19:59:12 Carl Worth wrote:
> Of course, I also pushed a set of tests to the test suite for this, (and
> some new "notmuch search" tests while I was at it).

Hi Carl,

I've just looked at your notmuch-test commits. Did you noticed my patches 
which port Git's test framework for use with notmuch? That framework has the 
same spirit as yours (shell scripting, easy to use) but compared to your 
current test script it has some nice features:

- Test suite is split into several files. Therefore you do not need to run the 
whole test suit when you are working in one area of notmuch.
- If some test fails, the executed commands are automatically displayed from 
which you can immediately see what was the problem.
- Working directory for each test has a fixed name based on the name of the 
script (no $$) so you know where to look if some test fails.
- You can decide whether you want to stop on the first failure or complete the 
whole test suite.
- At the end the results are summarized so you do not need to watch the output 
of the test suite.

It is straightforward to convert your current test script to Git's framework. 
If you are interested I'll do it.

Michal


Re: [notmuch] A functional (but rudimentary) test suite for notmuch

2010-02-06 Thread Oliver Charles
On Thu, Feb 4, 2010 at 11:29 PM, Carl Worth  wrote:
> Looking at TAP, one thing I don't like is that it prints the
> success/failure of the test first, before the description of the
> test. That's not so nice in the case of a long-running (perhaps
> infinitely running) test where you might need to interrupt it, but you'd
> still want to know *what* was running for so long.

Ah, the way this works for Test::Harness in Perl is that while a test
suite is running the output is of the form:

t/edit_artist_add_alias.t .. 1/?

And then when it completes it will change to:

t/edit_artist_add_alias.t .. OK

So you can see stuff that's failing to terminate (as I just found
while running my test suites ;))

-- 
Oliver Charles / aCiD2
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] notmuch new: Memory problem (with uuencoded content)

2010-02-06 Thread Michal Sojka
On Friday 05 of February 2010 19:59:12 Carl Worth wrote:
> Of course, I also pushed a set of tests to the test suite for this, (and
> some new "notmuch search" tests while I was at it).

Hi Carl,

I've just looked at your notmuch-test commits. Did you noticed my patches 
which port Git's test framework for use with notmuch? That framework has the 
same spirit as yours (shell scripting, easy to use) but compared to your 
current test script it has some nice features:

- Test suite is split into several files. Therefore you do not need to run the 
whole test suit when you are working in one area of notmuch.
- If some test fails, the executed commands are automatically displayed from 
which you can immediately see what was the problem.
- Working directory for each test has a fixed name based on the name of the 
script (no $$) so you know where to look if some test fails.
- You can decide whether you want to stop on the first failure or complete the 
whole test suite.
- At the end the results are summarized so you do not need to watch the output 
of the test suite.

It is straightforward to convert your current test script to Git's framework. 
If you are interested I'll do it.

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