]> git.notmuchmail.org Git - notmuch/log
notmuch
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

8 years agoNEWS: missing NEWS for 20.1
David Bremner [Tue, 2 Jun 2015 04:34:48 +0000 (06:34 +0200)]
NEWS: missing NEWS for 20.1

Embarrassingly, these were not included in the actual 20.1 release

8 years agodebian: change stanza for 0.20.1 0.20.1
David Bremner [Mon, 1 Jun 2015 20:00:11 +0000 (22:00 +0200)]
debian: change stanza for 0.20.1

8 years agoversion: bump to 20.1
David Bremner [Mon, 1 Jun 2015 19:47:35 +0000 (21:47 +0200)]
version: bump to 20.1

8 years agocli: add standard option processing to config, help and setup
David Bremner [Sun, 5 Apr 2015 20:34:55 +0000 (05:34 +0900)]
cli: add standard option processing to config, help and setup

In particular this fixes a recently encountered bug where the
"--config" argument to "notmuch setup" is silently ignored, which the
unpleasant consequence of overwriting the users config file.

8 years agocli: define shared options, use for --help and --version
David Bremner [Sun, 5 Apr 2015 13:13:03 +0000 (22:13 +0900)]
cli: define shared options, use for --help and --version

Unfortunately it seems trickier to support --config globally

The non-trivial changes are in notmuch.c; most of the other changes
consists of blindly inserting two lines into every subcommand.

8 years agocli: refactor notmuch_help_command
David Bremner [Sun, 5 Apr 2015 14:59:18 +0000 (23:59 +0900)]
cli: refactor notmuch_help_command

Create a new private entry point _help_for so that we can call help
without simulating a command line invokation to set up the arguments.

8 years agocli: ignore config argument of notmuch_help_command
David Bremner [Sun, 5 Apr 2015 13:24:42 +0000 (22:24 +0900)]
cli: ignore config argument of notmuch_help_command

We call it with NULL at one point anyway, so it needs to work with
NULL. Since the only place we use talloc is right before exec, there
is no harm in always using NULL.

8 years agocli: change "setup" to "set up" where used as a verb
J. Lewis Muir [Wed, 27 May 2015 17:53:52 +0000 (12:53 -0500)]
cli: change "setup" to "set up" where used as a verb

The word "setup" is a noun, not a verb.  Change occurrences of "setup"
where used as a verb to "set up".

8 years agoemacs: Added "is:<tag>" style completion to notmuch-read-query.
Charles Celerier [Sat, 27 Dec 2014 09:18:27 +0000 (10:18 +0100)]
emacs: Added "is:<tag>" style completion to notmuch-read-query.

The notmuch-search-terms man page states that "tag:<tag>" is equivalent
to "is:<tag>". Completion for "is:<tag>" style searches is now supported
in the Emacs interface.

Amended by David Bremner: combine lexical-let and let into
lexical-let*

8 years agotest: remove redundant 'file' command from gdb scripts.
David Bremner [Sun, 31 May 2015 16:56:10 +0000 (18:56 +0200)]
test: remove redundant 'file' command from gdb scripts.

Quoting Debian bug 787341

   It failed to build on arm64: the last ten tests in T070-insert
   failed.

   What's happening here is that GDB is segfaulting in response to
   the
   "file" command. GDB on arm64 can be a bit buggy.

   However, the "file" command is redundant here as GDB has already
   got
   the file from the --args on the command line.

8 years agoMerge tag '0.20'
David Bremner [Sun, 31 May 2015 10:06:40 +0000 (12:06 +0200)]
Merge tag '0.20'

notmuch 0.20 release

8 years agoNEWS: bump date 0.20
David Bremner [Sun, 31 May 2015 09:26:41 +0000 (11:26 +0200)]
NEWS: bump date

8 years agodebian: changelog stanza for 0.20-1
David Bremner [Sun, 31 May 2015 09:22:34 +0000 (11:22 +0200)]
debian: changelog stanza for 0.20-1

8 years agoversion: bump to 0.20
David Bremner [Sun, 31 May 2015 09:13:56 +0000 (11:13 +0200)]
version: bump to 0.20

8 years agodrop mention of notmuch-emacs-mua
David Bremner [Sun, 31 May 2015 09:12:13 +0000 (11:12 +0200)]
drop mention of notmuch-emacs-mua

