notmuch
11 years agonotmuch.el: Make magic space bar advance to next unread messages.
Carl Worth [Wed, 4 Nov 2009 19:23:44 +0000 (11:23 -0800)]
notmuch.el: Make magic space bar advance to next unread messages.

The magic of the space bar is all about unread messages, so there's no
reason for it to advance to messages that have already been read.

Similarly, we now remove any magic from (n)ext so that it simply
advances to the next message without marking anything read, (which
makes it symmetrical with (p)revious).

11 years agonotmuch.el: Move to first unread message on notmuch-show.
Carl Worth [Wed, 4 Nov 2009 19:19:50 +0000 (11:19 -0800)]
notmuch.el: Move to first unread message on notmuch-show.

This is important for when a new message is delivered to an existing
enormous thread.

11 years agonotmuch.el: Make next-message move to end of buffer after last message.
Carl Worth [Wed, 4 Nov 2009 19:03:07 +0000 (11:03 -0800)]
notmuch.el: Make next-message move to end of buffer after last message.

We need an easier way to detect when we're done with the last message
so taking advantage of the end-of-buffer position helps here.

11 years agonotmuch.el: Leave a blank line after last thread in search.
Carl Worth [Wed, 4 Nov 2009 18:43:07 +0000 (10:43 -0800)]
notmuch.el: Leave a blank line after last thread in search.

This allows for pleasant termination of the "show next thread" magic
in notmuch-show mode. Now, it will terminate and show the
notmuch-search results rather than continually displaying the last
thread over and over.

11 years agonotmuch.el: Move "show next thread" from magic-space-bar to archive-thread
Carl Worth [Wed, 4 Nov 2009 18:32:44 +0000 (10:32 -0800)]
notmuch.el: Move "show next thread" from magic-space-bar to archive-thread

If I explicitly hit the 'a' key before reading the whole thread, I
still want to advance to the next thread in my search.

11 years agonotmuch.el: More magic for magic space bar: Show next thread from search.
Carl Worth [Wed, 4 Nov 2009 18:25:04 +0000 (10:25 -0800)]
notmuch.el: More magic for magic space bar: Show next thread from search.

This is implemented by stashing away the parent notmuch-search buffer
into a variable within the notmuch-show buffer. Then, when magic space
bar triggers an archive of the current thread, it switches to the parent
search buffer and shows the next thread.

11 years agonotmuch.el: notmuch-search: Advance to next line before showing thread.
Carl Worth [Wed, 4 Nov 2009 17:32:47 +0000 (09:32 -0800)]
notmuch.el: notmuch-search: Advance to next line before showing thread.

The idea here is that after viewing the thread, when we come back to
this buffer we'll be all ready to view the next thread.

11 years agonotmuch.el: Make archive-thread more efficient for already archived messages.
Carl Worth [Wed, 4 Nov 2009 17:26:50 +0000 (09:26 -0800)]
notmuch.el: Make archive-thread more efficient for already archived messages.

The approach here is to move the optimization from mark-read to the
more general remove-tag. Namely, don't call out to a "notmuch tag"
command to remove a tag that's not there already.

11 years agonotmuch.el: Make the magic spacebar archive a thread in the end.
Carl Worth [Wed, 4 Nov 2009 17:21:09 +0000 (09:21 -0800)]
notmuch.el: Make the magic spacebar archive a thread in the end.

Next all it needs to do is kill the buffer and show the next thread.

11 years agonotmuch.el: Start implementing the magic space bar.
Carl Worth [Wed, 4 Nov 2009 16:42:38 +0000 (08:42 -0800)]
notmuch.el: Start implementing the magic space bar.

Currently this will either advance by screenfuls, or to the next
message if it's already within a screenful, and will mark each message
read as it is left.

It doesn't yet complete the magic by archiving the messages nor by
advancing to the next thread in the search.

11 years agonotmuch.el: Fix to hide citations in body of read messages.
Carl Worth [Wed, 4 Nov 2009 16:38:49 +0000 (08:38 -0800)]
notmuch.el: Fix to hide citations in body of read messages.

Previously, unhinding a read message would still show all the citations
in that message without an explicit command to make them visible. Fix.

11 years agonotmuch.el: Redefine behavior of notmuch-show-previous-message
Carl Worth [Wed, 4 Nov 2009 16:48:57 +0000 (08:48 -0800)]
notmuch.el: Redefine behavior of notmuch-show-previous-message

Now, if the user has manually moved point to somewhere within a
message, executing the previous-message command onece will rewind
point only to the beginning of the current message. Previously this
would go back to the previous message, (which the user can now do
easily and naturally by simply executing the command one more time).

