]> git.notmuchmail.org Git - notmuch/log
notmuch
8 years agocli: update to use new count API
David Bremner [Sun, 27 Sep 2015 15:31:58 +0000 (12:31 -0300)]
cli: update to use new count API

Essentially replace each call to notmuch_count_* with the corresponding
_st call, followed by print_status_query.

8 years agolib: add versions of n_q_count_{message,threads} with status return
David Bremner [Sun, 27 Sep 2015 15:31:57 +0000 (12:31 -0300)]
lib: add versions of n_q_count_{message,threads} with status return

Although I think it's a pretty bad idea to continue using the old API,
this allows both a more gentle transition for clients of the library,
and allows us to break one monolithic change into a series

8 years agocli/count: simplify and document return value of print_count
David Bremner [Sun, 27 Sep 2015 15:31:56 +0000 (12:31 -0300)]
cli/count: simplify and document return value of print_count

Essentially a cosmetic change.

8 years agolib: move query variable to function scope
David Bremner [Sun, 27 Sep 2015 15:31:55 +0000 (12:31 -0300)]
lib: move query variable to function scope

This is a prelude to deallocating it (if necessary) on the error path.

8 years agonmbug-status: print config errors to stderr
Jani Nikula [Sat, 3 Oct 2015 07:57:56 +0000 (10:57 +0300)]
nmbug-status: print config errors to stderr

Particularly scripted usage with stdout redirection can be confusing
if errors are printed to stdout instead of stderr.

8 years agonotmuch-emacs-mua: make --auto-daemon imply --create-frame
Tomi Ollila [Wed, 30 Sep 2015 06:36:52 +0000 (09:36 +0300)]
notmuch-emacs-mua: make --auto-daemon imply --create-frame

Before this change with --auto-daemon but without --create-frame
emacs server was started but no clients stay connected to it
(in both graphical and terminal displays).

Note that this changes how --client --auto-daemon works on
graphical display; New emacs frame is now created for the
message (and message-exit-actions hook appended).

8 years agonotmuch-emacs-mua: do not create a frame by default with --client
Jani Nikula [Sat, 15 Aug 2015 09:05:15 +0000 (12:05 +0300)]
notmuch-emacs-mua: do not create a frame by default with --client

Make the default behaviour for --client the same as emacsclient
default: do not create a new frame. Add a new option --create-frame,
passing the same option to emacsclient to create a frame.

8 years agonotmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed
Jani Nikula [Sat, 15 Aug 2015 09:05:14 +0000 (12:05 +0300)]
notmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed

Automatically starting Emacs in daemon mode if the Emacs server is not
running is a matter of preference better not hard coded in
notmuch-emacs-mua. Add an option to control the behaviour.

8 years agonotmuch-emacs-mua: move --client option handling around
Jani Nikula [Sat, 15 Aug 2015 09:05:13 +0000 (12:05 +0300)]
notmuch-emacs-mua: move --client option handling around

Move --client handling to a more suitable location. No functional
changes.

8 years agonotmuch-emacs-mua: support --no-window-system also for non-client
Jani Nikula [Sat, 15 Aug 2015 09:05:12 +0000 (12:05 +0300)]
notmuch-emacs-mua: support --no-window-system also for non-client

Clearly --no-window-system should be applicable without --client as
well. Prepare for future changes with the naming of the variables.

8 years agoman: clean up notmuch-emacs-mua man page
Jani Nikula [Sat, 15 Aug 2015 09:05:11 +0000 (12:05 +0300)]
man: clean up notmuch-emacs-mua man page

Move --client description to a more suitable location, stylistic
changes.

8 years agocli: use designated initializer to initialize add_files_state
Jani Nikula [Fri, 25 Sep 2015 18:47:35 +0000 (21:47 +0300)]
cli: use designated initializer to initialize add_files_state

The side effect is that all of add_files_state will be initialized to
zero, removing any lingering doubt that some of it might not be
initialized. It's not a small struct, and the initialization is
scattered around a bit, so this makes the code more readable.

8 years agonmbug-status: add support for specifying sort order for each view
Jani Nikula [Sat, 26 Sep 2015 11:37:51 +0000 (14:37 +0300)]
nmbug-status: add support for specifying sort order for each view

Let each view have a "sort" key, typically used with values
"oldest-first" or "newest-first" (although all values in Query.SORT
are accepted), and sort the results accordingly. Oldest first remains
the default.

The dynamic approach of mapping sort values is as suggested by
W. Trevor King <wking@tremily.us>.

8 years agoMerge branch 'release'
David Bremner [Sat, 26 Sep 2015 13:31:50 +0000 (10:31 -0300)]
Merge branch 'release'

