W. Trevor King [Mon, 3 Feb 2014 09:02:44 +0000 (01:02 -0800)]
emacs: Prefer Content-Description over filename for part buttons
On the rss2email list, Victor Orlikowski pointed out [1] that a number
of MUAs don't use the Subject header of attached message/rfc822 parts
to label multipart/digest subparts [2]. Instead, notmuch and several
other MUAs use the filename parameter [3] as a content hint. Using
the filename parameter seems more sane than diving into the
message/rfc822 part header, but that's still not what the filename
parameter was designed for. It makes more sense to me to use the
message/rfc822 part's Content-Description header (which I just taught
notmuch-show to export), falling back on the filename parameter if
Content-Description isn't set.
[1]: http://article.gmane.org/gmane.mail.rss2email/211
[2]: Digests: http://tools.ietf.org/html/rfc2046#section-5.1.5
[3]: Filename: http://tools.ietf.org/search/rfc2183#section-2.3
W. Trevor King [Mon, 3 Feb 2014 08:46:47 +0000 (00:46 -0800)]
notmuch-show: Add content-description output pair
Parse and display the Content-Description header [1,2] so UIs
rendering message parts have easy access to description strings.
Extracting the value is a two-step process (extract [3] and decode
[4]).
[1]: http://tools.ietf.org/html/rfc2045#section-8
[2]: http://tools.ietf.org/html/rfc2183#section-3
[3]: https://developer.gnome.org/gmime/stable/GMimeObject.html#g-mime-object-get-header
[4]: https://developer.gnome.org/gmime/stable/gmime-gmime-utils.html#g-mime-utils-header-decode-text
W. Trevor King [Sat, 5 Apr 2014 17:17:03 +0000 (10:17 -0700)]
doc/INSTALL: Remove rst2man reference and other updates
The rst2man target was removed in
9d9a700 (doc: build man pages at
build time; introduce HAVE_SPHINX, HAVE_RST2MAN, 2014-03-13), but a
reference in the install docs slipped through. While I was removing
that reference, I also:
* Converted doc/INSTALL to reStructuredText, so I can link to Sphinx
and Docutils directly. Not everyone has access to Debian's
python-docutils, so it's better to be genric here.
* Converted from an unordered list to paragraphs, because I think it
flows better.
* Dropped the rst2man no-automatic-install caveat. I don't think this
applies to the current code, although I haven't tried to track down
a commit that adds the automatic-install support. Anyhow,
$ make HAVE_SPHINX=0 RST2MAN=/usr/bin/rst2man.py DESTDIR=/tmp/ install-man
works for me.
W. Trevor King [Sat, 5 Apr 2014 17:13:55 +0000 (10:13 -0700)]
doc/prerst2man.py: Convert execfile to import
excefile is gone in Python 3 [1]. Instead of exec-ing the
configuration, it's easier to insert the source directory in Python's
path [2], and just import the configuration. With this change,
prerst2man.py is compatible with both Python 2 and 3.
[1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins
[2]: https://docs.python.org/3/library/sys.html#sys.path
W. Trevor King [Sat, 5 Apr 2014 17:04:22 +0000 (10:04 -0700)]
doc: Allow rst2man.py as an alternative to rst2man
Gentoo's dev-python/docutils-0.10 installs Docutils scripts with a
*.py extension, so I have /usr/bin/rst2man.py and no rst2man script.
This patch supports users with both types of systems by checking for
rst2man, falling back on rst2man.py, and giving up only if neither is
found. Users can also set the new RST2MAN path variable explicitly
when they call Make:
make RST2MAN=/my/custom/rst_to_man_converter build-man
I use POSIX's 'command -v' [1] to find the path to rst2man or
rst2man.py, and save that as RST2MAN in Makefile.config. We can use a
non-empty RST2MAN to check for the availability of an rst2man program,
so there's no need for a separate HAVE_RST2MAN. Then pass the
configured RST2MAN path through to prerst2man.py to use in its system
call.
[1]: http://pubs.opengroup.org/onlinepubs/
9699919799/utilities/command.html
W. Trevor King [Sat, 5 Apr 2014 16:38:39 +0000 (09:38 -0700)]
doc/prerst2man.py: Fix 'os.system' -> 'system' typo
Avoid:
$ make HAVE_SPHINX=0 HAVE_RST2MAN=1 build-man
python ./doc/prerst2man.py ./doc doc/_build/man
Traceback (most recent call last):
File "./doc/prerst2man.py", line 65, in <module>
os.system('set -x; rst2man {0} {1}/{2}.{3}'
NameError: name 'os' is not defined
make: *** [doc/_build/man/man1/notmuch.1] Error 1
by using system directly. We don't need the 'os.' namespacing,
because the function was imported with:
from os import makedirs, system
W. Trevor King [Sat, 5 Apr 2014 16:30:56 +0000 (09:30 -0700)]
doc/prerst2man.py: Use Python-3-compatible octal notation
Python 3 only supports the 0oXXX notation for octal literals [1,2],
which have also been supported in 2.x since 2.6 [2].
[1]: https://docs.python.org/3.0/whatsnew/3.0.html#integers
[2]: http://legacy.python.org/dev/peps/pep-3127/
W. Trevor King [Sat, 5 Apr 2014 15:47:33 +0000 (08:47 -0700)]
doc/mkdocdeps.py: Use "with" statement for the output file
Before this patch, the open was unnecessarily early and relied on the
process cleanup to close. Neither one of these was a real problem,
but PEP 343's context managers (which landed in Python 2.5) make
proper cleanup very easy.
[1]: http://legacy.python.org/dev/peps/pep-0343/
W. Trevor King [Sat, 5 Apr 2014 15:41:39 +0000 (08:41 -0700)]
doc/mkdocdeps.py: Convert execfile to import
excefile is gone in Python 3 [1]. Instead of exec-ing the
configuration, it's easier to insert the source directory in Python's
path [2], and just import the configuration. With this change,
mkdocdeps.py is compatible with both Python 2 and 3.
[1]: https://docs.python.org/3.0/whatsnew/3.0.html#builtins
[2]: https://docs.python.org/3/library/sys.html#sys.path
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 '('.
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.
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
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>.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Jani Nikula [Sun, 23 Feb 2014 16:55:21 +0000 (18:55 +0200)]
cli: export function for illegal tag checking
This lets us check for forbidden tags consistently across the cli. No
functional changes.
Jani Nikula [Sat, 1 Mar 2014 13:17:50 +0000 (15:17 +0200)]
emacs: use the originating buffer's working directory for pipe
Currently notmuch-show-pipe-message runs the command in the working
directory of the *notmuch-pipe* buffer if it exists, and the current
buffer's working directory (which is inherited to the new
*notmuch-pipe* buffer) otherwise. This is all very surprising to the
user, and it's difficult to know or change where the command will be
run.
Always use the current show buffer's working directory for piping. The
user can check that with M-x pwd and change it with M-x cd. This is
consistent with notmuch-show-pipe-part.
Austin Clements [Thu, 27 Feb 2014 18:10:54 +0000 (13:10 -0500)]
emacs: Simplify and fix `notmuch-mua-prompt-for-sender'
`notmuch-mua-prompt-for-sender' is over-engineered and often wrong.
It attempts to detect when all identities have the same name and
specialize the prompt to just the email address part. However, to do
this it uses `mail-extract-address-components', which is meant for
displaying email addresses, not general-purpose parsing, and hence
performs many canonicalizations that can interfere with this use. For
example, configuring notmuch-identities to ("Austin
<austin@example.com>"), will cause `notmuch-mua-prompt-for-sender' to
lose the name part entirely and return " <austin@example.com>".
This patch rewrites `notmuch-mua-prompt-for-sender' to simply prompt
for a full identity when notmuch-identities is configured, or to
prompt for a sender address when it isn't.
The original code also did several strange things, like using `eval'
and specifying that this function was interactive. As a side-effect,
this patch fixes these problems. And it adds a docstring.
David Bremner [Mon, 3 Mar 2014 12:48:33 +0000 (08:48 -0400)]
NEWS: note closing of id:87ty19pi85.fsf@zancas.localnet
Also close the original debian bug.
David Bremner [Mon, 3 Mar 2014 12:36:37 +0000 (08:36 -0400)]
debian: note closing of debian bug 739556
This one doesn't seem NEWS-worthy.
David Bremner [Mon, 3 Mar 2014 12:25:04 +0000 (08:25 -0400)]
NEWS: note closing of bug id:87wqhcxb5j.fsf@maritornes.cs.unb.ca
This is also/originally Debian bug 737496, so close that too.
David Bremner [Mon, 3 Mar 2014 12:10:51 +0000 (08:10 -0400)]
Merge tag 'debian/0.17-5'
uploaded to unstable
David Bremner [Sun, 2 Mar 2014 11:36:34 +0000 (07:36 -0400)]
debian: fix typo in postinst (Debian bug 740325), clean up empty directory
Try to remove the directory /0755 ; if that fails assume it has
something in it to preserve.
Austin Clements [Tue, 25 Feb 2014 19:18:59 +0000 (14:18 -0500)]
test: Simplify CLEAN list construction
Construct as much of the CLEAN list from TEST_BINARIES as possible,
rather than duplicating this information by hand.
Jani Nikula [Mon, 24 Feb 2014 21:36:58 +0000 (23:36 +0200)]
cli: command line option parser cleanup
Reduce the indentation for clarity. No functional changes.
David Bremner [Sat, 8 Feb 2014 14:25:17 +0000 (10:25 -0400)]
emacs: remove newlines from input to notmuch count --batch
Since a newline starts a new query in batch mode, this causes
mysterious crashes in the emacs interface if saved searches contain
newlines. See the discussion at
id:87wqhcxb5j.fsf@maritornes.cs.unb.ca
In general newlines seem to be just whitespace to the xapian query
parser, so this should be mainly harmless.
David Bremner [Sat, 15 Feb 2014 03:24:58 +0000 (23:24 -0400)]
man: escape backslash in notmuch-tag example
The example was originally intended to have a literal backslash in it, but
'\ ' is interpreted by nroff as a non-breaking space.
It doesn't make much difference to the example, but the non-breaking
space triggers a bug in doclifter.
Austin Clements [Thu, 20 Feb 2014 19:16:36 +0000 (14:16 -0500)]
emacs: Fix `notmuch-user-other-email' when no other emails are configured
Thanks to the previous patch, this no longer crashes in this
situation, but now would return (""). Fix it to return () when no
emails are configured.
Austin Clements [Thu, 20 Feb 2014 19:16:35 +0000 (14:16 -0500)]
emacs: Fix exception when fetching empty or unconfigured settings
When "notmuch config" is called with the name of an empty or
unconfigured setting, it prints nothing (not even a new line).
Previously, `notmuch-config-get' assumed it would always print a
newline. As a result, when `notmuch-config-get' was called with the
name of an empty of unconfigured setting, it would attempt to
(substring "" 0 -1) to strip the newline, which would fail with a
(args-out-of-range "" 0 -1) exception.
Fix this by only stripping the newline if there actually is one.
Austin Clements [Thu, 20 Feb 2014 19:16:34 +0000 (14:16 -0500)]
emacs: Build forwarded message buffer more directly
Previously, we used `message-forward' to build forwarded messages, but
this function is simply too high-level to be a good fit for some of
what we do.
First, since `message-forward' builds a full forward message buffer
given the message to forward, we have to duplicate much of the logic
in `notmuch-mua-mail' to patch the notmuch-y things into the built
buffer.
Second, `message-forward' constructs the From header from
user-full-name and user-mail-address. As a result, if we prompt the
user for an identity, we have to parse it into name and address
components, just to have it put back together by `message-forward'.
This process is not entirely loss-less because
`mail-extract-address-components' does a lot of canonicalization
(since it's intended for displaying addresses, not for parsing them).
To fix these problems, don't use `message-forward' at all.
`message-forward' itself is basically just a call to `message-mail'
and `message-forward-make-body'. Do this ourselves, but call
`notmuch-mua-mail' instead of `message-mail' so we can directly build
a notmuch-y message and control the From header.
This also fixes a bug that was a direct consequence of our use of
`mail-extract-address-components': if the user chose an identity that
had no name part (or the name part matched the mailbox), we would bind
user-full-name to nil, which would cause an exception in the bowels of
message-mode because user-full-name is expected to always be a string
(even if it's just "").
David Bremner [Sat, 22 Feb 2014 01:22:46 +0000 (21:22 -0400)]
man: fix typo in notmuch.1
Fix for Debian bug 739556
Gaute Hope [Thu, 30 Jan 2014 19:11:51 +0000 (20:11 +0100)]
ruby bindings message: docstring typo
Tomi Ollila [Tue, 18 Feb 2014 18:34:52 +0000 (20:34 +0200)]
nmbug-status: replace __values__() with values() in OrderedDict stub
Python dict() object does not have __values__() function which
OrderedDict().values() (the stub provided in nmbug-status) could call
to provide ordered list of values. By renaming this thinko to
values() will make our stub work as expected -- dict items listed out
in order those were added to the dictionary.
Austin Clements [Thu, 20 Feb 2014 04:24:24 +0000 (23:24 -0500)]
emacs: Avoid rebuilding .eldeps even when there's nothing to do
Previously, we updated .eldeps only if the file contents actually
needed to change. This was done to avoid unnecessary make restarts
(if the .eldeps rule changes the mtime of .eldeps, make has to restart
to collect the new dependencies). However, this meant that, after a
modification to any .el file that did not change dependencies, .eldeps
would always be out of date, so every make invocation would run the
.eldeps rule, which is both expensive because it starts up Emacs and
noisy. This was true even when there was nothing to do. E.g.,
$ make clean && make
...
$ touch emacs/notmuch-lib.el && make
...
$ make
Use "make V=1" to see the verbose compile lines.
EMACS emacs/.eldeps
make: Nothing to be done for `all'.
$ make
Use "make V=1" to see the verbose compile lines.
EMACS emacs/.eldeps
make: Nothing to be done for `all'.
Fix this by replacing .eldeps with two files with identical content.
One tracks the mtime of the dependency information and triggers the
Emacs call to rebuild dependencies only when it may be necessary. The
other tracks the content only; this rule over-triggers in the same way
the old rule did, but this rule is cheap and quiet.
David Bremner [Sat, 22 Feb 2014 01:05:05 +0000 (21:05 -0400)]
Merge tag 'debian/0.17-4'
uploaded to Debian unstable
David Bremner [Wed, 19 Feb 2014 01:38:55 +0000 (21:38 -0400)]
changelog stanza for 0.17-4
David Bremner [Wed, 19 Feb 2014 01:05:14 +0000 (21:05 -0400)]
debian: update ruby binary extension install path
From Christian Hofstaedler, Debian bug 739120:
When ruby-defaults > 1:2.0 will be uploaded to sid, the version of
Ruby provided by the 'ruby' and 'ruby-dev' packages will change to
version 2.0. This version change includes a change to the path for
binary extensions.
This patch works for Ruby 1.9.1 as well as Ruby 2.0, so it's safe to
apply now.
Jed Brown [Thu, 13 Feb 2014 15:04:22 +0000 (08:04 -0700)]
emacs: update alist for mail-archive.com API change
Searching by Message-Id no longer works via the old mail-archive.com
API, though I have contacted them in hopes that they restore it to
prevent dead links. Anyway, the new API is cleaner.
Acked-by: Austin Clements <amdragon@MIT.EDU>
W. Trevor King [Fri, 14 Feb 2014 16:48:55 +0000 (08:48 -0800)]
nmbug-status: Hardcode UTF-8 instead of using the user's locale
David [1] and Tomi [2] both feel that the user's choice of LANG is not
explicit enough to have such a strong effect on nmbug-status. For
example, cron jobs usually default to LANG=C, and that is going to
give you ASCII output:
$ LANG=C python -c 'import locale; print(locale.getpreferredencoding())'
ANSI_X3.4-1968
Trying to print Unicode author names (and other strings) in that
encoding would crash nmbug-status with a UnicodeEncodeError. To avoid
that, this patch hardcodes UTF-8, which can handle generic Unicode,
and is the preferred encoding (regardless of LANG settings) for
everyone who has chimed in on the list so far. I'd prefer trusting
LANG, but in the absence of any users that prefer non-UTF-8 encodings
I'm fine with this approach.
While we could achieve the same effect on the output content by
dropping the previous patch (nmbug-status: Encode output using the
user's locale), Tomi also wanted UTF-8 hardcoded as the config-file
encoding [2]. Keeping the output encoding patch and then adding this
to hardcode both the config-file and output encodings at once seems
the easiest route, now that
fd29d3f (nmbug-status: Decode Popen output
using the user's locale, 2014-02-10) has landed in master.
[1]: id="877g8z4v4x.fsf@zancas.localnet"
http://article.gmane.org/gmane.mail.notmuch.general/17202
[2]: id="m2vbwj79lu.fsf@guru.guru-group.fi"
http://article.gmane.org/gmane.mail.notmuch.general/17209
W. Trevor King [Fri, 14 Feb 2014 16:48:54 +0000 (08:48 -0800)]
nmbug-status: Encode output using the user's locale
Instead of always writing UTF-8, allow the user to configure the
output encoding using their locale. This is useful for previewing
output in the terminal, for poor souls that don't use UTF-8 locales
;).
W. Trevor King [Fri, 14 Feb 2014 16:48:53 +0000 (08:48 -0800)]
nmbug-status: Add inter-message padding
We already had the tbody with a blank row separating threads (which is
not colored); this commit adds a bit of spacing to separate messages
within a thread. It will also add a bit of colored padding above the
first message and below the final message, but the main goal is to add
padding *between* two-row message blocks.
<--- new padding
thread-1, message-1, row-1 (class="message-first")
thread-1, message-1, row-2 (class="message-last")
<--- new padding
spacer tbody with a blank row
<--- new padding
thread-2, message-1, row-1 (class="message-first")
thread-2, message-1, row-2 (class="message-last")
<--- new padding
<--- new padding
thread-2, message-2, row-1 (class="message-first")
thread-2, message-2, row-2 (class="message-last")
<--- new padding
W. Trevor King [Fri, 14 Feb 2014 16:48:52 +0000 (08:48 -0800)]
nmbug-status: Color threads in HTML output
Add tbody sections so we don't have to color every row. Multiple
tbody sections are allowed [1]. Use CSS 3's nth-child to handle
even/odd coloring (skipping the spacer rows) [2], which is supported
on the major browsers [3].
border-spacing is from CCS 2.1 [4,5]. I'm using it to avoid
whitespace between td cells.
border-radius is from CCS 3 [6,7]. I'm using it to make the colored
sections a bit less harsh. I tried adding rounded borders to the
tbody itself doesn't work, but I couldn't get that to work without
setting the tbody's display to 'block'. That rounded the corners, but
collapsed the cell spacing (e.g. columns were no longer aligned).
This commit's by-corner-td approach is not particularly elegant, but
it works. The td padding entries just ensure that the cell body is
suitably far from the edges that it doesn't fall outside of the
rounded corners.
The doubled-braces are escapes from Python's str.format.
[1]: http://www.w3.org/TR/html5/tabular-data.html#the-table-element
[2]: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo
[3]: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child#Browser_compatibility
[4]: http://www.w3.org/TR/CSS2/tables.html#propdef-border-spacing
[5]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing#Browser_compatibility
[6]: http://www.w3.org/TR/css3-background/#the-border-radius
[7]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#Browser_compatibility