11 years agonotmuch.el: Fix notmuch-snow-next-message when on the last message.
Carl Worth [Wed, 4 Nov 2009 03:32:56 +0000 (19:32 -0800)]
notmuch.el: Fix notmuch-snow-next-message when on the last message.

Before this just brought the current line to the top of the
window. Now it actually moves to the beginning of the current message.

This is built on a much more solid foundation now with a function to
move to the summary-line of the current message, and then moving from
there.

11 years agonotmuch.el: Add more complete documentation to the major modes.
Carl Worth [Wed, 4 Nov 2009 02:24:13 +0000 (18:24 -0800)]
notmuch.el: Add more complete documentation to the major modes.

These now provide a summary of the most useful features/bindings
as well as a complete printout of the relevant mode maps to show
all available keybindings.

11 years agonotmuch.el: Make archive-thread advance to next line.
Carl Worth [Wed, 4 Nov 2009 01:18:04 +0000 (17:18 -0800)]
notmuch.el: Make archive-thread advance to next line.

This is the command in notmuch-search mode and it's cer convenient
for it to advance to the next line there. (It would be even more
convenient if it didn't also take forever, but as mentioned before
that's an issue we'll need to fix in Xapian.)

11 years agonotmuch.el: Add 't' binding to filter results to a specific tag.
Carl Worth [Wed, 4 Nov 2009 01:01:07 +0000 (17:01 -0800)]
notmuch.el: Add 't' binding to filter results to a specific tag.

This is a convenience function to avoid having to type "tag:" with
the (f)ilter command.

11 years agonotmuch.el: Add bindings for scrolling to notmuch-search mode.
Carl Worth [Wed, 4 Nov 2009 00:55:20 +0000 (16:55 -0800)]
notmuch.el: Add bindings for scrolling to notmuch-search mode.

We turn on the scroll-preserve-screen-position option which seems
like what's desired here, (though that's not what I normally use
when editing files---but I think scrolling through a list of email
threads is different).

11 years agoDrop inapplicable copyright statements.
Carl Worth [Wed, 4 Nov 2009 00:47:34 +0000 (16:47 -0800)]
Drop inapplicable copyright statements.

I had put these in here since I had originally planned to copy
liberally from the body of the implementation of 'compile in order
to get process output into a buffer. But once I found call-process
in the documentation of emacs, that was all I needed.

And all the code I've written since has been entirely my own with
just the help of emacs documentation.

11 years agonotmuch-el: Fix implementation of show/hide-thread-ids.
Carl Worth [Wed, 4 Nov 2009 00:46:27 +0000 (16:46 -0800)]
notmuch-el: Fix implementation of show/hide-thread-ids.

I'm definitely more comfortable with the add-to-invisibility-spec
now than I was when I first wrote these functions, (which weren't
working at all).

11 years agonotmuch.el: Add command to (a)rchive a thread from notmuch-show mode.
Carl Worth [Tue, 3 Nov 2009 21:34:05 +0000 (13:34 -0800)]
notmuch.el: Add command to (a)rchive a thread from notmuch-show mode.

This is our first race-free implementation of archive-thread! It
acts only on the messages explcitly contained in the buffer, not
on an entire thread ID, so it's safe in the face of new messages
have been delivered for this thread since the view was made.

11 years agonotmuch.el: Don't try to remove an "unread" tag that's not there.
Carl Worth [Tue, 3 Nov 2009 21:16:40 +0000 (13:16 -0800)]
notmuch.el: Don't try to remove an "unread" tag that's not there.

This optimization wouldn't be necessary if we had a nice fast "notmuch
tag" command. But since it's currently fairly slow, (see Xapian defect
250: http://trac.xapian.org/ticket/250), we're willing to take some
extra care to avoid calling "notmuch tag" unnecessarily.

11 years agonotmuch show: Remove custom "unread" hack, (printing tag in two locations).
Carl Worth [Tue, 3 Nov 2009 21:13:50 +0000 (13:13 -0800)]
notmuch show: Remove custom "unread" hack, (printing tag in two locations).

I previously had a hack that special-cased the "unread" tag and
printed it on the same line as the message ID. But now that we are
printing all tags at the end of the one-line summary we don't need
this anymore. Get rid of it, and just read "unread" from the list of
tags just like any other tag.

11 years agonotmuch.el: Add + and - bindings to add/remove tags from messages.
Carl Worth [Tue, 3 Nov 2009 20:54:10 +0000 (12:54 -0800)]
notmuch.el: Add + and - bindings to add/remove tags from messages.

This is in notmuch-show mode rather than in notmuch-search mode,
(where we had + and - working already). This gives the same visual
feedback as in notmuch-search-mode, (the tags are manipulated first in
the database and then the list of tags in the buffer is updated).

