Commit graph

909 commits

Author SHA1 Message Date
Bart Trojanowski
84f33e6546 added tagging and refresh to search screen 2009-11-25 00:48:51 -05:00
Bart Trojanowski
804715316b add dummy entries to search screen keymap 2009-11-25 00:48:51 -05:00
Bart Trojanowski
b0a0016416 define keymap for show screen as a dictionary 2009-11-25 00:48:51 -05:00
Bart Trojanowski
f8c4b93840 cleanup default handling code 2009-11-25 00:48:51 -05:00
Bart Trojanowski
fe2a905110 make search screen mappings configurable via dictionary 2009-11-25 00:48:51 -05:00
Bart Trojanowski
5c7ebe31d5 make it possible to set config options from outside the script 2009-11-25 00:48:50 -05:00
Bart Trojanowski
5a2d760067 toggle signatures and citations with s/c respectively 2009-11-25 00:48:50 -05:00
Bart Trojanowski
1e0005e6d0 fix a corner case with folding a single line citation 2009-11-25 00:48:50 -05:00
Bart Trojanowski
3dc96c6dc8 added ^n to handle walking messages 2009-11-25 00:48:50 -05:00
Bart Trojanowski
010eac8b43 pretty colouring and folding for message show 2009-11-25 00:48:50 -05:00
Bart Trojanowski
8a31802b94 parsing rewritten one more time 2009-11-25 00:48:50 -05:00
Bart Trojanowski
c53b945504 completely rewritten show handling 2009-11-25 00:48:50 -05:00
Bart Trojanowski
89dc64726f first attempt to fold the message nicely 2009-11-25 00:48:50 -05:00
Bart Trojanowski
71bdd859dc folding for citations 2009-11-25 00:48:50 -05:00
Bart Trojanowski
c6314fa234 naively fold all signatures 2009-11-25 00:48:49 -05:00
Bart Trojanowski
c80ab27d08 grab all the pattern matchers from the emacs script 2009-11-25 00:48:49 -05:00
Bart Trojanowski
905a08788e make <Enter> from search screen display the correct message 2009-11-25 00:48:49 -05:00
Bart Trojanowski
3fe89c43dd updated README 2009-11-25 00:48:49 -05:00
Bart Trojanowski
02fbef68c5 add 's' binding to let you search for different terms 2009-11-25 00:48:49 -05:00
Bart Trojanowski
cfb18a6cbb reverse order so that the latest is at top 2009-11-25 00:48:49 -05:00
Bart Trojanowski
df5137ff34 README 2009-11-25 00:48:49 -05:00
Bart Trojanowski
dd7bab6273 simplify install with a Makefile 2009-11-25 00:48:49 -05:00
Bart Trojanowski
3493ea0ed5 added syntax files for search and show screens 2009-11-25 00:48:49 -05:00
Bart Trojanowski
5e7df3c17e move from search to show with Enter, and back with q 2009-11-25 00:48:49 -05:00
Bart Trojanowski
0265a00303 primitive notmuch mail interface for vim 2009-11-25 00:48:48 -05:00
Bart Trojanowski
b9e96ccb0d notmuch-show: identify which messages printed matched the query string
The show command outputs all messages in the threads that match the
search-terms.  This patch introduces a 'match:[01]' entry to the 'message{'
line output by the show command.  Value of 1 indicates that the message is
matching the search expression.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
2009-11-25 00:46:44 -05:00
Bart Trojanowski
62878f71c2 have _notmuch_thread_create mark which messages matched the query
When _notmuch_thread_create() is given a query string, it can return more
messages than just those matching the query.  To distinguish those that
matched the query expression, the MATCHING_SEARCH flag is set
appropriately.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
2009-11-25 00:46:44 -05:00
Bart Trojanowski
7e02b448e7 message: add flags to notmuch_message_t
This patch allows for different flags, internal to notmuch, to be set on a
message object.  The patch does not define any such flags, just the
facilities to manage these flags.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
2009-11-25 00:46:44 -05:00
Carl Worth
adef907918 notmuch.el: Quote arguments to protect from shell interpretation.
We want to allow the user to be able to use search expressions with
parentheses and semi-colons, etc. and we definitely don't want the
shell interpreting those!
2009-11-24 19:08:53 -08:00
Carl Worth
93af7b5745 notmuch.el: Exceute "notmuch search" asynchronously.
Previously, our emacs interface was waiting for the "notmuch search"
to complete before it would display anything. Now, we execute the
process asyncrhonously and filter results as they come in.