8 years agoMerge tag '0.20_rc2'
David Bremner [Sat, 23 May 2015 19:27:41 +0000 (21:27 +0200)]
Merge tag '0.20_rc2'

notmuch 0.20~rc2 release

8 years agodebian: changelog stanza for 0.20~rc2-1
David Bremner [Sat, 23 May 2015 19:05:25 +0000 (21:05 +0200)]
debian: changelog stanza for 0.20~rc2-1

8 years agoversion: bump to 0.20~rc2
David Bremner [Sat, 23 May 2015 19:03:30 +0000 (21:03 +0200)]
version: bump to 0.20~rc2

8 years agopython: use absolute import for SOVERSION
David Bremner [Sat, 9 May 2015 06:13:50 +0000 (08:13 +0200)]
python: use absolute import for SOVERSION

Apparently python3 needs this.

8 years agodocs: initial draft of NEWS for 0.20
David Bremner [Fri, 1 May 2015 14:54:57 +0000 (23:54 +0900)]
docs: initial draft of NEWS for 0.20

This is meant as much to jog people's memory as to be definitive.

8 years agoconfigure: Add sanity checking for environment variables
David Bremner [Tue, 19 May 2015 20:48:24 +0000 (22:48 +0200)]
configure: Add sanity checking for environment variables

Passing in environment variables incompatible with the compiler may
cause other parts of the configure script to fail in hard to
understand ways, so we abort early.

8 years agoMerge tag '0.20_rc1'
David Bremner [Mon, 4 May 2015 08:47:22 +0000 (10:47 +0200)]
Merge tag '0.20_rc1'

notmuch 0.20~rc1 release

8 years agodebian: add new symbols to libnotmuch4.symbols
David Bremner [Mon, 4 May 2015 08:18:43 +0000 (10:18 +0200)]
debian: add new symbols to libnotmuch4.symbols

Since we only add new symbols, no SONAME bump is needed.

8 years agodebian: call upstream configure script directly
David Bremner [Mon, 4 May 2015 07:43:52 +0000 (09:43 +0200)]
debian: call upstream configure script directly

dh defaults for dh_auto_configure are now incompatible with notmuch's
homebrew configure script (at least in debian experimental)

8 years agoversion: bump to 0.20~rc1
David Bremner [Mon, 4 May 2015 06:09:43 +0000 (08:09 +0200)]
version: bump to 0.20~rc1

8 years agodebian: changelog stanza for 0.20~rc1
David Bremner [Mon, 4 May 2015 06:08:43 +0000 (08:08 +0200)]
debian: changelog stanza for 0.20~rc1

8 years agonotmuch-mutt: fix xargs/ln usage for OpenBSD compatibility
Jack Peirce [Fri, 1 May 2015 08:32:05 +0000 (10:32 +0200)]
notmuch-mutt: fix xargs/ln usage for OpenBSD compatibility

- xargs: use -r flag instead of --no-run-if-empty
- ln: use -I flag/3rd form of ln command instead of -t flag/4th form

Signed-off-by: Stefano Zacchiroli <zack@upsilon.cc>
9 years agotest: move nonexistent directory to something under notmuch's control.
David Bremner [Tue, 7 Apr 2015 12:10:15 +0000 (21:10 +0900)]
test: move nonexistent directory to something under notmuch's control.

Apparently some systems actually have a directory called /nonexist[ae]nt.
It's hard to fathom a good reason for that, but oh well. As long as we
don't create such a directory inside the notmuch source tree, the new
version should be more robust.

9 years agotest: be consistent about spelling `nonexistent'
David Bremner [Wed, 8 Apr 2015 14:31:43 +0000 (23:31 +0900)]
test: be consistent about spelling `nonexistent'

Apparently most of the misspellings are my fault.

9 years agoemacs: show: hide large text attachments by default
Mark Walters [Sat, 28 Mar 2015 11:08:59 +0000 (11:08 +0000)]
emacs: show: hide large text attachments by default

notmuch-show can be slow displaying large attachments so hide them by
default. The default maximum size is 10000 bytes/characters but it is
customizable.

Note that notmuch-show-insert-bodypart is also called from the reply
code so we need to be a little careful.

