Jani Nikula [Mon, 21 Nov 2016 21:13:36 +0000 (23:13 +0200)]
notmuch-emacs-mua: add --hello parameter
If the --hello parameter is given, display the notmuch hello buffer
instead of the message composition buffer if no message composition
parameters are given.
David Bremner [Sat, 19 Nov 2016 17:44:28 +0000 (13:44 -0400)]
build: Move variable definitions to Makefile.global
I noticed when trying to use VERSION (and derived variables) in a
subdirectory that the top level Makefile.local needed to be included
first. But according to c10085c77b407d9ea704f8b4f9e0a805f63e72cb it
actually needs to be last. To break this conflict, move the variables
definitions into a new Makefile.global.
Jani Nikula [Mon, 21 Nov 2016 20:14:33 +0000 (22:14 +0200)]
cli: consider files vanishing during notmuch new non-fatal
If some software other than notmuch new renames or removes files
during the notmuch new scan (specifically after scandir but before
indexing the file), keep going instead of bailing out. Failing to
index the file is just a race condition between notmuch and the other
software; the rename could happen after the notmuch new scan
anyway. It's not fatal, and we'll catch the renamed files on the next
scan.
Add a new exit code for when files vanished, so the caller has a
chance to detect the race and re-run notmuch new to recover.
Reported by Paul Wise <pabs@debian.org> at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843127
tests: account for varying-size cryptographic signatures
GnuPG 2.1.16 is now injecting the full issuer fingerprint in its
signatures, which makes them about 32 octets larger when
ascii-armored.
This change in size means that the size of the MIME parts will vary
depending on the version of gpg that the user has installed. at any
rate, the signature part should be non-zero (this is true for
basically any MIME part), so we just test for that instead of an exact
size.
Jani Nikula [Sat, 5 Nov 2016 20:18:18 +0000 (22:18 +0200)]
build: only install known man pages
Install man pages based on $(MAN_GZIP_FILES), which directly
corresponds to the man page source rst files. This way we can filter
the man pages to be installed as needed.
Jani Nikula [Sat, 5 Nov 2016 20:18:17 +0000 (22:18 +0200)]
build: generate man page list from source files, not conf.py
Use $(wildcard ...) to generate the list of man pages based on the rst
source files present in the man page directories, instead of reading
conf.py. This has three main benefits:
1) This makes the man page build slightly less complicated and easier
to understand. At least there are fewer moving parts.
2) This makes the build fail if we add a man page rst file, but fail
to add it to conf.py.
3) We can use Sphinx constructs in conf.py that are not available when
importing the file into a normal python program such as
mkdocdeps.py.
Jani Nikula [Sat, 5 Nov 2016 20:18:16 +0000 (22:18 +0200)]
build: do not touch roff files after sphinx-build
If Sphinx fails to create any of the roff files, having touch create
them hides the errors until someone realizes, possibly much later,
that the resulting files are empty. (Note that gzip doesn't fail on
empty input files.) Sphinx will change the timestamps of any files it
has written anyway.
Jani Nikula [Sat, 5 Nov 2016 20:18:11 +0000 (22:18 +0200)]
doc/conf.py: generate texinfo_documents list from man_pages list
No need to repeat mostly the same information twice in conf.py. We
probably want to have a corresponding texinfo document for all the man
pages. Python list comprehension to the rescue. (The reverse is not
true; we have a texinfo document for notmuch-emacs we don't want as a
man page.)
Mark Walters [Tue, 15 Nov 2016 19:48:45 +0000 (19:48 +0000)]
emacs: add compatibility functions for emacs 23
Some of the recent changes to the emacs code have used functions
introduced in emacs 24. The functions used are read-char-choice and
setq-local. This changeset adds a file notmuch-compat.el which
contains compatibility functions so that it should work on emacs
23.
Note, since these functions are taken almost unchanged from the emacs
source they are copyright the Free Software Foundation, and the header
in the file reflects that.
Mark Walters [Mon, 14 Nov 2016 13:49:28 +0000 (13:49 +0000)]
Test: fix draft test for emacs23
emacs24 and emacs23 have different secure tag defaults: in particular,
mml-secure-message-sign only signs the part on emacs23 but the whole
message on emacs24. This difference makes one of the draft tests fail
(which causes a cascade of later failures) on emacs23. It seems that
travis uses emacs23 so it is useful to fix this.
We do this by forcing the whole message to be signed in either case --
the code snippet is extracted from mml-secure-message-sign on emacs24.
Mark Walters [Sun, 13 Nov 2016 14:08:48 +0000 (14:08 +0000)]
emacs: postpone a message
This provides initial support for postponing in the emacs frontend;
resuming will follow in a later commit. On saving/postponing it uses
notmuch insert to put the message in the notmuch database
Current bindings are C-x C-s to save a draft, C-c C-p to postpone a
draft (save and exit compose buffer).
Previous drafts get tagged deleted on subsequent saves, or on the
message being sent.
Each draft gets its own message-id, and we use the namespace
draft-.... for draft message ids (so, at least for most people, drafts
are easily distinguisable).
David Bremner [Fri, 4 Nov 2016 01:02:43 +0000 (22:02 -0300)]
emacs: add notmuch-address-post-completion-hook
This hook can be used to update the message based on the results of
address completion. For example using message-templ or gnus-alias to set
the From address based on the To address just completed.
The post-completion command is added to the notmuch-company backend to
ensure that the hook is also called company completion is started
without going through notmuch-address-expand-name. See the docstring of
`company-backends' for more information.
Mark Walters [Wed, 21 Sep 2016 15:49:19 +0000 (16:49 +0100)]
emacs: tree: use message pane decryption state for replies
This makes replying to a message in tree view, use the decrypted state
from the message pane if it is open. Previously it just used the
global decryption state from notmuch-crypto-process-mime.
In particular if notmuch-crypto-process-mime is nil, and the user
views the messages (which doesn't decrypt), toggles decryption in the
message pane, and then replies, the reply will be decrypted.
Mark Walters [Wed, 21 Sep 2016 15:49:18 +0000 (16:49 +0100)]
emacs: tree: allow the user to decrypt the message pane
This makes $ in the tree pane toggle decryption in the message
pane. Without this the user can only decrypt the message pane by
switching to it, or by setting decryption on globally by setting
notmuch-crypto-process-mime to t.
Jani Nikula [Sat, 22 Oct 2016 11:22:49 +0000 (14:22 +0300)]
notmuch-emacs-mua: add support for mailto: URL handling
Add support for composing an email in the Notmuch Emacs UI using a
mailto: URL. The mailto: URL mode is mutually exclusive with
specifying other message modifying parameters and positional
arguments.
Matt Armstrong [Fri, 28 Oct 2016 22:31:42 +0000 (15:31 -0700)]
emacs: make faces readable on dark backgrounds.
The notmuch-tag-flagged, notmuch-search-flagged-face and
notmuch-crypto-part-header faces defaulted to "blue", which is nearly
unreadable when a dark background is in use. This is addressed by using
"LightBlue1" for dark backgrounds.
As a side effect, these faces are now no-op definitions for grayscale or
mono displays.
Jani Nikula [Sat, 22 Oct 2016 12:50:05 +0000 (15:50 +0300)]
cli: try to run external notmuch- prefixed commands as subcommands
If the given subcommand is not known to notmuch, try to execute
external notmuch-<subcommand> instead. This allows users to have their
own notmuch related tools be run via the notmuch command, not unlike
git does. Also notmuch-emacs-mua will be executable via 'notmuch
emacs-mua'.
By design, this does not allow notmuch's own subcommands to be
overriden using external commands.
Mark Walters [Sun, 16 Oct 2016 16:12:23 +0000 (17:12 +0100)]
emacs: make notmuch-search-tag tag the region when called non-interactively.
The normal tag commands in search mode tag the all threads meeting the
region when called interactively. This makes them do the same when
called non-interactively. This is a change in the api.
Tomi Ollila [Sun, 9 Oct 2016 20:36:07 +0000 (23:36 +0300)]
test/test-lib.sh: execute basename(1)s lazier in test_expect_equal_file ()
Moved the 2 basename(1) executions to the test failure branch in
test_expect_equal_file ().
The output of basename(1) executions in function test_expect_equal_file ()
are only used when tests fails -- when all tests pass these 2 basename(1)
executions are no longer done at all.
Mark Walters [Sat, 15 Oct 2016 18:25:19 +0000 (19:25 +0100)]
emacs: tree: make tag updates show in the message pane
This makes tag changes appear in the message pane as well as in the
tree window.
Note that the message pane is reloaded each time a message is viewed
so the tags shown in the message pane can still be different from
those in the tree window. Usually this will just be that the tag
change is still shown as a change (strikethough underline etc) in the
tree window, and are shown after the change in the message
pane. However, if something else updates the database then the tags
shown can be genuinely different.
Mark Walters [Sat, 22 Oct 2016 12:10:04 +0000 (13:10 +0100)]
emacs: interesting-buffer bugfixes/updates
The command notmuch-interesting-buffer has got out of date -- it
doesn't mention notmuch-tree, and it still refers to message-mode not
notmuch-message-mode. Update both of these.
This fixes the bug that notmuch-cycle-notmuch-buffers does not include
notmuch-tree or notmuch-message-mode buffers in its cycling.
Mark Walters [Sun, 23 Oct 2016 08:38:21 +0000 (09:38 +0100)]
devel: Document emacs keybindings
This adds a file under devel listing all the keybindings sorted by key
in the main three modes (search, show and tree).
To reduce clutter it only lists the single key "unmodified"
keybindings: I think all our uses of prefixes and modifiers are
natural variants of the unmodified binding (eg M-n compared to n in
show mode)
This should make easier to see what keybindings are available when
adding new features.
Matt Armstrong [Wed, 19 Oct 2016 22:08:15 +0000 (15:08 -0700)]
Add notmuch-show--build-queries.
notmuch-show--build-buffer now queries a list of queries built by the
former. This simplifies the logic. It also provides an easy place to
experiment with alternate sets of queries for given notmuch-show-*
variables (e.g. users can use advice-add to do so in a surgical way).
Keith Amidon [Wed, 19 Oct 2016 10:05:19 +0000 (03:05 -0700)]
Expand docstrings about fcc using notmuch-insert
This commit expands docstrings for notmuch-fcc-dirs and
notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
are processed and make the ability to configure sent folders containing
whitespace more discoverable.
Mark Walters [Sat, 15 Oct 2016 09:40:48 +0000 (10:40 +0100)]
emacs: fix notmuch-search-line-faces defcustom
In commit 2a7b11b064233afc4feead876fa396e3c18a6b91 the default value
for notmuch-search-line-faces was changed so that it didn't match the
specification in the corresponding defcustom. This meant that it was
difficult for the user to customize this variable as they got a type
mismatch error.
Note anyone who had already customised this variable would not see
this bug as their customisation would match the defcustom.
Mark Walters [Sat, 15 Oct 2016 07:32:46 +0000 (08:32 +0100)]
emacs: add global keybinding M-= for refresh all buffers
We can't use c-u = as some of the notmuch-show refresh function
already uses that. This is a global keybinding for a relatively
infrequent function but M-= seems unlikely to cause conflicts.
emacs: notmuch-lib: add refresh all buffers function
notmuch-refresh-all-buffers calls each buffer's major mode specific
refresh function using the generic notmuch-refresh-this-buffer function.
Since the earlier changesets have stopped the refresh functions from
forcing the buffers to be redisplayed this can refresh buffers that
are not currently displayed without disturbing the user. This is very
useful for silent async background updating the emacs display when new
mail is fetched.
emacs: notmuch-show: refresh all windows displaying buffer
This updates all windows displaying a notmuch-show buffer when the
buffer refresh function is called.
Each window displaying a notmuch-show buffer has its own currently
displayed message based on the (point) location. We store the state
of all displayed windows when refreshing a notmuch-show buffer and
re-apply the current shown message (point) for all windows.
Implementation note: Each window has it's own (point) value, besides
the buffer's (point) value. Sometimes these values are identical like
in the case where a single window displays a buffer. When multiple
windows display a buffer, (point) returns each window's specific value.
What we are storing in this changeset is the window values not the
buffer point values. The buffer's point is returned only if no window
is displaying the buffer, a case we do not care about here.
There's no reason to completely kill a buffer while refreshing its
search results because the buffer name is constant between refreshes
(based on the search query), only its contents may change and notmuch
search kills all local variables, so it's safe to reuse.
Reusing the same buffer also makes it possible to do things like
refreshing a buffer which is not focused or even not shown in any
window - this will be used in the next commits to add auto-refresh
capabilities to all existing notmuch buffers + a function to call
after syncing mail to refresh everything.
Mark Walters [Sat, 15 Oct 2016 07:32:41 +0000 (08:32 +0100)]
emacs: hello: stop update from forcing the buffer to be displayed
Make the notmuch-hello refresh function (notmuch-hello-update) not
force the buffer to be displayed. All the callers call it when the
buffer is already displayed so it will only affect non-interactive
callers. Since it is just a trivial wrapper of notmuch-hello anyone
who wants to force the buffer to be displayed should just call
notmuch-hello.
Matthew Lear [Tue, 11 Oct 2016 21:24:30 +0000 (22:24 +0100)]
Fix reply to encrypted mail when discouraging plain text.
If an encrypted multipart message is received which contains html and
notmuch-multipart/alternative-discouraged is set to discourage "text/plain",
any encrypted parts are not decrypted during generation of the reply
text. This fixes that problem by making sure notmuch-mua-reply does
that.
Mark Walters [Sat, 15 Oct 2016 11:50:42 +0000 (12:50 +0100)]
emacs: jump: make multilevel keys do multilevel jump
notmuch jump allows the user to specify a key sequence rather than
just a single key for its bindings. However, it doesn't show what has
already been typed so it can be difficult to see what has
happened. This makes each key press appear, and the jump menu reduce
to the possible follow up keys.
We also bind backspace (emacs symbol DEL) to go back up a level in the
subjumpmaps, and to exit from the top level.
Mark Walters [Sat, 15 Oct 2016 11:09:31 +0000 (12:09 +0100)]
emacs: tag-jump: docstring fix
In commit 297d091e1ca8f5b1e144d2be0a8e0a7c271634a8 the key for
switching to the reverse keymap was changed from r to k but the
docstring for the defcustom was not updated. This changeset updates
the documentation to match.
David Bremner [Sun, 9 Oct 2016 22:30:44 +0000 (19:30 -0300)]
emacs/show: force notmuch-show-buttonise-links to act on lines
This seems to fix a problem with emacs 25 creating partial buttons by
calling n-s-b-l with a region that does not include the whole button.
I'm not 100% sure it's legit to act outside the region passed by
jit-lock, but goto-address-fontify-region (where I borrowed the code
from) already does this, so this patch to not make things worse.
Mark Walters [Sat, 8 Oct 2016 20:05:23 +0000 (21:05 +0100)]
emacs: mua: check for misplaced secure mml tags
Emacs message-send seems to ignore a secure mml tag anywhere except at
the start of the body, and it must be followed by a newline. Since
this is almost certainly not desired we check for it, and require user
confirmation before sending.
As the setup before message-send or message-send-and-exit is getting
more complicated it is convenient to unify the two correspoinding
notmuch functions.
Mark Walters [Sat, 8 Oct 2016 20:05:22 +0000 (21:05 +0100)]
emacs: mua: extract a common message-send function.
This commit adds a common message-send function for message-send and
message-send-and-exit. At the moment the overlap is small, but the
message-send function will get more complex.
Mark Walters [Tue, 27 Sep 2016 15:45:27 +0000 (16:45 +0100)]
emacs: include first match in address completion
The current code for address completion takes the list of possible
completions (whether generated internally or externally), makes the
first match the initial value for the completion, and puts all the
others (but not the first match) into the possible completions.
This has the nice effect that the <down> key takes you immediately to
the next completion (whereas if the first match were included in the
possible completions it would take you to the first match
again).
However, it has two side effects. First, once you have completed to
the full match you find it says and try completing again you get told
"no match" not "sole completion". Secondly, if you delete some of the
text and try completing you don't get the first match as an option.
This tries to get round most of these problems by including the full
list of possible completions, but with the first match moved to the
very end of the list.
Mark Walters [Thu, 6 Oct 2016 21:59:00 +0000 (22:59 +0100)]
emacs: tag-jump: make k binding for the reverse tag change map
Currently, by default k invokes the tag-jump menu, and following it by
r invokes the reverse tag change jump menu. This is awkward to type
(e.g. k r u for undoing a -unread change). This changes it so that k
followed by k invokes the reverse menu. We make the key for the
reverse map a variable as that makes it possible for a user to
change it by editing their .emacs file.
David Bremner [Wed, 5 Oct 2016 00:35:23 +0000 (21:35 -0300)]
require xapian >= 1.2.6
It seems that no-one tried to compile without Xapian compact support
since March of 2015, since that's when I introduced a syntax error in
that branch of the ifdef.
Given the choice of maintaining this underused branch of code, or
bumping the Xapian dependency to a version from 2011, it seems
reasonable to do the latter.
W. Trevor King [Mon, 26 Sep 2016 16:32:13 +0000 (09:32 -0700)]
nmbug: Add --no-renames to default log options
Git has supported this since b68ea12e (diff.c: respect diff.renames
config option, 2006-07-07, v1.4.2). All of our information is in the
paths (the files are empty), so we don't want rename detection. By
using --no-renames, we get entries like: