Commit graph

847 commits

Author SHA1 Message Date
Daniel Kahn Gillmor
8ea4a99d74 cli/show: make --decrypt take a keyword.
We also expand tab completion for it, update the emacs bindings, and
update T350, T357, and T450 to match.

Make use of the bool-to-keyword backward-compatibility feature.
2017-12-29 16:45:46 -04:00
David Bremner
040c3236af Merge branch 'release'
Conflicts:
        NEWS

Add in NEWS from point release
2017-12-08 22:19:06 -04:00
Tomi Ollila
f55e9a3bda emacs: letf enriched-decode-display-prop for text/enriched display
Dynamically bind enriched-decode-display-prop when inserting
text/enriched part. This complements commit 9b05823838 for
emacs versions before 24.4 which do not have advice-add
functionality.

Since emacs 25.3 this particular bug is fixed.
2017-12-08 20:35:41 -04:00
Jani Nikula
b2b65b4e6d emacs: sanitize subject in replies
Commit a7964c86d1 ("emacs: Sanitize authors and subjects in search
and show") added sanitization of header information for display. Do
the same for reply subjects.

This fixes the long-standing annoying artefact of certain versions of
mailman using tab as folding whitespace, leading to tabs in reply
subjects.
2017-09-27 08:15:02 -03:00
David Bremner
ff6d3b6489 emacs/address: use member instead of memq to check for pair
Quoting from the elisp reference:

     For other types (e.g., lists, vectors, strings), two arguments
     with the same contents or elements are not necessarily ‘eq’ to
     each other.

Thanks to "Attic Hermit" for the fix.
2017-09-12 22:17:32 -03:00
David Bremner
4366895062 notmuch 0.25.1 release
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCAAdFiEE3VS2dnyDRXKVCQCp8gKXHaSnniwFAlm3OCwACgkQ8gKXHaSn
 niz5Swv/bhm/cSBRoav7deonMPfAAqloeNSdCpcOksEvGFtn6PZMHPDLfQ0DORcb
 pHIfGnrIpGFKlOZ8zO4Q3ANhito7hCCaasn6k70Zhpu5KV+YMCKMABtnho1p3jKT
 elK/3tkvlcWFEgRBVbuLsTn/iYFz8kaukfRyh+BhlchJSifSZQDFaPnmxOCvOfNK
 Aipp7o/yAQGgiXUczISgceirOEruq3QePC9Bjbzj3UKa5D/UUqki37xlojl9dUC7
 eNmt/grittR4e0eU5ytKck5KlVwxirs9U3Hm9A8o9giWkk98lJYobLXpDFPQ8Ock
 7GGIMyP3DGBGTfn5mswKUdiEsuCgobH47y4RBd0jpSyTpFDSTD/BTYTiU/kSa8k4
 XNO9uS4+jrgUJ4rfrZYK1VNXfQ85L17zZCpgeGgV+XguVcLKwQEjQ945/wk32pVh
 03vdQX57myPLWeWVo5pIB0qzKeuEuaZ5b2m1QngHYUgROEm5PZnBGGHkgS50dNxp
 5156wSur
 =dTj5
 -----END PGP SIGNATURE-----

Merge tag '0.25.1'

notmuch 0.25.1 release (bugfix for emacs bug 28350)
2017-09-11 22:32:00 -03:00
Jani Nikula
9b05823838 emacs: override enriched-decode-display-prop for text/enriched display
Switch to a local version of enriched-decode-display-prop if we
encounter a text/enriched part. This is to mitigate
https://bugs.gnu.org/28350. Normally it would be prudent to remove the
override afterwards, but in this case just leave it in.

Notes from db:
      This doesn't disable text/enriched, just one feature of it.
2017-09-11 22:08:01 -03:00
Vladimir Panteleev
1348212cb0 emacs: Refuse requests to refresh tree views while a refresh is running
notmuch-tree did not protect against concurrent refreshes like
notmuch-search, meaning, hitting '=' (notmuch-refresh-this-buffer)
quickly will spawn multiple parallel notmuch processes, and clobber
the existing results in the current buffer.

* notmuch-tree.el: Add a guard to notmuch-tree-refresh-view similar to
  the one in notmuch-search.
2017-09-05 21:50:03 -03:00
Vladimir Panteleev
d7a49e8199 notmuch-tag.el: Fix minor grammar error 2017-08-23 08:08:01 -03:00
Vladimir Panteleev
fdf2b3007a emacs: Use make-process when available
make-process is a new function introduced in Emacs 25, which provides
greater control over process creation. Crucially, it allows
separately redirecting stderr directly to a buffer, which allows us to
avoid needing to use the shell to redirect to a temporary file in
order to correctly distinguish stdout and stderr.

* notmuch-lib.el: Use make-process when it is available; fall back to
  the previous method when not.
2017-08-20 08:33:09 -03:00
Vladimir Panteleev
69946c47c9 emacs: Refactor subprocess stderr propagation
Load subprocess error output to a string in the callers, and propagate
the error messages as a string parameter instead of a path to file
names.

Required to be able to avoid using temporary files for subprocess
error output.

* notmuch-lib.el: Update notmuch-check-async-exit-status,
  notmuch-check-exit-status: accept an err parameter instead of
  err-file; shift the responsibility of loading error messages from
  files up the call stack.
2017-08-20 08:32:47 -03:00
Jani Nikula
cb5253578d emacs: set query-context to nil if its "" or "*"
The queries "" and "*" are special cased in the notmuch library to
match all messages, but only if they're the entire query. They can't
be combined with other queries, such as "* AND foo", in which case
they "leak" down to the Xapian query parser.

Notmuch show and tree buffers inadvertently combine the thread query
with said special queries, causing incorrect collapsing of
messages. Handle the special queries specially. We already do a
similar thing in notmuch-search-filter.
2017-08-20 08:32:07 -03:00
Vladimir Panteleev
ca4688e103 Use rooted paths in .gitignore files
A leading / in paths in a .gitignore file matches the beginning of the
path, meaning that for patterns without slashes, git will match files
only in the current directory as opposed to in any subdirectory.

Prefix relevant paths with / in .gitignore files, to prevent
accidentally ignoring files in subdirectories and possibly slightly
improve the performance of "git status".
2017-08-18 19:42:35 -03:00
David Bremner
c28ac94abf emacs: Add commentary for MELPA users
We have a steady trickle of people using notmuch-emacs from melpa with
distro packages of notmuch, and then being confused when it doesn't
work. Try to warn people what a foot-gun this is; this commentary
should be copied to the melpa web site.
2017-07-20 07:01:17 -03:00
David Bremner
1d82110f83 emacs: convert remaining format-versions from 3 to 4
This is needed for consistent beheviour between notmuch built against
gmime-2.6 and gmime-3.0 w.r.t. error reporting.
2017-07-18 06:57:26 -03:00
David Bremner
f1bcb6b7c2 emacs: change default for notmuch-crypto-process-mime to t
There are some cases like remote usage where this might cause
problems, but those users can easily customize the variable. The
inconvenience seems to be outweighed by the security benefit for most
users.
2017-07-15 09:11:32 -03:00
Kyle Meyer
37d1fa5672 emacs: tree: drop repeated "of" from docstring 2017-07-10 21:58:30 -03:00
David Bremner
e1b7d32db0 cli: implement structured output version 4
Since the error field is unused by the emacs front end, no changes are
needed other than bumping the format version number.

As it is, this is a bit overengineered, but it will reduce duplication
when we support gmime 3.0
2017-07-04 08:32:44 -03:00
David Bremner
b6f87c3085 emacs: convert to use format-version 3
Keeping the emacs interface running old format-versions makes it
impossible to test new format-versions or deprecate old ones.
2017-07-04 08:32:28 -03:00
Tom Hinton
d848d4040a Fix minor mistake where indentation width is ignored 2017-06-30 08:55:16 -03:00
Damien Cassou
3840b6b495 Add indentation to imenu in notmuch-show 2017-06-30 08:33:29 -03:00
Piotr Trojanek
c9deb32933 remove extra space in Emacs prompt
Trivial: fix extra space in the "Insert failed" Emacs prompt message.
2017-06-25 09:57:48 -03:00
Damien Cassou
a83ab29930 Add Emacs' imenu support in notmuch-show and notmuch-search
Emacs' major modes can facilitate navigation in their buffers by
supporting Imenu. In such major modes, launching Imenu (M-x imenu)
makes Emacs display a list of items (e.g., function definitions in a
code buffer). Selecting an item from this list moves point to this
item.

This patch adds Imenu support to both notmuch-show and notmuch-search
buffers:

* in notmuch-show, Imenu will present a list of all messages in the
  currently visible thread;

* in notmuch-search, Imenu will present a list of all messages in the
  search buffer.
2017-06-14 07:49:08 -03:00
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