9 years agotest/thread-order: more robust loop exit in case of broken input
Tomi Ollila [Sun, 29 Mar 2015 15:30:36 +0000 (18:30 +0300)]
test/thread-order: more robust loop exit in case of broken input

When creating $THREADS data it may end of not having 'None' at all
or the numbers in line output yields a loop.

To avoid loop the value in current array index is set to 'None'
so that if the same item is reached again the loop will end.

Also empty string as next array index will end the loop.

9 years agonotmuch-emacs-mua: non-forking escape () usage with backslash '\' escape
Tomi Ollila [Sun, 29 Mar 2015 16:37:34 +0000 (19:37 +0300)]
notmuch-emacs-mua: non-forking escape () usage with backslash '\' escape

Use the printf -v convention to give output variable as argument
to escape () function so no subshell needs to be executed for
escaping input. The '-v' option to escape () is just syntactic
sugar for better understanding.

Also, backslash is now escaped with another backslash for emacs. This
ie especially important at the end of string.

`echo` is no longer used to write escaped output -- it might interpret
the escapes itself.

9 years agonmbug-status: Use 'show-ref --heads' for loading configs
W. Trevor King [Sun, 22 Mar 2015 22:51:41 +0000 (15:51 -0700)]
nmbug-status: Use 'show-ref --heads' for loading configs

When loading configs from Git, the bare branch name (without a
refs/heads/ prefix or similar) matches all branches of that name
(including remote-tracking branches):

  .nmbug $ git show-ref config
  48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/heads/config
  48f3bbf1d1492e5f3d2f01de6ea79a30d3840f20 refs/remotes/origin/config
  4b6dbd9ffd152e7476f5101eff26747f34497cee refs/remotes/wking/config

Instead of relying on the ordering of the matching references, use
--heads to ensure we only match local branches.

9 years agoNEWS: fix 'not' -> 'now' typo in 0.19 nmbug section
W. Trevor King [Sat, 28 Mar 2015 15:46:40 +0000 (08:46 -0700)]
NEWS: fix 'not' -> 'now' typo in 0.19 nmbug section

9 years agotest: make one error output test more robust.
David Bremner [Sun, 29 Mar 2015 07:39:46 +0000 (09:39 +0200)]
test: make one error output test more robust.

Since notmuch_database_status_string can return NULL, passing it
directly to fputs is not a good idea.

9 years agotest: add more error reporting tests
David Bremner [Sat, 28 Mar 2015 23:24:38 +0000 (00:24 +0100)]
test: add more error reporting tests

This second half of the error reporting tests actually uses the function
notmuch_database_status_string to retrieve the last logged error

9 years agolib: eliminate fprintf from _notmuch_message_file_open
David Bremner [Fri, 26 Dec 2014 17:34:49 +0000 (18:34 +0100)]
lib: eliminate fprintf from _notmuch_message_file_open

You may wonder why _notmuch_message_file_open_ctx has two parameters.
This is because we need sometime to use a ctx which is a
notmuch_message_t. While we could get the database from this, there is
no easy way in C to tell type we are getting.

9 years agolib: replace almost all fprintfs in library with _n_d_log
David Bremner [Fri, 26 Dec 2014 16:25:35 +0000 (17:25 +0100)]
lib: replace almost all fprintfs in library with _n_d_log

This is not supposed to change any functionality from an end user
point of view. Note that it will eliminate some output to stderr. The
query debugging output is left as is; it doesn't really fit with the
current primitive logging model. The remaining "bad" fprintf will need
an internal API change.

9 years agolib: add private function to extract the database for a message.
David Bremner [Fri, 26 Dec 2014 16:16:12 +0000 (17:16 +0100)]
lib: add private function to extract the database for a message.

This is needed by logging in functions outside message.cc that take
only a notmuch_message_t object.

9 years agolib: add a log function with output to a string in notmuch_database_t
David Bremner [Fri, 26 Dec 2014 08:01:01 +0000 (09:01 +0100)]
lib: add a log function with output to a string in notmuch_database_t

In principle in the future this could do something fancier than
asprintf.

9 years agolib: add "verbose" versions of notmuch_database_{open,create}
David Bremner [Sat, 27 Dec 2014 18:12:49 +0000 (19:12 +0100)]
lib: add "verbose" versions of notmuch_database_{open,create}