bring debian specific changes into master

8 years agodebian: changelog stanza for 0.20.2-2 debian/0.20.2-2
David Bremner [Sat, 26 Sep 2015 12:27:34 +0000 (09:27 -0300)]
debian: changelog stanza for 0.20.2-2

8 years agodebian: fix linking in emacsen-install script
David Bremner [Sat, 26 Sep 2015 12:22:11 +0000 (09:22 -0300)]
debian: fix linking in emacsen-install script

When upgrading emacs, the install file can (apparently) be called with
the lisp files already linked into the flavour specific
directories. In this case we should not fail.

8 years agocli: do not sort addresses on --output=count or --deduplicate=address
Jani Nikula [Thu, 3 Sep 2015 19:40:05 +0000 (22:40 +0300)]
cli: do not sort addresses on --output=count or --deduplicate=address

The order of the results with --output=count and --deduplicate=address
are unspecified as they're based on a hash table traversal. This being
the case, optimize the query by explicitly requesting unsorted
results. Clarify the documentation accordingly.

8 years agoman: document notmuch address --deduplicate=address option
Jani Nikula [Thu, 3 Sep 2015 19:40:04 +0000 (22:40 +0300)]
man: document notmuch address --deduplicate=address option

Document the deduplication based on case insensitive address.

8 years agotest: add notmuch address --deduplicate=(no|mailbox|address) tests
Jani Nikula [Fri, 25 Sep 2015 17:08:09 +0000 (20:08 +0300)]
test: add notmuch address --deduplicate=(no|mailbox|address) tests

First a simple smoke test first, next generate messages with multiple
email address variants and check the behaviour of deduplication
schemes with these.

8 years agocli: add support for deduplicating based on case insensitive address
Jani Nikula [Thu, 3 Sep 2015 19:40:03 +0000 (22:40 +0300)]
cli: add support for deduplicating based on case insensitive address

Consider all variants of an email address as one, and print the most
common variant.

8 years agocli: change the data structure for notmuch address deduplication
Jani Nikula [Fri, 25 Sep 2015 16:48:20 +0000 (19:48 +0300)]
cli: change the data structure for notmuch address deduplication

Currently we key the address hash table with the case sensitive "name
<address>". Switch to case insensitive keying with just address, and
store the case sensitive name and address in linked lists. This will
be helpful in adding support for different deduplication schemes in
the future.

There will be a slight performance penalty for the current full case
sensitive name + address deduplication, but this is simpler as a whole
when other deduplication schemes are added, and I expect the schemes
to be added to become more popular than the current default.

Aparet from the possible performance penalty, the only user visible
change should be the change in the output ordering for
--output=count. The order is not guaranteed (and is based on hash
table traversal) currently anyway, so this should be of no
consequence.

8 years agoutil: add strcmp_null, a strcmp that handles NULL parameters
Jani Nikula [Fri, 25 Sep 2015 16:48:19 +0000 (19:48 +0300)]
util: add strcmp_null, a strcmp that handles NULL parameters

Add strcmp_null, a strcmp that handles NULL strings; in strcmp terms a
NULL string is considered to be less than a non-NULL string.

8 years agolib: add support for date:<expr>..! to mean date:<expr>..<expr>
Jani Nikula [Sat, 15 Aug 2015 11:25:47 +0000 (14:25 +0300)]
lib: add support for date:<expr>..! to mean date:<expr>..<expr>

It doesn't seem likely we can support simple date:<expr> expanding to
date:<expr>..<expr> any time soon. (This can be done with a future
version of Xapian, or with a custom query query parser.) In the mean
time, provide shorthand date:<expr>..! to mean the same. This is
useful, as the expansion takes place before interpetation, and we can
use, for example, date:yesterday..! to match from beginning of
yesterday to end of yesterday.

Idea from Mark Walters <markwalters1009@gmail.com>.

8 years agotest suite: don't consider skipped individual tests as failing
David Bremner [Thu, 24 Sep 2015 11:13:30 +0000 (08:13 -0300)]
test suite: don't consider skipped individual tests as failing

It isn't completely clear what we want to do here, but

1) We currently don't fail if we skip a whole test file (mainly because
we neglect to count those skipped tests properly). This change at least
makes the two kinds of skipping consistent.

2) Automated build environments may have good reasons for building with
a minimal set of prereqs, and we don't want to discourage running our
test suite by breaking builds.

8 years agomake test: NOTMUCH_TEST_QUIET=1 is now the default
Tomi Ollila [Fri, 11 Sep 2015 20:44:11 +0000 (23:44 +0300)]
make test: NOTMUCH_TEST_QUIET=1 is now the default

