Austin Clements [Sun, 13 May 2012 23:36:11 +0000 (19:36 -0400)]
python: Update for changes to notmuch_database_get_directory
notmuch_database_get_directory now returns
NOTMUCH_STATUS_READ_ONLY_DATABASE on its own (rather than crashing) so
the workaround in Database.get_directory is no longer necessary.
Austin Clements [Sun, 13 May 2012 23:36:09 +0000 (19:36 -0400)]
lib/cli: Make notmuch_database_get_directory return a status code
Previously, notmuch_database_get_directory had no way to indicate how
it had failed. This changes its prototype to return a status code and
set an out-argument to the retrieved directory, like similar functions
in the library API. This does *not* change its currently broken
behavior of creating directory objects when they don't exist, but it
does document it and paves the way for fixing this. Also, it can now
check for a read-only database and return
NOTMUCH_STATUS_READ_ONLY_DATABASE instead of crashing.
In the interest of atomicity, this also updates calls from the CLI so
that notmuch still compiles.
Justus Winter [Wed, 9 May 2012 11:15:19 +0000 (13:15 +0200)]
go: update the build system
The new "go" utility does not require any Makefiles to compile go
packages and programs. Remove the old Makefiles and replace the top
level Makefile with one defining some convenience targets for
compiling the notmuch bindings and the notmuch-addrlookup utility.
Justus Winter [Wed, 9 May 2012 11:15:16 +0000 (13:15 +0200)]
go: reorganize the go bindings
go 1 introduced the "go" program that simplifies building of libraries
and programs. This patch reorganizes the go code so it can be compiled
using the new utility, it does not change any files.
Justus Winter [Wed, 9 May 2012 10:23:07 +0000 (12:23 +0200)]
go: fix the notmuch status constants
Formerly all the constants were set to zero since in golang constants
are set to the previous value if no new value is specified. Use the
iota operator that is incremented after each use to fix this issue.
emacs: fix custom queries section customization widget in notmuch-hello
The customization widget referred to a non-existing function
`notmuch-hello-insert-query-list'. The patch changes it to the
correct one - `notmuch-hello-insert-searches'. The relevant test is
fixed now.
test: Force reply to use html2text for consistency
The output of the HTML reply test in the emacs suite can vary
depending on which HTML renderers are installed on the machine running
the tests. The renderer that is always available is emacs's builtin
html2text function. In order to get consistency, force the test to use
html2text even if other renderers are available.
Michal Sojka [Tue, 1 May 2012 21:10:47 +0000 (23:10 +0200)]
emacs: Do not pass stderr of notmuch reply to JSON parser
Sometimes, notmuch reply outputs something to stderr, for example:
"Failed to verify signed part: Cannot verify multipart/signed part:
unsupported signature protocol". When this happens, replying in emacs
fails, because emacs cannot parse the error message as JSON.
This patch causes emacs to ignore stderr when reading reply from
notmuch.
Thomas Jost [Fri, 4 May 2012 10:37:56 +0000 (12:37 +0200)]
emacs: Let the user choose where to compose new mails
Introduce a new defcustom notmuch-mua-compose-in that allows users to
specify where new mails are composed, either in the current window or
in a new window or frame.
emacs: Correctly quote non-text/plain parts in reply
Quote non-text parts nicely by displaying them with mm-display-part
before calling message-cite-original to quote them. HTML-only emails
can now be quoted correctly. We re-use some code from notmuch-show
(notmuch-show-mm-display-part-inline), which has been moved to
notmuch-lib.el.
With the latest reply infrastructure, we should be able to nicely
quote HTML-only emails. But currently emacs quotes the raw HTML
instead of parsing it first. This commit adds a test for this case.
David Bremner [Tue, 4 Oct 2011 17:01:21 +0000 (14:01 -0300)]
debian: update packaging for new soname libnotmuch.so.3
we need
- a new changelog stanza, because the symbols files need a new version
- s/libnotmuch2/libnotmuch3/ everywhere
- update symbols file, s/.so.1/.so.2/, and bump minimum versions on changed
symbols (although the latter is just documentation)
lib/cli: Make notmuch_database_create return a status code
This is the notmuch_database_create equivalent of the previous change.
In this case, there were places where errors were not being propagated
correctly in notmuch_database_create or in calls to it. These have
been fixed, using the new status value.
lib/cli: Make notmuch_database_open return a status code
It has been a long-standing issue that notmuch_database_open doesn't
return any indication of why it failed. This patch changes its
prototype to return a notmuch_status_t and set an out-argument to the
database itself, like other functions that return both a status and an
object.
In the interest of atomicity, this also updates every use in the CLI
so that notmuch still compiles. Since this patch does not update the
bindings, the Python bindings test fails.
Tomi Ollila [Thu, 26 Apr 2012 19:52:31 +0000 (22:52 +0300)]
NEWS: Insert markdown formatting commands
To make updating the notmuchmail.org wiki 'news' section more
straightforward the content of the NEWS file has now been brought
to almost the same as the *.mdwn files in the wiki page.
The changes are basically insertion of mdwn formatting "commands".
More effort has been put into formatting the newer release entries
(0.12, 0.11 & 0.10) than older. Commit to format 0.13 entries will
be made available separately.
Tomi Ollila [Thu, 26 Apr 2012 19:52:29 +0000 (22:52 +0300)]
NEWS: untabified and added file local variables block
Changed all tabs to 8 spaces (M-x untabify over region of the
whole file).
Now this looks uniformly on all viewers (using fixed-width font)
and the observed difference between this "source" file and markdown
generated html output on browser window is smaller. In markdown to
html conversions tab and 8 spaces indents differently.
Also the "Local variables:" block added to the end of this file
attempts to ensure tabs are always expanded; whether the used editor
is Emacs or Vi.
go: Update to the current notmuch_database_find_message API
The signature of notmuch_database_find_message was changed in 02a30767
to report errors and the Go bindings were never updated. This brings
the Go bindings in sync with that change and at least makes them
compile with Go r60.3, the last release before Go 1.
Put a prominent warning into the docstring of Database.close, make the
function show up in the sphinx doc and refer to the warning in the
paragraph mentioning the context manager protocol.
python: deprecate code formatting messages as text and json
This code adds functionality at the python level that is unlikely to
be useful for anyone. Furthermore the python bindings strive to be a
thin wrapper around libnotmuch, so this code will be removed in
notmuch 0.14.
Cleanup the code, reword the docstring and use the same implementation
in the Threads, Tags and Messages classes.
__nonzero__ implements truth value testing. If __nonzero__ is not
implemented, the python runtime would fall back to `len(..) > 0` thus
exhausting the iterator.
emacs: modify show tag functions to use new notmuch-tag interface
The main change here is to modify argument parsing so as to not force
tag-changes to be a list, and to let notmuch-tag handle prompting the
user when required. doc strings are also updated and cleaned up.
emacs: modify search tag functions to use new notmuch-tag interface
The main change here is to modify argument parsing so as to not force
tag-changes to be a list, and to let notmuch-tag handle prompting the
user when required. doc strings are also updated and cleaned up.
emacs: allow notmuch-tag to accept string inputs and prompt for tags
notmuch-tag is extended to accept various formats of the tag changes.
In particular, user prompting for tag changes is now incorporated
here, so it is common for modes.
The tag binary and the notmuch-{before,after}-tag-hooks are only
called if tag changes is non-nil.
emacs: create notmuch-tag.el, and move appropriate functions from notmuch.el
Tagging functions are used in notmuch.el, notmuch-show.el, and
notmuch-message.el. There are enough common functions for tagging
that it makes sense to put them all in their own library.
David Edmondson [Tue, 31 Jan 2012 08:01:54 +0000 (08:01 +0000)]
emacs: Don't move to the next thread unless the cursor is at the end of the buffer.
When using the spacebar to scroll through a thread, hitting 'space'
when the bottom of the last message is visible should take the cursor
to the end of the buffer rather than immediately archiving the thread
and moving to the next thread.
Mark Walters [Thu, 15 Mar 2012 18:28:10 +0000 (18:28 +0000)]
emacs-show: open excluded matches if no other matches
Currently emacs show does not open matching but excluded
messages. This is normally the desired behaviour but is probably not
ideal if only excluded messages match. This patch opens all the
matching (necessarily excluded) messages in this case and goes to the
first one.
A previous patch [0] replaced blank subject lines with '[No Subject]'
in search and show mode. Apparently this was needed to circumvent
some bug in the printing code, but there was no need for it search or
show, and it is definitely not desirable, so we undo it here (a revert
is no longer feasible). We should not be modifying strings in the
original message without good reason, or without a clear indication
that we are doing so, neither of which apply in this case. For
further discussion see [0].
Peter Wang [Sat, 14 Apr 2012 01:41:05 +0000 (11:41 +1000)]
config: Add 'config list' command
Add a command to list all configuration items with their associated
values.
One use is as follows: a MUA may prefer to store data in a central
notmuch configuration file so that the data is accessible across
different machines, e.g. an addressbook. The list command helps
to implement features such as tab completion on the keys.
Peter Wang [Sat, 14 Apr 2012 01:41:02 +0000 (11:41 +1000)]
config: Check 'config get' arity exactly
Require that 'config get' is passed exactly one additional argument,
instead of silently ignoring extra arguments. As a side-effect, produce
more specific error messages for the 'config' command as a whole.
Formerly notmuch_database_close closed the xapian database and
destroyed the talloc structure associated with the notmuch database
object. Split notmuch_database_close into notmuch_database_close and
notmuch_database_destroy.
This makes it possible for long running programs to close the xapian
database and thus release the lock associated with it without
destroying the data structures obtained from it.
This also makes the api more consistent since every other data
structure has a destructor function.
The comments in notmuch.h are a courtesy of Austin Clements.
new: Fix missing end_atomic in remove_filename on error
Previously, if we failed to find the message by filename in
remove_filename, we would return immediately from the function without
ending its atomic block. Now this code follows the usual goto DONE
idiom to perform cleanup.
This was going to stdout. I removed the newline at the beginning of
printing the fatal error message because it wouldn't make sense if you
were only looking at the stderr stream (e.g., you had redirected
stdout to /dev/null).
Previously, fatal errors in add_files_recursive were not treated as
fatal by its callers (including itself!). This makes
add_files_recursive errors consistently fatal and updates all callers
to treat them as fatal.
emacs: modify help message for notmuch-search-line-faces to reflect preferred "deleted" tag name.
No functional change here. The help message previously referred to
the "delete" tag, but "deleted" is now preferred, so hopefully this
will reduce any potential confusion.
Jani Nikula [Thu, 12 Apr 2012 20:57:39 +0000 (23:57 +0300)]
lib: work around talloc_steal usage from C++ code
Implicit typecast from 'void *' to 'T *' is okay in C, but not in
C++. In talloc_steal, an explicit cast is provided for type safety in
some GCC versions. Otherwise, a cast is required. Provide a template
function for this to maintain type safety, and redefine talloc_steal
to use it.
The template must be outside the extern "C" block (NOTMUCH_BEGIN_DECLS
and NOTMUCH_END_DECLS), but keep it within the GCC visibility #pragma.
No functional changes, apart from making the library build with
compilers other than recent GCC.
Record dependencies during build instead of before
Previously, the makefile created dependency files in a separate, first
pass. In particular, include-ing the dependency files would cause
make to attempt to rebuild those files using the dependency-generation
rules in the makefile. Unfortunately, this approach required obtuse
rules and silently delayed the start of the build process (by quite a
bit on a clean tree without any dependency files). Worse, this
required the dependency files to themselves depend on all of the
headers the source file depended on, which meant that, if a header
file was removed, the depedency file could not be updated because of a
missing dependency (!), which would cause make to silently fail.
This patch eliminates the dependency generation rules and instead
generates dependency files as a side-effect of the regular build rule.
On the first build, we don't need to know the dependencies beforehand;
the object file doesn't exist, so it will be built anyway. On
subsequent builds, if a header file is updated, the dependency rules
generated by the previous build will force a rebuild. If a source
file is updated, the dependency rules may be stale, but it doesn't
matter because the updated source file will force a rebuild.
In the final case above, the stale dependency rules may refer to a
header file that no longer exists but is also no longer needed. In
order to prevent this from breaking the build, we also pass gcc the
-MP option, which generates phony targets for every depended-on header
file, so make won't complain if it can't find them during a later
build.