]> git.notmuchmail.org Git - notmuch/log
notmuch
10 years agodoc: Fix parallel build of roff files
Austin Clements [Thu, 17 Apr 2014 20:34:57 +0000 (16:34 -0400)]
doc: Fix parallel build of roff files

The roff build rule builds all of the roff files in a single command.
Previously, this was expressed as a multi-target rule, but since this
is equivalent to specifying a copy of the rule for each target, make
-jN could start up to N parallel instances of this command.  Fix this
by bottlenecking this rule through a single stamp file.

This also removes the unused man.stamp from CLEAN.

10 years agoNEWS: notmuch-init-file and notmuch-emacs-version related news
Tomi Ollila [Mon, 14 Apr 2014 18:32:35 +0000 (21:32 +0300)]
NEWS: notmuch-init-file and notmuch-emacs-version related news

Along with those, removed trailing space from subsection title.

10 years agoNEWS: Document the recent 'nmbug clone' and @{upstream} changes
W. Trevor King [Tue, 15 Apr 2014 21:03:56 +0000 (14:03 -0700)]
NEWS: Document the recent 'nmbug clone' and @{upstream} changes

The changes landed with c200167 (nmbug: Add 'clone' and replace
FETCH_HEAD with @{upstream}, 2014-03-09).

The preferred markup language for NEWS seems to be Markdown, which is
parsed by devel/news2wiki.pl into Markdown chunks for rendering by
ikiwiki [1].

[1]: http://notmuchmail.org/news/

10 years agotest: use test_expect_equal for PATH test, update message
David Bremner [Sun, 13 Apr 2014 12:42:49 +0000 (09:42 -0300)]
test: use test_expect_equal for PATH test, update message

- The old test was quite impossible to debug; the new one shows the difference
  between the two directories, if any.

- "repository" doesn't make sense for out of tree builds. Or tarball
  builds, for that matter.

10 years agonmbug: mark repository as bare on clone
David Bremner [Sat, 12 Apr 2014 16:30:32 +0000 (13:30 -0300)]
nmbug: mark repository as bare on clone

If a git repository is non-bare, and core.worktree is not set, git
tries to deduce the worktree. This deduction is not always helpful, e.g.

% git --git-dir=$HOME/.nmbug clean -f

would likely delete most of the files in the current directory

10 years agoNEWS: document possible breakage from saved-search format change
Mark Walters [Sat, 12 Apr 2014 12:46:27 +0000 (13:46 +0100)]
NEWS: document possible breakage from saved-search format change

If the user has unsorted or alphabetically sorted saved-searches these
should continue to work. If they have some custom lisp sort function
then it will need updating to work with the new saved-sort
format. Document this, and how the updating should be done.

