Commit graph

824 commits

Author SHA1 Message Date
Tomi Ollila
427fa5e6e6 emacs: with prefix argument, notmuch-show-stash-date stashes timestamp
Using timestamp of a message is useful in many Xapian queries.
2017-05-30 08:54:35 -03:00
David Bremner
523d2b50fc Merge branch 'release'
Emacs bug fix from Mark
2017-05-13 08:51:10 -03:00
Mark Walters
2d79d38a0f emacs: tree: bugfix: specify --format-version
Previously notmuch tree did not specify the format-version when
calling notmuch. This meant that when the structured output was
slightly changed (in commit 14c60cf168)
stash filename broke. This fixes this breakage by specifying the
format-version.
2017-05-13 08:47:04 -03:00
David Bremner
0b76e4a6f4 emacs/notmuch.el: don't use 'function' as variable name.
In principle this should work, but at least in some pre-release
versions of emacs26, this causes problems inside lexical let [1].

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26406
2017-04-20 06:58:32 -03:00
John Byrnes
f0d06c8ca3 emacs: use epg-gpg-program
Adjusted notmuch-crypto gpg call-process function to respect
the GPG program set by the EasyPG epg-gpg-program variable.

This is to correct a problem observed on NixOS where only gpg2 is
installed by default. The Notmuch Emacs frontend fails when trying to
access someone's key to verify their signature when it cannot find the
GPG binary.
2017-03-13 21:12:14 -03:00
Mark Walters
95e9c137e1 emacs: compat: backport fix for folding long headers when sending
This backports the fix from emacs master (commit
77bbca8c82f6e553c42abbfafca28f55fc995d00) to notmuch-emacs to wrap
long headers.

This fixes the test introduced in the previous changeset.
2017-03-04 21:16:42 -04:00
Jani Nikula
4f2a7993a5 emacs/desktop: update to use notmuch-emacs-mua and handle mailto
With the mailto: handling in notmuch-emacs-mua, we can update the
desktop file to advertize we can be set as the default application to
handle email. While at it, add GenericName and Comment to be more
informative.

