Previously, _notmuch_database_filename_to_direntry would abort with an
internal error when called on a read-only database. Now that creating
the directory document is optional,
notmuch_database_find_message_by_filename can disable directory
document creation (as it should) and, as a result, not abort on
read-only databases.
notmuch_database_get_directory no longer returns an error for
read-only databases, so remove ReadOnlyDatabaseError from the list of
get_directory exceptions.
Previously, notmuch_database_get_directory did not indicate whether or
not the returned directory object was newly created, which required a
workaround to distinguish newly created directory objects with no
child messages from directory objects that had no mtime set but did
have child messages. Now that notmuch_database_get_directory
distinguishes whether or not the directory object exists in the
database, this workaround is no longer necessary.
Using the new support from _notmuch_directory_create, this makes
notmuch_database_get_directory a read-only operation that simply
returns the directory object if it exists or NULL otherwise. This
also means that notmuch_database_get_directory can work on read-only
databases.
This change breaks the directory mtime workaround in notmuch-new.c by
fixing the exact issue it was working around. This permits mtime
update races to prevent scans of changed directories, which
non-deterministically breaks a few tests. The next patch fixes this.
Now _notmuch_database_filename_to_direntry takes a flags argument and
can indicate if the necessary directory documents do not exist.
Again, callers have been updated, but retain their original behavior.
Now _notmuch_database_find_directory_id takes a flags argument, which
it passes through to _notmuch_directory_create and can indicate if the
directory does not exist. Again, callers have been updated, but
retain their original behavior.
Previously this function would create directory documents if they
didn't exist. As a result, it could only be used on writable
databases. This adds an argument to make creation optional and to
make this function work on read-only databases. We use a flag
argument to avoid a bare boolean and to permit future expansion.
Both callers have been updated, but currently retain the old behavior.
We'll take advantage of the new argument in the following patches.
When mail message is read from emacs, the message structure
obtained may contain parts which have content included
(`text/plain` for example) and other parts where content is not
included (`text/html` for example).
In case content is included, the string is already available in
emacs' internal format and therefore mm-... functions should not
attempt to do further decoding for the data in temp buffer
provided for it.
Currently when reply buffer is created,
notmuch-mm-display-part-inline () is used to provided quoted reply
content. This change makes the mm-... functions called by it use
'gnus-decoded as charset whenever the content is already available.
File .../emacs-23.3/lisp/gnus/mm-uu.el mentions:
"`gnus-decoded' is a fake charset, which means no further decoding."
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.15.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
8dc8495010 introduced a bug, if the
requested header is not set the underlying notmuch function returns an
empty string that also made the expression true resulting in an
exception being raised. Partly revert the commit to fix this
issue. Testing for equality with None is correct in this case since
the restype of the function Message._get_header is c_char_p so NULL
pointers are in fact converted to None in this case.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Removes Message.format_message_{internal,as_json,as_text}.
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. The code has been marked as deprecated
in 0.13 and is now removed.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Removes notmuch.py. If someone wants to step up and work on this it
can always be restored using the version control system.
notmuch.py was meant to be a python implementation of the notmuch
utility. It was never finished and hasn't been updated to changes in
the API and bindings and its features and interface haven't been kept
in sync with the notmuch utility.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Recommend all notmuch UI (including notmuch-mutt) as alternatives, to
avoid unneeded vim/emacs installation.
Thanks Matteo F. Vescovi for the patch.
Closes: #673011
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.
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.
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.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Use the new built in error type that replaces os.Error, adapt the code
to the fact that strings.Split has just two arguments now.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Set the LDFLAGS to -lnotmuch so the resulting go package will be
linked with libnotmuch.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
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.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
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.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
notmuch.OpenDatabase now returns a status indicating success or
failure. Use this information to inform the user of any failures.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
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.