This takes advantage of the recent work to make "notmuch search"
results stream out steadily. The result is that some search results
will be available nearly instantly and the user can navigate and view
those while additional results continue loading.
2009-11-24 18:49:58 -08:00
Carl Worth
c1e16435cf Merge buttons-for-body-and-headers branch.
Thanks, Alexander!
2009-11-24 11:35:13 -08:00
Alexander Botero-Lowry
0ad3534b94 Remove the global expand body keymapping
With local buttons done now, we don't need this anymore.
2009-11-24 11:34:13 -08:00
Carl Worth
70962fabf9 lib/messages.c: Make message searches stream as well.
Xapian provides an interator-based interface to all search results.
So it was natural to make notmuch_messages_t be iterator-based as
well. Which we did originally.

But we ran into a problem when we added two APIs, (_get_replies and
_get_toplevel_messages), that want to return a messages iterator
that's *not* based on a Xapian search result. My original compromise
was to use notmuch_message_list_t as the basis for all returned
messages iterators in the public interface.

This had the problem of introducing extra latency at the beginning
of a search for messages, (the call would block while iterating over
all results from Xapian, converting to a message list).

In this commit, we remove that initial conversion and instead provide
two alternate implementations of notmuch_messages_t (one on top of a
Xapian iterator and one on top of a message list).

With this change, I tested a "notmuch search" returning *many* results
as previously taking about 7 seconds before results started appearing,
and now taking only 2 seconds.
2009-11-24 11:33:09 -08:00
Alexander Botero-Lowry
daeda152b8 Make bodies locally toggleable
Having actually implemented this, I realized that my
initial approach of providing a function to configure
a button was wrong. Instead I've replaced that with
button types. This then makes it possible to provide
the fully expanded view when all threads in a message
are unread.

It also has the potential to allow global-expansion functions
if that is desireable
2009-11-24 10:39:18 -08:00
Alexander Botero-Lowry
9eb90688b7 make a nice function for generating invisibility toggle buttons
I realized I was replicating this code over and over again, so this
way if I change my mind about something I only have to do it on one
place.
2009-11-24 10:39:18 -08:00
Alexander Botero-Lowry
60817c39d8 cleanup a lot of left-overs from the global invis
Basically I'd left in a lot of the key-bindings and all the
invisiblity spec variables so just rid the world of those
2009-11-24 10:38:53 -08:00
Alexander Botero-Lowry
bde9284064 make headers locally expandable/collapsable
This is the same as with citations and signatures.
I used an ellipsis here for the invisible region, which
I think make it more obvious that there are extra headers.
MH-e used this for extra long To/CC headers.
2009-11-24 10:37:40 -08:00
Carl Worth
94eb9aacd4 lib/query: Drop the first and max_messages arguments from search_messages.
These only existed to support the chunky-searching hack, but that
was recently dropped anyway.
2009-11-23 20:25:13 -08:00
Carl Worth
ba3554b804 lib/query: Fix notmuch_threads_t to stream results rather than blocking.
Previously, notmuch_query_search_threads would do all the work, so the
caller would block until all results were processed. Now, we do the
work as we go, as the caller iterates with notmuch_threads_next. This
means that once results start coming back from "notmuch search" they
just keep continually streaming.