make test V=1 (or any other value than 0) and make test V=0
works similar way as build in general

8 years agoman: document notmuch address --deduplicate=(no|mailbox) option
Jani Nikula [Wed, 23 Sep 2015 19:31:13 +0000 (22:31 +0300)]
man: document notmuch address --deduplicate=(no|mailbox) option

Document the deduplication of results.

8 years agotest: notmuch address --deduplicate=no tests
Jani Nikula [Fri, 4 Sep 2015 18:35:16 +0000 (21:35 +0300)]
test: notmuch address --deduplicate=no tests

Test not using address deduplication. Incorporate some trivial output
sorting tests here, as they seem to lack tests.

8 years agocli: add support for not deduplicating notmuch address results
Jani Nikula [Thu, 3 Sep 2015 19:39:59 +0000 (22:39 +0300)]
cli: add support for not deduplicating notmuch address results

Make it possible to use notmuch address as part of a | sort | uniq -c
pipe instead of forcing --output=count. This is useful for combining
results from multiple notmuch address queries.

8 years agotest: check argc in symbol-test
Jani Nikula [Wed, 23 Sep 2015 18:48:05 +0000 (21:48 +0300)]
test: check argc in symbol-test

Check argc mainly to fix unused parameter warning:

test/symbol-test.cc:7:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
  int main(int argc, char** argv) {
               ^

This makes more sense than telling the compiler it's unused on
purpose.

8 years agolib: constify arguments to notmuch_query_get_*
David Bremner [Wed, 23 Sep 2015 11:31:19 +0000 (08:31 -0300)]
lib: constify arguments to notmuch_query_get_*

These functions are all just accessors, and it's pretty clear they don't
modify the query struct. This also fixes one warning I created when I
introduced status.c.

8 years agocli: convert remainder of CLI to n_q_search_{messages,threads}_st
David Bremner [Sun, 6 Sep 2015 13:15:47 +0000 (10:15 -0300)]
cli: convert remainder of CLI to n_q_search_{messages,threads}_st

I think it would be no real problem to cut and paste the gdb based
error message test from count to the other clients modified here, but
I'm not currently convinced it's worth the trouble since the code path
being tested is almost the the same, and the tests are relatively
heavyweight.

8 years agocli/count: update to use notmuch_query_search_messages_st
David Bremner [Sun, 6 Sep 2015 13:15:46 +0000 (10:15 -0300)]
cli/count: update to use notmuch_query_search_messages_st

This brings back status information that may have been hidden by the
great library logging conversion.

Note the change of the internal API / return-value for count_files. The
other count calls to the lib will also get error handling when that API
is updated in the lib.

8 years agocli: add utility routine to print error status.
David Bremner [Sun, 6 Sep 2015 13:15:45 +0000 (10:15 -0300)]
cli: add utility routine to print error status.

No attention to formatting here, initially just focus on getting the
relevant strings out of the library.

8 years agocli/count: apply uncrustify changes
David Bremner [Mon, 7 Sep 2015 13:29:14 +0000 (10:29 -0300)]
cli/count: apply uncrustify changes

Leave the indentation alone because I don't know how to duplicate it
with Emacs.

8 years agocli/count: remove unused argument handling for output=modifications
David Bremner [Mon, 7 Sep 2015 13:08:25 +0000 (10:08 -0300)]
cli/count: remove unused argument handling for output=modifications

In the end this UI was rejected, but bits of it stayed in the code to
confuse future generations.

8 years agoutil: move strcase_equal and strcase_hash to util
Jani Nikula [Thu, 3 Sep 2015 19:40:01 +0000 (22:40 +0300)]
util: move strcase_equal and strcase_hash to util

For future use in both cli and lib.

8 years agocli: abstract new mailbox creation
Jani Nikula [Thu, 3 Sep 2015 19:39:58 +0000 (22:39 +0300)]
cli: abstract new mailbox creation

We'll be needing more mailbox creation soon, so abstract it
away. While at it, check for allocation failures. No other functional
changes.

8 years agocli: g_hash_table_lookup_extended is overkill
Jani Nikula [Thu, 3 Sep 2015 19:39:57 +0000 (22:39 +0300)]
cli: g_hash_table_lookup_extended is overkill

Switch to normal glib hash table lookup. The extended version is only
required if the values may contain NULL.

8 years agotest: fix whitespace/indentation in symbol-test
Jani Nikula [Fri, 4 Sep 2015 18:49:14 +0000 (21:49 +0300)]
test: fix whitespace/indentation in symbol-test

Not of much consequence, but makes it nicer to do further edits.

8 years agocli: reset db directory mtime upon directory removal
Jani Nikula [Sat, 5 Sep 2015 09:35:31 +0000 (12:35 +0300)]
cli: reset db directory mtime upon directory removal

The library does not have a function to remove a directory document
for a path. Usually this doesn't matter except for a slight waste of
space. However, if the same directory gets added to the filesystem
again, the old directory document is found with the old mtime. Reset
the directory mtime on removal to avoid problems.

The corner case that can hit this problem is renaming directories back
and forth. Renaming does not change the mtime of the directory in the
filesystem, and thus the old db directory document mtime may match the
fs mtime of the directory.

The long term fix might be to add a library function to remove a
directory document, however this is a much simpler and faster fix for
the time being.

8 years agoemacs: wrap current search in parens when filtering
Uli Scholler [Sun, 6 Sep 2015 21:29:05 +0000 (23:29 +0200)]
emacs: wrap current search in parens when filtering

When filtering the current search further with notmuch-search-filter,
wrap the current search in parens (if necessary).

This fixes unexpected behavior when the current search is
complex (like "(tag:this and date:one_week_ago..) or tag:that").

8 years agolib: constify argument to notmuch_database_status_string
David Bremner [Sun, 7 Jun 2015 15:02:00 +0000 (17:02 +0200)]
lib: constify argument to notmuch_database_status_string

We don't modify the database struct, so no harm in committing to that.

8 years agotest: move backup_database and restore_database to library
David Bremner [Sun, 7 Jun 2015 15:01:59 +0000 (17:01 +0200)]
test: move backup_database and restore_database to library

The plan is to re-use them in testing the same errors from the CLI

8 years agolib: note remaining uses of deprecated message search API
David Bremner [Sun, 7 Jun 2015 15:01:58 +0000 (17:01 +0200)]
lib: note remaining uses of deprecated message search API

The two remaining cases in the lib seem to require more than a simple
replacement of the old call, with the new call plus a check of the
return value.

8 years agolib: remove use of notmuch_query_search_messages from query.cc
David Bremner [Sun, 7 Jun 2015 15:01:57 +0000 (17:01 +0200)]
lib: remove use of notmuch_query_search_messages from query.cc

There is not too much point in worrying about the bad error reporting
here, because the count api is due for the same deprecation.

8 years agocli/lib: remove support for GMime 2.4
David Bremner [Sun, 16 Aug 2015 15:33:21 +0000 (17:33 +0200)]
cli/lib: remove support for GMime 2.4

It's becoming a maintenance burden to do anything things with the
crypto glue code twice, once for 2.4 and once for 2.6. I don't have
any 2.4 version available to test on my development machine anymore,
so the 2.4 specific code paths are likely not very well tested.

8 years agolib: Add "lastmod:" queries for filtering by last modification
Austin Clements [Mon, 13 Oct 2014 06:20:03 +0000 (02:20 -0400)]
lib: Add "lastmod:" queries for filtering by last modification

The implementation is essentially the same as the date range search
prior to Jani's fancy date parser.

8 years agocli: add global option "--uuid"
David Bremner [Sun, 5 Apr 2015 22:39:55 +0000 (07:39 +0900)]
cli: add global option "--uuid"

The function notmuch_exit_if_unmatched_db_uuid is split from
notmuch_process_shared_options because it needs an open notmuch
database.

There are two exceptional cases in uuid handling.

1) notmuch config and notmuch setup don't currently open the database,
   so it doesn't make sense to check the UUID.