The compatibility wrapper ensures that clients calling
notmuch_database_open will receive consistent output for now.

The changes to notmuch-{new,search} and test/symbol-test are just to
make the test suite pass.

The use of IGNORE_RESULT is justified by two things. 1) I don't know
what else to do.  2) asprintf guarantees the output string is NULL if
an error occurs, so at least we are not passing garbage back.

9 years agotest: add error reporting tests
David Bremner [Sat, 14 Mar 2015 08:50:55 +0000 (09:50 +0100)]
test: add error reporting tests

This first half of the tests is all that don't need to retrieve the
the error string explicitly from the notmuch database structure.

9 years agotest: add support for compiling and running C snippets
David Bremner [Sat, 14 Mar 2015 08:02:03 +0000 (09:02 +0100)]
test: add support for compiling and running C snippets

This is to limit the copy-pasta involved in running C tests. I decided
to keep things simple and not try to provide an actual C skeleton.

The setting of LD_LIBRARY_PATH is to force using the built libnotmuch
rather than any potential system one.

9 years agotest: Add two tests for error output from notmuch_database_open
David Bremner [Sat, 14 Mar 2015 07:32:22 +0000 (08:32 +0100)]
test: Add two tests for error output from notmuch_database_open

This is arguably testing the same thing twice, but in the brave new
future where we don't use printf anymore, each subcommand will be
responsible for handling the output on it's own.

9 years agonmbug-status: Clarify errors for illegible configs
W. Trevor King [Sat, 10 May 2014 19:16:38 +0000 (12:16 -0700)]
nmbug-status: Clarify errors for illegible configs

Carl Worth pointed out that errors like:

  $ ./nmbug-status
  fatal: Not a git repository: '/home/cworth/.nmbug'
  fatal: Not a git repository: '/home/cworth/.nmbug'
  Traceback (most recent call last):
    File "./nmbug-status", line 254, in <module>
      config = read_config(path=args.config)
    File "./nmbug-status", line 73, in read_config
      return json.load(fp)
    File "/usr/lib/python2.7/json/__init__.py", line 290, in load
      **kw)
    File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
      return _default_decoder.decode(s)
    File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
      raise ValueError("No JSON object could be decoded")
  ValueError: No JSON object could be decoded

are not particularly clear.  With this commit, we'll get output like:

  $ ./nmbug-status
  fatal: Not a git repository: '/home/wking/.nmbug'
  No local branch 'config' in /home/wking/.nmbug.  Checkout a local
  config branch or explicitly set --config.

which is much more accessible.  I've also added user-friendly messages
for a number of other config-parsing errors.

9 years agolib: make notmuch_query_count_messages explicitely exact
Jani Nikula [Tue, 14 Oct 2014 16:32:54 +0000 (19:32 +0300)]
lib: make notmuch_query_count_messages explicitely exact

The default is actually exact if no checkatleast parameter is
specified. This change makes that explicit, mainly for documentation,
but also to be safe in the unlikely event of a change of default.

[ commit message rewritten by db based on id:87lho0nlkk.fsf@nikula.org
]

9 years agocompletion: complete addresses in from:/to: search terms
Jani Nikula [Sat, 7 Mar 2015 12:44:42 +0000 (14:44 +0200)]
completion: complete addresses in from:/to: search terms

Use the new notmuch address command to do completion for addresses in
from: and to:. Use --output=sender for both for efficiency, even
though --output=recipients would be more accurate for to: prefix
completion.

9 years agocli: add support for notmuch command --help
Jani Nikula [Sun, 8 Mar 2015 16:18:55 +0000 (18:18 +0200)]
cli: add support for notmuch command --help

Recognize 'notmuch command --help' at the top level as a special case,
and show help for the command. Note that for simplicity, --help is
only recognized as the first option for the subcommand.

9 years agocli: fix top level --help combined with other options
Jani Nikula [Sun, 8 Mar 2015 16:18:54 +0000 (18:18 +0200)]
cli: fix top level --help combined with other options

If the top level --help is combined with other options, help
fails. For example:

    $ notmuch --version --help

    Sorry, --help is not a known command. There's not much I can do to help.

Fix this by adjusting argc and argv appropriately. The help command
ignores argv[0] anyway, so we don't have to set it to "help".