11 years agonotmuch show: Print tags for each message.
Carl Worth [Tue, 3 Nov 2009 20:29:07 +0000 (12:29 -0800)]
notmuch show: Print tags for each message.

This is in the one-line summary so should always be visible even
in our emacs client that's so eager to make things invisible.

11 years agonotmuch.el: Preserve current thread when refreshing search results.
Carl Worth [Tue, 3 Nov 2009 19:54:34 +0000 (11:54 -0800)]
notmuch.el: Preserve current thread when refreshing search results.

Otherwise, try to keep point in the same place, (such as when the
current thread has been archived away).

11 years agonotmuch.el: Add an '=' key to refresh the current view.
Carl Worth [Tue, 3 Nov 2009 19:47:48 +0000 (11:47 -0800)]
notmuch.el: Add an '=' key to refresh the current view.

This will allow for updates when a separate process (say, a notmuch-
show buffer), has archived messages.

11 years agonotmuch.el: Mark messages read when the (n)ext keybinding is pressed
Carl Worth [Tue, 3 Nov 2009 19:42:04 +0000 (11:42 -0800)]
notmuch.el: Mark messages read when the (n)ext keybinding is pressed

Of course, technically, we're removing the "unread" tag, but you
get the idea. :-)

11 years agonotmuch.el: Hide citations and signatures.
Carl Worth [Tue, 3 Nov 2009 19:14:52 +0000 (11:14 -0800)]
notmuch.el: Hide citations and signatures.

