]> git.cworth.org Git - notmuch-old/log
notmuch-old
3 years agodebian: changelog for 0.31.1-1
David Bremner [Sun, 8 Nov 2020 11:46:51 +0000 (07:46 -0400)]
debian: changelog for 0.31.1-1

3 years agoNEWS: add news for 0.31.1
David Bremner [Sun, 8 Nov 2020 11:39:14 +0000 (07:39 -0400)]
NEWS: add news for 0.31.1

3 years agoupdate versions
David Bremner [Sun, 8 Nov 2020 11:32:10 +0000 (07:32 -0400)]
update versions

3 years agobuild: fix update-versions rule
David Bremner [Sun, 8 Nov 2020 11:27:48 +0000 (07:27 -0400)]
build: fix update-versions rule

This was missed in the rename of the 'version' file to version.txt

4 years agoRename version to version.txt
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.
4 years agolib/config: don't set destructor until iterator is initialized.
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.

4 years agoconfigure: replace $(realpath emacs) with $(cd emacs && pwd -P)
Tomi Ollila [Tue, 20 Oct 2020 06:57:11 +0000 (09:57 +0300)]
configure: replace $(realpath emacs) with $(cd emacs && pwd -P)

For portability; the realpath command (e.g. from GNU coreutils)
is not so common outside Linux systems.

The "$(cd emacs && pwd -P)" replaces that realpath(1) execution
suitably in this context (using just bash(1) builtins).

4 years agoemacs docs: rstdoc.el: consistent single quote conversions
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)."

Which looks pretty much right.

4 years agoemacs: Remove notmuch-mua-message-send-hook
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.

4 years agoMerge tag '0.31' into master
David Bremner [Sun, 6 Sep 2020 01:27:32 +0000 (22:27 -0300)]
Merge tag '0.31' into master

notmuch 0.31 release

4 years agoNEWS: set release date 0.31 archive/debian/0.31-1 debian/0.31-1
David Bremner [Sun, 6 Sep 2020 00:50:03 +0000 (21:50 -0300)]
NEWS: set release date

4 years agodebian: changelog for 0.31-1
David Bremner [Sun, 6 Sep 2020 00:48:27 +0000 (21:48 -0300)]
debian: changelog for 0.31-1

4 years agoversion: bump to 0.31
David Bremner [Sun, 6 Sep 2020 00:26:36 +0000 (21:26 -0300)]
version: bump to 0.31

4 years agoNews: add entry for unthreaded mode
Mark Walters [Sat, 5 Sep 2020 17:44:45 +0000 (18:44 +0100)]
News: add entry for unthreaded mode

A belated NEWS entry for the new un-threaded mode introduced in Notmuch
0.30.

4 years agotest: fix syntax errors in erroring calls to notmuch insert
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.

4 years agoNEWS: mention reproducibility fix 0.31_rc2 archive/debian/0.31_rc2-1 debian/0.31_rc2-1
David Bremner [Sat, 29 Aug 2020 12:23:10 +0000 (09:23 -0300)]
NEWS: mention reproducibility fix

4 years agoNEWS: mention Emacs 27.1 compatibility fixes
David Bremner [Sat, 29 Aug 2020 12:23:09 +0000 (09:23 -0300)]
NEWS: mention Emacs 27.1 compatibility fixes

4 years agoversion: bump to 0.31~rc2
David Bremner [Sat, 29 Aug 2020 12:32:36 +0000 (09:32 -0300)]
version: bump to 0.31~rc2

4 years agodebian: drop notmuch-emacs dependency package
David Bremner [Tue, 25 Aug 2020 11:03:26 +0000 (08:03 -0300)]
debian: drop notmuch-emacs dependency package

elpa-notmuch is now present in oldstable, and we don't need to support
direct upgrades from older releases than that.

4 years agodebian: suggest mailscripts
David Bremner [Tue, 25 Aug 2020 11:03:25 +0000 (08:03 -0300)]
debian: suggest mailscripts

These contain several useful tools for the notmuch user, particularly
on Debian.

4 years agodebian: suggest elpa-mailscripts
David Bremner [Tue, 25 Aug 2020 11:03:24 +0000 (08:03 -0300)]
debian: suggest elpa-mailscripts

These contain some useful functions for notmuch users, mainly wrappers
for scripts from mailscripts.

4 years agoNEWS: remaining user visible library changes
David Bremner [Sun, 23 Aug 2020 12:22:45 +0000 (09:22 -0300)]
NEWS: remaining user visible library changes