2) notmuch compact opens the database inside the library, so we either
   need to open the database just to check uuid, or change the API.

8 years agocli/count: add --lastmod
David Bremner [Fri, 5 Jun 2015 06:16:17 +0000 (08:16 +0200)]
cli/count: add --lastmod

In the short term we need a way to get lastmod information e.g. for
the test suite. In the long term we probably want to add lastmod
information to at least the structured output for several other
clients (e.g. show, search).

8 years agolib: API to retrieve database revision and UUID
Austin Clements [Mon, 13 Oct 2014 06:20:02 +0000 (02:20 -0400)]
lib: API to retrieve database revision and UUID

This exposes the committed database revision to library users along
with a UUID that can be used to detect when revision numbers are no
longer comparable (e.g., because the database has been replaced).

8 years agolib: Add per-message last modification tracking
Austin Clements [Mon, 13 Oct 2014 06:20:01 +0000 (02:20 -0400)]
lib: Add per-message last modification tracking

This adds a new document value that stores the revision of the last
modification to message metadata, where the revision number increases
monotonically with each database commit.

An alternative would be to store the wall-clock time of the last
modification of each message.  In principle this is simpler and has
the advantage that any process can determine the current timestamp
without support from libnotmuch.  However, even assuming a computer's
clock never goes backward and ignoring clock skew in networked
environments, this has a fatal flaw.  Xapian uses (optimistic)
snapshot isolation, which means reads can be concurrent with writes.
Given this, consider the following time line with a write and two read
transactions:

   write  |-X-A--------------|
   read 1       |---B---|
   read 2                      |---|

