David Edmondson [Sat, 20 Feb 2016 18:24:36 +0000 (18:24 +0000)]
emacs/show: Make the insertion of part headers overridable.
This allows callers of notmuch-show-insert-bodypart to use a `let'
binding to override the default function for specifying when part
headers should be inserted.
We also add an option to never show part buttons which will be used by
the test suites for the reply tests.
David Edmondson [Thu, 11 Feb 2016 08:33:27 +0000 (08:33 +0000)]
emacs: Report a lack of matches when calling `notmuch-show'.
If the basic query passed to `notmuch-show' generates no results, ring
the bell and inform the user that no messages matched the query rather
than displaying an empty buffer and showing an obscure error.
Similarly when refreshing a `notmuch-show' buffer and no messages match.
Mark Walters [Sat, 13 Jun 2015 08:08:10 +0000 (09:08 +0100)]
emacs: Bind filter in search to 'l'
Change the key binding for filter (or "limit") in search-mode. This
gives consistency with the new filter in show-mode, and frees 'f' for
forward-thread in the future.
Tomi Ollila [Fri, 22 Jan 2016 22:01:53 +0000 (00:01 +0200)]
configure: pass HAVE_TIMEGM to build
Checking the existence of timegm() function and setting
configure internal variable ${have_timegm} was done, but
actually defining HAVE_TIMEGM in build was not done --
meaning that compat timegm() was always part of final
notmuch binaries.
notmuch.Database.remove_message should raise exception on failure
The notmuch python bindings document that database.remove_message
should raise an exception when the message removal fails, but they
don't actually do it.
David Bremner [Sun, 16 Aug 2015 17:41:16 +0000 (19:41 +0200)]
debian: add gpgsm as build dependency
It's not needed for the actual build, but it is needed to run the
SMIME tests; <!nocheck> means it can be omitted if the tests are not
going to be run.
David Bremner [Sun, 16 Aug 2015 17:41:13 +0000 (19:41 +0200)]
test: add broken S/MIME signature verification test for notmuch CLI
The test is pretty much cut and paste from the PGP/MIME version, with
obvious updates taken from notmuch output. This also requires setting
up gpgsm infrastucture.
Tomi Ollila [Wed, 6 Jan 2016 19:04:03 +0000 (21:04 +0200)]
devel/emacs: add devel/try-emacs-mua
devel/try-emacs-mua provides an easy way to try and experiment
with the notmuch emacs client distributed in emacs subdirectory of
the notmuch source tree.
try-emacs-mua starts a new emacs process and if initial checks pass
*scratch* buffer is filled with information of how to begin.
Normal emacs command line arguments can be used, like -q or -Q.
These arguments are appended verbatim to the starting emacs process.
If the emacs version in use is smaller than 24.4, special care is taken
to ensure that notmuch*.elc files older than corresponding .el files
are not loaded. Since emacs 24.4, setting `load-prefer-newer' variable
takes care of this.
W. Trevor King [Wed, 30 Dec 2015 21:04:13 +0000 (13:04 -0800)]
nmbug-status: Fix unbalanced <p> tags in default header/footer
These were broken by b70386a4 (Move the generated date from the top of
the page to the footer, 2014-05-31), which moved 'Generated ...' to
the footer with the opening tag, but didn't replace the blurb opening
tag or add a closing tag after 'Generated ...'.
W. Trevor King [Thu, 7 Jan 2016 13:51:29 +0000 (05:51 -0800)]
nmbug-status: Style headers with smaller fonts
We only use h1 through h3, and David prefers smaller headers [1], so
shift over to the font sizes usually used for h2 through h4 [2,3,4].
I haven't bothered with the W3C's default margins, since a bit of
extra whitespace doesn't seem like a big deal.
Michal Sojka [Wed, 6 Jan 2016 21:28:45 +0000 (22:28 +0100)]
emacs: Don't use nconc on quoted list
As pointed out by David Bremner, Elisp manual says "A common pitfall
is to use a quoted constant list as a non-last argument to ‘nconc’."
Since this was the case in recently added code, we fix it here.
Michal Sojka [Sat, 2 Jan 2016 16:47:45 +0000 (17:47 +0100)]
emacs: Handle switch-function argument of notmuch-mua-mail
notmuch-mua-mail ignored the switch-function argument and always used
the function returned by notmuch-mua-get-switch-function instead. In
order to support standard emacs interfaces (compose-mail in this
case), this commit changes notmuch-mua-mail to use the switch-function
argument if it is non-nil and notmuch-mua-get-switch-function
otherwise.
Michal Sojka [Sat, 2 Jan 2016 16:47:43 +0000 (17:47 +0100)]
emacs: Fix mail composition under Emacs 23
Commit 570c0aeb40bd0c3af8174624a55e968f62c44f09 reworked
notmuch-mua-mail function in a way that worked only under Emacs 24.
The reason was that message-setup-1 took one argument less in Emacs
23.
We fix this by only supplying the return-action argument when it is
actually set by the caller.
W. Trevor King [Sat, 2 Jan 2016 06:08:01 +0000 (22:08 -0800)]
nmbug-status: Avoid hard-coded filename in error message
We already have a 'filename' variable with the name, so stay DRY and
use that variable here.
Also fix a missing-whitespace error from bed8b674 (nmbug-status:
Clarify errors for illegible configs, 2014-05-10), wrapping on the
sentence to match similar error-generation earlier in this function.
Recent addition of notmuch-message-mode introduced several problems:
1. When message-setup-hook is used to set buffer local variables,
these settings are not effective, because all buffer local
variables are immediately erased by notmuch-message-mode
initialization.
2. message-mode-hook gets invoked twice - first when message-mail
invokes message-mode and second when notmuch-mua-mail invokes
notmuch-message-mode.
This commit fixes these problems by replacing a call to message-mail
with notmuch-specific code that is (hopefully) equivalent to
message-mail functionality before introduction of
notmuch-message-mode.
We first initialize notmuch-message-mode with
notmuch-mua-pop-to-buffer, which is a modified version of
message-pop-to-buffer and then call message-setup-1, which is the only
functionality of message-mail that is needed for notmuch.
Michal Sojka [Tue, 29 Dec 2015 08:52:17 +0000 (09:52 +0100)]
test: Unset ALTERNATE_EDITOR before running emacsclient
ALTERNATE_EDITOR causes emacsclient to run an alternate editor if the
emacs server is not ready. This can collide with intended
functionality in test-lib.sh.
If the ALTERNATE_EDITOR is set but empty, emacsclient runs emacs
daemon and tries to connect to it. When this happens the emacs run by
test-lib.sh fails to start the server and the subsequent attempts to
use the server fail because the daemon started by emacsclient does not
know about notmuch-test-progn. This leads to test suite failure due to
time out on any emacs test.
Michal Sojka [Tue, 29 Dec 2015 09:30:26 +0000 (10:30 +0100)]
test: Always use paths without symlinks
When notmuch sources are at a symlinked path, some tests fail because
one part of the test uses physical path and another uses logical
path (with symlinks). For example the following test output is
produced when the test is started from /home/src/symlink-to-notmuch,
which is a symlink to /home/src/notmuch.
FAIL notmuch-fcc-dirs set to a string
--- T310-emacs.26.OUTPUT 2015-12-29 08:54:29.055878637 +0000
+++ T310-emacs.26.EXPECTED 2015-12-29 08:54:29.055878637 +0000
@@ -1,5 +1,5 @@
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To:
Subject:
-Fcc: /home/src/notmuch/test/tmp.T310-emacs/mail/sent-string
+Fcc: /home/src/symlink-to-notmuch/test/tmp.T310-emacs/mail/sent-string
--text follows this line--
nil
This commit makes all paths in test scripts physical. With it, all
tests pass even when run from a symlinked directory.
Mark Walters [Wed, 28 Oct 2015 18:28:39 +0000 (18:28 +0000)]
emacs: poll: return useful errors when poll fails.
Previously poll called from emacs would fail silently. This makes it
return a useful error message.
In the non-deprecated case of notmuch new and appropriate hooks, it
uses notmuch-call-notmuch-process which gives an error and
additionally puts the stdout/stderr etc in the *Notmuch errors*
buffer.
In the deprecated case of a custom poll script it only returns an
error message.
Commit based on a bug report, and a potential fix, by Ketil Malde.
Mark Walters [Thu, 12 Nov 2015 11:02:19 +0000 (11:02 +0000)]
emacs: hello: fix accidental modification of widget-keymap
In emacs24 we use make-composed-keymap. It seems that if only a single
map is specified then emacs just resuses it rather than creating a
copy of it. Thus use make-sparse-keymap to force a copy.
Steven Allen [Sun, 25 Oct 2015 21:30:39 +0000 (17:30 -0400)]
forbid atomic transactions on writable, upgradable databases
We can't (but currently do) allow upgrades within transactions because
upgrades need their own transactions. We don't want to re-use the
current transaction because bailing out of an upgrade would mean loosing
all previous changes (because our "atomic" transactions don't commit
before hand). This gives us two options:
1. Fail at the beginning of upgrade (tell the user to end the
transaction, upgrade, and start over).
2. Don't allow the user to start the transaction.
I went with the latter because:
1. There is no reason to call `begin_atomic` unless you intend to to
write to the database and anyone intending to write to the database
should upgrade it first.
2. This means that nothing inside an atomic transaction can ever fail
with NOTMUCH_STATUS_UPGRADE_REQUIRED.
Tomi Ollila [Wed, 2 Sep 2015 14:34:39 +0000 (17:34 +0300)]
emacs: notmuch-show-view-raw-message clears buffer, makes it read-only
notmuch-show-view-raw-message() re-uses buffer created with same
name (same Message-Id:) but it did not erase it before filling.
If this ever happened, there were duplicated (potentially overlapping)
content in the buffer. Now this is fixed.
Apparently since emacs 24.5 the (view-buffer) makes the buffer read-only;
so this problem would not have happened there, just that
notmuch-show-view-raw-message() failed. This is fixed by setting
inhibit-read-only t before erasing and filling the buffer. The emacs 24.5
feature having raw message buffer read-only is also now explicitly set to
the buffer so the same experience is available with emaces < 24.5.
Daniel Schoepe [Tue, 11 Aug 2015 07:46:37 +0000 (09:46 +0200)]
cli: Allow combining --remove-all and --batch
This patch removes the restriction on notmuch-tag that disallows using
both --remove-all and --batch. Combining the two options removes tags
on all messages affected by each query before applying the new tags.
Jani Nikula [Sat, 26 Sep 2015 09:35:22 +0000 (12:35 +0300)]
cli: content disposition values are not case-sensitive
Per RFC 2183, the values for Content-Disposition values are not
case-sensitive. While at it, use the gmime function for getting at the
disposition string instead of referencing the field directly.
This fixes attachment display and quoting in notmuch show and reply,
respectively.
Jani Nikula [Sat, 26 Sep 2015 09:35:21 +0000 (12:35 +0300)]
lib: content disposition values are not case-sensitive
Per RFC 2183, the values for Content-Disposition values are not
case-sensitive. While at it, use the gmime function for getting at the
disposition string instead of referencing the field directly.
This fixes "attachment" tagging and filename term generation for
attachments while indexing.
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).