Ralph Seichter [Wed, 28 Oct 2020 14:44:35 +0000 (15:44 +0100)]
Rename version to version.txt
Building Notmuch on macOS is known to cause problems because the Notmuch
distribution archive contains two files named "version". These names
clash with the <version> header as defined in C++20. Therefore, the
existing naming will likely become a problem on other platforms as well,
once compilers adopt the new standard.
Signed-off-by: Ralph Seichter <github@seichter.de> Amended-by: db s/keyword/header/ in commit message.
David Bremner [Fri, 30 Oct 2020 00:13:01 +0000 (21:13 -0300)]
lib/config: don't set destructor until iterator is initialized.
As diagnosed by Olivier Taïbi in
id:20201027100916.emry3k2wujod4xnl@galois.lan, if an exception is
thrown while the initialization is happening (e.g. if the function is
called on a closed database), then the destructor is (sometimes)
invoked on an uninitialized Xapian object.
Solve the problem by moving the setting of the destructor until after
the placement new successfully completes. It is conceivable this might
cause a memory leak, but that seems preferable to crashing, and in any
case, there seems to be nothing better to be done if the
initialization is failing things are in an undefined state by
definition.
Tomi Ollila [Fri, 9 Oct 2020 07:32:02 +0000 (10:32 +0300)]
emacs docs: rstdoc.el: consistent single quote conversions
With text-quoting-style 'grave keeps "'" and "`" quotes unaltered
for further processing done by this code (regardless of locale...).
The tools that read the reStructuredText markup generated can do
their styling instead.
Added temporary conversions of ' and ` to \001 and \002 so that
's and `s outside of `...' and `...` are converted separately
('s restored back to ' and `s converted to \`).
Both `...' and `...` are finally "converted" to `...` (not ``...``).
https://docutils.sourceforge.io/docs/user/rst/quickref.html documents
that as `interpreted text`:
"The rendering and meaning of interpreted text is domain- or
application-dependent. It can be used for things like index
entries or explicit descriptive markup (like program identifiers)."
Tim Quelch [Sat, 12 Sep 2020 04:45:40 +0000 (14:45 +1000)]
emacs: Remove notmuch-mua-message-send-hook
Currently `message-send-hook` functions are being called twice: In
notmuch send common when `notmuch-mua-send-hook` functions are
run (which by default includes `notmuch-mua-message-send-hook`) and in
`message-send` itself.
Because `message-send-hook` functions are run in `message-send` itself,
we don't need also need to run them before we delegate to `message-send`
Calling `notmuch-mua-message-send-hook` resulted in functions in
`message-send-hook` to be called twice. This causes bugs in
non-idempotent hook functions.
David Bremner [Fri, 4 Sep 2020 01:10:57 +0000 (22:10 -0300)]
test: fix syntax errors in erroring calls to notmuch insert
notmuch insert does not currently support passing a filename for the
input, so all of these tests have an extra error in addition to the
one being tested for.
Currently this does not make a difference because the error being
tested for is caught before the error of an extra command line
argument. In the future it might make a difference, and in any case it
is confusing.
Sean Whitton [Tue, 11 Aug 2020 16:59:13 +0000 (09:59 -0700)]
emacs: Use pop-to-buffer-same-window rather than switch-to-buffer
This means that notmuch commands obey display-buffer-alist so the user
can customize how buffers show up.
It also permits the use of C-x 4 4, C-x 5 5 and C-x t t, available in
Emacs 28. For example, one can use C-x 4 4 M-x notmuch-jump-search RET
to open a saved search in another window rather than the current window.
Or in notmuch-search mode, C-x 5 5 RET to view the message at point in
a new frame.
notmuch-tree has custom buffer display logic, so bind
display-buffer-overriding-action to make pop-to-buffer-same-window
behave exactly as switch-to-buffer while that function is running.
William Casarin [Tue, 11 Aug 2020 17:36:52 +0000 (10:36 -0700)]
emacs/tree: enable moving to next thread in search results
This introduces a new function called
notmuch-tree-next-thread-from-search which is analogous to
notmuch-show-next-thread. It will switch to the next or previous
thread from the parent search results.
We rename notmuch-tree-{prev,next}-thread to a more descriptive
notmuch-tree-{prev,next}-thread-in-tree to reflect the fact that it
only moves to the next thread in the current tree.
notmuch-tree-next-thread now switches to the next thread in the
current tree first, but if there are none, it looks for the next tree
in the search results.
This makes notmuch-tree feel more like notmuch-show when using the
M-Enter, M-n and M-p bindings.
This variable will be used in a similar fashion to
notmuch-show-parent-buffer. It will be used to navigate between
threads from the parent search buffer.
Teemu Likonen [Sat, 15 Aug 2020 06:28:29 +0000 (09:28 +0300)]
Emacs: Indent first header line only when indentation is turned on
Previously in message-show mode message's first header line (From
header) was always indented, even if user had turned thread
indentation off with "<" (notmuch-show-toggle-thread-indentation)
command.
This change modifies notmuch-show-insert-headerline function so that
it doesn't indent the first header line if notmuch-show-indent-content
variable is nil.
This change also modifies tests so that they expect this new output
format:
test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
Tomi Ollila [Mon, 27 Jul 2020 19:38:33 +0000 (22:38 +0300)]
notmuch-mutt: replace shell pipeline with internal pipe processing
The shell pipeline used to symlink files based in search results
to "cache" directory for mutt(1) to use was prone to portability
problems (due to /bin/sh differences).
The replacement executes `notmuch search` without intermediate shell
(so shell_quote was removed in this case), reads the filenames from
piped output and symlinks files internally.
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:09 +0000 (13:50 +0200)]
try-emacs-mua: Trim `require' advice for Emacs 25
- Since Emacs 25 comes with `load-prefer-newer' we can remove the
complicated variant of the advice, which implemented a poorman's
version of that.
- Since Emacs 25 comes with the new advice mechanism, we can use
that now for the simple variant of the advice, which just informs
about the library that is being required.
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:52 +0000 (13:49 +0200)]
emacs: Autoload notmuch-jump using an autoload cookie
Doing that is better than using an `autoload' form because the latter
may result in dependencies getting hidden and indeed it turns out we
have to declare `notmuch-jump' in "notmuch-tag.el".
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:51 +0000 (13:49 +0200)]
emacs: Autoload notmuch-jump-search only once
This function is being autoloaded using an autoload cookie, so it
shouldn't additionally be autoloaded using an `autoload' form.
When building libraries we don't actually load the autoloads file and
dropping the `autoload' form results in an error, which reveals a so
far unspecified dependency: `notmuch-tree' needs `notmuch-jump'.
Before this commit compiling (or even just loading) `notmuch-tree'
resulted in `notmuch-jump' being loaded because the former requires
`notmuch-lib', which autoloaded `notmuch-jump-search'.
The bug was that this dependency was not explicitly specified, which
we fix by adding the respective `require' form.
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:50 +0000 (13:49 +0200)]
emacs: Improve doc-strings
- The first sentence should fit on the first line in full. This is
even the case when that causes the line to get a bit long. If it
gets very long, then it should be made shorter.
- Even even the second sentence would fit on the first line, if it
just provides some details, then it shouldn't be done.
- Symbols are quoted like `so'.
- There is no clear rule on how to (not) quote non-atomic
s-expressions, but quoting like '(this) is definitely weird.
- It is a good idea to remember that \" becomes " and to take
that in mind when adjusting the automatic filling by hand.
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:49 +0000 (13:49 +0200)]
emacs: Use makefile-gmake-mode in Makefile*s
Use `makefile-gmake-mode' instead of `makefile-mode' because the
former also highlights ifdef et al. while the latter does not.
"./Makefile.global" and one "Makefile.local" failed to specify any
major mode at all but doing so is necessary because Emacs does not
automatically figure out that these are Makefiles (of any flavor).
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:45 +0000 (13:49 +0200)]
emacs: Extend face to window edge again
Since Emacs 27 each face has to be explicitly configured to "extend
to the edge of the window". Without doing that the face used for
the newline character only has an effect that spans "one character"
(i.e. it looks like there is a single trailing space character).
We don't want that so extend the face in Emacs 27, so that it looks
the same as it did in older Emacs releases. We have to do this
conditionally, otherwise older Emacsen would choke on it.
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:40 +0000 (13:49 +0200)]
emacs: Only set one variable per setq form
It's a bit weird to avoid having to write the "(setq ... )" more than
once, just because we can. In a language that uses '=' for the same
purpose we also happily use that once per assignment.
While there are no benefit to using just one 'setq' there are some
drawbacks. It is not always clear on first what is a key and what a
value and as a result it is easy to make a mistake. Also it becomes
harder to comment out just one assignment.
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:37 +0000 (13:49 +0200)]
emacs: Remove excess empty lines
Most people who write lots of lisp tend to only sparsely use empty
"separator" lines within forms. In lisp they feel unnecessary and
since most files stick to this convention we get a bit confused
when there are extra empty lines. It feels like the s-expressions
are falling into pieces.
All of this is especially true between a function's doc-string and
body because the doc-string is colored differently, which visually
already separates it quite sufficiently from the code that follows.
Teemu Likonen [Fri, 7 Aug 2020 04:46:41 +0000 (07:46 +0300)]
Emacs: Ensure left-to-right display for message headers
In notmuch-show buffer insert invisible U+200E LEFT-TO-RIGHT MARK
character at the beginning of message header paragraph if the From
header contains a right-to-left character. This ensures that the
header paragraph is always rendered in left-to-right mode.
See Emacs Lisp reference manual section "(elisp) Bidirectional
Display" for more info.
Starting from xapian 1.3.5, xapian switched default backend to glass.
From 00cdfe10 (build: drop support for xapian versions less than 1.4,
2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
to check for default xapian backend anymore.
Further more, from 99a7aac8 (test: drop use of db_ending, 2020-07-29),
our test framework has become independence from default xapian.
Let's drop it.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
David Bremner [Thu, 16 Jul 2020 11:11:26 +0000 (08:11 -0300)]
build: upload html docs as part of release process
Use a URL https://notmuchmail.org/doc/latest to leave room for a
future more ambitious scheme deploying multiple versions.
This also forces the html docs to built as part of the release
process. In the future this should be updated to tolerate generating a
release without sphinx installed. This needs a new target analogous to
build-info and build-man that does nothing if sphinx is not installed.