The user can make these visible again by pressing 'c' or 's',
(though we'd like to move to direct manipulation instead soon).

11 years agoHide bodies of message that have already been read.
Carl Worth [Tue, 3 Nov 2009 18:32:42 +0000 (10:32 -0800)]
Hide bodies of message that have already been read.

Also hide all markers.

From here, all we really need for legibility is the following:

  * Hide away citations and signatures

  * Call out the one-line summary some way, (larger font size?)

  * Add nesting for replies

11 years agonotmuch.el: Hide email headers by default.
Carl Worth [Tue, 3 Nov 2009 06:24:35 +0000 (22:24 -0800)]
notmuch.el: Hide email headers by default.

The display of the header can be toggled with the 'h' key.

11 years agonotmuch show: Switch to control character to mark sections of output
Carl Worth [Tue, 3 Nov 2009 05:13:19 +0000 (21:13 -0800)]
notmuch show: Switch to control character to mark sections of output

We were previously using things like "%message{" which were not
guaranteed to never appear in an email message. Using a control
character (^L or '\f' instead of '%') gives us better assurance that
our delimiter doesn't show up in an original email message.

This still isn't entirely safe since we're decoding encoded text in
the body of the email message so almost all bets are off really.

11 years agonotmuch.el: Make 'n' and 'p' bring the current message to the top.
Carl Worth [Tue, 3 Nov 2009 04:47:11 +0000 (20:47 -0800)]
notmuch.el: Make 'n' and 'p' bring the current message to the top.

This is much more convenient for reading the messages, and happens
to match the behavior of sup.

11 years agonotmuch.el: Add (n)ext and (p)revious bindings to notmuch-show mode.
Carl Worth [Tue, 3 Nov 2009 02:45:17 +0000 (18:45 -0800)]
notmuch.el: Add (n)ext and (p)revious bindings to notmuch-show mode.

Almost starting to get usable now. Still need to make it mark messages
as they are read, (by removing the unread tag), and selectively hiding
the full header.

11 years agoTODO: Add an idea from talking with keithp on the train.
Carl Worth [Tue, 3 Nov 2009 02:44:34 +0000 (18:44 -0800)]
TODO: Add an idea from talking with keithp on the train.

I mentioned the read-only directory optimization to Keith, and he
liked it but wanted to be able to configure it to be fully automated.

11 years agonotmuch.el: Add '<' and '>' bindings to goto first/last thread.
Carl Worth [Tue, 3 Nov 2009 02:23:06 +0000 (18:23 -0800)]
notmuch.el: Add '<' and '>' bindings to goto first/last thread.

Also, take care to remove a final blank line to avoid the point
going beyond the last thread in the buffer.

11 years agoTODO: Organize tasks based on emacs interface, command-line tool, or library.
Carl Worth [Tue, 3 Nov 2009 02:02:38 +0000 (18:02 -0800)]
TODO: Organize tasks based on emacs interface, command-line tool, or library.

There are conceptually three different projects here, so it helps
to keep the tasks for each separated.

11 years agonotmuch.el: Add commands to (s)earch globally, and (f)ilter a search
Carl Worth [Tue, 3 Nov 2009 01:56:18 +0000 (17:56 -0800)]
notmuch.el: Add commands to (s)earch globally, and (f)ilter a search

Also add 'q' and 'x' keybindings to kill the current buffer.

11 years agoTweak relative dates to be close to the same length.
Carl Worth [Tue, 3 Nov 2009 00:18:28 +0000 (16:18 -0800)]
Tweak relative dates to be close to the same length.

Most all of the returned strings will now fill most of a 12-character
string, (depending on the length of the month).

11 years agoRemove notmuch_message_get_header_size and notmuch_message_get_all_headers
Carl Worth [Tue, 3 Nov 2009 00:08:24 +0000 (16:08 -0800)]
Remove notmuch_message_get_header_size and notmuch_message_get_all_headers

The notmuch.c main program now uses GMime directly rather than using
these functions, and I'd rather not export any functions unless we
have good evidence that the functions are necessary.

11 years agonotmuch.el: Hide thread IDs in notmuch-search mode.
Carl Worth [Tue, 3 Nov 2009 00:02:32 +0000 (16:02 -0800)]
notmuch.el: Hide thread IDs in notmuch-search mode.

One more baby step toward something that's pleasant to use.

11 years agonotmuch.el: Implement visual feedback for add/remove tags.
Carl Worth [Mon, 2 Nov 2009 23:48:21 +0000 (15:48 -0800)]
notmuch.el: Implement visual feedback for add/remove tags.

There's no undo still, but at least you can see what you are doing
now.

11 years agoDrop date.c file, (use identical function from GMime instead).
Carl Worth [Mon, 2 Nov 2009 22:36:33 +0000 (14:36 -0800)]
Drop date.c file, (use identical function from GMime instead).

We had originally copied this function in at a time when notmuch
wasn't actually depending on the GMime library. Now that it does,
we might as well call the function that exists there rather
than having a private copy of it.

11 years agonotmuch show: Don't print non-text MIME parts.
Carl Worth [Mon, 2 Nov 2009 22:33:15 +0000 (14:33 -0800)]
notmuch show: Don't print non-text MIME parts.

Additionally, print a part number for each MIME part so that the
client could (conceivably) ask for the contents of a specific
part by part number.

11 years agoFix to decode header values, (primarily subject).
Carl Worth [Mon, 2 Nov 2009 22:32:20 +0000 (14:32 -0800)]
Fix to decode header values, (primarily subject).

Use GMime function to decode message-header values according to
RFC 2047.

11 years agoPrint "part" markers for each MIME part (with Content-type).
Carl Worth [Mon, 2 Nov 2009 21:27:34 +0000 (13:27 -0800)]
Print "part" markers for each MIME part (with Content-type).

This can allow for the client to hide undesired MIME parts
such as text/html.

11 years agonotmuch show: Use GMime to decode messages.
Carl Worth [Mon, 2 Nov 2009 21:19:39 +0000 (13:19 -0800)]
notmuch show: Use GMime to decode messages.

We now actually get text content rather than blocks of BASE64, etc.

11 years agoTODO: Add several items.
Carl Worth [Mon, 2 Nov 2009 21:18:58 +0000 (13:18 -0800)]
TODO: Add several items.

These are the things that are actively preventing me from being able
to use notmuch as an email-reading client.

11 years agoAdd an INSTALL file.
Carl Worth [Mon, 2 Nov 2009 17:25:04 +0000 (09:25 -0800)]
Add an INSTALL file.

The README file was already referring to this, so we actually add it
now.

11 years agoAdd a simple configure script.
Carl Worth [Mon, 2 Nov 2009 17:11:37 +0000 (09:11 -0800)]
Add a simple configure script.

This is *not* based on autoconf. In fact, this doesn't actually
configure anything, (one can compile notmuch directly with just
"make" without running configure if the dependencies are all
satisfied).

The only thing that this configure script does is to check for the
presence of the various dependencies and provide some guidance to
the user if they are not all available.

11 years agoMakefile: Rewrite to use NOTMUCH rather than MY in variable names.
Carl Worth [Mon, 2 Nov 2009 15:15:54 +0000 (07:15 -0800)]
Makefile: Rewrite to use NOTMUCH rather than MY in variable names.

I was about to refer to these names in some documentation, so I
wanted a slightly better name for them.

11 years agoREADME: Add a simple file explaining notmuch and pointing out resources.
Carl Worth [Mon, 2 Nov 2009 14:30:18 +0000 (06:30 -0800)]
README: Add a simple file explaining notmuch and pointing out resources.

This is part of getting notmuch ready for a more public announcement.

11 years agoAdd a simple manual page for notmuch.
Carl Worth [Mon, 2 Nov 2009 14:13:16 +0000 (06:13 -0800)]
Add a simple manual page for notmuch.

By pulling content out of notmuch help, and also the messages
printed by "notmuch setup".

11 years agonotmuch: Add a talloc context argument to each top-level command function.
Carl Worth [Sat, 31 Oct 2009 23:40:47 +0000 (16:40 -0700)]
notmuch: Add a talloc context argument to each top-level command function.

I had noticed several times earlier that having a talloc context
passed in would make things more convenient. I'm not exercising
that convenience yet, but the context is there now, (and there's
one fewer item on our TODO list).

11 years agoRename message_results/thread_results to messages/threads.
Carl Worth [Sat, 31 Oct 2009 23:32:30 +0000 (16:32 -0700)]
Rename message_results/thread_results to messages/threads.

Shorter naming without being any less clear. A definite win.

11 years agonotmuch.el: Add commands to add tag, remove tag, and archive (== remove inbox tag)
Carl Worth [Sat, 31 Oct 2009 19:09:06 +0000 (12:09 -0700)]
notmuch.el: Add commands to add tag, remove tag, and archive (== remove inbox tag)

These have keybindings of '+', '-', and 'a'. The bug they have so
far is lack of visual feedback for their effect, and lack of undo.

(Also the fact that adding or removing a single tag for a thread
takes way too long--but that's as a Xapian issue as discussed here:

replace_document should make minimal changes to database file
http://trac.xapian.org/ticket/250
)

11 years agonotmuch: Reference help, don't print it for unknown commands.
Carl Worth [Sat, 31 Oct 2009 19:08:00 +0000 (12:08 -0700)]
notmuch: Reference help, don't print it for unknown commands.

The shorter output is much nicer for something that might end up
in an emacs mini-buffer, for example.

11 years agonotmuch.el: Add final '*' to generated buffer names.
Carl Worth [Sat, 31 Oct 2009 08:55:12 +0000 (01:55 -0700)]
notmuch.el: Add final '*' to generated buffer names.

Just looks a little neater that way.

11 years agonotmuch.el: Enter now calls "notmuch show" on the current thread
Carl Worth [Sat, 31 Oct 2009 08:41:44 +0000 (01:41 -0700)]
notmuch.el: Enter now calls "notmuch show" on the current thread

It's remarkable how little code we need for a very functional GUI
here. I think we're doing something right.

11 years agonotmuch.el: Start fleshing out notmuch-search-mode with a custom keymap
Carl Worth [Sat, 31 Oct 2009 08:04:01 +0000 (01:04 -0700)]
notmuch.el: Start fleshing out notmuch-search-mode with a custom keymap

All we have here so far is 'n' and 'p' for going to next and
previous lines respectively.

11 years agonotmuch.el: Switch from start-process to call-process
Carl Worth [Sat, 31 Oct 2009 07:44:39 +0000 (00:44 -0700)]
notmuch.el: Switch from start-process to call-process

We now get the point staying right at the top where we want it.
We also don't get any extraneous noise about "Process notmuch
completed" or anything like that. Just the output in a read-only
buffer.

11 years agonotmuch.el: Switch from compilation-start to start-process
Carl Worth [Sat, 31 Oct 2009 06:42:39 +0000 (23:42 -0700)]
notmuch.el: Switch from compilation-start to start-process

Compilation mode does a bunch of things that we don't want. Instead
of trying to tear it down to what we want, let's start at the other
end and build up only things that we really want.

11 years agonotmuch.el: Add notmuch-search command as well as notmuch
Carl Worth [Sat, 31 Oct 2009 00:18:19 +0000 (17:18 -0700)]
notmuch.el: Add notmuch-search command as well as notmuch

This allows for entering a query string interactively.

11 years agonotmuch.el: Copy copyright information from compilation.el
Carl Worth [Sat, 31 Oct 2009 00:17:16 +0000 (17:17 -0700)]
notmuch.el: Copy copyright information from compilation.el

I'm using that file as my reference here, so I'm likely to end up
copying some code here or there. Might as well be safe and just
copy the copyright statement.

11 years agonotmuch.el: Rename from notmuch-mode.el to notmuch.el
Carl Worth [Fri, 30 Oct 2009 22:17:27 +0000 (15:17 -0700)]
notmuch.el: Rename from notmuch-mode.el to notmuch.el

Also add the copyright and licensing blurb.

11 years agonotmuch-mode: Add an actualy notmuch-search-mode as well
Carl Worth [Fri, 30 Oct 2009 22:12:49 +0000 (15:12 -0700)]
notmuch-mode: Add an actualy notmuch-search-mode as well

Doesn't really do anything so far other than mark the buffer read-
only. This does have the benefit of giving us our own name rather
than "Compilation" for the mode.

11 years agoThe very beginnings of an emacs mode for notmuch in notmuch-mode.el.
Carl Worth [Fri, 30 Oct 2009 22:05:53 +0000 (15:05 -0700)]
The very beginnings of an emacs mode for notmuch in notmuch-mode.el.

As expected, there's not much done here yet---it simply displays the
output of "notmuch search" in a new window.

11 years agoTODO: Add man page and compiling a libnotmuch library to the list.
Carl Worth [Fri, 30 Oct 2009 19:02:11 +0000 (12:02 -0700)]
TODO: Add man page and compiling a libnotmuch library to the list.

These are things we'll want done before any big announcement.

11 years agoMakefile: Add a simple target for "make install".
Carl Worth [Fri, 30 Oct 2009 19:00:55 +0000 (12:00 -0700)]
Makefile: Add a simple target for "make install".

The more I do here, the less I see the need for autotools.

11 years agoTODO: Note that "notmuch show" exists now and list several new ideas.
Carl Worth [Fri, 30 Oct 2009 18:57:43 +0000 (11:57 -0700)]
TODO: Note that "notmuch show" exists now and list several new ideas.

The timestamp stuff we'll want to do soon, since it's a database
change, (though not a major one---at worst a handful of stale
timestamp documents would be left in the database).

11 years agoFix relative date formatting to not split one day into two formats.
Carl Worth [Fri, 30 Oct 2009 00:42:21 +0000 (17:42 -0700)]
Fix relative date formatting to not split one day into two formats.

We were aware of this bug when we wrote the function, (that a date
six days in the past would be treated as the "Friday" or as the
"Oct. 23" case depending on whether its time was before or after
the current time today). We thought it wouldn't be a problem, but
in practice it is. In scanning search results with this output,
the transition between formats makes it look like a day boundary,
(so it would be easy to mistakenly think "Oct. 23" is Thursday).

Fix this to avoid confusion, (still being careful to never print
"Thursday" for a date 7 days in the past when today is Thursday).

11 years agonotmuch search: Add (relative) date to search output
Carl Worth [Fri, 30 Oct 2009 00:31:07 +0000 (17:31 -0700)]
notmuch search: Add (relative) date to search output

The new function for formatting relative dates is nice enough that
we need to start using it more places. Here's one of them.

11 years agonotmuch show: Add a one-line summary of the message before the header.
Carl Worth [Thu, 29 Oct 2009 23:06:27 +0000 (16:06 -0700)]
notmuch show: Add a one-line summary of the message before the header.

The idea here is that a client could usefully display just this one
line while optionally hiding the other header fields.

11 years agonotmuch show: Trim down header list.
Carl Worth [Thu, 29 Oct 2009 21:07:45 +0000 (14:07 -0700)]
notmuch show: Trim down header list.

This is for now a non-configurable list of Subject, From, To, Cc,
Bcc, and Date.

11 years agonotmuch show: Add body of message as well.
Carl Worth [Thu, 29 Oct 2009 16:06:53 +0000 (09:06 -0700)]
notmuch show: Add body of message as well.

This is just the raw message body for now, (so any MIME parsing will
be up to the consumer). And this will likely change in the future.

11 years agonotmuch show: Initial implementation (headers only)
Carl Worth [Thu, 29 Oct 2009 15:51:12 +0000 (08:51 -0700)]
notmuch show: Initial implementation (headers only)

We're using a delimiter syntax that Keith is optimistic about
being able to easily parse in emacs. Note: We're not escaping
any occurrence of the delimiters in the message yet, so we'll
need to fix that.

11 years agoTODO: Update now that full-text indexing is in.
Carl Worth [Wed, 28 Oct 2009 23:52:45 +0000 (16:52 -0700)]
TODO: Update now that full-text indexing is in.

The optimization idea removed here doesn't make sense anymore with
full-text indexing happening up front.

11 years agoFix add_message and get_filename to strip/re-add the database path.
Carl Worth [Wed, 28 Oct 2009 23:50:14 +0000 (16:50 -0700)]
Fix add_message and get_filename to strip/re-add the database path.

We now store only a relative path inside the database so the database
is not nicely relocatable.

11 years agonotmuch setup/new: Print progress once per second instead of after 1000 files.
Carl Worth [Wed, 28 Oct 2009 23:09:19 +0000 (16:09 -0700)]
notmuch setup/new: Print progress once per second instead of after 1000 files.

With the recent addition of full-text indexing, printing only once per
1000 files just isn't often enough. The new timer-based approach will
be reliable regardless of the speed of adding message.

11 years agoindex: Don't bother indexing quoted portions of messages (and signatures).
Carl Worth [Wed, 28 Oct 2009 22:41:42 +0000 (15:41 -0700)]
index: Don't bother indexing quoted portions of messages (and signatures).

Our old notmuch-index-message.cc code had this, but I originally
left it out when adding indexing back in. I was concerned primarily
with mistakenly detecting signature markers and omitting important
text, (for example, I often do long lines of "----" as section
separators).

But now I  see that there's a performance benefit to skippint the
quotations, (about 120 files/sec. instead of 95 files/sec.). I mitigated
the bogus signature checking by recognizing nothing other than the
all-time classic "-- ".

11 years agonotmuch_database_add_message: Sanity check the file as the first thing
Carl Worth [Wed, 28 Oct 2009 20:35:10 +0000 (13:35 -0700)]
notmuch_database_add_message: Sanity check the file as the first thing

This avoids us wasting a bunch of time doing an expensive SHA-1 over a large
file only to discover later that it doesn't even *look* like an email message.

11 years agoTweak formatting of internal error messages.
Carl Worth [Wed, 28 Oct 2009 19:46:50 +0000 (12:46 -0700)]
Tweak formatting of internal error messages.

Was neglecting to print the phrase "Internal error: " before, and for
the duplicate message-ID error it's nice to actually see the duplicate
IDs.

11 years agoindex: Store "Full Name <user@example.com>" addressses in the database
Carl Worth [Wed, 28 Oct 2009 20:09:08 +0000 (13:09 -0700)]
index: Store "Full Name <user@example.com>" addressses in the database

We put these is as a separate term so that they can be extracted.
We don't actually need this for searching, since typing an email
address in as a search term will already trigger a phrase search
that does exactly what's wanted.

11 years agoAdd full-text indexing using the GMime library for parsing.
Carl Worth [Wed, 28 Oct 2009 17:42:07 +0000 (10:42 -0700)]
Add full-text indexing using the GMime library for parsing.

This is based on the old notmuch-index-message.cc from early in
the history of notmuch, but considerably cleaned up now that
we have some experience with Xapian and know just what we want
to index, (rather than just blindly trying to index exactly
what sup does).

This does slow down notmuch_database_add_message a *lot*, but I've
got some ideas for getting some time back.

11 years agonotmuch search: Clarify documentation of implicit Boolean operators
Carl Worth [Wed, 28 Oct 2009 17:35:26 +0000 (10:35 -0700)]
notmuch search: Clarify documentation of implicit Boolean operators

The original documentation of implicit AND is what we want, but
Xapian doesn't actually let us get that today. So be honest about
what the user can actually expect. And let's hope the Xapian
wizards give us the feature we want soon:

http://trac.xapian.org/ticket/402

11 years agoTODO: A couple new items.
Carl Worth [Wed, 28 Oct 2009 14:28:01 +0000 (07:28 -0700)]
TODO: A couple new items.

It's time to put full-text indexing back, and we might want to
experiment with optimization the original thread-stitching phase.

11 years agoTODO: Remove a couple of since-completed items.
Carl Worth [Wed, 28 Oct 2009 08:46:24 +0000 (01:46 -0700)]
TODO: Remove a couple of since-completed items.

"notmuch tag" is implemented now and seems to work great (and fast).

As for the race condition, as noted in the description we're removing
it's not exposed directly in the API, but only in a client that
allows for looping over search results and removing the inbox tag
from all of them. But then, that's exactly what the "notmuch tag"
command does. So, as discussed, we've now documented that command
to highlight the issue. Problem resolved, (as well as we can).

11 years agonotmuch help: Review and augment all of the "notmuch help" documentation.
Carl Worth [Wed, 28 Oct 2009 08:37:57 +0000 (01:37 -0700)]
notmuch help: Review and augment all of the "notmuch help" documentation.

The big addition here is the first description of the syntax for
the query strings for "notmuch search", (and, by reference, for
"notmuch tag").

11 years agonotmuch help: Be less verbose by default and support detailed help
Carl Worth [Wed, 28 Oct 2009 07:58:26 +0000 (00:58 -0700)]
notmuch help: Be less verbose by default and support detailed help

Putting all of our documentation into a single help message was getting
a bit unwieldy. Now, the simple output of "notmuch help" is a reasonable
reminder and a quick reference. Then we now support a new syntax of:
"notmuch help <command>" for the more detailed help messages.

This gives us freedom to put more detailed caveats, etc. into some
sub-commands without worrying about the usage statement getting too
long.

11 years agonotmuch tag: Fix crash when removing a tag that didn't exist
Carl Worth [Wed, 28 Oct 2009 06:59:06 +0000 (23:59 -0700)]
notmuch tag: Fix crash when removing a tag that didn't exist

Xapian is trying to be useful by reporting that the specified term
didn't exist, but this is one case where we just don't care. :-)