These could both cause / fix crashes for user code.

4 years agoNEWS: mention new API entries
David Bremner [Sun, 23 Aug 2020 12:19:28 +0000 (09:19 -0300)]
NEWS: mention new API entries

4 years agoNEWS: mention port to Xapian 1.5
David Bremner [Sun, 23 Aug 2020 12:16:16 +0000 (09:16 -0300)]
NEWS: mention port to Xapian 1.5

4 years agoNEWS: mention exception handling changes
David Bremner [Sun, 23 Aug 2020 12:02:18 +0000 (09:02 -0300)]
NEWS: mention exception handling changes

4 years agoNEWS: mention merging of documentation for python bindings
David Bremner [Sun, 23 Aug 2020 11:53:37 +0000 (08:53 -0300)]
NEWS: mention merging of documentation for python bindings

4 years agoNEWS: add news entry for tree navigation changes
William Casarin [Sat, 22 Aug 2020 18:05:44 +0000 (11:05 -0700)]
NEWS: add news entry for tree navigation changes

Signed-off-by: William Casarin <jb55@jb55.com>
Amended-by: db, add verb
4 years agoEmacs: Fix notmuch-message-summary-face definition
Teemu Likonen [Sun, 16 Aug 2020 17:13:23 +0000 (20:13 +0300)]
Emacs: Fix notmuch-message-summary-face definition

Emacs face definition forms are either

    ((DISPLAY . PLIST)
     (DISPLAY . PLIST))

or

    ((DISPLAY PLIST)   ;For backward compatibility.
     (DISPLAY PLIST))

Commit a2388bc56e55da5d5695816818274f8a84b0ed92 (2020-08-08) follows
neither of the correct formats. It defines:

    `((((class color) (background light))
       ,@(and (>= emacs-major-version 27) '(:extend t))
       (:background "#f0f0f0"))
      (((class color) (background dark))
       ,@(and (>= emacs-major-version 27) '(:extend t))
       (:background "#303030")))

which produces:

    ((DISPLAY
      :extend t (:background "#f0f0f0"))
     (DISPLAY
      :extend t (:background "#303030")))

And that is wrong format.

This change fixes the face definition form to produce:

    ((DISPLAY
      :extend t :background "#f0f0f0")
     (DISPLAY
      :extend t :background "#303030"))

which follows the (DISPLAY . PLIST) format (see above).

4 years agoAUTHORS: update for 0.31
David Bremner [Tue, 18 Aug 2020 11:43:06 +0000 (08:43 -0300)]
AUTHORS: update for 0.31

Just shuffles existing authors around, mainly due to Jonas's
enthusiastic cleanup work.

4 years agoemacs: Use pop-to-buffer-same-window rather than switch-to-buffer
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.

4 years agodebian/changelog: fix typo
David Bremner [Tue, 18 Aug 2020 11:48:02 +0000 (08:48 -0300)]
debian/changelog: fix typo

4 years agoupdate changelog for 0.31~rc1-1 0.31_rc1 archive/debian/0.31_rc1-1 debian/0.31_rc1-1
David Bremner [Tue, 18 Aug 2020 10:58:28 +0000 (07:58 -0300)]
update changelog for 0.31~rc1-1

4 years agoversion: bump to 0.31~rc1
David Bremner [Tue, 18 Aug 2020 00:02:30 +0000 (21:02 -0300)]
version: bump to 0.31~rc1

4 years agoNEWS: notmuch-mutt: system(shell pipeline) replaced internally
Tomi Ollila [Mon, 17 Aug 2020 20:39:22 +0000 (23:39 +0300)]
NEWS: notmuch-mutt: system(shell pipeline) replaced internally

4 years agotest: fix uninitialized variable use in T562-lib-database
David Bremner [Sun, 16 Aug 2020 17:04:36 +0000 (14:04 -0300)]
test: fix uninitialized variable use in T562-lib-database

Fix a copy paste error of using the boolean ret as a notmuch_status_t,
and uninitialized.

4 years agobuild: clean up sphinx.config
David Bremner [Sun, 16 Aug 2020 15:27:11 +0000 (12:27 -0300)]
build: clean up sphinx.config

Follow the existing practice and remove it under "distclean", same as
sh.config and Makefile.config

4 years agodevel/release-checks.sh: use grep to find copyright year. 0.31_rc0
David Bremner [Sun, 16 Aug 2020 14:32:28 +0000 (11:32 -0300)]
devel/release-checks.sh: use grep to find copyright year.

This is quite fragile, but it works for now, unlike the python
version.

In general it seems conf.py is not intended to be evaluated outside of
sphinx, as it assumes certain global names (in particular "tags") are
defined.

4 years agodebian: update symbols for 0.31
David Bremner [Sun, 16 Aug 2020 14:12:59 +0000 (11:12 -0300)]
debian: update symbols for 0.31

Two new API entries for better error handling

4 years agodebian: start changelog for 0.31~rc0-1
David Bremner [Sun, 16 Aug 2020 14:09:18 +0000 (11:09 -0300)]
debian: start changelog for 0.31~rc0-1

4 years agoversion: bump to 0.31~rc0
David Bremner [Sun, 16 Aug 2020 14:06:13 +0000 (11:06 -0300)]
version: bump to 0.31~rc0

Start the release process for 0.31

4 years agoemacs/tree: add notmuch-tree-archive-thread-then-next
William Casarin [Tue, 11 Aug 2020 17:36:53 +0000 (10:36 -0700)]
emacs/tree: add notmuch-tree-archive-thread-then-next

Now that notmuch-tree-next-thread acts more like its notmuch-show
counterpart, let's update the binding to move to the next thread after
archiving.

Signed-off-by: William Casarin <jb55@jb55.com>
4 years agoemacs/tree: enable moving to next thread in search results
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.

Signed-off-by: William Casarin <jb55@jb55.com>
4 years agoemacs/tree: introduce notmuch-tree-parent-buffer variable
William Casarin [Tue, 11 Aug 2020 17:36:51 +0000 (10:36 -0700)]
emacs/tree: introduce notmuch-tree-parent-buffer variable

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.

Signed-off-by: William Casarin <jb55@jb55.com>
4 years agotest: update README to reflect dropping upgrade tests
David Bremner [Sat, 15 Aug 2020 12:15:05 +0000 (09:15 -0300)]
test: update README to reflect dropping upgrade tests

These test databases have been unneeded since ee897cab8.

4 years agoEmacs: Indent first header line only when indentation is turned on
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

4 years agonotmuch-mutt: replace shell pipeline with internal pipe processing
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.

4 years agoconfigure: Check if emacs >= 25 (instead of >= 24) is available
Tomi Ollila [Tue, 11 Aug 2020 07:38:19 +0000 (10:38 +0300)]
configure: Check if emacs >= 25 (instead of >= 24) is available

"The minimum supported major version of GNU Emacs is now 25.1."

25.1 is the first "released" version of Emacs 25.

4 years agotry-emacs-mua: Trim `require' advice for Emacs 25
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.

