Michal Sojka [Tue, 3 Nov 2015 21:02:12 +0000 (22:02 +0100)]
emacs: Make notmuch-message-mode play nicely with flyspell
Flyspell mode uses a special setting for message-mode to not
spell-check message headers except Subject. Apply this setting also to
notmuch-message-mode.
Commit e26d767897e8ab59f05808a12ac5c9c1e3c7030f changed the
fontification of the body associated with the From header to
message-header-from. However, that face is non-existent, and in
message.el (message-font-lock-keywords) the From-header falls through
and is attributed the message-header-other face.
This commit removes the fontification of the [Ff]rom header in
notmuch-show-mode in order to fontify it using the message-header-other
face.
This only affects non-default configurations where
notmuch-message-headers is set to display From.
David Bremner [Fri, 30 Oct 2015 10:12:50 +0000 (07:12 -0300)]
release: disable wget certificate check
this is a minor security hole, but no worse than what we had before. In
particular the worst that happens is someone prevents us from making a
release. Which is hardly worth the trouble of jacking the URL.
Michal Sojka [Mon, 26 Oct 2015 23:22:49 +0000 (00:22 +0100)]
Emacs: Add address completion based on company-mode
When company-mode is available (Emacs >= 24), address completion
candidates are shown in a nice popup box. This is triggered either by
pressing TAB or by waiting a while during typing an address. The
completion is based entirely on the asynchronous address harvesting
from notmuch-address.el so the GUI is theoretically not blocked for
long time.
The completion works similarly as the TAB-initiated completion from
notmuch-address.el, i.e. quick harvest based on user input is executed
first and only after full harvesting is finished, in-memory cached data
is used.
Michal Sojka [Mon, 26 Oct 2015 23:22:48 +0000 (00:22 +0100)]
Emacs: Add address completion mechanism implemented in elisp
Currently, notmuch has an address completion mechanism that requires
external command to provide completion candidates. This commit adds a
completion mechanism inspired by https://github.com/tjim/nevermore,
which is implemented in Emacs lisp only.
The preexisting address completion mechanism, activated by pressing
TAB on To/Cc lines, is extended to use the new mechanism when
notmuch-address-command to 'internal, which is the new default.
The core of the new mechanism is the function notmuch-address-harvest,
which collects the completion candidates from the notmuch database and
stores them in notmuch-address-completions variable. The address
harvesting can run either synchronously (same as with the previous
mechanism) or asynchronously. When the user presses TAB for the first
time, synchronous harvesting limited to user entered text is performed.
If the entered text is reasonably long, this operation is relatively
fast. Then, asynchronous harvesting over the full database is triggered.
This operation may take long time (minutes on rotating disk). After it
finishes, no harvesting is normally performed again and subsequent
completion requests use the harvested data cached in memory. Completion
cache is updated after 24 hours.
Note that this commit restores (different) completion functionality for
users when the user used external command named "notmuch-addresses",
i.e. the old default. The result will be that the user will use
the new mechanism instead of this command. I believe that many users may
not even recognize this because the new mechanism works the same as
http://commonmeasure.org/~jkr/git/notmuch_addresses.git and perhaps also
as other commands suggested at
http://notmuchmail.org/emacstips/#address_completion.
[This feature was significantly improved by David Bremner and Mark Walters]
David Bremner [Mon, 26 Oct 2015 23:22:47 +0000 (00:22 +0100)]
emacs: replace use of notmuch-address-message-insinuate
This allows e.g. Gnus users to load this file without changing
message-mode behaviour.
This will disable completion for those that did not customize the
variable but relied on the existence of a file named "notmuch-addresses"
in their path. In the next commit the default behaviour will change to
use a "workalike" internal completion mechanism.
Jani Nikula [Sat, 17 Oct 2015 16:30:02 +0000 (19:30 +0300)]
completion: complete shared options for each command
Add support for completing --help, --uuid=, and --version after the
subcommand. Do not support shared options at the top level yet due to
difficulties in handling options with arguments.
--uuid necessitates adding 'compopt -o nospace' also to notmuch new
completion, but that just brings it in line with the rest.
Mark Walters [Wed, 14 Oct 2015 08:38:22 +0000 (09:38 +0100)]
emacs: allow saved searches to select tree-view
This patch allows the user to customize a saved search to choose tree
view rather than the default search view. It also updates notmuch-jump
so that it respects this choice.
Jani Nikula [Sat, 17 Oct 2015 20:58:48 +0000 (23:58 +0300)]
man: clarify the parameters for lastmod: range query
<since> and <until> for the lastmod: prefix right below the date:
prefix description give the impression one could use last modified
dates to lastmod: which is not at all the case. Use
<initial-revision>..<final-revision> instead.
Tomi Ollila [Mon, 19 Oct 2015 18:09:21 +0000 (21:09 +0300)]
NEWS: a few formatting updates for 0.21 news items (wiki compatibility)
Trailing dots were removed from 3 NEWS items so that those appear in
same level as surrounding "heading" lines in generated wiki page.
One trailing dot was added to nmbug-status item so it appears as normal
text in generated wiki page. `nmbug-status` was put in backticks so it
looks the same as in older nmbug-status news text.
Mark Walters [Thu, 15 Oct 2015 18:53:09 +0000 (19:53 +0100)]
emacs: show: increase default max-text-part-size
Currently notmuch-show-max-text-part-size is 10000 which means some
relatively normal messages have all parts hidden by default. Increase
this to 100000 by default.
The setting was introduced to alleviate problems with notmuch being
very slow on large threads. Users hitting these problems may wish to
customize this variable to something smaller (like 10000).
Mark Walters [Thu, 15 Oct 2015 18:46:34 +0000 (19:46 +0100)]
emacs: tree bugfix
Formerly replying to an encrypted message in tree-view did not work:
the message was not decrypted. This commit makes notmuch-tree respect
the setting of notmuch-crypto-process-mime. In particular, if
notmuch-crypto-process-mime is set to t, then replying to encrypted
messages in tree mode will now decrypt the reply (as it already did in
show mode).
Jani Nikula [Fri, 25 Sep 2015 20:48:46 +0000 (23:48 +0300)]
cli: delete directory documents on directory removal
There was a problem with the directory documents being left behind when
the filesystem directory was removed. This was worked around in [1].
However, that ignored the fact that the directory documents are also
still listed by notmuch_directory_get_child_directories() leading to
confusing results when running notmuch new. The directory documents are
found and queued for removal over and over again.
Fix the problem for real by removing the directory documents. This fixes
the tests flagged as broken in [2].
The (non-deterministic) hack test from [3] also still passes with this
change.
Jani Nikula [Fri, 25 Sep 2015 20:48:44 +0000 (23:48 +0300)]
test: flag one more notmuch new test as broken
Drop the test update added in [1] and mark the test as broken, like the
tests flagged as broken in [2]. These all reflect the same underlying
breakage with (lack of) directory deletion.
David Bremner [Sun, 27 Sep 2015 15:31:57 +0000 (12:31 -0300)]
lib: add versions of n_q_count_{message,threads} with status return
Although I think it's a pretty bad idea to continue using the old API,
this allows both a more gentle transition for clients of the library,
and allows us to break one monolithic change into a series
Tomi Ollila [Wed, 30 Sep 2015 06:36:52 +0000 (09:36 +0300)]
notmuch-emacs-mua: make --auto-daemon imply --create-frame
Before this change with --auto-daemon but without --create-frame
emacs server was started but no clients stay connected to it
(in both graphical and terminal displays).
Note that this changes how --client --auto-daemon works on
graphical display; New emacs frame is now created for the
message (and message-exit-actions hook appended).
Jani Nikula [Sat, 15 Aug 2015 09:05:15 +0000 (12:05 +0300)]
notmuch-emacs-mua: do not create a frame by default with --client
Make the default behaviour for --client the same as emacsclient
default: do not create a new frame. Add a new option --create-frame,
passing the same option to emacsclient to create a frame.
Jani Nikula [Sat, 15 Aug 2015 09:05:14 +0000 (12:05 +0300)]
notmuch-emacs-mua: add --auto-daemon option to start Emacs daemon as needed
Automatically starting Emacs in daemon mode if the Emacs server is not
running is a matter of preference better not hard coded in
notmuch-emacs-mua. Add an option to control the behaviour.
Jani Nikula [Fri, 25 Sep 2015 18:47:35 +0000 (21:47 +0300)]
cli: use designated initializer to initialize add_files_state
The side effect is that all of add_files_state will be initialized to
zero, removing any lingering doubt that some of it might not be
initialized. It's not a small struct, and the initialization is
scattered around a bit, so this makes the code more readable.
Jani Nikula [Sat, 26 Sep 2015 11:37:51 +0000 (14:37 +0300)]
nmbug-status: add support for specifying sort order for each view
Let each view have a "sort" key, typically used with values
"oldest-first" or "newest-first" (although all values in Query.SORT
are accepted), and sort the results accordingly. Oldest first remains
the default.
The dynamic approach of mapping sort values is as suggested by
W. Trevor King <wking@tremily.us>.
David Bremner [Sat, 26 Sep 2015 12:22:11 +0000 (09:22 -0300)]
debian: fix linking in emacsen-install script
When upgrading emacs, the install file can (apparently) be called with
the lisp files already linked into the flavour specific
directories. In this case we should not fail.
Jani Nikula [Thu, 3 Sep 2015 19:40:05 +0000 (22:40 +0300)]
cli: do not sort addresses on --output=count or --deduplicate=address
The order of the results with --output=count and --deduplicate=address
are unspecified as they're based on a hash table traversal. This being
the case, optimize the query by explicitly requesting unsorted
results. Clarify the documentation accordingly.
First a simple smoke test first, next generate messages with multiple
email address variants and check the behaviour of deduplication
schemes with these.
Jani Nikula [Fri, 25 Sep 2015 16:48:20 +0000 (19:48 +0300)]
cli: change the data structure for notmuch address deduplication
Currently we key the address hash table with the case sensitive "name
<address>". Switch to case insensitive keying with just address, and
store the case sensitive name and address in linked lists. This will
be helpful in adding support for different deduplication schemes in
the future.
There will be a slight performance penalty for the current full case
sensitive name + address deduplication, but this is simpler as a whole
when other deduplication schemes are added, and I expect the schemes
to be added to become more popular than the current default.
Aparet from the possible performance penalty, the only user visible
change should be the change in the output ordering for
--output=count. The order is not guaranteed (and is based on hash
table traversal) currently anyway, so this should be of no
consequence.
Jani Nikula [Sat, 15 Aug 2015 11:25:47 +0000 (14:25 +0300)]
lib: add support for date:<expr>..! to mean date:<expr>..<expr>
It doesn't seem likely we can support simple date:<expr> expanding to
date:<expr>..<expr> any time soon. (This can be done with a future
version of Xapian, or with a custom query query parser.) In the mean
time, provide shorthand date:<expr>..! to mean the same. This is
useful, as the expansion takes place before interpetation, and we can
use, for example, date:yesterday..! to match from beginning of
yesterday to end of yesterday.
Idea from Mark Walters <markwalters1009@gmail.com>.
David Bremner [Thu, 24 Sep 2015 11:13:30 +0000 (08:13 -0300)]
test suite: don't consider skipped individual tests as failing
It isn't completely clear what we want to do here, but
1) We currently don't fail if we skip a whole test file (mainly because
we neglect to count those skipped tests properly). This change at least
makes the two kinds of skipping consistent.
2) Automated build environments may have good reasons for building with
a minimal set of prereqs, and we don't want to discourage running our
test suite by breaking builds.
Jani Nikula [Thu, 3 Sep 2015 19:39:59 +0000 (22:39 +0300)]
cli: add support for not deduplicating notmuch address results
Make it possible to use notmuch address as part of a | sort | uniq -c
pipe instead of forcing --output=count. This is useful for combining
results from multiple notmuch address queries.
David Bremner [Wed, 23 Sep 2015 11:31:19 +0000 (08:31 -0300)]
lib: constify arguments to notmuch_query_get_*
These functions are all just accessors, and it's pretty clear they don't
modify the query struct. This also fixes one warning I created when I
introduced status.c.
David Bremner [Sun, 6 Sep 2015 13:15:47 +0000 (10:15 -0300)]
cli: convert remainder of CLI to n_q_search_{messages,threads}_st
I think it would be no real problem to cut and paste the gdb based
error message test from count to the other clients modified here, but
I'm not currently convinced it's worth the trouble since the code path
being tested is almost the the same, and the tests are relatively
heavyweight.
David Bremner [Sun, 6 Sep 2015 13:15:46 +0000 (10:15 -0300)]
cli/count: update to use notmuch_query_search_messages_st
This brings back status information that may have been hidden by the
great library logging conversion.
Note the change of the internal API / return-value for count_files. The
other count calls to the lib will also get error handling when that API
is updated in the lib.
Jani Nikula [Sat, 5 Sep 2015 09:35:31 +0000 (12:35 +0300)]
cli: reset db directory mtime upon directory removal
The library does not have a function to remove a directory document
for a path. Usually this doesn't matter except for a slight waste of
space. However, if the same directory gets added to the filesystem
again, the old directory document is found with the old mtime. Reset
the directory mtime on removal to avoid problems.
The corner case that can hit this problem is renaming directories back
and forth. Renaming does not change the mtime of the directory in the
filesystem, and thus the old db directory document mtime may match the
fs mtime of the directory.
The long term fix might be to add a library function to remove a
directory document, however this is a much simpler and faster fix for
the time being.