11 years agoFix segfault in case of the database lock not being available.
Carl Worth [Wed, 28 Oct 2009 06:57:37 +0000 (23:57 -0700)]
Fix segfault in case of the database lock not being available.

We were nicely reporting the lock-aquisition failure, but then marching
along trying to use the database object and just crashing badly.
So don't do that.

11 years agoUpdate prefix so that "thread:" can be used in search strings.
Carl Worth [Wed, 28 Oct 2009 06:55:08 +0000 (23:55 -0700)]
Update prefix so that "thread:" can be used in search strings.

It's convenient to be able to do things like:

     notmuch tag -inbox thread:<thread-id>

(even though this can run into a race condition as noted in TODO--the fix
for the race is simply to not run "notmuch new" between reading a thread
with the (not yet existent) "notmuch show" and removing its inbox tag
with a command like the above). So we now allow such a thing.

11 years agoAdd new "notmuch tag" command for adding/removing tags.
Carl Worth [Wed, 28 Oct 2009 00:07:14 +0000 (17:07 -0700)]
Add new "notmuch tag" command for adding/removing tags.

This uses the same search functionality as "notmuch search" so
it should be quite powerful. And this global search might be
quick enough to be used for "automatic" adding of tags to new
messages.

Of course, this will all be a lot more useful when we can search
for actual text of messages and not just tags.