The write transaction modifies message X and records the wall-clock
time of the modification at A.  The writer hangs around for a while
and later commits its change.  Read 1 is concurrent with the write, so
it doesn't see the change to X.  It does some query and records the
wall-clock time of its results at B.  Transaction read 2 later starts
after the write commits and queries for changes since wall-clock time
B (say the reads are performing an incremental backup).  Even though
read 1 could not see the change to X, read 2 is told (correctly) that
X has not changed since B, the time of the last read.  In fact, X
changed before wall-clock time A, but the change was not visible until
*after* wall-clock time B, so read 2 misses the change to X.

This is tricky to solve in full-blown snapshot isolation, but because
Xapian serializes writes, we can use a simple, monotonically
increasing database revision number.  Furthermore, maintaining this
revision number requires no more IO than a wall-clock time solution
because Xapian already maintains statistics on the upper (and lower)
bound of each value stream.

8 years agoconfigure: clean up messages around reading libnotmuch version
Jani Nikula [Mon, 10 Aug 2015 12:39:16 +0000 (15:39 +0300)]
configure: clean up messages around reading libnotmuch version

Clean up punctuation for consistency, and add newline for clean
configure output.

8 years agobuild: extract library versions from notmuch.h
David Bremner [Sun, 9 Aug 2015 14:25:41 +0000 (16:25 +0200)]
build: extract library versions from notmuch.h

- Make lib/notmuch.h the canonical location for the library versioning
information.

- Since the release-check should never fail now, remove it to reduce
complexity.

- Make the version numbers in notmuch.h consistent with the (now
  deleted) ones in lib/Makefile.local

8 years agotest: make script exit (1) if it "fails" to source (.) a file
Tomi Ollila [Thu, 6 Aug 2015 09:13:36 +0000 (12:13 +0300)]
test: make script exit (1) if it "fails" to source (.) a file