4 years agoemacs: Use new advice mechanism do advice mm-shr
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:08 +0000 (13:50 +0200)]
emacs: Use new advice mechanism do advice mm-shr

Also because we now only support Emacs >= 25,
we can remove the check for Emacs >= 24.

4 years agoemacs: Do not abuse advice to monkey patch while testing
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:07 +0000 (13:50 +0200)]
emacs: Do not abuse advice to monkey patch while testing

Use `cl-letf*' instead.

4 years agoemacs: Drop old advices that were only need for Emacs 23
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:06 +0000 (13:50 +0200)]
emacs: Drop old advices that were only need for Emacs 23

4 years agoemacs: Remove notmuch-read-char-choice
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:05 +0000 (13:50 +0200)]
emacs: Remove notmuch-read-char-choice

Just use `read-char-choice', which existed since Emacs 24.1.

4 years agoemacs: Remove notmuch-setq-local
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:04 +0000 (13:50 +0200)]
emacs: Remove notmuch-setq-local

Just use setq-local, which existed since Emacs 24.3.

4 years agoemacs: Use cl-incf where appropriate
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:03 +0000 (13:50 +0200)]
emacs: Use cl-incf where appropriate

It's shorter.  That's it pretty much.

4 years agoNEWS: At least Emacs 25.1 is required now
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:02 +0000 (13:50 +0200)]
NEWS: At least Emacs 25.1 is required now

Some backward incompatible changes follow in the next few commits
and going forward contributors don't have to worry about Emacs 24
at all anymore.

4 years agoNEWS: Add stub for 0.31
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:01 +0000 (13:50 +0200)]
NEWS: Add stub for 0.31

4 years agoemacs: Add end-of-file line to libraries that lack it
Jonas Bernoulli [Sat, 8 Aug 2020 11:50:00 +0000 (13:50 +0200)]
emacs: Add end-of-file line to libraries that lack it

