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.
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.
David Bremner [Sat, 27 Jun 2015 12:47:38 +0000 (14:47 +0200)]
NEWS for 0.20.2
Just the one bug fix
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.
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
David Bremner [Mon, 1 Jun 2015 20:00:11 +0000 (22:00 +0200)]
debian: change stanza for 0.20.1
David Bremner [Mon, 1 Jun 2015 19:47:35 +0000 (21:47 +0200)]
version: bump to 20.1
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.
David Bremner [Sun, 31 May 2015 09:26:41 +0000 (11:26 +0200)]
NEWS: bump date
David Bremner [Sun, 31 May 2015 09:22:34 +0000 (11:22 +0200)]
debian: changelog stanza for 0.20-1
David Bremner [Sun, 31 May 2015 09:13:56 +0000 (11:13 +0200)]
version: bump to 0.20
David Bremner [Sun, 31 May 2015 09:12:13 +0000 (11:12 +0200)]
drop mention of notmuch-emacs-mua
David Bremner [Sat, 23 May 2015 19:05:25 +0000 (21:05 +0200)]
debian: changelog stanza for 0.20~rc2-1
David Bremner [Sat, 23 May 2015 19:03:30 +0000 (21:03 +0200)]
version: bump to 0.20~rc2
David Bremner [Sat, 9 May 2015 06:13:50 +0000 (08:13 +0200)]
python: use absolute import for SOVERSION
Apparently python3 needs this.
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.
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.
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)
David Bremner [Mon, 4 May 2015 06:09:43 +0000 (08:09 +0200)]
version: bump to 0.20~rc1
David Bremner [Mon, 4 May 2015 06:08:43 +0000 (08:08 +0200)]
debian: changelog stanza for 0.20~rc1
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>
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.
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.
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.
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.
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.
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.
W. Trevor King [Sat, 28 Mar 2015 15:46:40 +0000 (08:46 -0700)]
NEWS: fix 'not' -> 'now' typo in 0.19 nmbug section
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
]
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.
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.
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".
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
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.
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.
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.
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.
Trevor Jim [Sat, 7 Mar 2015 20:23:51 +0000 (15:23 -0500)]
go: add binding for notmuch_message_get_date
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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))
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jani Nikula [Mon, 23 Feb 2015 16:56:14 +0000 (18:56 +0200)]
lib: abstract bit validity check in bit test/set/clear macros
Reduce duplication in the bit test/set/clear macros. No functional
changes.
David Bremner [Mon, 23 Feb 2015 20:01:00 +0000 (21:01 +0100)]
doc: update list of prefixes
'attachement' missed a colon, and 'mimetype' was not added to this table
at all.
David Bremner [Mon, 23 Feb 2015 19:55:03 +0000 (20:55 +0100)]
doc: typo fix for prefix discussion.
David Bremner [Sun, 18 Jan 2015 12:59:31 +0000 (13:59 +0100)]
doc: add more information on operators.
More material borrowed from the wiki page on "searching"
David Bremner [Sun, 18 Jan 2015 12:59:30 +0000 (13:59 +0100)]
doc: add material on stemming and wildcards
This is lightly massaged from the searching page on the wiki.
Jani Nikula [Tue, 27 Jan 2015 19:48:17 +0000 (21:48 +0200)]
completion: complete notmuch dump --gzip option
Jani Nikula [Tue, 27 Jan 2015 19:48:16 +0000 (21:48 +0200)]
doc: document notmuch-restore --input=filename option
Document all options for completeness.
Jani Nikula [Tue, 27 Jan 2015 19:48:15 +0000 (21:48 +0200)]
doc: document notmuch-dump --output=filename option
Document all options for completeness.
Jani Nikula [Tue, 27 Jan 2015 19:48:14 +0000 (21:48 +0200)]
doc: bring notmuch-dump manual page in line with the rest
Fix indentation of options. Move search terms description before
options. Fix synopsis.
David Bremner [Thu, 19 Feb 2015 18:03:21 +0000 (19:03 +0100)]
doc: remove reference to sender,recipients from notmuch-search.1
Apparently these were missed when notmuch-address was split to it's
own subcommand.
Tomi Ollila [Wed, 18 Feb 2015 14:54:01 +0000 (16:54 +0200)]
configure: consistent command -v usage
When the shell builtin `command -v` operates normally, it either
prints the path of the arg given to it and returns zero -- or it
returns nonzero and prints nothing.
In abnormal situations something might be printed to stderr and
in that case we want to know about it; therefore the used
command -v stderr redirections to /dev/null have been removed.
The `hash` (builtin) command in ksh returns zero even the arg
given to is is not found in path. For that and for consistency
the one appearance of it has been converted to `command -v`.
Stefano Zacchiroli [Sun, 15 Feb 2015 12:39:08 +0000 (13:39 +0100)]
notmuch-mutt: support for messages that lack Message-ID headers
For those messages, compute a synthetic Message-ID based on the SHA1
of the whole message, in the same way that notmuch would do. See:
http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/sha1.c
To do the above, rewrite get_message_id() to accumulate header lines,
parse them to check for Message-ID, and fallback to SHA1 computation
if it is not present.
Thanks to:
- Jan N. Klug for preliminary versions of this patch
- Tomi Ollila for suggesting an elegant implementation
Stefano Zacchiroli [Sun, 15 Feb 2015 12:39:07 +0000 (13:39 +0100)]
notmuch-mutt README: use metacpn.org/* as deps homepages
Stefano Zacchiroli [Sun, 15 Feb 2015 12:39:06 +0000 (13:39 +0100)]
notmuch-mutt: bump copyright year
Jinwoo Lee [Mon, 2 Feb 2015 21:04:52 +0000 (13:04 -0800)]
emacs: Add a defcustom that specifies regexp for blocked remote images.
It's default value is ".", meaning all remote images will be blocked
by default.
Austin Clements [Sat, 24 Jan 2015 21:17:03 +0000 (16:17 -0500)]
emacs: Support cid: references with shr renderer
shr has really nice support for inline image rendering, but previously
we only had the hooks for w3m cid: references.
Austin Clements [Sat, 24 Jan 2015 21:17:02 +0000 (16:17 -0500)]
emacs: Rewrite content ID handling
Besides generally cleaning up the code and separating the general
content ID handling from the w3m-specific code, this fixes several
problems.
Foremost is that, previously, the code roughly assumed that referenced
parts would be in the same multipart/related as the reference.
According to RFC 2392, nothing could be further from the truth:
content IDs are supposed to be globally unique and globally
addressable. This is nonsense, but this patch at least fixes things
so content IDs can be anywhere in the same message.
As a side-effect of the above, this handles multipart/alternate
content-IDs more in line with RFC 2046 section 5.1.2 (not that I've
ever seen this in the wild). This also properly URL-decodes cid:
URLs, as per RFC 2392 (the previous code did not), and applies crypto
settings from the show buffer (the previous code used the global
crypto settings).
Austin Clements [Sat, 24 Jan 2015 21:17:01 +0000 (16:17 -0500)]
emacs: Use generalized content caching in w3m CID code
Previously this did its own caching, but this is now supported by more
generally by `notmuch-get-bodypart-binary'.
Austin Clements [Sat, 24 Jan 2015 21:17:00 +0000 (16:17 -0500)]
emacs: Support caching in notmuch-get-bodypart-{binary,text}
(The actual code change here is small, but requires re-indenting
existing code.)
Austin Clements [Sat, 24 Jan 2015 21:16:59 +0000 (16:16 -0500)]
emacs: Return unibyte strings for binary part data
Unibyte strings are meant for representing binary data. In practice,
using unibyte versus multibyte strings affects *almost* nothing. It
does happen to matter if we use the binary data in an image descriptor
(which is, helpfully, not documented anywhere and getting it wrong
results in opaque errors like "Not a PNG image: <giant binary spew
that is, in fact, a PNG image>").
Austin Clements [Sat, 24 Jan 2015 21:16:58 +0000 (16:16 -0500)]
emacs: Remove broken `notmuch-get-bodypart-content' API
`notmuch-get-bodypart-content' could do two very different things,
depending on conditions: for text/* parts other than text/html, it
would return the part content as a multibyte Lisp string *after*
charset conversion, while for other parts (including text/html), it
would return binary part content without charset conversion.
This commit completes the split of `notmuch-get-bodypart-content' into
two different and explicit APIs: `notmuch-get-bodypart-binary' and
`notmuch-get-bodypart-text'. It updates all callers to use one or the
other depending on what's appropriate.
Austin Clements [Sat, 24 Jan 2015 21:16:57 +0000 (16:16 -0500)]
emacs: Create an API for fetching parts as undecoded binary
The new function, `notmuch-get-bodypart-binary', replaces
`notmuch-get-bodypart-internal'. Whereas the old function was really
meant for internal use in `notmuch-get-bodypart-content', it was used
in a few other places. Since the difference between
`notmuch-get-bodypart-content' and `notmuch-get-bodypart-internal' was
unclear, these other uses were always confusing and potentially
inconsistent. The new call clearly requests the part as undecoded
binary.
This is step 1 of 2 in separating `notmuch-get-bodypart-content' into
two APIs for retrieving either undecoded binary or decoded text.
Austin Clements [Sat, 24 Jan 2015 21:16:56 +0000 (16:16 -0500)]
emacs: Track full message and part descriptor in w3m CID store
This will simplify later changes.
David Bremner [Sun, 18 Jan 2015 12:59:29 +0000 (13:59 +0100)]
doc: add details about Xapian search syntax
Questions related to the way that probabilistic prefixes and phrases
are handled come up quite often and it is nicer to have the documentation self contained. Hopefully putting it in subsections prevents it from being overwhelming.
David Bremner [Sun, 25 Jan 2015 14:04:51 +0000 (15:04 +0100)]
doc: gzipped notmuch.3 before trying to install notmuch.3.gz
If HAVE_SPHINX=0 but HAVE_DOXYGEN=1, then the previous version was
trying to install notmuch.3.gz but only got as far as creating
notmuch.3
Todd [Thu, 22 Jan 2015 23:43:40 +0000 (17:43 -0600)]
Update documentation
Adds new entry to the NEWS file, and updates the search terms section
of the man page. The search terms section needs to be updated again
once the new section in the documentation covering probablistic terms
has been committed.
Todd [Thu, 22 Jan 2015 23:43:39 +0000 (17:43 -0600)]
Update completions for Emacs and bash
This adds completions for both Emacs and bash. ZSH does not appear to
have completions for search terms.
Todd [Thu, 22 Jan 2015 23:43:38 +0000 (17:43 -0600)]
Add indexing for the mimetype term
This adds the indexing support for the "mimetype:" term and removes
the broken test flag. The indexing is probablistic in Xapian terms,
which gives a better experience to end users. Standard content-types
of the form "foo/bar" are automatically interpreted as phrases in
Xapian due to the embedded slash.
Assume, separate messages with application/pdf and application/x-pdf
are indexed, then:
- mimetype:application/x-pdf will find only the application/x-pdf
- mimetype:application/pdf will find only the application/pdf
- mimetype:pdf will find both of the messages
Todd [Thu, 22 Jan 2015 23:43:37 +0000 (17:43 -0600)]
Add the NOTMUCH_FEATURE_INDEXED_MIMETYPES database feature
This feature will exist in all newly created databases, but there is
no upgrade provided for it. If this flag exists, it indicates that
the database was created after the indexed MIME-types feature was
added.
Todd [Thu, 22 Jan 2015 23:43:36 +0000 (17:43 -0600)]
test: Add failing unit tests for indexed mime types
Adds three failing unit tests for searching of mime-types.
An attempt was made at adding a negative test (i.e. searching for a
non-existent mime-type and ensuring it didn't return a message), but
that test would always pass making it pointless.
David Bremner [Thu, 22 Jan 2015 08:37:32 +0000 (09:37 +0100)]
emacs: escape % in header line format
We set header-line-format to the message subject, but if the subject
contains percents, the next character is interpreted as a formatting
control, which is not desired.
Franz Fellner [Thu, 22 Jan 2015 20:16:47 +0000 (21:16 +0100)]
VIM: Improve performance of folders_render
Simply use query.count_[messages,threads] instead of actually running
the query and using the count attribute of the result set.
Franz Fellner [Thu, 22 Jan 2015 12:52:47 +0000 (13:52 +0100)]
VIM: Respect exclude_tags specified in .notmuch-config
Exclude mails tagged with any tag specified in 'notmuch config get
search.exclude_tags' in folders list and search list.
David Bremner [Sun, 18 Jan 2015 16:55:10 +0000 (17:55 +0100)]
doc: remove support for rst2man
It was becoming increasingly complicated to support rst2man, and there
were apparently not many people that relied on it.
Tomi Ollila [Sun, 21 Sep 2014 18:06:20 +0000 (21:06 +0300)]
test: prepare test-lib.sh for possible test system debug session
When something in tests fails one possibility to test is to run
the test script as `bash -x TXXX-testname.sh`. As stderr (fd 2) was
redirected to separate file during test execution also this set -x
(xtrace) output would also go there.
test-lib.sh saves the stderr to fd 7 from where it can be restored,
and bash has BASH_XTRACEFD variable, which is now given the same value
7, making bash to output all xtrade information (consistently) there.
This lib file used to save fd's 1 & 2 to 6 & 7 (respectively) in
test_begin_subtest(), but as those needs to be set *before* XTRACEFD
variable is set those are now saved at the beginning of the lib (once).
This is safe and simple thing to do.
To make xtrace output more verbose PS4 variable was set to contain the
source file, line number and if execution is in function, that function
name. Setting this variable has no effect when not xtracing.
As it is known that fd 6 is redirected stdout, printing status can now
use that fd, instead of saving stdout to fd 5 and use it.
Todd [Sat, 17 Jan 2015 15:51:46 +0000 (09:51 -0600)]
lib: Fix use after free
_thread_set_subject_from_message sometimes replaces the subject, making the
cur_subject point to free'd memory
==6550== ERROR: AddressSanitizer: heap-use-after-free on address 0x601a0000bec0 at pc 0x4464a4 bp 0x7fffa40be910 sp 0x7fffa40be908
READ of size 1 at 0x601a0000bec0 thread T0
#0 0x4464a3 in _thread_add_matched_message /home/todd/.apps/notmuch/lib/thread.cc:369
#1 0x443c2c in notmuch_threads_get /home/todd/.apps/notmuch/lib/query.cc:496
#2 0x41d947 in do_search_threads /home/todd/.apps/notmuch/notmuch-search.c:131
#3 0x40a3fe in main /home/todd/.apps/notmuch/notmuch.c:345
#4 0x7f4e535b4ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
#5 0x40abe6 in _start ??:?
0x601a0000bec0 is located 96 bytes inside of 134-byte region [0x601a0000be60,0x601a0000bee6)
freed by thread T0 here:
#0 0x7f4e54e6933a in __interceptor_free ??:?
#1 0x7f4e54482fab in _talloc_free ??:?
previously allocated by thread T0 here:
#0 0x7f4e54e6941a in malloc ??:?
#1 0x7f4e54485b5d in talloc_strdup ??:?
Todd [Sat, 17 Jan 2015 15:51:45 +0000 (09:51 -0600)]
lib: Fix potential invalid read past an empty string
==22884== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x601600008291 at pc 0x7ff6295680e5 bp 0x7fff4ab9aa40 sp 0x7fff4ab9aa08
READ of size 1 at 0x601600008291 thread T0
#0 0x7ff6295680e4 in __interceptor_strcmp ??:?
#1 0x44763b in _thread_add_message /home/todd/.apps/notmuch/lib/thread.cc:255
#2 0x4459e8 in notmuch_threads_get /home/todd/.apps/notmuch/lib/query.cc:496
#3 0x41e2a7 in do_search_threads /home/todd/.apps/notmuch/notmuch-search.c:131
#4 0x40a408 in main /home/todd/.apps/notmuch/notmuch.c:345
#5 0x7ff627cb9ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
#6 0x40abf3 in _start ??:?
0x601600008291 is located 0 bytes to the right of 97-byte region [0x601600008230,0x601600008291)
allocated by thread T0 here:
#0 0x7ff62956e41a in malloc ??:?
#1 0x7ff628b8ab5d in talloc_strdup ??:?
Michal Sojka [Fri, 19 Sep 2014 18:16:40 +0000 (20:16 +0200)]
Emacs: Display a message when generating address completion candidates
The TAB-initiated address completion generates completion candidates
synchronously, blocking the UI. Since this can take long time, it is
better to let the use know what's happening.
W. Trevor King [Fri, 3 Oct 2014 18:20:58 +0000 (11:20 -0700)]
nmbug: Add a 'help' command for folks who don't like --help
The 'if args.func == help' block at the end avoids:
AttributeError: 'functools.partial' object has no attribute '__code__'