Also roll in fixes for the markdown in the first part of the NEWS
suggested by Tomi: change `just work' to *just work* and removed
periods from the end of subtitle lines.

10 years agoemacs: hello: bugfix: make alphabetically sorted saved searches work
Mark Walters [Sat, 12 Apr 2014 12:46:26 +0000 (13:46 +0100)]
emacs: hello: bugfix: make alphabetically sorted saved searches work

My recent changes to the saved search format broke the alphabetically
sorted saved sort option. This makes it work again.

Also update docs for saved-search sort defcustom to match the new
format.

Finally, since the saved-search list is no longer an alist change the
names in the sort function to avoid confusion.

10 years agoemacs: remove auto-signing of replies to signed messages
Jameson Graef Rollins [Mon, 14 Apr 2014 19:40:50 +0000 (12:40 -0700)]
emacs: remove auto-signing of replies to signed messages

It was decided that auto-signing is potentially too troublesome for the
apparently common case of users who enable crypto processing for the
purpose of checking signature validity but who are not in a position to
sign out-going messages.  Users can still manually invoke signing as needed.

Encrypting replies to encrypted messages is more of a security issue
so we leave it in place.

10 years agoemacs: add $(srcdir) to notmuch-version.el.tmpl dependency
Tomi Ollila [Sat, 12 Apr 2014 11:59:46 +0000 (14:59 +0300)]
emacs: add $(srcdir) to notmuch-version.el.tmpl dependency

This fixes out-of-tree build when generating emacs/notmuch-version.el.

10 years agoconfigure: add $(ZLIB_CFLAGS) to CONFIGURE_CFLAGS
Tomi Ollila [Sat, 12 Apr 2014 16:30:22 +0000 (19:30 +0300)]
configure: add $(ZLIB_CFLAGS) to CONFIGURE_CFLAGS

As it is defined in CONFIGURE_CXXFLAGS.

10 years agoemacs: sign/encrypt replies to signed/encrypted messages
Jani Nikula [Sat, 5 Apr 2014 09:18:06 +0000 (12:18 +0300)]
emacs: sign/encrypt replies to signed/encrypted messages

This is a simple approach to improving security when replying to
signed or encrypted messages. If the message being replied to was
signed, add mml tag to sign the reply. If the message being replied to
was encrypted, add mml tag to sign and encrypt the reply.

This may need configuration; I for one might want to encrypt replies
to encrypted messages, but not always sign replies to signed messages.

This still includes a slight bug: if any mml tags are added, they are
included in the region containing the quoted parts. Killing the region
will kill the mml tags too.

10 years agotest: verify tag backup generated by database upgrade
David Bremner [Wed, 2 Apr 2014 00:34:52 +0000 (21:34 -0300)]
test: verify tag backup generated by database upgrade

'pre upgrade dump' is not much of a test, but at least this way we get
somewhat sensible behaviour if it fails.

10 years agonotmuch-new: backup tags before database upgrade
David Bremner [Tue, 1 Apr 2014 14:06:05 +0000 (11:06 -0300)]
notmuch-new: backup tags before database upgrade

All we do here is calculate the backup filename, and call the existing
dump routine.

Also take the opportunity to add a message about being safe to
interrupt.

10 years agorestore: transparently support gzipped input
David Bremner [Sat, 29 Mar 2014 18:12:28 +0000 (15:12 -0300)]
restore: transparently support gzipped input

We rely completely on zlib to do the right thing in detecting gzipped
input. Since our dump format is chosen to be 7 bit ascii, this should
be fine.

10 years agotest: restore with missing final newline
David Bremner [Thu, 3 Apr 2014 11:02:23 +0000 (08:02 -0300)]
test: restore with missing final newline

Recent proposed patches for gzipped input had a bug with handling
missing newlines that was not caught by the current test suite

10 years agoutil: add gz_readline
David Bremner [Sat, 29 Mar 2014 17:53:17 +0000 (14:53 -0300)]
util: add gz_readline

The idea is to provide a more or less drop in replacement for readline
to read from zlib/gzip streams.  Take the opportunity to replace
malloc with talloc.

10 years agodump: support gzipped and atomic output
David Bremner [Sat, 29 Mar 2014 01:14:51 +0000 (22:14 -0300)]
dump: support gzipped and atomic output

The main goal is to support gzipped output for future internal
calls (e.g. from notmuch-new) to notmuch_database_dump.

The additional dependency is not very heavy since xapian already pulls
in zlib.

We want the dump to be "atomic", in the sense that after running the
dump file is either present and complete, or not present.  This avoids
certain classes of mishaps involving overwriting a good backup with a
bad or partial one.

10 years agoNews for emacs saved-searches change.
Mark Walters [Wed, 9 Apr 2014 17:09:54 +0000 (18:09 +0100)]
News for emacs saved-searches change.

The important point is that the changed search variable is not forward
compatible (it *is* backwards compatible): that is previous version
of notmuch-emacs will be unusable with a new style
notmuch-saved-search variable.

10 years agoemacs: Add a sort-order option to saved-searches
Mark Walters [Sun, 6 Apr 2014 05:44:49 +0000 (06:44 +0100)]
emacs: Add a sort-order option to saved-searches

This adds a sort-order option to saved-searches, stores it in the
saved-search buttons (widgets), and uses the stored value when the
button is pressed.

Storing the sort-order in the widget was suggested by Jani in
id:4c3876274126985683e888641b29cf18142a5eb8.1391771337.git.jani@nikula.org.

10 years agoemacs: hello: switch notmuch-hello-insert-buttons to plists
Mark Walters [Sun, 6 Apr 2014 05:44:48 +0000 (06:44 +0100)]
emacs: hello: switch notmuch-hello-insert-buttons to plists

Switching notmuch-hello-insert-buttons to plists means we can easily
pass extra options through to the buttons.

10 years agoemacs: hello: add a customize for saved-searches
Mark Walters [Sun, 6 Apr 2014 05:44:47 +0000 (06:44 +0100)]
emacs: hello: add a customize for saved-searches

Make the defcustom for notmuch-saved-searches use the new plist
format. It should still work with oldstyle saved-searches but will
write the newstyle form.

10 years agoemacs: hello: use the saved-search helper functions
Mark Walters [Sun, 6 Apr 2014 05:44:46 +0000 (06:44 +0100)]
emacs: hello: use the saved-search helper functions

This uses the helper functions: the saved searches format has not
changed yet but backwards compatibility means everything still works.

10 years agoemacs: hello: add helper functions for saved-searches
Mark Walters [Sun, 6 Apr 2014 05:44:45 +0000 (06:44 +0100)]
emacs: hello: add helper functions for saved-searches

Add helper functions to for saved searches to ease the transition to
the new plist form while maintaining backwards compatibility. They
will be used in the next patch.

10 years agoemacs: defun notmuch-hello-versions and bind 'v' in hello mode to it
Tomi Ollila [Wed, 19 Mar 2014 20:37:11 +0000 (22:37 +0200)]
emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it

If notmuch cli & notmuch emacs MUA versions differ, print also the
emacs MUA version string (along with the cli version) to the
minibuffer.

10 years agoemacs: add notmuch-version.el.tmpl and create notmuch-version.el from it
Tomi Ollila [Wed, 19 Mar 2014 20:37:10 +0000 (22:37 +0200)]
emacs: add notmuch-version.el.tmpl and create notmuch-version.el from it

The notmuch cli program and emacs lisp versions may differ (especially
in remote usage). It helps to resolve problems if we can determine
the versions of notmuch cli and notmuch emacs mua separately.

The build process now creates notmuch-version.el from template file
by filling the version info to notmuch-emacs-version variable.

10 years agobuild: write version.stamp file containing $(VERSION) string
Tomi Ollila [Wed, 19 Mar 2014 20:37:09 +0000 (22:37 +0200)]
build: write version.stamp file containing $(VERSION) string

This version file will be as prerequisite to the target files
that use the version info for some purpose, like printing
it for the user to examine. The contents of the version.stamp
file is seldom read by the build system itself as the $(VERSION)
variable has the same information.

Thanks to Trevor, David and Mark for their contributions.

10 years agonmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}
W. Trevor King [Mon, 10 Mar 2014 00:28:49 +0000 (17:28 -0700)]
nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

With two branches getting fetched (master and config), the branch
referenced by FETCH_HEAD is ambiguous.  For example, I have:

  $ cat FETCH_HEAD
  41d7bfa7184cc93c9dac139d1674e9530799e3b0 \
    not-for-merge   branch 'config' of http://nmbug.tethera.net/git/nmbug-tags
  acd379ccb973c45713eee9db177efc530f921954 \
    not-for-merge   branch 'master' of http://nmbug.tethera.net/git/nmbug-tags

(where I wrapped the line by hand).  This means that FETCH_HEAD
references the config branch:

  $ git rev-parse FETCH_HEAD
  41d7bfa7184cc93c9dac139d1674e9530799e3b0

which breaks all of the FETCH_HEAD logic in nmbug (where FETCH_HEAD is
assumed to point to the master branch).

Instead of relying on FETCH_HEAD, use @{upstream} as the
remote-tracking branch that should be merged/diffed/integrated into
HEAD.  @{upstream} was added in Git v1.7.0 (2010-02-12) [1], so
relying on it should be fairly safe.  One tricky bit is that bare
repositories don't set upstream tracking branches by default:

  $ git clone --bare http://nmbug.tethera.net/git/nmbug-tags.git nmbug-bare
  $ cd nmbug-bare
  $ git remote show origin
  * remote origin
    Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
    Push  URL: http://nmbug.tethera.net/git/nmbug-tags.git
    HEAD branch: master
    Local refs configured for 'git push':
      config pushes to config (up to date)
      master pushes to master (up to date)

While in a non-bare clone:

  $ git clone http://nmbug.tethera.net/git/nmbug-tags.git
  $ cd nmbug-tags
  $ git remote show origin
  * remote origin
    Fetch URL: http://nmbug.tethera.net/git/nmbug-tags.git
    Push  URL: http://nmbug.tethera.net/git/nmbug-tags.git
    HEAD branch: master
    Remote branches:
      config tracked
      master tracked
    Local branch configured for 'git pull':
      master merges with remote master
    Local ref configured for 'git push':
      master pushes to master (up to date)

From the clone docs [2]:

  --bare::
        Make a 'bare' Git repository…
        Also the branch heads at the remote are copied directly
        to corresponding local branch heads, without mapping
        them to `refs/remotes/origin/`.  When this option is
        used, neither remote-tracking branches nor the related
        configuration variables are created.

To use @{upstream}, we need to the local vs. remote-tracking
distinction, so this commit adds 'nmbug clone', replacing the
previously suggested --bare clone with a non-bare --no-checkout
--separate-git-dir clone into a temporary work directory.  After
which:

  $ git rev-parse @{upstream}
  acd379ccb973c45713eee9db177efc530f921954

gives us the master-branch commit.  Existing nmbug users will have to
run the configuration tweaks and re-fetch by hand.  If you don't have
any local commits, you could also blow away your NMBGIT repository and
re-clone from scratch:

  $ nmbug clone http://nmbug.tethera.net/git/nmbug-tags.git

Besides removing the ambiguity of FETCH_HEAD, this commit allows users
to configure which upstream branch they want nmbug to track via 'git
config', in case they want to change their upstream repository.

[1]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/1.7.0.txt
[2]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/git-clone.txt

10 years agorelease-checks: removed manual page version check
Tomi Ollila [Sat, 5 Apr 2014 09:47:29 +0000 (12:47 +0300)]
release-checks: removed manual page version check

Manual pages are now generated and during the generation the version
string is read from `version` file, so this (currently failing) test
checking manual page versions can be removed.

While at it, changed the case pattern *[^0-9.]*
to its portable alternative *[!0-9.]*

10 years agodoc: added 'Init File' section to notmuch-emacs info source
Tomi Ollila [Thu, 3 Apr 2014 20:53:03 +0000 (23:53 +0300)]
doc: added 'Init File' section to notmuch-emacs info source

While adding that fixed (also other) typos noticed by aspell(1) run,
and capitalized Emacs and (most) Notmuch terms to match how emacs
Info documentation seems to look in general.

10 years agodoc: move doxgen config from devel/ to doc/
David Bremner [Sun, 6 Apr 2014 02:02:23 +0000 (23:02 -0300)]
doc: move doxgen config from devel/ to doc/

a first step towards actually instally the API docs

10 years agocompat: add canonicalize_file_name
David Bremner [Mon, 27 Jan 2014 14:12:12 +0000 (10:12 -0400)]
compat: add canonicalize_file_name

the POSIX 2008 behaviour of realpath is not available everywhere so we
provide a simple wrapper function.  We use (and provide) the gnu
extension canonicalize_file_name to make it cleaner to test for the
feature we need; otherwise we have to rely on realpath segfaulting if
the second argument is null.

10 years agodebian: add build conflicts against ruby1.8
David Bremner [Sun, 6 Apr 2014 13:03:17 +0000 (10:03 -0300)]
debian: add build conflicts against ruby1.8

Debian stable has ruby 1.9, so this should be OK. The issue is that
the ruby bindings don't build if "ruby" points to ruby1.8

10 years agodebian: really delete madduck from uploaders
David Bremner [Sun, 6 Apr 2014 12:53:39 +0000 (09:53 -0300)]
debian: really delete madduck from uploaders

I'm not sure how it got into debian/changelog without actually
happening, but actually delete martin from debian/control per
request in Debian bug #719100

10 years agodebian: ignore performance corpus when making source package
David Bremner [Sun, 30 Mar 2014 14:54:15 +0000 (11:54 -0300)]
debian: ignore performance corpus when making source package

Currently "make debian-snapshot" will include the performance corpus
tarball in the source package, which slows things down and wastes disk
space.  tar-ignore is needed twice to keep the default exclude rules
(e.g. to exclude .git)

10 years agolib: replace the header parser with gmime
Jani Nikula [Sun, 30 Mar 2014 21:21:49 +0000 (00:21 +0300)]
lib: replace the header parser with gmime

The notmuch library includes a full blown message header parser. Yet
the same message headers are parsed by gmime during indexing. Switch
to gmime parsing completely.

These are the main changes:

* Gmime stops header parsing at the first invalid header, and presumes
  the message body starts from there. The current parser is quite
  liberal in accepting broken headers. The change means we will be
  much pickier about accepting invalid messages.

* The current parser converts tabs used in header folding to
  spaces. Gmime preserve the tabs. Due to a broken python library used
  in mailman, there are plenty of mailing lists that produce headers
  with tabs in header folding, and we'll see plenty of tabs. (This
  change has been mitigated in preparatory patches.)

* For pure header parsing, the current parser is likely faster than
  gmime, which parses the whole message rather than just the
  headers. Since we parse the message and its headers using gmime for
  indexing anyway, this avoids and extra header parsing round when
  adding new messages. In case of duplicate messages, we'll end up
  parsing the full message although just headers would be
  sufficient. All in all this should still speed up 'notmuch new'.

* Calls to notmuch_message_get_header() may be slightly slower than
  previously for headers that are not indexed in the database, due to
  parsing of the whole message. Within the notmuch code base, notmuch
  reply is the only such user.

10 years agolib: drop support for single-message mbox files
Jani Nikula [Sun, 30 Mar 2014 21:21:48 +0000 (00:21 +0300)]
lib: drop support for single-message mbox files

We've supported mbox files containing a single message for historical
reasons, but the support has been deprecated, with a warning message
while indexing, since Notmuch 0.15. Finally drop the support, and
consider all mbox files non-email.

10 years agocli: abstract dump file open from the dump command
Jani Nikula [Tue, 25 Mar 2014 17:48:57 +0000 (19:48 +0200)]
cli: abstract dump file open from the dump command

Also expose the dump function to the rest of notmuch. No functional
changes, except for slight improvement in error handling.

10 years agocli: abstract database dumping from the dump command
Jani Nikula [Tue, 25 Mar 2014 17:07:49 +0000 (19:07 +0200)]
cli: abstract database dumping from the dump command

No functional changes, except for slight improvement in error
handling.

10 years agoemacs: push mark before signature on reply
Jani Nikula [Fri, 28 Mar 2014 18:04:25 +0000 (20:04 +0200)]
emacs: push mark before signature on reply

We push mark on reply so user can cut the quote. Push the mark before
signature, if any, instead of end of buffer so the signature is
preserved.

This is consistent with message-kill-to-signature.

10 years agoemacs: add defcustom notmuch-init-file and load it if exists
Tomi Ollila [Sat, 29 Mar 2014 08:07:59 +0000 (10:07 +0200)]
emacs: add defcustom notmuch-init-file and load it if exists

So that users can easily organize their notmuch-specific configurations
to separate file and they don't have to have notmuch configurations in
*every* emacs installation they launch, especially if those need to
'(require notmuch) to make the configurations possible.

10 years agoemacs: instruct user to autoload notmuch instead of require'ing it
Tomi Ollila [Sat, 29 Mar 2014 08:07:58 +0000 (10:07 +0200)]
emacs: instruct user to autoload notmuch instead of require'ing it

When (require 'notmuch) is added to ~/.emacs notmuch is loaded to every
instance of emacs although it may not be used in majority of
those instances.

When (autoload 'notmuch "notmuch" ...) is added to ~/.emacs notmuch
is loaded (only) when user invokes the notmuch function.

User may want to add other entrypoints to notmuch by adding more
autoloads -- the autoload instruction given should offer them clue how
to do so.

10 years agocli: fix notmuch help additional topics
Jani Nikula [Sat, 22 Mar 2014 13:06:58 +0000 (15:06 +0200)]
cli: fix notmuch help additional topics

The help for hooks was missing.

10 years agotest: conditionally test help system depending on configured support
Jani Nikula [Wed, 26 Mar 2014 08:48:12 +0000 (09:48 +0100)]
test: conditionally test help system depending on configured support

If neither sphinx nor rst2man is available, the notmuch man pages will
not be available. Take this into account in the help system test.

10 years agocli: Flush stdout before fork()ing to run hooks
Austin Clements [Sun, 23 Mar 2014 21:22:26 +0000 (17:22 -0400)]
cli: Flush stdout before fork()ing to run hooks

Without this flush, if stdout is block buffered (which will happen if
it's a pipe or a file, for example) and the hook also writes to
stdout, then notmuch new's output will appear *after* the hook output.

This situation may be a little esoteric, but it's good practice to
flush before you fork anyway.

10 years agocli: sanitize the received header before scanning for replies
Jani Nikula [Wed, 19 Mar 2014 16:44:50 +0000 (18:44 +0200)]
cli: sanitize the received header before scanning for replies

This makes the from guessing agnostic to header folding by spaces or
tabs.

10 years agocompletion: complete directory parameters to directories only
Jani Nikula [Wed, 12 Mar 2014 20:33:49 +0000 (22:33 +0200)]
completion: complete directory parameters to directories only

i.e. don't complete to files if only directories are acceptable.

10 years agocompletion: add proper completion of folder: and path:
Jani Nikula [Wed, 12 Mar 2014 20:33:48 +0000 (22:33 +0200)]
completion: add proper completion of folder: and path:

Complete folder: to maildir folders and path: to directories in mail
store.

10 years agoemacs: Use whitelist instead of blacklist for term escaping
Austin Clements [Tue, 11 Mar 2014 22:19:54 +0000 (18:19 -0400)]
emacs: Use whitelist instead of blacklist for term escaping

Previously, the term escaper used a blacklist of characters that
needed escaping.  This blacklist turned out to be somewhat incomplete;
for example, it did not contain non-whitespace ASCII control
characters or Unicode "fancy quotes", both of which do require the
term to be escaped.

Switch to a whitelist of characters that are definitely safe to leave
unquoted.  This fixes the broken test introduced by the previous
patch.

10 years agotest: Add broken test for Emacs boolean term escaping
Austin Clements [Tue, 11 Mar 2014 22:19:53 +0000 (18:19 -0400)]
test: Add broken test for Emacs boolean term escaping

The current term escaper gets most of these right, but fails to escape
things containing Unicode "fancy quotes" or things containing
non-whitespace control characters.

10 years agotest: conditionally test compact depending on configured support
Jani Nikula [Wed, 12 Mar 2014 17:26:04 +0000 (19:26 +0200)]
test: conditionally test compact depending on configured support

I still have one machine with old enough Xapian to not have compaction
support. Make the tests check for unsupported compact operation when
compact is not available.

10 years agodoc: fix out-of-tree build
David Bremner [Thu, 20 Mar 2014 00:48:03 +0000 (21:48 -0300)]
doc: fix out-of-tree build

The subtle part is adding .rst and .py files to vpath so they can be
used as dependencies without prefixing with $(srcdir)

We also change the interface to mkbuildeps.py: rather than getting the
containing directory from the conf file path, we go the other way.

10 years agotest: use $(srcdir) instead of . as include path
David Bremner [Thu, 20 Mar 2014 00:48:04 +0000 (21:48 -0300)]
test: use $(srcdir) instead of . as include path

This is needed for out of tree builds. The functional change is the
modification of extra_cflags; the other changes are cosmetic.

10 years agobuild: move canonical list of subdirectories to configure script
David Bremner [Tue, 25 Mar 2014 11:28:09 +0000 (08:28 -0300)]
build: move canonical list of subdirectories to configure script

The configure script needs this list for out of tree builds. Grabbing
it from the Makefile via sed was fragile and broken.

10 years agoemacs: tree: use orig-tags in search
Mark Walters [Sat, 22 Mar 2014 11:51:12 +0000 (11:51 +0000)]
emacs: tree: use orig-tags in search

This uses the recent functionality to show the tag changes in the tree
buffer. Currently this is only used to show changes the tree buffer
makes itself: i.e., it does not make display any changes reflecting
tagging done by other notmuch-buffers.

10 years agoemacs: search: use orig-tags in search
Mark Walters [Sat, 22 Mar 2014 11:51:11 +0000 (11:51 +0000)]
emacs: search: use orig-tags in search

This uses the recent functionality to show the tag changes in the
search buffer. Currently this is only used to show changes the search
buffer makes itself: i.e., it does not make display any changes
reflecting tagging done by other notmuch-buffers.

10 years agoemacs: show: use orig-tags for tag display
Mark Walters [Sat, 22 Mar 2014 11:51:10 +0000 (11:51 +0000)]
emacs: show: use orig-tags for tag display

This uses the previous patch to show the tag changes that have occured
in the show buffer since it was last loaded/refreshed.

10 years agoemacs: show: mark tags changed since buffer loaded
Mark Walters [Sat, 22 Mar 2014 11:51:09 +0000 (11:51 +0000)]
emacs: show: mark tags changed since buffer loaded

This allows (and requires) the original-tags to be passed along with
the current-tags to be passed to notmuch-tag-format-tags. This allows
the tag formatting to show added and deleted tags.By default a removed
tag is displayed with strike-through in red (if strike-through is not
available, eg on a terminal, inverse video is used instead) and an
added tag is displayed underlined in green.

If the caller does not wish to use the new feature it can pass
current-tags for both arguments and, at this point, we do exactly that
in the three callers of this function.

Note, we cannot tidily allow original-tags to be optional because we would
need to distinguish nil meaning "we are not specifying original-tags"
from nil meaning there were no original-tags (an empty list).

We use this in subsequent patches to make it clear when a message was
unread when you first loaded a show buffer (previously the unread tag
could be removed before a user realised that it had been unread).

The code adds into the existing tag formatting code. The user can
specify exactly how a tag should be displayed normally, when deleted,
or when added.

Since the formatting code matches regexps a user can match all deleted
tags with a ".*" in notmuch-tag-deleted-formats.  For example setting
notmuch-tag-deleted-formats to '((".*" nil)) tells notmuch not to show
deleted tags at all.

All the variables are customizable; however, more complicated cases
like changing the face depending on the type of display will require
custom lisp.

Currently this overrides notmuch-tag-deleted-formats for the tests
setting it to '((".*" nil)) so that they get removed from the display
and, thus, all tests still pass.

10 years agoemacs: tag: add customize for deleted/added tag formats
Mark Walters [Sat, 22 Mar 2014 11:51:08 +0000 (11:51 +0000)]
emacs: tag: add customize for deleted/added tag formats

Add customize options for deleted/added tag formats.  These are not
used yet but will be later in the series.

We switch to using `notmuch-apply-face' rather than `propertize' in
the defcustom for faces so that the faces for deleted/added tags add
to the default face attributes for the tag.