4 years agoemacs: Provide 'rstdoc' feature at end of file
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:59 +0000 (13:49 +0200)]
emacs: Provide 'rstdoc' feature at end of file

Features should nearly always be provided at the very end of their
libraries.  This feature isn't one of the rare exceptions.

4 years ago.gitignore: Sort using sort-lines
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:58 +0000 (13:49 +0200)]
.gitignore: Sort using sort-lines

4 years agotest: Fix indentation
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:57 +0000 (13:49 +0200)]
test: Fix indentation

Fix it to consistently match the style we have configured in
".dir-locals.el".

4 years ago.dir-locals.el: Set variables for correct "shell" mode
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:56 +0000 (13:49 +0200)]
.dir-locals.el: Set variables for correct "shell" mode

The major mode used for shell scripts is named 'sh-mode'.
'shell-mode' on the other hand implements an interactive
shell in emacs-lisp.

4 years agoFix typos
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:55 +0000 (13:49 +0200)]
Fix typos

4 years agoemacs: Increase consistency of library headers
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:54 +0000 (13:49 +0200)]
emacs: Increase consistency of library headers

4 years agoemacs: Various cosmetic changes
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:53 +0000 (13:49 +0200)]
emacs: Various cosmetic changes

4 years agoemacs: Autoload notmuch-jump using an autoload cookie
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".

4 years agoemacs: Autoload notmuch-jump-search only once
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.

4 years agoemacs: Improve doc-strings
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.

- Use the imperative form.

- Arguments are written in all uppercase.

4 years agoemacs: Use makefile-gmake-mode in Makefile*s
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).

4 years agoemacs: notmuch-poll: Let the user know we are polling
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:48 +0000 (13:49 +0200)]
emacs: notmuch-poll: Let the user know we are polling

It is done synchronously and it can take a while,
so we should let the user know what is going on.

4 years agoemacs: No longer define notmuch-hello-mode-map as a function
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:47 +0000 (13:49 +0200)]
emacs: No longer define notmuch-hello-mode-map as a function

It was defined as such for a decade; ever since
a56010ac8b89a2489eee5c78469f05cee85ec858 but there
wasn't a reason to do that then nor is there now.

4 years agoemacs: Fix some function declarations
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:46 +0000 (13:49 +0200)]
emacs: Fix some function declarations

4 years agoemacs: Extend face to window edge again
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.

4 years agoemacs: Use one or three lines for 'if' forms
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:44 +0000 (13:49 +0200)]
emacs: Use one or three lines for 'if' forms

Putting the COND and THEN parts on the same line but ELSE on a
separate line makes it harder to determine if there actually is
an ELSE part.

4 years agoemacs: Use 'when' instead of 'if' when there is no ELSE part
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:43 +0000 (13:49 +0200)]
emacs: Use 'when' instead of 'if' when there is no ELSE part

4 years agoemacs: Use 'unless' instead of 'when' and 'not'
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:42 +0000 (13:49 +0200)]
emacs: Use 'unless' instead of 'when' and 'not'

Also use 'unless' in a few cases where previously 'if' was used with
'not' but without an ELSE part.

4 years agoemacs: Use 'and' instead of 'when' when the return value matters
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:41 +0000 (13:49 +0200)]
emacs: Use 'and' instead of 'when' when the return value matters

Also do so for some 'if' forms that lack an ELSE part.
Even go as far as using 'and' and 'not' instead of 'unless'.

4 years agoemacs: Only set one variable per setq form
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.

4 years agoemacs: Closing parenthesis go on the same line
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:39 +0000 (13:49 +0200)]
emacs: Closing parenthesis go on the same line

4 years agoemacs: Fix indentation
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:38 +0000 (13:49 +0200)]
emacs: Fix indentation

4 years agoemacs: Remove excess empty lines
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.

4 years agoemacs: Shorten long lines
Jonas Bernoulli [Sat, 8 Aug 2020 11:49:36 +0000 (13:49 +0200)]
emacs: Shorten long lines

4 years agoEmacs: Ensure left-to-right display for message headers
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.

4 years agoT355: specify hash algorithm explicitly
Đoàn Trần Công Danh [Mon, 3 Aug 2020 15:40:57 +0000 (22:40 +0700)]
T355: specify hash algorithm explicitly

On some systems (notably, the one shipped with LibreSSL),
default fingerprint digest algorithm is SHA256.

On other systems, users can change default digest algorithm by changing
default_md in /etc/ssl/default_md.

