Re: [PATCH 0/3] Control notmuch show output

2012-07-14 Thread Mark Walters
I wonder if we need as many options as this: I implemented a simpler set of possibilities: no-body: just from, to, cc, subject and date headers and no bodies brief:from, to, cc, subject and date header with bodies most: all headers except received with bodies

Re: Tests

2012-07-14 Thread David Bremner
Mark Walters markwalters1...@gmail.com writes: I wonder if we could have a sort of staging area for tests where they could roughly go in without review and would only be run by something like make stage-test or make all-tests or something. The hope is that this would encourage more tests.

Re: [PATCH v2 0/7] emacs: JSON-based search cleanups

2012-07-14 Thread Jameson Graef Rollins
On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: This version updates the docstrings for notmuch-search-update-result and notmuch-search-show-result and fixes the scrolling artifact in notmuch-search-update-result. I also updated the commit message of patch 7 to mention that it

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: Coincidentally, this also essentially enables multi-line search result formats; the only remaining non-multi-line-capable functions are notmuch-search-{next,previous}-thread, which are only used interactively. So I tried to

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: Coincidentally, this also essentially enables multi-line search result formats; the only remaining non-multi-line-capable functions are notmuch-search-{next,previous}-thread,

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth myself on Jul 14 at 3:50 pm: Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: On Fri, Jul 13 2012, Austin Clements amdra...@mit.edu wrote: +(defmacro notmuch-search-do-results (beg end pos-sym rest body) + Invoke BODY for each result between BEG and END. + +POS-SYM will be

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
On Sat, Jul 14 2012, Austin Clements amdra...@mit.edu wrote: That's strange. What was the error? I've been testing with ((date . %12s ) (count . %-7s ) (authors . %-20s ) (subject . \n%s ) (tags . (%s))) But maybe there are other cases it doesn't handle correctly?

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Mark Walters
On Sat, 14 Jul 2012, Austin Clements amdra...@mit.edu wrote: This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 2:13 pm: On Sat, Jul 14 2012, Austin Clements amdra...@mit.edu wrote: That's strange. What was the error? I've been testing with ((date . %12s ) (count . %-7s ) (authors . %-20s ) (subject . \n%s ) (tags . (%s))) But

[PATCH v3 1/8] emacs: Record thread search result object in a text property

2012-07-14 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

[PATCH v3 0/8] emacs: JSON-based search cleanups

2012-07-14 Thread Austin Clements
This version swaps out the notmuch-search-do-results macro for a higher-order function, notmuch-search-foreach-result. This requires less squiting to understand and clearly distinguishes the arguments passed in to the function from the arguments passed to the callback. This version also updates

[PATCH v3 7/8] emacs: Fix navigation of multi-line search result formats

2012-07-14 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so

[PATCH v3 5/8] emacs: Replace other search text properties with result property

2012-07-14 Thread Austin Clements
Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object. --- emacs/notmuch.el | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v3 4/8] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH v3 3/8] emacs: Update tags by rewriting the search result line in place

2012-07-14 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

Re: [PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
On Sat, Jul 14 2012, Austin Clements amdra...@mit.edu wrote: I think this is just a sharp corner in customize and there's notmuch we can do about it. I believe the proper way to enter the newline directly in customize is to hit C-q C-j (same way you get a raw newline in any other buffer).

[PATCH v2 7/7] emacs: Fix navigation of multi-line search result formats

2012-07-14 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so

[PATCH v2 6/7] emacs: Allow custom tags formatting

2012-07-14 Thread Austin Clements
Previously we ignored any notmuch-search-result-format customizations for tag formatting because we needed to be able to parse back in the result line and update the tags in place. We no longer do either of these things, so we can allow customization of this format. (Coincidentally, previously

[PATCH v2 2/7] emacs: Use text properties instead of overlays for tag coloring

2012-07-14 Thread Austin Clements
Previously, tag-based search result highlighting was done by creating an overlay over each search result. However, overlays have annoying front- and rear-advancement semantics that make it difficult to manipulate text at their boundaries, which the next patch will do. They also have performance

[PATCH v2 3/7] emacs: Update tags by rewriting the search result line in place

2012-07-14 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

[PATCH v2 0/7] emacs: JSON-based search cleanups

2012-07-14 Thread Austin Clements
This version updates the docstrings for notmuch-search-update-result and notmuch-search-show-result and fixes the scrolling artifact in notmuch-search-update-result. I also updated the commit message of patch 7 to mention that it changes the behavior of notmuch-search-previous-thread. The diff

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH v2 5/7] emacs: Replace other search text properties with result property

2012-07-14 Thread Austin Clements
Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object. --- emacs/notmuch.el | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v2 1/7] emacs: Record thread search result object in a text property