11 years agonotmuch_database_add_message: Do not return a message on failure.
Carl Worth [Tue, 27 Oct 2009 23:19:20 +0000 (16:19 -0700)]
notmuch_database_add_message: Do not return a message on failure.

The recent, disastrous failure of "notmuch new" would have been
avoided with this change. The new_command function was basically
assuming that it would only get a message object on success so
wasn't destroying the message in the other cases.

11 years agonotmuch_database_close: Explicitly flush the Xapian database.
Carl Worth [Tue, 27 Oct 2009 23:17:22 +0000 (16:17 -0700)]
notmuch_database_close: Explicitly flush the Xapian database.

This would have helped with the recent bug causing "notmuch new"
to not record any results in the database. I'm not sure why
the explicit flush would be required, (shouldn't the destructor
always ensure that things flush?), but perhaps some outstanding
references from the leak prevented that.

In any case, an explicit flush on close() seems to make sense.

11 years agoMerge branch to fix broken "notmuch setup" and "notmuch new"
Carl Worth [Tue, 27 Oct 2009 23:12:04 +0000 (16:12 -0700)]
Merge branch to fix broken "notmuch setup" and "notmuch new"

I'm trying to stick to a habit of fixing previously-introduced bugs
on side branches off of the commit that introduced the bug. The
idea here is to make it easy to find the commits to cherry pick
if bisecting in the future lands on one of the broken commits.