The files (test) scripts source (with builtin command `.`) provides
information which the scripts depend, and without the `source` to
succeed allowing script to continue may lead to dangerous situations
(e.g. rm -rf "${undefined_variable}"/*).

At the end of all source (.) lines construct ' || exit 1' was added;
In our case the script script will exit if it cannot find (or read) the
file to be sourced. Additionally script would also exits if the last
command of the sourced file exited nonzero.

8 years agoNEWS: emacs: notmuch-{cli,emacs}-version usage
Tomi Ollila [Wed, 5 Aug 2015 20:05:02 +0000 (23:05 +0300)]
NEWS: emacs: notmuch-{cli,emacs}-version usage

News for notmuch-emacs-version usage in User-Agent header and
rename of function notmuch-version to notmuch-cli-version.

While at it, made some minor (consistency) punctuation changes
to make news to wiki conversion work as expected.

8 years agoemacs/notmuch-mua.el: whitespace cleanup
David Bremner [Fri, 7 Aug 2015 19:33:57 +0000 (21:33 +0200)]
emacs/notmuch-mua.el: whitespace cleanup

M-x whitespace-cleanup in Emacs.

8 years agoemacs: make modifications to message Fcc vars buffer-local
David Bremner [Sat, 1 Aug 2015 09:44:56 +0000 (11:44 +0200)]
emacs: make modifications to message Fcc vars buffer-local

Previously we globally modified these variables, which tended to cause
problems for people using message-mode, but not notmuch-mua-mail, to
send mail.

User visible changes:

- Calling notmuch-fcc-header-setup is no longer optional. OTOH, it
  seems to do the right thing if notmuch-fcc-dirs is set to nil.

- The Fcc header is visible during message composition

- The name in the mode line is changed, and no longer matches exactly
  the menu label.

- Previously notmuch-mua-send-and-exit was never called.  Either we
  misunderstood define-mail-user-agent, or it had a bug.  So there was
  no difference if the user called message-send-and-exit directly. Now
  there will be.

- User bindings to C-c C-c and C-c C-s in message-mode-map are
  overridden. The user can override them in notmuch-message-mode-map,
  but then they're on their own for Fcc handling.

8 years agoemacs: define a notmuch-compose-mode based on message mode.
David Bremner [Sat, 1 Aug 2015 09:44:55 +0000 (11:44 +0200)]
emacs: define a notmuch-compose-mode based on message mode.

This is to provide a clean way of overriding e.g. keybindings when
sending mail from notmuch.

This is needed in particular to allow somewhere to dynamically bind
certain message-mode variables which are not respected when buffer-local. See e.g.

     http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21174

8 years agotest: add debugging output to notmuch-new tests, mark 5 as broken
David Bremner [Tue, 4 Aug 2015 06:48:34 +0000 (08:48 +0200)]
test: add debugging output to notmuch-new tests, mark 5 as broken

I marked the tests where I really couldn't understand the output as
broken. It could also be that I don't understand how directory removal
is supposed to work.

8 years agocli/new: add more debugging output
David Bremner [Tue, 4 Aug 2015 06:48:33 +0000 (08:48 +0200)]
cli/new: add more debugging output

Try to narrow down what part of the code adds files and directories to
the queue(s) to be deleted.

Update one test. The output is slightly confusing, but I believe it is
correct, resulting from a directory being discovered but containing only ignored files.

8 years agotest: don't claim single message mbox support is going away
David Bremner [Tue, 4 Aug 2015 06:48:32 +0000 (08:48 +0200)]
test: don't claim single message mbox support is going away

We gave up on this.

8 years agoemacs: prefer notmuch-emacs-version in User-Agent: header
Tomi Ollila [Sun, 2 Aug 2015 14:48:14 +0000 (17:48 +0300)]
emacs: prefer notmuch-emacs-version in User-Agent: header

Now that we have `notmuch-emacs-version' defined in notmuch emacs MUA
use that as a part of User-Agent: header to provide more accurate
version information when sending emails.

In case some incomplete installation of notmuch emacs MUA is used and
`notmuch-emacs-version' is defined as "unknown" then fall back to ask
version info from cli (as it used to be before this commit).

Requiring notmuch-version[.elc] and if that is missing setting
"fallback" notmuch-emacs-version (to "unknown") was moved from
notmuch.el to notmuch-lib.el as notmuch-mua.el (which provides
User-Agent: information) require's the latter.

8 years agoemacs: renamed function notmuch-version to notmuch-cli-version
Tomi Ollila [Sun, 2 Aug 2015 14:48:13 +0000 (17:48 +0300)]
emacs: renamed function notmuch-version to notmuch-cli-version

As it asks `notmuch` binary for its version number.

8 years agodevel/release-checks.sh: made python version check work with python 3
Tomi Ollila [Sun, 2 Aug 2015 09:48:25 +0000 (12:48 +0300)]
devel/release-checks.sh: made python version check work with python 3

This trivial change consists of just putting print() argument in
parentheses.

8 years agotest: use the python interpreter in sh.config
David Bremner [Sun, 2 Aug 2015 06:40:55 +0000 (08:40 +0200)]
test: use the python interpreter in sh.config

The configure script chooses "python" if both python and python{2,3}
exist exists, so this could change the version of python used to run
the test suite.

The checking for ${NOTMUCH_PYTHON} in the test suite is arguably
over-engineering, since the configure step will fail if it can't find
it.

8 years agoemacs: add a filter option to show
Mark Walters [Sat, 13 Jun 2015 08:08:09 +0000 (09:08 +0100)]
emacs: add a filter option to show

Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Bound to 'l' for "limit".

Note that it is not the same as filter in search mode as it replaces
the existing query rather than ANDing with it (but it does keep the
thread-id part of the query).

8 years agoemacs: split notmuch-show-apply-state
Mark Walters [Sat, 13 Jun 2015 08:08:08 +0000 (09:08 +0100)]
emacs: split notmuch-show-apply-state

Separate out a notmuch-show-goto-msg-id sub-function from
notmuch-show-apply-state. There should be no functional change but the
next patch will call the new function.

8 years agolib: add public accessor for database from query
David Bremner [Sun, 7 Jun 2015 15:01:56 +0000 (17:01 +0200)]
lib: add public accessor for database from query

This is to make it easier for clients of the library to update to the
new error code returning versions of notmuch_query_search_messages

8 years agolib: deprecate notmuch_query_search_{threads, messages}
David Bremner [Sun, 7 Jun 2015 15:01:55 +0000 (17:01 +0200)]
lib: deprecate notmuch_query_search_{threads, messages}

The CLI (and bindings) code should really be updated to use the new
status-code-returning versions. Here are some warnings to prod us (and
other clients) to do so.

8 years agolib: define NOTMUCH_DEPRECATED macro, document its use.
David Bremner [Sun, 7 Jun 2015 15:01:54 +0000 (17:01 +0200)]
lib: define NOTMUCH_DEPRECATED macro, document its use.

This has been tested with gcc and clang.

8 years agolib: Only sync modified message documents
Austin Clements [Fri, 5 Jun 2015 17:28:33 +0000 (19:28 +0200)]
lib: Only sync modified message documents

Previously, we updated the database copy of a message on every call to
_notmuch_message_sync, even if nothing had changed.  In particular,
this always happens on a thaw, so a freeze/thaw pair with no
modifications between still caused a database update.

We only modify message documents in a handful of places, so keep track
of whether the document has been modified and only sync it when
necessary.  This will be particularly important when we add message
revision tracking.

8 years agoconfigure: support --without-ruby
David Bremner [Thu, 30 Jul 2015 06:16:29 +0000 (08:16 +0200)]
configure: support --without-ruby

Apparently some ruby installs are broken in ways that prevent the ruby
bindings from building.

8 years agoconfigure: support --with-docs=no
David Bremner [Thu, 30 Jul 2015 06:08:31 +0000 (08:08 +0200)]
configure: support --with-docs=no

Since we promise --with-foo=no is equivalent to --without-foo

8 years agoconfigure: alphabetize --without help
David Bremner [Thu, 30 Jul 2015 06:00:55 +0000 (08:00 +0200)]
configure: alphabetize --without help

Now that the "without" options seem to be multiplying, try to make it
easier for people to find the one they want.

8 years agoconfigure: fix typo in comment
David Bremner [Thu, 30 Jul 2015 05:57:04 +0000 (07:57 +0200)]
configure: fix typo in comment

Some lazy person, probably me, forgot to press shift.

8 years agocli: enable notmuch --help command
David Bremner [Mon, 15 Jun 2015 15:46:44 +0000 (17:46 +0200)]
cli: enable notmuch --help command

This functionality seems to have been undocumented, if it ever
existed. Document it now.

8 years agodoc: whitespace cleanup for notmuch.rst
David Bremner [Tue, 28 Jul 2015 18:24:43 +0000 (20:24 +0200)]
doc: whitespace cleanup for notmuch.rst

replace leading spaces with tabs

8 years agobuild: add "set -eu" to version script generation
David Bremner [Mon, 27 Jul 2015 18:42:32 +0000 (20:42 +0200)]
build: add "set -eu" to version script generation

It turns out that on certain systems like FreeBSD, c++filt is not
installed by default. It's basically OK if we fail the build in that
case, but what's really not OK is for the build to continue and
generate bad binaries.

8 years agoconfigure: whitespace cleanup
David Bremner [Tue, 28 Jul 2015 13:29:38 +0000 (15:29 +0200)]
configure: whitespace cleanup

This is the result of running M-x whitespace-cleanup in emacs.  In
particular this replaces some spaces at the beginning of lines with
tabs.

8 years agoconfigure: add --without-docs switch
Mikhail [Mon, 27 Jul 2015 18:04:37 +0000 (21:04 +0300)]
configure: add --without-docs switch

Previously documentation was build automatically if sphinx/doxygen
executable were found. The switch is used to unconditionally disable
sphinx/doxygen detection and therefor, building of documentation
(including man pages).

8 years agoreplace hardcoded "python" with configured python command
David Bremner [Fri, 10 Jul 2015 16:13:28 +0000 (18:13 +0200)]
replace hardcoded "python" with configured python command

Thanks to FreeBSD port maintainer Mikhail for report and the original
the original patch.

This is the right thing (TM) and also apparently fixes the build on
FreeBSD.

8 years agoFix documentation for notmuch--tag-hook functions
Daniel Schoepe [Tue, 16 Jun 2015 21:47:20 +0000 (23:47 +0200)]
Fix documentation for notmuch--tag-hook functions

The second argument to notmuch-tag is now called tag-changes, but the
documentation for notmuch-before-tag-hook and notmuch-after-tag-hook
still used the old argument name `tags'. This resulted in broken hooks
when following the documentation.

8 years agoMerge tag '0.20.2'
David Bremner [Sat, 27 Jun 2015 13:29:52 +0000 (15:29 +0200)]
Merge tag '0.20.2'

notmuch 0.20.2 release

Conflicts:
NEWS

8 years agoversion: update to 0.20.2 0.20.2 debian/0.20.2-1
David Bremner [Sat, 27 Jun 2015 13:05:31 +0000 (15:05 +0200)]
version: update to 0.20.2

As usual, bump python version at same time.

8 years agodebian: update changelog for 20.2-1
David Bremner [Sat, 27 Jun 2015 13:04:16 +0000 (15:04 +0200)]
debian: update changelog for 20.2-1

Actual changes are documented in the bug.

8 years agoNEWS for 0.20.2
David Bremner [Sat, 27 Jun 2015 12:47:38 +0000 (14:47 +0200)]
NEWS for 0.20.2

Just the one bug fix

8 years agoemacs: tree: mark read change
Mark Walters [Tue, 9 Jun 2015 09:51:07 +0000 (10:51 +0100)]
emacs: tree: mark read change

The mark read code for tree mode did not get updated in the recent
changes. This updates it to match. Since the user can customize the
mark read logic we just call the show logic in the message pane.

8 years agotest: add initial ruby tests
David Bremner [Mon, 1 Jun 2015 07:09:02 +0000 (09:09 +0200)]
test: add initial ruby tests

This is pretty much a line by line translation of the existing python
tests, with two new tests for the count API.

8 years agobuild/ruby: use notmuch configure script values for shared lib
David Bremner [Mon, 1 Jun 2015 07:09:01 +0000 (09:09 +0200)]
build/ruby: use notmuch configure script values for shared lib

This is supposed to help build on systems like MacOS with different
conventions for naming shared libraries. We have already computed the
relevant names, so doing it again in ruby seems like a bad idea.

8 years agolib, ruby: make use of -Wl,--no-undefined configurable
David Bremner [Mon, 1 Jun 2015 07:09:00 +0000 (09:09 +0200)]
lib, ruby: make use of -Wl,--no-undefined configurable

In particular this is supposed to help build on systems (presumably
using a non-gnu ld) where this flag is not available.

8 years agoemacs search: stash query
Mark Walters [Fri, 12 Jun 2015 08:15:32 +0000 (09:15 +0100)]
emacs search: stash query

Add keybinding c q to stash the current query in search mode.

8 years agobuild: integrate building ruby bindings into notmuch build process
David Bremner [Mon, 1 Jun 2015 07:08:59 +0000 (09:08 +0200)]
build: integrate building ruby bindings into notmuch build process

Because ruby generates a Makefile, we have to use recursive make.
Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
in the parent directory.

8 years agolib: reject relative paths in n_d_{create,open}_verbose
David Bremner [Mon, 8 Jun 2015 06:02:22 +0000 (08:02 +0200)]
lib: reject relative paths in n_d_{create,open}_verbose

There are many places in the notmuch code where the path is assumed to be absolute. If someone (TM) wants a project, one could remove these assumptions. In the mean time, prevent users from shooting themselves in the foot.

Update test suite mark tests for this error as no longer broken, and
also convert some tests that used relative paths for nonexistent
directories.

8 years agolib: add NOTMUCH_STATUS_PATH_ERROR
David Bremner [Wed, 10 Jun 2015 05:58:44 +0000 (07:58 +0200)]
lib: add NOTMUCH_STATUS_PATH_ERROR

The difference with FILE_ERROR is that this is for things that are
wrong with the path before looking at the disk.

Add some 3 tests; two broken as a reminder to actually use this new
code.

8 years agorelease-checks: check that git working directory is clean
Tomi Ollila [Tue, 2 Jun 2015 14:43:45 +0000 (17:43 +0300)]
release-checks: check that git working directory is clean

Before release check that there are no uncommitted changes and
that there are no files in working directory that possibly should
have been added to the repository.

Amended by db: remove --ignored, since that seems like too much
trouble.

8 years agotest: redirect man output to /dev/null
David Bremner [Sat, 23 May 2015 20:28:47 +0000 (22:28 +0200)]
test: redirect man output to /dev/null

In the case the these tests fail, they generate a bunch of output;
this output is not very interesting because it is just the successful
output of a man page. It does however make it hard to see what tests are actually failing, even with NOTMUCH_TEST_QUIET

8 years agoconfigure: add ability to force python version via environment
David Bremner [Sat, 23 May 2015 20:28:45 +0000 (22:28 +0200)]
configure: add ability to force python version via environment

This is makes it a bit easier to run our test suite under alternative
python versions.

8 years agotest: make python tests compatible with python3
David Bremner [Sat, 23 May 2015 20:28:44 +0000 (22:28 +0200)]
test: make python tests compatible with python3

Making the test suite actually run them with python3 is left for
future work.

8 years agodoc: add minimal note about shared options.
David Bremner [Thu, 4 Jun 2015 05:32:42 +0000 (07:32 +0200)]
doc: add minimal note about shared options.

The example is a bit silly, but notmuch subcommand --help is actually
not equivalent to "notmuch --help subcommand".

8 years agoMerge branch 'release'
David Bremner [Tue, 2 Jun 2015 04:37:59 +0000 (06:37 +0200)]
Merge branch 'release'

20.1 plus NEWS fixup