Carl Worth [Thu, 15 Apr 2010 23:28:13 +0000 (16:28 -0700)]
Makefile: Re-order the commands in "make release" slightly.
We put verify-version as a dependency, not a recursive action to keep
its output clean, (I know that I will always type "make release"
instead of "make VERSION=X.Y release" so I want a nice, neat
reminder).
Also, put the various ssh-based commands together, and after the
build, (so that it doesn't ask for a password/passphrase both before
and after building).
Carl Worth [Thu, 15 Apr 2010 23:23:57 +0000 (16:23 -0700)]
Makefile: Simplify the release targets.
Previously, we had a separate release-upload target that a user might
mistake as something useful to call directly, (which would have the
undesired effect or uploading a new package, but without first making
all the checks that we want).
So we eliminate that target, (folding its actions into "make
release"), and we also rename the several release-verify-foo targets
to simply verify-foo. This leaves as the only targets with "release"
in the name as "release" and "release-message". Both of these are
intended for the user to call directly.
Carl Worth [Thu, 15 Apr 2010 23:09:43 +0000 (16:09 -0700)]
RELEASING: Remove obsolete step about updating micro version number.
We've now changed to using "git describe" to automatically report a
version number that changes with every git commit. So we no longer
need to manually update anything in the Makefile during the release
process.
Carl Worth [Thu, 15 Apr 2010 22:18:30 +0000 (15:18 -0700)]
make test: Actually count and report on failures.
Hurrah---no more manual verification of that PASS column.
This means that "make test" can actually be a useful part of the
release process now, (since it will exit with non-zero status if there
are any failures).
Carl Worth [Thu, 15 Apr 2010 22:09:21 +0000 (15:09 -0700)]
test: Unify all tests to use the pass_if_equal function.
Previously some tests (dump/restore) were doing ad-hoc verification of
values and their own printing of PASS/FAIL, etc. This made it
impossible to count test pass/fail rates in a single place.
The only reason these tests were written that way was because the old
execute_expecting function only worked if one could directly test the
stdout output of a notmuch command. The recent switch to pass_if_equal
means that all tests can use it.
Carl Worth [Thu, 15 Apr 2010 21:56:21 +0000 (14:56 -0700)]
Makefile: Add a "make test" target.
I just wasted far too much time looking for a bug that wasn't actually
there only because I hadn't recompiled before running the test
suite. Now we can take advantage of actual dependency information to
force a rebuild for "make test".
Carl Worth [Thu, 15 Apr 2010 16:15:10 +0000 (09:15 -0700)]
lib: search_threads: Fix nested search to handle original search of "*"
When constructing a thread, we usually run a nested query to find all
messages in the thread that match the original search string. However,
we need to have special-case handling of an original search string of
"*" now that that is a supported means of specifying all messages.
The special-case ends up bein quite simple---we do less work, (just
skipping the nested search since we know that all messages must
match). I had been wanting to write this identical code to more
efficiently handle "notmuch search thread:<foo>" which was previously
running two identical searches. So that case is now more efficient as
well.
Carl Worth [Thu, 15 Apr 2010 21:06:10 +0000 (14:06 -0700)]
test: Add a test for "notmuch search '*'"
This feature was added recently and should have gotten a new test at
the time.
As this test demonstrates, the code is broken, ("notmuch search '*'
returns bogus dates of the Unix epoch for any threads where the
term "and" does not appear in any messages).
Carl Worth [Thu, 15 Apr 2010 21:09:07 +0000 (14:09 -0700)]
test: Use an older date for the generated messages.
Using a date in the current year makes the test suite fragile since
the search output will include a date of "January 05" for now, but
will start doing "2010-01-05" in the future.
Carl Worth [Thu, 15 Apr 2010 21:01:54 +0000 (14:01 -0700)]
test: Remove test-message filenames from generated messages
The filenames aren't predictable (including the current directory) nor
stable from one run to the next (including the PID). This makes it
hard to predict the output from a search command that returns such a
message (such as "*").
The original goal was simply to ensure that each generated message was
distinguishable somehow. So just use the message counter instead.
Carl Worth [Thu, 15 Apr 2010 20:44:00 +0000 (13:44 -0700)]
test: Disentangle execution of notmuch from the examination of the results.
The old execute_expecting function was doing far too much for its own
good. One of the worst aspects of this was that it introduced
shell-quoting challengers where the caller could not easily control
the precise invocation of the command to be executed.
I personally couldn't find a way to test "notmuch search '*'" without
the shell expanding * against files in the current directory, or
having bogus quotation marks appearing in the search string,
(defeating the recognition of "*" as a special search term).
Hopefully this aspect of the test suite will be much easier to maintain now.
Carl Worth [Thu, 15 Apr 2010 20:19:19 +0000 (13:19 -0700)]
TODO: Add some ideas for improving the emacs interface.
One of these is a bad bug I noticed this morning, (archiving messages I had
never read when going through a search of "tag:inbox and tag:to-me" and
hitting space bar).
The other ideas came from recent conversations with Dirk and Eric.
Carl Worth [Thu, 15 Apr 2010 20:15:27 +0000 (13:15 -0700)]
TODO: Add some ideas about better search syntax
Recent coding around the "*" feature suggests some improvements that
we could make, (some of which might push us into writing a custom
query parser rather than using the one that exists in Xapian).
Carl Worth [Thu, 15 Apr 2010 00:17:50 +0000 (17:17 -0700)]
test: Fix reply tests to track insignificant change in output.
The recent fix to properly decode encoded headers made the expected
output of "notmuch reply" differ by a single space, (previously, there
were two spaces before the References: value and now there is just
one).
Fix the test suite so that these are all noted as correct results
again.
Carl Worth [Wed, 14 Apr 2010 23:29:50 +0000 (16:29 -0700)]
Makefile: Fix final linking of notmuch binary for OS X.
Apparently the OS X linker can't resolve symbols when linking a
program (notmuch) against a library (libnotmuch) when the library
depends on another library (libgmime) that the program doesn't depend
on directly.
For this case, we need to link the program directly against both
libraries, but we don't want to do this on Linux, where the linker can
do this on its own and the explicit, unneeded link would cause
problems.
Carl Worth [Wed, 14 Apr 2010 23:18:19 +0000 (16:18 -0700)]
Makefile: Add library version information on OS X.
This encodes the library version into the library, where the linking
binary can pick it up, and the linker can even enforce mismatches in
the minor release, (such as linking a binary against version 1.2 and
then attempting to run it against version 1.1).
Carl Worth [Wed, 14 Apr 2010 23:16:05 +0000 (16:16 -0700)]
Makefile: Fix library linking command for OS X
I'm not sure which system Aaron used, but on the machine I have access
to, (Darwin 8.11.0), the -shared and -dylib_install_name options are
not recognized. Instead I use -dynamic_lib and -install_name as
documented here:
Add simplistic reimplementation of strcasestr to compat library
While all systems that I have access to support strcasestr, it is
in fact not part of POSIX. So here's a fallback reimplementation
based on POSIX functions.
Signed-off-by: Dirk Hohndel <hohndel@infradead.org> Tested-by: Tomas Carnecky <tom@dbservice.com> (on OpenSolaris snv_134)
Carl Worth [Wed, 14 Apr 2010 18:32:26 +0000 (11:32 -0700)]
Makefile: Move include of Makefile.config up from Makefile.local
The recent change to include sub-directory Makefile.local files
before the top-level Makefile.local means that we need to include
the Makefile.config before those. So move it up from Makefile.local
to Makefile.
Clean up code duplication in adding or removing tag by region.
Clean up code duplication, as per Carl's suggestion, by making
notmuch-search-{add/remove}-tag-thread a special case of the -region
commands, where the region in question is between (point) and (point).
There was a bug in notmuch-search-{add,remove}-tag-region, which would
not behave correctly if the region went beyond the last message. Now,
instead of simply iterating to the last line of the region, these
functions will iterate to the minimum of the last line of the region
and the last possible line, i.e.
(- (line-number-at-pos (point-max)) 2)
Tested-by: Carl Worth <cworth@cworth.org> Note that the old, buggy
behavior included infinite loops of emacs lisp code, so the new
behavior is significantly better than that.
Michal Sojka [Wed, 3 Mar 2010 07:50:56 +0000 (08:50 +0100)]
Decode headers in reply
When headers contain non-ASCII characters, they are encoded according
to rfc2047. Nomtuch reply command emits the headers in the encoded
form, which makes them hard to read by humans who compose the reply.
For example instead of "Subject: Re: Rozlučka" one currently sees
"Subject: Re: =?iso-8859-2?q?Rozlu=E8ka?=".
This patch adds a new GMime filter which is used to decode headers to
UTF-8 and uses this filter when notmuch reply outputs headers.
Jesse Rosenthal [Sun, 24 Jan 2010 20:22:33 +0000 (15:22 -0500)]
notmuch.el: quote args in notmuch-show to facilitate remote use
Put single-quotes around the argument of the `show --entire-thread' command
in notmuch-show. This change should have no effect on normal usage.
However, it allows us to use the notmuch.el client with a remote notmuch
binary and database over ssh (by, e.g., setting `notmuch-command' to a
simple shell script). Without the quotes, ssh will not send the command
properly.
One very simple example script is as follows. (Note that it requires
keypair login to the ssh server.)
notmuch previously unconditionally checked mime parts for various
properties, but not for NULL, which is the case if libgmime encounters
an empty mime part.
Upon encounter of an empty mime part, the following is printed to
stderr (the second line due to my patch):
Michael Forney [Fri, 26 Mar 2010 18:39:17 +0000 (18:39 +0000)]
Fix typo in notmuch.h documentation regarding database open modes
Reviewed-by: Carl Worth <cworth@cworth.org>:
The original proposal for having different open modes used the name
WRITABLE. I didn't like that name, (easy to misspell as WRITEABLE even
for native English speakers). So we renamed it to READ_WRITE
immediately, but apparently some of the documentation held the old
name for a while.
Carl Worth [Tue, 13 Apr 2010 15:33:58 +0000 (08:33 -0700)]
TODO: Make an explicit note that we need to start testing --format=json
The recent fix to handle utf8 in the JSON output is the kind of bug
I'd never like to see again, (so that I'd like the test suite to be
helping us track that).
Gregor Hoffleit [Thu, 4 Mar 2010 10:40:03 +0000 (11:40 +0100)]
Fix json_quote_str to handle non-ASCII characters
The current code in json_quote_str() only accepts strict printable ASCII
code points (i.e. 32-127), all other code points are dropped from the
JSON output. The code is attempting to drop only non-printable ASCII
characters, but doing a signed comparison of the byte value is also
dropping characters with values >= 128.
This patch uses an unsigned comparison to accept code points 32-255.
Reviewed-by: Carl Worth <cworth@cworth.org> (with some additional
details for commit message).
Carl Worth [Mon, 12 Apr 2010 22:45:40 +0000 (15:45 -0700)]
lib: Always add reference terms to the database.
Previously, we were only adding the reference terms for cases where
the referenced message did not yet exist in the database. For thread
presentation, it's useful to have the connection information provided
by the references, even when the messages are present. So add this
term unconditionally.
Carl Worth [Mon, 12 Apr 2010 21:35:25 +0000 (14:35 -0700)]
lib: Fix internal documentation of _notmuch_database_link_message
This function was recently modified, (to include a metadata lookup for
a message's thread ID before looking for parent/child thread IDs), but
the documentation wasn't updated. Fix that.
Carl Worth [Mon, 12 Apr 2010 21:29:36 +0000 (14:29 -0700)]
lib: Simplify code flow in _resolve_message_id_to_thread_id
There are two primary cases in this function, (the message exists in
the database or it does not). Previously the code for these two cases
was split and intermingled with goto-spaghetti connections.
James Westby [Sat, 13 Mar 2010 21:27:57 +0000 (16:27 -0500)]
Store thread ids for messages that we haven't seen yet
This allows us to thread messages even when we receive them out of
order, or never receive the root.
The thread ids for messages that aren't present but are referred to are
stored as metadata in the database and then retrieved if we ever get
that message.
When determining the thread id for a message we also check for this
metadata so that we can thread descendants of a message together before
we receive it.
Edited by Carl Worth <cworth@cworth.org>: Split this portion of the
commit from the earlier-applied portion adding test cases.
James Westby [Sat, 13 Mar 2010 21:27:57 +0000 (16:27 -0500)]
test: Add new tests for out-of-order messages.
These new tests demonstrate a bug as follows:
Multiple messages are added to the database
All of these message references a common parent
The parent message does not exist in the databas
In this scenario, the messages will not be recognized as belonging to
the same thread. We consider this a bug, and the new tests treat this
as a failure.
Edited by Carl Worth <cworth@cworth.org>: Split these tests into their
own commit (before the fix of the bug). This lets me see the actual
failure in the test suite, before the fix is applied. Also fix the
alignment of new messages from test suite, (so that the PASS portions
all line up---which is important while we're still manually verifying
test-suite results).
Michal Sojka [Thu, 8 Apr 2010 11:49:22 +0000 (13:49 +0200)]
Derive version numbers from git
I often have several versions of notmuch compiled and it would be very
helpful to be able to distinguish between them. Git has a very nice
feature to make intermediate numbering automatic and unambiguous so
let's use it here.
For tagged versions, the version is the name of the tag, for
intermediate versions, the unique ID of the commit is appended to the
tag name.
When notmuch is compiled from a release tarball, there is no git
repository and therefore the tarball contains a special file 'version',
which contains the version of release tarball.
To create a new release one has to run 'make release VERSION=X.Y'.
Carl Worth [Fri, 9 Apr 2010 23:49:58 +0000 (16:49 -0700)]
notmuch count: Remove special handling of "*".
From both the implementation and from the documentation. This is
handled generically in the library for all search-based commands,
so count doesn't need special treatment.
Carl Worth [Fri, 9 Apr 2010 23:40:31 +0000 (16:40 -0700)]
lib: Handle "*" as a query string to match all messages.
This seems like a generally useful thing to support, (but the previous
support through an empty string was not convenient for some users,
(such as the command-line client).
Fix code extracting the MTA from Received: headers
The previous code made too many assumptions about the (sadly not
standardized) format of the Received headers. This version should
be more robust to deal with different variations.
Carl Worth [Wed, 7 Apr 2010 20:15:27 +0000 (13:15 -0700)]
emacs: Correct the documentation for notmuch-search-add-tag (and -remove-tag)
These commands act on all messages in the thread, not simply those
that match the search. (There are use case for both behaviors, but the
documentation must match the behavior that's actually implemented).
Jesse Rosenthal [Wed, 17 Feb 2010 00:07:40 +0000 (19:07 -0500)]
notmuch.el: add functionality in notmuch search mode to add or remove tags by region
This patch adds `-region' versions of the `notmuch-search-' commands to find
properties. It also splits up `notmuch-add/remove-tags' into both a
`-thread' and a `-region' version. (This makes us modify
`notmuch-search-archive-thread' to use the
`notmuch-search-remove-tag-thread' function, instead of
`notmuch-search-remove-tag', for consistency.) The add/remove-tag command
called by pressing `+' or `-' will then choose accordingly, based on whether
region is active.
This version fixes a couple of errors in the first version, which led to
incorrect marking of some tags in the search view (though the actual
tagging was still correct). It's also based on current master.
I'm not sure any more if region selection is actually the correct way to
do this, or if a mutt-style message-marking method would be better. But
I didn't want a buggy incorrect version out there.
Carl Worth [Wed, 7 Apr 2010 19:15:08 +0000 (12:15 -0700)]
Display the last few lines of a citation by default.
As put forth in the commit that enabled this functionality, the last
few lines of a citation are often much more important. In that case,
let's actually do the useful thing by default.
Jameson Rollins [Thu, 4 Feb 2010 12:07:26 +0000 (07:07 -0500)]
notmuch.el: colorize lines in notmuch-search based on thread tags.
Arbitrary font faces can be specified for given thread tags. By
default, no coloring is applied. To specify coloring, place something
like this in your .emacs:
Order matters: line faces listed first will take precedence (in the
example above, a thread tagged both "delete" and "unread" will be
colored red, since the "delete" face is listed before the "unread").
notmuch.el | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
Jesse Rosenthal [Sat, 6 Mar 2010 14:20:21 +0000 (09:20 -0500)]
notmuch.el: Make notmuch-show buffer name first subject, instead of thread-id (supersedes V1--3)
Change the buffer name to a uniquified subject of the thread (i.e. the
subject of the first message in the thread) instead of the thread-id. This
is more meaningful to the user, and will make it easier to scroll through
numerous open buffers.
Note that this patch adds an optional `buffer-name' argument to notmuch
show.
Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Carl Worth [Wed, 7 Apr 2010 17:07:23 +0000 (10:07 -0700)]
Makefile: Install emacs code to site-lisp, not site-lisp/notmuch
And just make the Debian packaging request site-lisp/notmuch like it
wants. Otherwise, the installed files won't appear on the load-path
so won't be found by emacs.
When replying to a message notmuch tries to pick the correct From
address by looking which one of a user's configured email addresses
were included in To or Cc headers of the email that is being replied to.
If none of the users email addresses are in the To or Cc headers we now
try to guess from the first (chronologically, last) Received header
which domain this email was received in and therefore which of the
email addresses to use in a reply
If that fails we still use the primary email as From email
Carl Worth [Wed, 7 Apr 2010 01:44:12 +0000 (18:44 -0700)]
Merge branch 'debian'
These are the changes made between the notmuch 0.1 release and the
release of Debian version 0.1-1. It's mostly changes to the debian
directory, of course, but does also include some generally useful
Makefile improvements.
Carl Worth [Tue, 6 Apr 2010 21:18:05 +0000 (14:18 -0700)]
Makefile: Add a disctclean target (simply calling clean)
We currently don't distribute anything that's not already in git, so
there's no difference between these two targets, (but debhelper wants
to be able to call distclean).
Carl Worth [Tue, 6 Apr 2010 19:53:02 +0000 (12:53 -0700)]
configure: Add a --sysconfdir option.
Which means that the bash completion script will now install
to ${prefix}/etc by default (unless configured with --syconfdir=/etc)
which is probably the right thing to do.
Carl Worth [Tue, 6 Apr 2010 19:39:29 +0000 (12:39 -0700)]
configure: Add stub support for --build=<cpu>-<vendor>-<host> option.
I'm not sure that this option would actually be useful for anything,
but debhelper at least expects our configure script to support it. So
we'll accept it and ignore it.
Carl Worth [Tue, 6 Apr 2010 18:28:24 +0000 (11:28 -0700)]
packaging: Add a pointer to where the debian packaging really is.
Most anyone familiar with debian should know to look for the top-level
debian directory, but since we do have a "packaging" directory, I
thought it should at least mention the debian stuff rather than just
containing the fedora spec file.
Carl Worth [Tue, 6 Apr 2010 21:38:04 +0000 (14:38 -0700)]
Merge branch 'debian' into rebuild
Conflicts:
Makefile.local: The Makefiles were all recently re-written on
master, but I did ensure that the changes from the
debian branch were all implemented here, (in
particular, installing the emacs files from "make
install").
configure: I've reverted one change as part of this merge:
Remove ./configure failure for unrecognized options
I'd much rather find what options the Debian scripts pass
and either implement them or at least make the explicitly
do nothing. One of the things that often annoyed me about
gnu autoconf-generated configure scripts was the silent
ignoring of unknown options, (which was very unhelpful in
the case of mistyped options on the command line).