There's still some initial blocking before the first results appear
because the notmuch_messages_t object has the same bug (for now).
2009-11-23 20:18:57 -08:00
Carl Worth
1fd8b7866f notmuch search: Remove the chunked-searching hack.
This was a poor workaround around the fact that the existing
notmuch_threads_t object is implemented poorly. It's got a fine
iterartor-based interface, but the implementation does all of the
work up-front in _create rather than doing the work incrementally
while iterating.

So to start fixing this, first get rid of all the hacks we had working
around this. This drops the --first and --max-threads options from the
search command, (but hopefully nobody was using them
anyway---notmuch.el certainly wasn't).
2009-11-23 20:17:37 -08:00
Carl Worth
f615803932 notmuch.el: Add TAB and M-TAB buttons to move between buttons.
Thanks to Alexander Botero-Lowry for pointing out the interesting
functions to use here. This functionality was really easy to add.
2009-11-23 19:03:59 -08:00
Carl Worth
1e4f5108b5 Fix printing of literal '%' in help message.
I suppose I could have just used puts instead...
2009-11-23 18:36:14 -08:00
Jed Brown
1e75f5f3a7 Make addresses case insensitive for the purpose of constructing replies.
The domain is alway case insensitive, but in principle the username is
case sensitive.  Few systems actually enforce this so I think a good
default is to treat the entire address as case insensitive, it will
eliminate a lot of superfluous self-addressed messages and reply from
the correct address in these cases.

Signed-off-by: Jed Brown <jed@59A2.org>
2009-11-23 18:35:01 -08:00
Jed Brown
f667bad7a5 Stay out of tmp to respect the Maildir spec. 2009-11-23 18:29:01 -08:00
Carl Worth
bc0a873b18 search : Extend "intial burst" optimization to return all results by chunks
This way, the user gets a steady (but bursty) stream of reults. We
double the chunk size each time since each successive chunk has to
redo work from all previous chunks.

Of course, the overall time is thereby slower, as the price we pay for
increased responsiveness. With a search returning about 17000 thread
results I measured a total time of 48.8 seconds before this change and
58.4 seconds afterwards.
2009-11-23 18:14:47 +01:00
Carl Worth
793cbf8049 Add rudimentary date-based search.
The rudimentary aspect here is that the date ranges are specified with
UNIX timestamp values (number of seconds since 1970-01-01 UTC). One
thing that can help here is using the date program to determins
timestamps, such as:

	$(date +%s -d 2009-10-01)..$(date +%s)

Long-term, we'll probably need to do our own query parsing to be able
to support directly-specified dates and also relative expressions like
"since:'2 months ago'".
2009-11-23 17:17:08 +01:00
Keith Packard
a378dff8a1 Add notmuch-folder mode to provide an overview of search matches
Folder mode takes a (user-configurable) list of search patterns and
produces a list of those patterns and the count of messages that they
match. When an entry in this list is selected, a search window with
the defined search is opened.  The set of folders is defined as a
list, each element contains the name of the folder and the query string
to count.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-23 06:34:05 +01:00
Keith Packard
53f8cc5651 Add 'notmuch count' command to show the count of matching messages
Getting the count of matching threads or messages is a fairly
expensive operation. Xapian provides a very efficient mechanism that
returns an approximate value, so use that for this new command.

This returns the number of matching messages, not threads, as that is
cheap to compute.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-23 06:33:54 +01:00
Keith Packard
43daa6f070 Make mouse-1 click in search view show thread
Selecting text in the search view isn't all that useful, so instead,
make mouse-1 clicks actually show the thread you click on. It's almost
like direct manipulation or something.

Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-23 06:29:53 +01:00
Carl Worth
cfc671cc2e TODO: Yet another idea.
This is an idea I've had "forever" (and is commented as such in the
code already), but just came up on the mailing list. So note it here.
2009-11-23 06:28:41 +01:00