2012-07-14 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

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

2012-07-14 Thread Austin Clements
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*. That is, if point isn't already at the beginning of the message, it moves to the beginning of the current

Notmuch scripts (again), now with more usenet

2012-07-14 Thread c...@webprojekty.cz
: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/9d1ae862/attachment.pgp>

[PATCH 0/3] Control notmuch show output

2012-07-14 Thread Mark Walters
I wonder if we need as many options as this: I implemented a simpler set of possibilities: no-body: just from, to, cc, subject and date headers and no bodies brief:from, to, cc, subject and date header with bodies most: all headers except "received" with bodies

Tests

2012-07-14 Thread David Bremner
Mark Walters writes: > > I wonder if we could have a sort of staging area for tests where they > could roughly go in without review and would only be run by something > like make stage-test or make all-tests or something. The hope is that > this would encourage more tests. If somebody is

[PATCH v2 0/7] emacs: JSON-based search cleanups

2012-07-14 Thread Jameson Graef Rollins
ble URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/17de2914/attachment.pgp>

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
le Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/8a361946/attachment.pgp>

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
plication/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/89fa5b45/attachment.pgp>

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: > On Fri, Jul 13 2012, Austin Clements wrote: > > Coincidentally, this also essentially enables multi-line search result > > formats; the only remaining non-multi-line-capable functions are > > notmuch-search-{next,previous}-thread, which are

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth myself on Jul 14 at 3:50 pm: > Quoth Jameson Graef Rollins on Jul 14 at 12:31 pm: > > On Fri, Jul 13 2012, Austin Clements wrote: > > > +(defmacro notmuch-search-do-results (beg end pos-sym body) > > > + "Invoke BODY for each result between BEG and END. > > > + > > > +POS-SYM will be

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/f45b6c5b/attachment-0001.pgp>

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Mark Walters
On Sat, 14 Jul 2012, Austin Clements wrote: > This simplifies the traversal of regions of results and eliminates the > need for save-excursions (which tend to get in the way of maintaining > point when we make changes to the buffer). It also fixes some strange > corner cases in the old

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
Quoth Jameson Graef Rollins on Jul 14 at 2:13 pm: > On Sat, Jul 14 2012, Austin Clements wrote: > > That's strange. What was the error? > > > > I've been testing with > >(("date" . "%12s ") > > ("count" . "%-7s ") > > ("authors" . "%-20s ") > > ("subject" . "\n%s ") > >

[PATCH v3 1/8] emacs: Record thread search result object in a text property

2012-07-14 Thread Austin Clements
This also provides utility functions for working with this text property that get its value, find its start, and find its end. --- emacs/notmuch.el | 27 +++ 1 file changed, 27 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fabb7c0..ef18927 100644

[PATCH v3 0/8] emacs: JSON-based search cleanups

2012-07-14 Thread Austin Clements
This version swaps out the notmuch-search-do-results macro for a higher-order function, notmuch-search-foreach-result. This requires less squiting to understand and clearly distinguishes the arguments passed in to the function from the arguments passed to the callback. This version also updates

[PATCH v3 7/8] emacs: Fix navigation of multi-line search result formats

2012-07-14 Thread Austin Clements
At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so

[PATCH v3 4/8] emacs: Use result text properties for search result iteration

2012-07-14 Thread Austin Clements
This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but

[PATCH v3 5/8] emacs: Replace other search text properties with result property

2012-07-14 Thread Austin Clements
Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object. --- emacs/notmuch.el | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff

[PATCH v3 6/8] emacs: Allow custom tags formatting

2012-07-14 Thread Austin Clements
Previously we ignored any notmuch-search-result-format customizations for tag formatting because we needed to be able to parse back in the result line and update the tags in place. We no longer do either of these things, so we can allow customization of this format. (Coincidentally, previously

[PATCH v3 2/8] emacs: Use text properties instead of overlays for tag coloring

2012-07-14 Thread Austin Clements
Previously, tag-based search result highlighting was done by creating an overlay over each search result. However, overlays have annoying front- and rear-advancement semantics that make it difficult to manipulate text at their boundaries, which the next patch will do. They also have performance

[PATCH v3 8/8] News for search cleanups

2012-07-14 Thread Austin Clements
--- NEWS | 14 ++ 1 file changed, 14 insertions(+) diff --git a/NEWS b/NEWS index a1a6e93..7b33f0d 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,20 @@ Maildir tag synchronization Emacs Interface --- +Search results now get re-colored when tags are updated + +The

[PATCH v3 3/8] emacs: Update tags by rewriting the search result line in place

2012-07-14 Thread Austin Clements
Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change. ---

[PATCH v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
for the uninitiated. jamie. -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120714/092fb00e/attachment.pgp>