11 years agoFix "notmuch new" (bad performance, and no committing of results).
Carl Worth [Tue, 27 Oct 2009 23:07:27 +0000 (16:07 -0700)]
Fix "notmuch new" (bad performance, and no committing of results).

We were incorrectly only destroying messages in the case of
successful addition to the database, and not in other cases,
(such as failure due to FILE_NOT_EMAIL).

I'm still not entirely sure why this was performing abysmally, (as in
making an operation that should take a small fraction of a second take
10 seconds), nor why it was causing the database to entirely fail to
get new results.

But fortunately, this all seems to work now.

11 years agoUnbreak the "notmuch setup" command.
Carl Worth [Tue, 27 Oct 2009 19:00:58 +0000 (12:00 -0700)]
Unbreak the "notmuch setup" command.

The recent addition of support for automatically adding tags to
new messages for "notmuch new" caused "notmuch setup" to segfault.
The fix is simple, (just need to move a destroy function to inside
a nearby if block).

Did I mention recently we need to add a test suite?

11 years agoTODO: Several more ideas that have come to mind, that I don't want to forget.
Carl Worth [Tue, 27 Oct 2009 18:35:30 +0000 (11:35 -0700)]
TODO: Several more ideas that have come to mind, that I don't want to forget.

Some of these are simple little code cleanups, but it's nice to write them
down rather than trying to remember them.

11 years agoTODO: More notes on archive-thread and race conditions.
Carl Worth [Tue, 27 Oct 2009 17:19:46 +0000 (10:19 -0700)]
TODO: More notes on archive-thread and race conditions.

Interstingly, it's our simple "notmuch" client that's going to be the
most difficult to fix. There's just not as much information preserved
in the textual representation from "notmuch search" as there is in the
objects returned from notmuch_query_search_threads.

11 years agoTODO: Add "notmuch tag" and thoughts on avoiding races in archiving threads.
Carl Worth [Tue, 27 Oct 2009 17:04:48 +0000 (10:04 -0700)]
TODO: Add "notmuch tag" and thoughts on avoiding races in archiving threads.

The archive-thread race condition doesn't even exist now because there's
no command for modifying tags at the level of a thread (just individual
messages).