notmuch.git
15 years agoNew function notmuch-search-operate-all: operate on all messages in the current query.
Jed Brown [Thu, 26 Nov 2009 21:36:49 +0000 (22:36 +0100)]
New function notmuch-search-operate-all: operate on all messages in the current query.

It is often convenient to change tags on several messages at once.  This
function applies any number of tag whitespace-delimited tag
modifications to all messages matching the current query.

I have bound this to `*'.

Signed-off-by: Jed Brown <jed@59A2.org>
15 years agoReturn unpropertized strings for filename and message-id
Tassilo Horn [Mon, 23 Nov 2009 16:57:31 +0000 (17:57 +0100)]
Return unpropertized strings for filename and message-id

15 years agonotmuch.el: Use variable notmuch-search-oldest-first to decide the search order
Aneesh Kumar K.V [Mon, 23 Nov 2009 14:50:59 +0000 (20:20 +0530)]
notmuch.el: Use variable notmuch-search-oldest-first to decide the search order

Make sure we use notmuch-search-oldest-first to decide the how
the search result should be displayed. This helps to set the
value to nil and have latest mail shown first

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
15 years agoTODO: A read-only file in the mail store should be a warning, not an error.
Carl Worth [Thu, 26 Nov 2009 21:07:20 +0000 (13:07 -0800)]
TODO: A read-only file in the mail store should be a warning, not an error.

It's a bug that processing currently stops when it hits a read-only
file. This is yet another case we'll want our test suite to cover.

15 years agonotmuch.el: When removing tags, offer only those a msg/thread has set.
Jan Janak [Wed, 25 Nov 2009 04:05:39 +0000 (05:05 +0100)]
notmuch.el: When removing tags, offer only those a msg/thread has set.

When removing a tag from a message or thread, build a completion buffer
which contains only tags that the message or thread has really set.

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agosearch-tags: Add support for search-terms.
Jan Janak [Wed, 25 Nov 2009 03:30:22 +0000 (04:30 +0100)]
search-tags: Add support for search-terms.

This patch adds support for search-terms to 'notmuch search-tags'. If
no search-term is provided then the command returns a list of all tags
from the database.

If the user provides one or more search-terms as arguments then the
command collects tags from matching messages only.

This could be used by functions in the Emacs mode to further limit the
list of tags offered for completion. For example, functions that remove
tags from message(s) could offer only tags present in the message(s).

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agolib: New function to collect tags from a list of messages.
Jan Janak [Wed, 25 Nov 2009 03:30:21 +0000 (04:30 +0100)]
lib: New function to collect tags from a list of messages.

This patch adds a new function that can be used to collect a list of
unique tags from a list of messages. 'notmuch search-tags' uses the
function to get a list of tags from messages matching a search-term,
but it has the potential to be used elsewhere so we put it in the lib.

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agonotmuch.el: Select tag names with completion.
Jan Janak [Mon, 23 Nov 2009 00:10:56 +0000 (01:10 +0100)]
notmuch.el: Select tag names with completion.

Several commands ask the user for a tag name. With this feature the
user can just press tab and Emacs automatically retrieves the list of
all existing tags from notmuch database with 'notmuch search-tags' and
presents a completion buffer to the user.

This feature is very useful for users who have a large number of tags
because it saves typing and minimizes the risk of typos.

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agonotmuch: New command 'search-tags'.
Jan Janak [Mon, 23 Nov 2009 00:10:55 +0000 (01:10 +0100)]
notmuch: New command 'search-tags'.

This is a new notmuch command that can be used to search for all tags
found in the database. The resulting list is alphabetically sorted.

The primary use-case for this new command is to provide the tag
completion feature in Emacs (and other interfaces).

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agonotmuch: New function to retrieve all tags from the database.
Jan Janak [Mon, 23 Nov 2009 00:10:54 +0000 (01:10 +0100)]
notmuch: New function to retrieve all tags from the database.

This patch adds a new function called notmuch_database_get_all_tags
which can be used to obtain a list of all tags from the database
(in other words, the list contains all tags from all messages). The
function produces an alphabetically sorted list.

To add support for the new function, we rip the guts off of
notmuch_message_get_tags and put them in a new generic function
called _notmuch_convert_tags. The generic function takes a
Xapian::TermIterator as argument and uses the iterator to find tags.
This makes the function usable with different Xapian objects.

Function notmuch_message_get_tags is then reimplemented to call the
generic function with message->doc.termlist_begin() as argument.

Similarly, we implement notmuch_message_database_get_all_tags, the
function calls the generic function with db->xapian_db->allterms_begin()
as argument.

Finally, notmuch_database_get_all_tags is exported through
lib/notmuch.h

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agomodify notmuch_setup_command to return 1 if config file write fails.
Jameson Graef Rollins [Sun, 22 Nov 2009 21:58:35 +0000 (16:58 -0500)]
modify notmuch_setup_command to return 1 if config file write fails.

This fixes a small bug in notmuch_setup_command such that it returned
OK and output the setup message footer even if the config file write
step failed.

15 years agoTesting.
Carl Worth [Wed, 25 Nov 2009 17:39:10 +0000 (09:39 -0800)]
Testing.

15 years agonotmuch.el: Remove some dead code.
Carl Worth [Wed, 25 Nov 2009 17:18:39 +0000 (09:18 -0800)]
notmuch.el: Remove some dead code.

This was left over from before the switch to using a filter for
processing the results of "notmuch search".

15 years agonotmuch.el: Quote arguments to protect from shell interpretation.
Carl Worth [Wed, 25 Nov 2009 03:08:53 +0000 (19:08 -0800)]
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!

15 years agonotmuch.el: Exceute "notmuch search" asynchronously.
Carl Worth [Wed, 25 Nov 2009 02:49:58 +0000 (18:49 -0800)]
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.

15 years agoMerge buttons-for-body-and-headers branch.
Carl Worth [Tue, 24 Nov 2009 19:35:08 +0000 (11:35 -0800)]
Merge buttons-for-body-and-headers branch.

Thanks, Alexander!

15 years agoRemove the global expand body keymapping
Alexander Botero-Lowry [Tue, 24 Nov 2009 07:41:42 +0000 (23:41 -0800)]
Remove the global expand body keymapping

With local buttons done now, we don't need this anymore.

15 years agolib/messages.c: Make message searches stream as well.
Carl Worth [Tue, 24 Nov 2009 05:47:24 +0000 (21:47 -0800)]
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.

15 years agoMake bodies locally toggleable
Alexander Botero-Lowry [Tue, 24 Nov 2009 07:39:57 +0000 (23:39 -0800)]
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

15 years agomake a nice function for generating invisibility toggle buttons
Alexander Botero-Lowry [Tue, 24 Nov 2009 06:37:49 +0000 (22:37 -0800)]
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.

15 years agocleanup a lot of left-overs from the global invis
Alexander Botero-Lowry [Tue, 24 Nov 2009 06:28:56 +0000 (22:28 -0800)]
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

15 years agomake headers locally expandable/collapsable
Alexander Botero-Lowry [Tue, 24 Nov 2009 06:25:33 +0000 (22:25 -0800)]
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.

15 years agolib/query: Drop the first and max_messages arguments from search_messages.
Carl Worth [Tue, 24 Nov 2009 04:25:13 +0000 (20:25 -0800)]
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.

15 years agolib/query: Fix notmuch_threads_t to stream results rather than blocking.
Carl Worth [Tue, 24 Nov 2009 04:18:57 +0000 (20:18 -0800)]
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).

15 years agonotmuch search: Remove the chunked-searching hack.
Carl Worth [Tue, 24 Nov 2009 04:12:57 +0000 (20:12 -0800)]
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).

15 years agonotmuch.el: Add TAB and M-TAB buttons to move between buttons.
Carl Worth [Tue, 24 Nov 2009 03:03:59 +0000 (19:03 -0800)]
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.

15 years agoFix printing of literal '%' in help message.
Carl Worth [Tue, 24 Nov 2009 02:36:14 +0000 (18:36 -0800)]
Fix printing of literal '%' in help message.

I suppose I could have just used puts instead...

15 years agoMake addresses case insensitive for the purpose of constructing replies.
Jed Brown [Mon, 23 Nov 2009 18:29:52 +0000 (19:29 +0100)]
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>
15 years agoStay out of tmp to respect the Maildir spec.
Jed Brown [Mon, 23 Nov 2009 20:57:33 +0000 (21:57 +0100)]
Stay out of tmp to respect the Maildir spec.

15 years agosearch : Extend "intial burst" optimization to return all results by chunks
Carl Worth [Mon, 23 Nov 2009 16:42:45 +0000 (17:42 +0100)]
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.

15 years agoAdd rudimentary date-based search.
Carl Worth [Mon, 23 Nov 2009 15:58:35 +0000 (16:58 +0100)]
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'".

15 years agoAdd notmuch-folder mode to provide an overview of search matches
Keith Packard [Sat, 21 Nov 2009 19:59:00 +0000 (11:59 -0800)]
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>
15 years agoAdd 'notmuch count' command to show the count of matching messages
Keith Packard [Sat, 21 Nov 2009 07:15:07 +0000 (23:15 -0800)]
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>
15 years agoMake mouse-1 click in search view show thread
Keith Packard [Sat, 21 Nov 2009 07:15:06 +0000 (23:15 -0800)]
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>
15 years agoTODO: Yet another idea.
Carl Worth [Mon, 23 Nov 2009 05:28:41 +0000 (06:28 +0100)]
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.

15 years agoANSI escapes in "new" only when output is a tty
Adrian Perez [Mon, 23 Nov 2009 00:54:35 +0000 (01:54 +0100)]
ANSI escapes in "new" only when output is a tty

When running "notmuch new --verbose", ANSI escapes are used. This may not be
desirable when the output of the command is *not* being sent to a terminal
(e.g. when piping output into another command). In that case each file
processed is printed in a new line and ANSI escapes are not used at all.

15 years agofix notmuch-new bug when database path ends with a trailing /
Bart Trojanowski [Sun, 22 Nov 2009 16:19:31 +0000 (11:19 -0500)]
fix notmuch-new bug when database path ends with a trailing /

I configured my database.path with a trailing /, and after running notmuch
new every notmuch search would fail with error messages like this:

  Error opening /inbox/cur/1258565257.000211.mbox:2,S: No such file or directory

The actual bug was in the filename normalization for storage in the
database.  The database.path was removed from the full filename, but if
the database.path from the config file contained a trailing /, the
relative file name would retain an extra leading /... which made it look
like an absolute path after it was read out from the DB.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
15 years agoTODO: Add a couple of notes about things to do with/to Xapian.
Carl Worth [Mon, 23 Nov 2009 02:48:04 +0000 (03:48 +0100)]
TODO: Add a couple of notes about things to do with/to Xapian.

I had these notes sitting in an uncommitted file that was cluttering
up my "git status" output. This cleans that up, and also shares the
ideas with the wider community.

15 years agomakefile: Declare clean target as phony.
Jan Janak [Sun, 22 Nov 2009 12:55:35 +0000 (13:55 +0100)]
makefile: Declare clean target as phony.

This ensures that make clean always proceeds, even if the user
accidentally creates a file named 'clean'. Also, it ignores errors in
rm and other commands.

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agoTODO: Capturing even more ideas.
Carl Worth [Mon, 23 Nov 2009 02:34:24 +0000 (03:34 +0100)]
TODO: Capturing even more ideas.

Hopefully soon I can start implementing ideas rather than just writing
them down.

15 years agoTODO: A couple of more ideas for improving the emacs interface.
Carl Worth [Mon, 23 Nov 2009 02:04:16 +0000 (03:04 +0100)]
TODO: A couple of more ideas for improving the emacs interface.

We're not likely to run out of work to do anytime soon...

15 years agoSupport multiple configuration files via $NOTMUCH_CONFIG
Alec Berryman [Sun, 22 Nov 2009 05:18:26 +0000 (23:18 -0600)]
Support multiple configuration files via $NOTMUCH_CONFIG

If present, $NOTMUCH_CONFIG will be used as the configuration file
location.

15 years agoTODO: Add several ideas for improving the emacs interface.
Carl Worth [Mon, 23 Nov 2009 01:57:39 +0000 (02:57 +0100)]
TODO: Add several ideas for improving the emacs interface.

These are from email messages on the notmuch mailing list and from
IRC conversations in #notmuch.

15 years agoInsert signature into replies
Keith Packard [Sat, 21 Nov 2009 04:57:35 +0000 (20:57 -0800)]
Insert signature into replies

When you compose a new message, message mode carefully inserts your
mail signature at the bottom of the message; as notmuch constructs the
reply all by itself, this doesn't happen then. Use the message mode
function 'message-insert-signature' to add that to reply buffers.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 years agoQuote file names passed to the shell
Jed Brown [Sat, 21 Nov 2009 02:37:54 +0000 (03:37 +0100)]
Quote file names passed to the shell

Prior to this, notmuch-show-pipe-message could not handle file names
with spaces and similar.

15 years agoSupport for printing file paths in new command
Adrian Perez [Sat, 21 Nov 2009 00:17:18 +0000 (01:17 +0100)]
Support for printing file paths in new command

For very large mail boxes, it is desirable to know which files are being
processed e.g. when a crash occurs to know which one was the cause. Also,
it may be interesting to have a better idea of how the operation is
progressing when processing mailboxes with big messages.

This patch adds support for printing messages as they are processed by
"notmuch new":

* The "new" command now supports a "--verbose" flag.

* When running in verbose mode, the file path of the message about to be
  processed is printed in the following format:

    current/total: /path/to/message/file

  Where "current" is the number of messages processed so far and "total" is
  the total count of files to be processed.

  The status line is erased using an ANSI sequence "\033[K" (erase current
  line from the cursor to the end of line) each time it is refreshed. This
  should not pose a problem because nearly every terminal supports it.

* The signal handler for SIGALRM and the timer are not enabled when running
  in verbose mode, because we are already printing progress with each file,
  periodical reports are not neccessary.

15 years agoMerge remote branch 'drax/master'
Carl Worth [Sun, 22 Nov 2009 23:43:26 +0000 (00:43 +0100)]
Merge remote branch 'drax/master'

15 years agoswitch to button-1, which seems to interact poorly with text-selection by mouse
Alexander Botero-Lowry [Sun, 22 Nov 2009 23:42:59 +0000 (15:42 -0800)]
switch to button-1, which seems to interact poorly with text-selection by mouse

15 years agoTODO: Add a bunch of ideas that have been on my mind lately.
Carl Worth [Sun, 22 Nov 2009 23:29:00 +0000 (00:29 +0100)]
TODO: Add a bunch of ideas that have been on my mind lately.

So get these out of my mind and out to the user community.

15 years agoinstead of trying to cause a redisplay, actually do a redisplay
Alexander Botero-Lowry [Sun, 22 Nov 2009 23:24:25 +0000 (15:24 -0800)]
instead of trying to cause a redisplay, actually do a redisplay

15 years agoput a newline after the headers
Alexander Botero-Lowry [Fri, 20 Nov 2009 22:17:06 +0000 (14:17 -0800)]
put a newline after the headers

15 years agomake header names bold in show-mode
Alexander Botero-Lowry [Fri, 20 Nov 2009 08:06:17 +0000 (00:06 -0800)]
make header names bold in show-mode

15 years agoMake expanding/collapsing signatures and citations local to them
Alexander Botero-Lowry [Fri, 20 Nov 2009 07:21:04 +0000 (23:21 -0800)]
Make expanding/collapsing signatures and citations local to them

This is the first step towards localizing all the expand/collapse
operations in the show buffer

15 years agobuttonize signatures as well
Alexander Botero-Lowry [Fri, 20 Nov 2009 06:11:48 +0000 (22:11 -0800)]
buttonize signatures as well

15 years agoButtonize citation expander.
Alexander Botero-Lowry [Thu, 19 Nov 2009 20:30:32 +0000 (12:30 -0800)]
Buttonize citation expander.

Currently the button has no action or special handling at all.

15 years agonotmuch-show: Show message part using UTF-8.
Kan-Ru Chen [Sun, 22 Nov 2009 08:30:47 +0000 (16:30 +0800)]
notmuch-show: Show message part using UTF-8.

Pass the message through the charset filter so that we can view
messages wrote in different charset encoding.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
15 years agoMissing final semi-colon in .desktop's Categories.
James Rowe [Sat, 21 Nov 2009 09:13:31 +0000 (09:13 +0000)]
Missing final semi-colon in .desktop's Categories.

"Those keys which have several values should have a semicolon as the trailing
character."
  -- http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s03.html

Signed-off-by: James Rowe <jnrowe@gmail.com>
Reviewed-by: Jeffrey C. Ollie <jeff@ocjtech.us>
15 years agoFix invalid face reference.
Kan-Ru Chen [Sun, 22 Nov 2009 06:40:59 +0000 (14:40 +0800)]
Fix invalid face reference.

To avoid the "Invalid face reference: cons [18 times]" kind of message
goes on and on in the *Messages*.

Signed-off-by: Kan-Ru Chen <kanru@kanru.info>
15 years agonotmuch-new: Only print the regular progress report when on a tty
Chris Wilson [Sun, 22 Nov 2009 00:44:32 +0000 (00:44 +0000)]
notmuch-new: Only print the regular progress report when on a tty

Check that the stdout is connected to an interactive terminal with
isatty() before installing the periodic timer to print progress reports.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agonotmuch-new: Only install SIGALRM if not running under gdb
Chris Wilson [Sun, 22 Nov 2009 00:44:31 +0000 (00:44 +0000)]
notmuch-new: Only install SIGALRM if not running under gdb

I felt sorry for Carl trying to step through an exception from xapian
and suffering from the SIGALARMs..

We can detect if the user launched notmuch under a debugger by either
checking our cmdline for the presence of the gdb string or querying if
valgrind is controlling our process. For the latter we need to add a
compile time check for the valgrind development library, and so add the
initial support to build Makefile.config from configure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Carl Worth <cworth@cworth.org>
[ickle: And do not install the timer when under the debugger]

15 years agolib/database.cc: coding style
Chris Wilson [Sat, 21 Nov 2009 23:14:39 +0000 (23:14 +0000)]
lib/database.cc: coding style

Carl claims he must have been distracted when he wrote this...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
15 years agoMakefile: Fix to work even with GZIP environment variable set.
Carl Worth [Sun, 22 Nov 2009 03:45:16 +0000 (04:45 +0100)]
Makefile: Fix to work even with GZIP environment variable set.

The rule here was written to assume that if the GZIP environment
variable was set that it would be the gzip binary to execute,
(similar to the CC and CXX variables). But GZIP is actually used
to pass arguments to gzip, so we have to use a different name.

15 years agoMakefile: Magic silent rules.
Chris Wilson [Sat, 21 Nov 2009 20:32:20 +0000 (20:32 +0000)]
Makefile: Magic silent rules.

Use the facilities of GNU make to create a magic function that will
on the first invocation print a description of how to enable verbose
compile lines and then print the quiet rule.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Carl Worth <cworth@cworth.org>
Cc: Mikhail Gusarov <dottedmag@dottedmag.net>
[ickle: Rebased, and duplicate command string eliminated.]
[ickle: Fixed verbose bug pointed out by Mikhail]

15 years agoadd_message: Use sha-1 in place of overly long message ID.
Carl Worth [Sun, 22 Nov 2009 03:03:49 +0000 (04:03 +0100)]
add_message: Use sha-1 in place of overly long message ID.

Since Xapian has a limit on the maximum length of a term, we have
to check for that before trying to add the message ID as a term.

This fixes the bug reported by Mike Hommey here:

<20091120132625.GA19246@glandium.org>

I've also constructed 20 files with a range of message ID lengths
centered around the Xapian term-length limit which I'll use to seed a
new test suite soon.

15 years agoget_timestamp: Ensure that return value is 0 in case of exception.
Carl Worth [Sun, 22 Nov 2009 02:55:39 +0000 (03:55 +0100)]
get_timestamp: Ensure that return value is 0 in case of exception.

Just to be on the safe side of things.

15 years agoCatch and optionally print about exception at database->flush.
Carl Worth [Sun, 22 Nov 2009 02:54:20 +0000 (03:54 +0100)]
Catch and optionally print about exception at database->flush.

If an earlier exception occurred, then it's not unexpected for the
flush to fail as well. So in that case, we'll silently catch the
exception. Otherwise, make some noise about things going wrong at the
time of flush.

15 years agoAdd a missing print after catching an exception.
Carl Worth [Sun, 22 Nov 2009 02:52:55 +0000 (03:52 +0100)]
Add a missing print after catching an exception.

Without this, trying to debug this exception was *really* confusing.

15 years agoPrint information about where Xapian exception occurred.
Carl Worth [Sun, 22 Nov 2009 02:41:30 +0000 (03:41 +0100)]
Print information about where Xapian exception occurred.

Previously, our Xapian exception reports where identical so they
were hard to track down.

15 years agonotmuch-config: Fix memleaks.
Holger Freyther [Sat, 21 Nov 2009 21:45:23 +0000 (22:45 +0100)]
notmuch-config: Fix memleaks.

While talloc is great we need to free the g_error by hand.

Tested-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Holger Freyther <zecke@selfish.org>
15 years agonotmuch new: Fix to actually open the database READ_WRITE.
Chris Wilson [Sat, 21 Nov 2009 23:13:24 +0000 (00:13 +0100)]
notmuch new: Fix to actually open the database READ_WRITE.

Chris claims he must have been distracted when he wrote this.

15 years agoFix freak case problem that broke the compile.
Carl Worth [Sat, 21 Nov 2009 21:29:31 +0000 (22:29 +0100)]
Fix freak case problem that broke the compile.

I think I must have bumped some emacs keybinding that changed the case
of a word here.

15 years agoRename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITE
Carl Worth [Sat, 21 Nov 2009 21:10:18 +0000 (22:10 +0100)]
Rename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITE

And correspondingly, READONLY to READ_ONLY.

15 years agoPermit opening the notmuch database in read-only mode.
Chris Wilson [Sat, 21 Nov 2009 19:54:25 +0000 (19:54 +0000)]
Permit opening the notmuch database in read-only mode.

We only rarely need to actually open the database for writing, but we
always create a Xapian::WritableDatabase. This has the effect of
preventing searches and like whilst updating the index.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Carl Worth <cworth@cworth.org>
15 years agoINSTALL/notmuch.el: More details on how to install/run notmuch.el
Carl Worth [Sat, 21 Nov 2009 20:40:57 +0000 (21:40 +0100)]
INSTALL/notmuch.el: More details on how to install/run notmuch.el

Hopefully this will save some people some head-scratching trying
to figure out how to use it.

15 years agoINSTALL: emacs install dokumentation.
Stefan Schmidt [Sat, 21 Nov 2009 19:36:06 +0000 (20:36 +0100)]
INSTALL: emacs install dokumentation.

Write down the steps needed to install and actuall use notmuch in emacs. Should
help emacs newbies.

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
15 years agoRevert "notmuch: Add Maildir directory name as tag name for messages"
Carl Worth [Sat, 21 Nov 2009 20:21:58 +0000 (21:21 +0100)]
Revert "notmuch: Add Maildir directory name as tag name for messages"

This reverts commit 9794f19017e028b542ed715bef3fd7cf0da5edff.

The feature makes a lot of sense for the initial import, but it's not
as clear whether it makes sense for ongoing "notmuch new" runs. We
might need to make this opt-in by configuration.

15 years agoTODO: Add notes on portability, and remove completed tasks.
Carl Worth [Sat, 21 Nov 2009 18:54:24 +0000 (19:54 +0100)]
TODO: Add notes on portability, and remove completed tasks.

It's better to have things in TODO rather than mails with a todo
tag in my notmuch database.

15 years agoTODO: Several updates.
Carl Worth [Sat, 21 Nov 2009 18:52:43 +0000 (19:52 +0100)]
TODO: Several updates.

15 years agoINSTALL: Mention that xapian-config might be named xapian-config-1.1
Carl Worth [Sat, 21 Nov 2009 18:52:06 +0000 (19:52 +0100)]
INSTALL: Mention that xapian-config might be named xapian-config-1.1

As reported on the mailing list.

15 years agonotmuch: Add Maildir directory name as tag name for messages
Aneesh Kumar K.V [Wed, 18 Nov 2009 15:50:12 +0000 (21:20 +0530)]
notmuch: Add Maildir directory name as tag name for messages

This patch adds maildir directory name as the tag name for
messages. This helps in adding tags using filtering already
provided by procmail.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
15 years agoMakefile: Fix the fallback emacs install path.
Carl Worth [Sat, 21 Nov 2009 10:38:27 +0000 (11:38 +0100)]
Makefile: Fix the fallback emacs install path.

When pkg-config can't be used to find out where to install emacs
files, we fallback to a hard-coded directory. Only, we were falling
back to the wrong thing, (one that emacs doesn't look into by
default).

15 years agoDrop redundant CFLAGS, was already included in CXXFLAGS
Jed Brown [Fri, 20 Nov 2009 15:58:15 +0000 (16:58 +0100)]
Drop redundant CFLAGS, was already included in CXXFLAGS

15 years agonotmuch reply: Include text parts in reply, even with disposition attachment.
Carl Worth [Sat, 21 Nov 2009 00:14:01 +0000 (01:14 +0100)]
notmuch reply: Include text parts in reply, even with disposition attachment.

If it's text, (such as a patch), then I want it quoted in my reply,
(so that I can comment on it).

15 years agonotmuch show: Don't hide text parts, even with disposition attachment.
Carl Worth [Sat, 21 Nov 2009 00:09:36 +0000 (01:09 +0100)]
notmuch show: Don't hide text parts, even with disposition attachment.

If it's text, (such as a patch), then I want to see it.

15 years agonotmuch show: Don't hide a digital signature.
Carl Worth [Sat, 21 Nov 2009 00:00:41 +0000 (01:00 +0100)]
notmuch show: Don't hide a digital signature.

This was a bug that was introduced in copying the indexing code over
into notmuch-show.c. When indexing, we want to ignore the signature,
(it has no interesting terms). But when presenting the message, it's
important to present the signature to the user.

(And would be even better if we presented whether or not the signature
is good.)

15 years agonotmuch.el: Don't use end-of-buffer which is inappropriate from programs
Carl Worth [Fri, 20 Nov 2009 23:58:16 +0000 (00:58 +0100)]
notmuch.el: Don't use end-of-buffer which is inappropriate from programs

The documentation is quite clear about this case.

With this, we can now byte compile without warnings.

15 years agonotmuch.el: Fix stale reference to non-existing variable.
Carl Worth [Fri, 20 Nov 2009 23:53:27 +0000 (00:53 +0100)]
notmuch.el: Fix stale reference to non-existing variable.

We changed from "query" to "thread-id" a while ago, and broke this
error message at the time. Fix it now.

15 years agonotmuch.el: Add many missing defvar calls.
Carl Worth [Fri, 20 Nov 2009 23:52:23 +0000 (00:52 +0100)]
notmuch.el: Add many missing defvar calls.

Without these, emacs was complaining about "assignment to free variable",
(though only when byte compiling, which is why we didn't notice earlier).

15 years agoWhen a search query triggers a Xapian exception, log what the query was.
Eric Anholt [Fri, 20 Nov 2009 13:00:42 +0000 (14:00 +0100)]
When a search query triggers a Xapian exception, log what the query was.

In my script containing a series of queries to be run on new mail for
setting up tags, it's nice to see which query I typed wrong.

Signed-off-by: Eric Anholt <eric@anholt.net>
15 years agoMake bash completion directory configurable.
James Rowe [Fri, 20 Nov 2009 15:28:26 +0000 (15:28 +0000)]
Make bash completion directory configurable.

Some systems install completion scripts in /usr/share/bash-completion, make the
location configurable from Makefile.config.

15 years agoadd_message: Re-fix handling of non-mail files.
Carl Worth [Fri, 20 Nov 2009 20:46:37 +0000 (21:46 +0100)]
add_message: Re-fix handling of non-mail files.

More fallout from _get_header now returning "" for missing headers.

The bug here is that we would no longer detect that a file is not an
email message and give up on it like we should.

And this time, I actually audited all callers to
notmuch_message_get_header, so hopefully we're done fixing this
bug over and over.

15 years agonotmuch_database_add_message: Add missing error-value propagation.
Carl Worth [Fri, 20 Nov 2009 20:02:11 +0000 (21:02 +0100)]
notmuch_database_add_message: Add missing error-value propagation.

Thanks to Mike Hommey for doing the analysis that led to noticing that
this was missing.

15 years agoadd_message: Properly handle missing Message-ID once again.
Carl Worth [Fri, 20 Nov 2009 18:31:00 +0000 (19:31 +0100)]
add_message: Properly handle missing Message-ID once again.

There's been a fair amount of fallout from when we changed
message_file_get_header from returning NULL to returning "" for
missing headers. This is yet more fallout from that, (where we were
accepting an empty message-ID rather than generating one like we want
to).

15 years agoCheckin some command-only tcsh completions
Alexander Botero-Lowry [Thu, 19 Nov 2009 01:15:43 +0000 (17:15 -0800)]
Checkin some command-only tcsh completions

Modified-by Carl Worth <cworth@cworth.org>: Just moved the file down
into contrib where the other completion scripts are.

15 years agobash-completion: Move to contrib
Ingmar Vanhassel [Fri, 20 Nov 2009 13:36:14 +0000 (14:36 +0100)]
bash-completion: Move to contrib

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
15 years agozsh-completion: Initial zsh-completion for notmuch
Ingmar Vanhassel [Fri, 20 Nov 2009 13:36:13 +0000 (14:36 +0100)]
zsh-completion: Initial zsh-completion for notmuch

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
15 years agoAdd notmuch.1.gz to files to be cleaned
Mikhail Gusarov [Fri, 20 Nov 2009 12:58:39 +0000 (18:58 +0600)]
Add notmuch.1.gz to files to be cleaned

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
15 years agoTODO: Add a couple of notes about fixing the completion script.
Carl Worth [Fri, 20 Nov 2009 16:04:29 +0000 (17:04 +0100)]
TODO: Add a couple of notes about fixing the completion script.

I'm throwing away a half-finished fix of this now, and just want to
ensure I don't forget about it.

15 years agoMakefile: Make object targets depend on Makefiles
Jan Janak [Thu, 19 Nov 2009 00:37:25 +0000 (01:37 +0100)]
Makefile: Make object targets depend on Makefiles

All objects need to be recompiled when any of the Makefiles changes, so
we make them all depend on all the Makefiles.

Signed-off-by: Jan Janak <jan@ryngle.com>
15 years agoAllow to redefine notmuch binary name and path in elisp mode
Mikhail Gusarov [Fri, 20 Nov 2009 01:15:40 +0000 (07:15 +0600)]
Allow to redefine notmuch binary name and path in elisp mode

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>