[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 line-base

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

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

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

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

[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. --- emacs/

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

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

[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 ") > > ("tag

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

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 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). Given that I

[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. --- emacs/

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

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

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

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

[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 v2 4/7] emacs: Use result text properties for search result iteration

2012-07-14 Thread Jameson Graef Rollins
make things clearer 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>

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

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

[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 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 &rest 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 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 only

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 wrote: > > That's strange. What was the error? > > > > I've been testing with > >(("date" . "%12s ") > > ("count" . "%-7s ") > > ("authors" . "%-20s ") > > ("subject" . "\n%s ") > > ("tag

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 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 line-base

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 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 cor

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

2012-07-14 Thread Jameson Graef Rollins
The patch series is great. 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/f45b6c5b/attachment-0001.pgp>

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 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 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 only

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 willin

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

2012-07-14 Thread Jameson Graef Rollins
> Some sophisticated elisp here! Ah, Mark just pointed me to this message that has a good explanation of some of these concepts: id:"20120117230255.gw16...@mit.edu" jamie. pgpQgrW3zokC1.pgp Description: PGP signature ___ notmuch mailing list notmuch@

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

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 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 experiment with multi

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

2012-07-14 Thread Jameson Graef Rollins
- 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/8a361946/attachment.pgp>

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

2012-07-14 Thread Jameson Graef Rollins
On Fri, Jul 13 2012, Austin Clements 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 changes the beh

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

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

Re: 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 willin

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 al

Notmuch scripts (again), now with more usenet

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