Let's ask openssl to provide us specific algorithm to make the test
more deterministic.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
4 years agoconfigure: drop check for default xapian backend
Đoàn Trần Công Danh [Mon, 3 Aug 2020 15:40:56 +0000 (22:40 +0700)]
configure: drop check for default xapian backend

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>
4 years agoconfigure: check for pytest with python -m pytest
Đoàn Trần Công Danh [Mon, 3 Aug 2020 15:40:55 +0000 (22:40 +0700)]
configure: check for pytest with python -m pytest

On different distro, pytest is suffixed with different patterns.

On the other hand, `python3-pytest' could be invoked correctly,
via `python3 -m pytest', the latter is used by our tests, now.

Switch to `$python -m pytest` to fix address all incompatible naming.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
4 years agotest: regression tests for n_indexopts_{get,set}_decrypt_policy
David Bremner [Sat, 1 Aug 2020 12:26:03 +0000 (09:26 -0300)]
test: regression tests for n_indexopts_{get,set}_decrypt_policy

The main criteria is that they don't crash. Working with a closed
database is a bonus.

4 years agotest: regression test for traversing config list with closed db
David Bremner [Sat, 1 Aug 2020 12:26:02 +0000 (09:26 -0300)]
test: regression test for traversing config list with closed db

Also mention error return in API docs

4 years agotest: regression test for n_d_get_config_list on closed db.
David Bremner [Sat, 1 Aug 2020 12:26:01 +0000 (09:26 -0300)]
test: regression test for n_d_get_config_list on closed db.

Exception is caught.

4 years agotest: regression test for n_directory_{get,set}_mtime
David Bremner [Sat, 1 Aug 2020 12:26:00 +0000 (09:26 -0300)]
test: regression test for n_directory_{get,set}_mtime

The mtime is cached, so closing the db is not a problem. Writing the
mtime throws an exception, which is caught.

4 years agolib: fix return value for n_directory_delete
David Bremner [Sat, 1 Aug 2020 12:25:59 +0000 (09:25 -0300)]
lib: fix return value for n_directory_delete

Falling out of the catch meant the error return was lost

4 years agotest: known broken test for n_directory_delete with closed db.
David Bremner [Sat, 1 Aug 2020 12:25:58 +0000 (09:25 -0300)]
test: known broken test for n_directory_delete with closed db.

There is a return value bug in notmuch_directory_delete that is hiding
the exception.

4 years agolib: catch exceptions in n_directory_get_child_files
David Bremner [Sat, 1 Aug 2020 12:25:57 +0000 (09:25 -0300)]
lib: catch exceptions in n_directory_get_child_files

Also clarify API in error case.

4 years agotest: add known broken test for n_directory_get_child_files
David Bremner [Sat, 1 Aug 2020 12:25:56 +0000 (09:25 -0300)]
test: add known broken test for n_directory_get_child_files

This is a clone of the one for get_child_directories

4 years agolib: catch exceptions in n_directory_get_child_directories
David Bremner [Sat, 1 Aug 2020 12:25:55 +0000 (09:25 -0300)]
lib: catch exceptions in n_directory_get_child_directories

Also clarify API in error case.

4 years agotest: add known broken test for n_directory_get_child_directories
David Bremner [Sat, 1 Aug 2020 12:25:54 +0000 (09:25 -0300)]
test: add known broken test for n_directory_get_child_directories

Start a new test file (for the notmuch_directory_* API group) to hold
this test.

4 years agotest: regression test for n_m_get_filenames
David Bremner [Sat, 1 Aug 2020 12:25:53 +0000 (09:25 -0300)]
test: regression test for n_m_get_filenames

Closing the database after the iterator is created is not a problem.

4 years agotest: split header for lib-message tests.
David Bremner [Sat, 1 Aug 2020 12:25:52 +0000 (09:25 -0300)]
test: split header for lib-message tests.

This allows finer control over when to close the database.

4 years agotest: add regression test for n_messages_collect_tags
David Bremner [Sat, 1 Aug 2020 12:25:51 +0000 (09:25 -0300)]
test: add regression test for n_messages_collect_tags

Also test n_messages_destroy.

4 years agolib: return NULL from n_d_get_default_indexopts on error
David Bremner [Sat, 1 Aug 2020 12:25:50 +0000 (09:25 -0300)]
lib: return NULL from n_d_get_default_indexopts on error

This is a rare and probably serious programming error, so better not
to silently return a default value.

4 years agobuild: upload html docs as part of release process
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.