With --hello, notmuch-emacs-mua will run (notmuch) if mailto: url is
not given.
2017-03-01 19:33:52 -04:00
Mark Walters
df483ed4bd emacs: show: stop display of application/* parts
Gnus seems to display application/zip and application/tar by
default. This doesn't seem desirable so we override it.

We only override if the user has not customized
mm-inline-override-types themselves.
2017-02-26 07:55:00 -04:00
Jani Nikula
524372de10 emacs: use (system-name) instead of system-name
Fix the deprecation warning:

In notmuch-maildir-fcc-make-uniq-maildir-id:
emacs/notmuch-maildir-fcc.el:279:53:Warning: ‘system-name’ is an obsolete
    variable (as of 25.1); use (system-name) instead

I've used (system-name) since at least 2011, so it must have been
around quite a while.
2017-02-26 07:37:01 -04:00
Mark Walters
9916dea473 emacs: company: remove two build warnings
This adds two defvars to avoid two build warnings in the notmuch emacs
code. These were both introduced (by me) in commit 827c28a0.
2017-02-23 08:55:10 -04:00
Mark Walters
3e21b22c32 emacs: fully add the notmuch-address customize group
We now have several customizable options for address completion. There
is a customize group notmuch-address but it only contains one of these
options. Add all the others, and make it part of the notmuch customize
group.
2017-02-23 08:54:55 -04:00
Mark Walters
08343d3da0 emacs: address: save hash
This allows the user to save the address hash so that it is much
faster for the first completion after a restart. This defaults to off
as there are privacy implications to saving this information.

The code tries hard to avoid overwriting the wrong file. It also notes
if changes have been made to any of the relevant user settings, so
that the user does not get surprising results (i.e., outdated options
being used). Finally it stores some version information so that is
easy for us to update the format of the save file.
2017-01-27 22:08:16 -04:00
Mark Walters
df9736f20b emacs: address: move address-full-harvest-finished to a function
This makes the code access notmuch-address-full-harvest-finished via a
helper function, notmuch-address--harvest-ready. Later we will use
this to check whether we can load the harvest instead of regenerating
it.
2017-01-27 22:07:43 -04:00
David Bremner
5de84d0752 Merge branch 'release'
Add back in no-display parameter by hand.
2016-12-15 21:57:10 +09:00
David Bremner
001256ab29 emacs: restore autoload cookie for notmuch-search
The cookie only applies to next form, so in the previous location it
applied to the put, rather than the function.
2016-12-15 20:22:34 +09:00
Jani Nikula
383796c325 build: update the desktop database after installing the desktop file
This makes the option to choose Notmuch as mailto: handler show up in
the desktop environment settings. Ignore errors.
2016-11-28 22:04:26 -04:00
Jani Nikula
459989b7ef build: install notmuch-emacs-mua.desktop file with emacs
There is really no need to have a separate install target for the
desktop file. Just install the desktop file with emacs, with a
configure option to opt out.
2016-11-28 22:01:45 -04:00
Jani Nikula
66c1bff416 notmuch.desktop: move under emacs as notmuch-emacs-mua.desktop
The notmuch.desktop file is part of notmuch-emacs. Move it under
emacs, and rename as notmuch-emacs-mua.desktop to reflect this.
2016-11-26 08:16:39 -04:00
Jani Nikula
440d24e7cc build: install notmuch-emacs-mua with notmuch-emacs
notmuch-emacs-mua is good enough to be installed with notmuch-emacs.
2016-11-26 08:16:19 -04:00
Jani Nikula
a5df39c276 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.

Signed-off-by: Jani Nikula <jani@nikula.org>
2016-11-26 08:15:11 -04:00
Jani Nikula
04174cdfad emacs: move notmuch-emacs-mua under emacs
While the notmuch-emacs-mua script is a sort of cli command, it is
really a part of notmuch-emacs. Move it under the emacs directory.
2016-11-26 08:10:44 -04:00
David Bremner
10f8c5d205 build/emacs: add target to create elpa package
This package can be created without emacs, but will only be usable in
versions of emacs supporting package.el
2016-11-26 07:57:58 -04:00
David Bremner
60ac94fe58 Merge branch 'release'
Updates for 0.23.2
2016-11-17 08:25:08 -04:00
David Bremner
297d27e9f9 emacs: generate notmuch-pkg.el
This file contains metadata for the built in (as of emacs 24) packaging
system.
2016-11-16 21:45:56 -04:00
Mark Walters
a3e712fa86 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.
2016-11-16 21:42:34 -04:00
David Bremner
2dd96d6bd6 emacs: resume messages
Provide functionality to resume editing a message previously saved with
notmuch-draft-save, including decoding the X-Notmuch-Emacs-Secure
header.

Resume gets the raw file from notmuch and using the emacs function
mime-to-mml reconstructs the message (including attachments).

'e' is bound to resume a draft from show or tree mode.
2016-11-13 13:15:31 -04:00
David Bremner
90248f862b emacs: check drafts for encryption tags before saving
In general the user may not want to save plaintext copies of messages
that they are sending encrypted, so give them a chance to abort.
2016-11-13 13:15:31 -04:00
Mark Walters
d820b97477 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).
2016-11-13 12:55:24 -04:00
Mark Walters
f8bdba37d3 emacs: tree: remove binding for pressing button in message pane
We want to use "e" for editting postponed messages in show, and in
tree view, so remove the binding for the function which does

     (In message pane) Activate BUTTON or button at point
2016-11-13 12:55:16 -04:00
David Bremner
4817005bfc emacs: rename notmuch-address-completion-hook to notmuch-address-post-completion-functions
Apparently it is a (not completely adhered to) emacs convention [1] that
only hooks that don't take arguments end in 'hook'

[1]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html
2016-11-13 08:52:17 -04:00
David Bremner
343534d82d 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.
2016-11-04 12:51:50 -03:00
Mark Walters
e5786283e7 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.
2016-11-02 07:45:28 -03:00
Mark Walters
8a20400490 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.
2016-11-02 07:45:18 -03:00
Matt Armstrong
d62f9dbfc0 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.
2016-11-02 07:40:20 -03:00
Mark Walters
b810e64242 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.
2016-10-31 08:10:27 -03:00
David Bremner
608a3cb231 Merge branch 'release'
merge interesting buffers bugfix from release
2016-10-25 21:57:23 -03:00
Mark Walters
8128c7b5aa 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.
2016-10-25 18:13:16 -03:00
Mark Walters
09caa0fce7 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.
2016-10-25 18:12:12 -03:00
Matt Armstrong
c2d1984b02 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).
2016-10-22 12:47:09 -03:00
David Bremner
d93e9cee13 Merge in test-suite, docstring fixes, release prep 2016-10-22 12:44:39 -03:00
Keith Amidon
4bf3bb31dd 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.
2016-10-22 12:28:13 -03:00
David Bremner
9dea5b8804 Merge emacs face fixes and NEWS 2016-10-19 08:44:35 -03:00
Mark Walters
4c822aecc7 emacs: search face bugfix
In commit 2a7b11b064 the default faces
for unread and flagged were accidentally swapped. This swaps them back.
2016-10-19 08:39:58 -03:00
Mark Walters
a4331bf138 emacs: fix notmuch-search-line-faces defcustom
In commit 2a7b11b064 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.
2016-10-19 08:39:36 -03:00
Mark Walters
2f643ac763 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.
2016-10-17 09:07:54 -03:00
Ioan-Adrian Ratiu
02d3c76102 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.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
2016-10-17 09:07:32 -03:00
Ioan-Adrian Ratiu
4954bc50e8 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.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
2016-10-17 09:05:22 -03:00
Ioan-Adrian Ratiu
fae3d361f2 emacs: notmuch-search-refresh-view: reuse buffer
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.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
2016-10-17 09:05:05 -03:00
Ioan-Adrian Ratiu
e37a64da7a emacs: notmuch-search: add no-display functionality
If no-display is non-nil when calling notmuch-search then do not force
the search buffer to be displayed.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
2016-10-17 09:04:53 -03:00
Mark Walters
a9ab5e42af 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.
2016-10-17 09:04:38 -03:00