9 years agoCLI: make gpg binary used by libgmime configurable.
David Bremner [Tue, 9 Dec 2014 20:01:11 +0000 (21:01 +0100)]
CLI: make gpg binary used by libgmime configurable.

Previously we set up a way for the top level notmuch command to choose
which gpg binary was invoked by libgmime. In this commit we add the
(mostly boilerplate) code to allow the notmuch-config command to read
and write this path, and use it in the appropriate struct.

Update tests for new default variable

9 years agoCLI: set up infrastructure to make path to gpg configurable.
David Bremner [Tue, 9 Dec 2014 20:01:10 +0000 (21:01 +0100)]
CLI: set up infrastructure to make path to gpg configurable.

GMIME takes a path to gpg, but we hardcode that path.  In this commit
we set up argument passing and option storage to allow this path to
specified in the top level notmuch command.

9 years agopython: replace hardcoding of SONAME version
David Bremner [Sat, 7 Mar 2015 07:31:14 +0000 (08:31 +0100)]
python: replace hardcoding of SONAME version

Failing to update this string in globals.py causes failures when the
SONAME changes.  In order to hopefully reduce the number of such
errors, automate the process of setting the SONAME in the python
bindings.

9 years agoman: fix notmuch-emacs-mua environment section
Jani Nikula [Sat, 7 Mar 2015 14:30:20 +0000 (16:30 +0200)]
man: fix notmuch-emacs-mua environment section

It's emacsclient command, not comment. Document default values. While
at it, format the environment section similarly to other man pages.

9 years agonotmuch-emacs-mua: remove -C to keep short options compatible with mutt
Jani Nikula [Sat, 7 Mar 2015 14:30:19 +0000 (16:30 +0200)]
notmuch-emacs-mua: remove -C to keep short options compatible with mutt

Notmuch uses long options exclusively all around. The short options in
notmuch-emacs-mua are intentionally just a compatible subset of
mutt(1). Keep it this way, if only to make documenting the fact easy!

The Notmuch style --client long option remains, of course.

9 years agogo: add binding for notmuch_message_get_date
Trevor Jim [Sat, 7 Mar 2015 20:23:51 +0000 (15:23 -0500)]
go: add binding for notmuch_message_get_date

9 years agolib: bump library minor version
David Bremner [Sat, 7 Mar 2015 14:49:00 +0000 (15:49 +0100)]
lib: bump library minor version

This should have happened in commit 326e18856, but it didn't.

9 years agoparse-time-string: fix setting and rounding of seconds
Jani Nikula [Mon, 2 Mar 2015 17:47:04 +0000 (19:47 +0200)]
parse-time-string: fix setting and rounding of seconds

If seconds are not specified in the string to be parsed, they're not
set according to the reference time (in the no rounding case) nor
rounded properly (in the rounding up cases). Fix this.

The bug caused searches such as date:10:30..10:30 to match messages
with date exactly 10:30:00 only, and not in range 10:30:00..10:30:59
(inclusive) as documented.

Note that date searches referring "noon" or "5pm" will still be
interpreted as exact to the second.

9 years agotest: extract and flag second rounding tests as broken
Jani Nikula [Mon, 2 Mar 2015 17:47:03 +0000 (19:47 +0200)]
test: extract and flag second rounding tests as broken

Extract and add some more tests relating to rounding seconds into a
separate subtest, and flag it as broken. If seconds are not specified,
the time is not set or rounded according to the interface defined in
parse-time-string/parse-time-string.h. Instead, seconds are always set
to 00 in reality, which is broken.

9 years agotest: add some more time tests
Jani Nikula [Mon, 2 Mar 2015 17:47:02 +0000 (19:47 +0200)]
test: add some more time tests

Ensure the seconds are set properly.

9 years agotest: improve the time parsing tests
Jani Nikula [Mon, 2 Mar 2015 17:47:01 +0000 (19:47 +0200)]
test: improve the time parsing tests

Set the reference time to 12:13:14 instead of 11:11:00 to ensure hours
and minutes are not mixed up, and seconds are really set instead of
defaulted to 00.

9 years agocompletion: update list of commands in zsh completion.
David Bremner [Sat, 10 Jan 2015 10:23:03 +0000 (11:23 +0100)]
completion: update list of commands in zsh completion.