We special case deleting the unread tag as that tag is a strong visual
cue and we don't need that cue when we are just saying it used to be
unread. Thus, we revert to the normal tag face with strikethough for
deleted unread tags.

10 years agoemacs: tag split customise option for format-tags into a widget
Mark Walters [Sat, 22 Mar 2014 11:51:07 +0000 (11:51 +0000)]
emacs: tag split customise option for format-tags into a widget

We will re-use the customize option for format-tags for formattting
deleted tags to added tags in the next patch so split it into a
widget. There should be no functional change.

10 years agoMake keys of notmuch-tag-formats regexps and use caching
Austin Clements [Sat, 22 Mar 2014 11:51:06 +0000 (11:51 +0000)]
Make keys of notmuch-tag-formats regexps and use caching

This modifies `notmuch-tag-format-tag' to treat the keys of
`notmuch-tag-formats' as (anchored) regexps, rather than literal
strings.  This is clearly more flexible, as it allows for prefix
matching, defining a fallback format, etc.  This may cause compatibility
problems if people have customized `notmuch-tag-formats' to match tags
that contain regexp specials, but this seems unlikely.

Regular expression matching has quite a performance hit over string
lookup, so this also introduces a simple cache from exact tags to
formatted strings.  The number of unique tags is likely to be quite
small, so this cache should have a high hit rate.  In addition to
eliminating the regexp lookup in the common case, this cache stores
fully formatted tags, eliminating the repeated evaluation of potentially
expensive, user-specified formatting code.  This makes regexp lookup at
least as fast as assoc for unformatted tags (e.g., inbox) and *faster*
than the current code for formatted tags (e.g., unread):

                    inbox (usec)   unread (usec)
    assoc:              0.4            2.8
    regexp:             3.2            7.2
    regexp+caching:     0.4            0.4

(Though even at 7.2 usec, tag formatting is not our top bottleneck.)

This cache must be explicitly cleared to keep it coherent, so this adds
the appropriate clearing calls.

10 years agoemacs: Combine notmuch-combine-face-text-property{, -string}
Austin Clements [Sat, 22 Mar 2014 11:51:05 +0000 (11:51 +0000)]
emacs: Combine notmuch-combine-face-text-property{, -string}

This combines our two face combining functions into one, easy to use
function with a much shorter name: `notmuch-apply-face'.  This
function takes the full set of arguments that
`notmuch-combine-face-text-property' took, but takes them in a more
convenient order and provides smarter defaults that make the function
easy to use on both strings and buffers.

10 years agonmbug-status: make output title and blurb configurable
Jani Nikula [Thu, 13 Mar 2014 12:04:05 +0000 (13:04 +0100)]
nmbug-status: make output title and blurb configurable

Make nmbug-status more generally usable outside of nmbug by not
hardcoding notmuch related things.

This lets anyone publish html search views to mailing list messages
with a custom config file, independent of nmbug.

10 years agonmbug-status: parameterize title and blurb in the page header
Jani Nikula [Thu, 13 Mar 2014 12:04:04 +0000 (13:04 +0100)]
nmbug-status: parameterize title and blurb in the page header

Prepare for more general use.

10 years agoemacs: add path: prefix to query completion
Jani Nikula [Wed, 19 Mar 2014 16:53:06 +0000 (18:53 +0200)]
emacs: add path: prefix to query completion

Complete to the new path: prefix.

10 years agodoc: cosmetic fix for prerst2man.py
David Bremner [Thu, 13 Mar 2014 03:21:17 +0000 (00:21 -0300)]
doc: cosmetic fix for prerst2man.py

Fix a particular egregious combination of format and string
concatenation.

10 years agodoc: configure detection of sphinx and rst2man
David Bremner [Thu, 13 Mar 2014 03:21:16 +0000 (00:21 -0300)]
doc: configure detection of sphinx and rst2man

Because sphinx-build does not provide a convenient way of listing
which builders exist, and some people actually have pre 1.0 sphinx, we
try loading a relevant python module.

Currently the assumption is that no python in path -> no sphinx-build
in path.

10 years agodoc: build man pages into hierarchy, fix help test.
David Bremner [Thu, 13 Mar 2014 03:21:15 +0000 (00:21 -0300)]
doc: build man pages into hierarchy, fix help test.

It turns out there was a reason the old man pages were stored in a man
compatible hierarchy, namely so that we could run man on them before
installing.

Hardcode doc build location into test suite.  This isn't ideal, but
let's unbreak the test suite for now.

10 years agodoc: build man pages at build time; introduce HAVE_SPHINX, HAVE_RST2MAN
David Bremner [Thu, 13 Mar 2014 03:21:14 +0000 (00:21 -0300)]
doc: build man pages at build time; introduce HAVE_SPHINX, HAVE_RST2MAN

This helps avoid build artifacts (namely, nroff and gzipped-nroff man
pages) owned by root.

The variables allow choosing which generator to use for the man page.
These will be hooked to configure in a following commit.

10 years agoutil: Fix two corner-cases in boolean term quoting function
Austin Clements [Tue, 11 Mar 2014 20:42:00 +0000 (16:42 -0400)]
util: Fix two corner-cases in boolean term quoting function

Previously, make_boolean_term did not quote empty boolean terms or
boolean terms that started with '('.  These cases are incompatible
with Xapian: empty terms cannot be omitted, and boolean terms that
start with '(' trigger an alternate term quoting syntax.

Fix this by quoting empty terms and terms that contain '('.

10 years agoperf-test: use command line arguments for directories
David Bremner [Fri, 7 Mar 2014 12:03:23 +0000 (08:03 -0400)]
perf-test: use command line arguments for directories

It seems that between version 1.26 and 1.27 of gnu tar, directories to
be extracted read with --files-from are no longer recursively extacted.
This patch puts them on the command line instead.

10 years agoman: try to clarify the folder: and path: vs. --output=files confusion
Jani Nikula [Sat, 8 Feb 2014 21:14:25 +0000 (23:14 +0200)]
man: try to clarify the folder: and path: vs. --output=files confusion

10 years agoman: update man pages for folder: and path: search terms
Jani Nikula [Sun, 9 Mar 2014 21:03:06 +0000 (23:03 +0200)]
man: update man pages for folder: and path: search terms

Text from review by Austin Clements <amdragon@MIT.EDU>.

10 years agotest: add machinery to download and verify databases
David Bremner [Sat, 1 Mar 2014 20:12:44 +0000 (16:12 -0400)]
test: add machinery to download and verify databases

Note that it is intentional that the checksum file is not
downloaded. The intent is to check those into git.

10 years agotest: commit database checksum, ignore actual databases
David Bremner [Sat, 1 Mar 2014 23:22:59 +0000 (19:22 -0400)]
test: commit database checksum, ignore actual databases

The checksum file is used by the test infrastructure to verify the downloaded
test database is the one we had in mind.  Note that this test is
rather strict, and the the checksum file needs to be recommitted when
the database is regenerated.

add a pattern .gitignore to ignore the actual databases

10 years agodevel: add script to generate test databases
Jani Nikula [Sat, 8 Feb 2014 13:36:54 +0000 (15:36 +0200)]
devel: add script to generate test databases

Add script to generate notmuch test databases using specified versions
of notmuch. This is useful for generating material for database
upgrade tests.

This reuses the test infrastructure to have a sandbox environment for
notmuch new etc.

10 years agotest: add database upgrade test from format version 1 to 2
Jani Nikula [Tue, 11 Mar 2014 05:42:49 +0000 (07:42 +0200)]
test: add database upgrade test from format version 1 to 2

Test the upgrade from probabilistic to boolean folder: terms, and
addition of path: terms.

The test depends on the pre-built test corpus and database tarball and
checksum file being in place. If it's not, the test is skipped. The
mechanism to fetch the test database will be added later.

At the time of writing, a working test database and checksum file is
available at

   http://notmuchmail.org/releases/test-databases/

It has been noted that some non-GNU environments make lack
sha256sum. We leave this portability issue for a followup patch.

10 years agotest: add tests for the new boolean folder: and path: prefixes
Jani Nikula [Sat, 22 Feb 2014 20:59:18 +0000 (22:59 +0200)]
test: add tests for the new boolean folder: and path: prefixes

Additional tests for the boolean folder: and path: prefixes using the
full corpus.

10 years agolib: make folder: prefix literal
Jani Nikula [Sat, 8 Feb 2014 19:20:42 +0000 (21:20 +0200)]
lib: make folder: prefix literal

In xapian terms, convert folder: prefix from probabilistic to boolean
prefix, matching the paths, relative from the maildir root, of the
message files, ignoring the maildir new and cur leaf directories.

folder:foo matches all message files in foo, foo/new, and foo/cur.

folder:foo/new does *not* match message files in foo/new.

folder:"" matches all message files in the top level maildir and its
new and cur subdirectories.

This change constitutes a database change: bump the database version
and add database upgrade support for folder: terms. The upgrade also
adds path: terms.

Finally, fix the folder search test for literal folder: search, as
some of the folder: matching capabilities are lost in the
probabilistic to boolean prefix change.

10 years agotest: make insert test use the path: prefix
Jani Nikula [Mon, 6 Jan 2014 21:48:24 +0000 (23:48 +0200)]
test: make insert test use the path: prefix

This is a more strict test for the insert test.

10 years agolib: add support for path: prefix searches
Jani Nikula [Sat, 8 Feb 2014 18:50:44 +0000 (20:50 +0200)]
lib: add support for path: prefix searches

The path: prefix is a literal boolean prefix matching the paths,
relative from the maildir root, of the message files.

path:foo matches all message files in foo (but not in foo/new or
foo/cur).

path:foo/new matches all message files in foo/new.

path:"" matches all message files in the top level maildir.

path:foo/** matches all message files in foo and recursively in all
subdirectories of foo.

path:** matches all message files recursively, i.e. all messages.

10 years agolib: refactor folder term update after filename removal
Jani Nikula [Sat, 8 Feb 2014 17:48:16 +0000 (19:48 +0200)]
lib: refactor folder term update after filename removal

Abstract some blocks of code for reuse. No functional changes.

10 years agotest: rearrange the test corpus into subfolders, fix tests
Jani Nikula [Sun, 9 Mar 2014 12:25:37 +0000 (14:25 +0200)]
test: rearrange the test corpus into subfolders, fix tests

We will need this for improved folder search tests, but having some
folders should exercise our code paths better anyway.

Modify the relevant test accordingly to make it pass.

This reorganization triggers a bug in the test suite, namely that it
expects the output of --output=files to be in a certain order. So we
add the fix for that into the same commit.

This mainly involves sorting, although the case --duplicate=$n
requires more subtlety.

10 years agotest: add notmuch_search_files_sanitize and use it
Jani Nikula [Sun, 9 Mar 2014 13:19:09 +0000 (15:19 +0200)]
test: add notmuch_search_files_sanitize and use it

We do this in a lot of places, so make it a helper in the test-lib.

10 years agotest: add utility function to sort a json list
David Bremner [Tue, 11 Mar 2014 16:52:19 +0000 (13:52 -0300)]
test: add utility function to sort a json list

So far we only need this one place, but it's a bit messy to inline

10 years agodoc: remove preformatted nroff pages
David Bremner [Mon, 10 Mar 2014 00:59:27 +0000 (21:59 -0300)]
doc: remove preformatted nroff pages

From now on, we should edit the rst source.

10 years agodoc: automatically read version from file
David Bremner [Wed, 5 Mar 2014 03:09:38 +0000 (23:09 -0400)]
doc: automatically read version from file

This avoids having to recreate the update-man-versions rule

10 years agodoc: install sphinx version of man pages
David Bremner [Wed, 5 Mar 2014 13:34:10 +0000 (09:34 -0400)]
doc: install sphinx version of man pages

The python script mkdocdeps.py is used to import the list of man pages
from the sphinx configuration to make.

This will delete the (release only) target update-man-versions. This
will be replaced in a followup commit.

10 years agodoc: add target rst2man to build man pages using rst2man
David Bremner [Tue, 28 Jan 2014 16:12:38 +0000 (12:12 -0400)]
doc: add target rst2man to build man pages using rst2man

Many people have docutils installed, but not sphinx. Allow these
people to build the man pages.

10 years agodoc: convert sphinx based docs
David Bremner [Tue, 28 Jan 2014 16:12:37 +0000 (12:12 -0400)]
doc: convert sphinx based docs

This is the output from sphinx-quickstart, massaged a bit, along with
our existing man pages converted to rst.

A skeleton notmuch-emacs manual is also included. It is not suitable
for end user use yet.

10 years agoutil: make sanitize string available in string util for reuse
Jani Nikula [Mon, 3 Feb 2014 19:51:43 +0000 (21:51 +0200)]
util: make sanitize string available in string util for reuse

No functional changes.

10 years agocli: refactor reply from guessing
Jani Nikula [Mon, 3 Feb 2014 19:51:42 +0000 (21:51 +0200)]
cli: refactor reply from guessing

The guess_from_received_header() function had grown quite big. Chop it
up into smaller functions.

No functional changes.

10 years agocli: sanitize tabs and newlines to spaces in notmuch search
Jani Nikula [Mon, 3 Feb 2014 19:51:41 +0000 (21:51 +0200)]
cli: sanitize tabs and newlines to spaces in notmuch search

Sanitize tabs and newlines to spaces rather than question marks in
--output=summary --format=text output.

This will also hide any difference in unfolding a header that has been
folded with a tab. Our own header parser replaces tabs with spaces,
while gmime would retain the tab.

10 years agosupport for generating decreasing dates in bash 4.0 and 4.1
Tomi Ollila [Mon, 10 Feb 2014 21:15:00 +0000 (23:15 +0200)]
support for generating decreasing dates in bash 4.0 and 4.1

The printf builtin "%(fmt)T" specifier (which allows time values
to use strftime-like formatting) is introduced in bash 4.2.

Trying to execute this in pre-4.2 bash will fail -- and if this
happens execute the fallback piece of perl code to do the same thing.

10 years agotest: NOTMUCH_SKIP_TESTS accepts test names with or without Tddd- prefix
Tomi Ollila [Tue, 4 Mar 2014 20:38:21 +0000 (22:38 +0200)]
test: NOTMUCH_SKIP_TESTS accepts test names with or without Tddd- prefix

The test names assigned to NOTMUCH_SKIP_TESTS variable can now be given
with or without the Tddd- prefix for tester convenience:

The test name without Tddd -prefix stays constant even when test filenames
are renumbered.

The test name with Tddd -prefix is printed out when tests run.

10 years agotest: don't use $(dir) in recipes.
David Bremner [Sat, 8 Mar 2014 14:00:39 +0000 (10:00 -0400)]
test: don't use $(dir) in recipes.

According the semantics of make, the expansion of $(dir) in recipes
uses dynamic scope, i.e. the value at the time the recipe is run. This
means if test/Makefile.local is not the last sub-makefile included,
all heck breaks loose.

10 years agodebian: add dependency on bash-completion
David Bremner [Thu, 6 Mar 2014 12:52:02 +0000 (08:52 -0400)]
debian: add dependency on bash-completion

At some point we decided to only install bash completion for notmuch
if the bash-completion file was present. Add the corresponding debian
build dependency.

10 years agotest: Print the number of the test along with its name
Austin Clements [Tue, 4 Mar 2014 06:40:08 +0000 (01:40 -0500)]
test: Print the number of the test along with its name

Previously, we stripped the "Tnnn-" part from the test name when
printing its description at the beginning of each test.  However, this
makes it difficult to find the source script for a test (e.g., when a
test fails).  Put this prefix back.

10 years agocli: add missing \n in error message
Jani Nikula [Tue, 4 Mar 2014 16:51:54 +0000 (18:51 +0200)]
cli: add missing \n in error message

The error messages returned by illegal_tag() don't contain newlines.

10 years agotest: add tests for invalid new.tags
Jani Nikula [Sun, 23 Feb 2014 16:55:23 +0000 (18:55 +0200)]
test: add tests for invalid new.tags

Similar tests for both notmuch new and insert.

10 years agocli: make sure notmuch new and insert don't add invalid tags
Jani Nikula [Sun, 23 Feb 2014 16:55:22 +0000 (18:55 +0200)]
cli: make sure notmuch new and insert don't add invalid tags

Check new.tags configuration values before doing anything, and bail
out on invalid values.