This is actually generated by the script in

     id:1420289900-29717-2-git-send-email-david@tethera.net

We may as well update the list of commands while we decide if it's
worth automating the process. Note that there is a bit more noise than
expected because it alphabetizes all of the commands with their own
man pages.

9 years agocli: add a tool for starting new message in the emacs ui
Jani Nikula [Sun, 22 Feb 2015 20:34:44 +0000 (21:34 +0100)]
cli: add a tool for starting new message in the emacs ui

Add a tool to start composing an email in the Notmuch Emacs UI with
the specified subject, recipients, and message body.

9 years agolib: make notmuch shared library install_name be full path on Mac OS X
J. Lewis Muir [Wed, 4 Mar 2015 22:32:49 +0000 (16:32 -0600)]
lib: make notmuch shared library install_name be full path on Mac OS X

The install_name of libnotmuch.dylib on Mac OS X is what is written
into a program that links against it.  If it is just the name of the
shared library file, as opposed to the full path, the program won't be
able to find it when it runs and will abort.  Instead, the install_name
should be the full path to the shared library (in its final installed
location).

Why does Notmuch work without this patch when installed via Homebrew?
The answer is twofold.  One, /usr/local/lib is a special location in
which the dynamic linker will look by default to find shared libraries.
Homebrew highly recommends installing to /usr/local, and, assuming it
has been configured this way, the Notmuch library will end up installed
in /usr/local/lib, and the dynamic linker will find it.  Two, Homebrew
globally corrects all install names in dynamically shared libraries and
binaries for each package it installs.  So, even if the install names in
a package's binaries and libraries are incorrect, Homebrew corrects them
automatically, and no one ever knows.

Why does Notmuch work without this patch when installed via MacPorts?
The answer is that MacPorts applies a patch just like this patch to fix
the same problem.

9 years agolib: bump SONAME minor version
David Bremner [Sat, 28 Feb 2015 08:38:26 +0000 (09:38 +0100)]
lib: bump SONAME minor version

This indicates upwardly compatible changes, namely adding new symbols.

Although we don't formally need to do this until the next release,
there is no hard in doing it now, as long as we don't bump the minor
version for every addition between now and the release.

9 years agolib: add new status reporting API for notmuch_query_search_{m,t}
David Bremner [Tue, 20 Jan 2015 07:53:41 +0000 (08:53 +0100)]
lib: add new status reporting API for notmuch_query_search_{m,t}

This at least allows distinguishing between out of memory and Xapian
exceptions. Adding finer grained status codes would allow different
Xapian exceptions to be preserved.

Adding wrappers allows people to transition gradually to the new API,
at the cost of bloating the library API a bit.

9 years agocli: fix clang build warnings
Jani Nikula [Mon, 23 Feb 2015 16:56:16 +0000 (18:56 +0200)]
cli: fix clang build warnings

Fix the following warning produced by clang 3.5.0:

notmuch-search.c:730:25: warning: initializing 'void *' with an
expression of type 'const notmuch_opt_desc_t (*)[4]' discards
qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        { NOTMUCH_OPT_INHERIT, &common_options, NULL, 0, 0 },
                               ^~~~~~~~~~~~~~~
1 warning generated.

9 years agolib: fix clang build warnings
Jani Nikula [Mon, 23 Feb 2015 16:56:15 +0000 (18:56 +0200)]
lib: fix clang build warnings

Fix the following warning produced by clang 3.5.0:

lib/message.cc:899:4: warning: comparison of constant 64 with expression of type 'notmuch_message_flag_t' (aka '_notmuch_message_flag') is always true [-Wtautological-constant-out-of-range-compare]
        ! NOTMUCH_TEST_BIT (message->lazy_flags, flag))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/notmuch-private.h:70:6: note: expanded from macro 'NOTMUCH_TEST_BIT'
    (_NOTMUCH_VALID_BIT(bit) ? !!((val) & (1ull << (bit))) : 0)
     ^~~~~~~~~~~~~~~~~~~~~~~
./lib/notmuch-private.h:68:26: note: expanded from macro '_NOTMUCH_VALID_BIT'
    ((bit) >= 0 && (bit) < CHAR_BIT * sizeof (unsigned long long))
                   ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~