[PATCH 3/4] emacs: Explicitly depend on Emacs 24

2020-04-15 Thread Jonas Bernoulli
We use various things that were not available in earlier versions. --- emacs/notmuch-pkg.el.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/notmuch-pkg.el.tmpl b/emacs/notmuch-pkg.el.tmpl index de97baac..3eb0e04e 100644 --- a/emacs/notmuch-pkg.el.tmpl +++

[PATCH 4/4] emacs: Use `cl-lib' instead of deprecated `cl'

2020-04-15 Thread Jonas Bernoulli
Starting with Emacs 27 the old `cl' implementation is finally considered obsolete. Previously its use was strongly discouraged at run-time but one was still allowed to use it at compile-time. For the most part the transition is very simple and boils down to adding the "cl-" prefix to some

[PATCH 0/4] Use cl-lib instead of deprecated cl

2020-04-15 Thread Jonas Bernoulli
controversial, but am limiting this initial patch series to just the cl-lib commit and a few harmless fixes. Jonas Bernoulli (4): gitignore: Ignore generated python-cffi files emacs: Declare function notmuch-show-get-message-id emacs: Explicitly depend on Emacs 24 emacs: Use `cl-lib

[PATCH 1/4] gitignore: Ignore generated python-cffi files

2020-04-15 Thread Jonas Bernoulli
--- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 468b660a..1c8705ec 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tags /releases /.stamps *.stamp +/bindings/python-cffi/build/ -- 2.26.0

[PATCH 2/4] emacs: Declare function notmuch-show-get-message-id

2020-04-15 Thread Jonas Bernoulli
--- emacs/notmuch-crypto.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 4035ee37..30425fbc 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -24,6 +24,8 @@ (require 'epg) (require 'notmuch-lib)

Re: easy (?) elisp project for notmuch [it's mostly DONE]

2020-04-15 Thread Jonas Bernoulli
Nice to run into you. Do you contribute to *all* the killer apps? ;D Kyle Meyer writes: > [ in case it's useful in the future ] > I've recently set up a public-inbox archive of notmuch Absolutely! In fact I already had a bookmark about that somewhere. > From there, you can easily download an

[PATCH v2] emacs: Use `cl-lib' instead of deprecated `cl'

2020-04-17 Thread Jonas Bernoulli
Starting with Emacs 27 the old `cl' implementation is finally considered obsolete. Previously its use was strongly discouraged at run-time but one was still allowed to use it at compile-time. For the most part the transition is very simple and boils down to adding the "cl-" prefix to some

Re: [PATCH] emacs: Use `cl-lib' instead of deprecated `cl'

2020-04-17 Thread Jonas Bernoulli
David Bremner writes: > A quick git grep suggests there are still cl-isms in the test-harness. I've fixed that now, see v2. > I get 3 test failures I am having issues running the tests. Currently notmuch-mua-send-and-exit in emacs_deliver_message from test-lib.sh just hangs for me. I

[PATCH v3 1/3] emacs: Use `cl-lib' instead of deprecated `cl'

2020-04-25 Thread Jonas Bernoulli
Starting with Emacs 27 the old `cl' implementation is finally considered obsolete. Previously its use was strongly discouraged at run-time but one was still allowed to use it at compile-time. For the most part the transition is very simple and boils down to adding the "cl-" prefix to some

[PATCH v3 3/3] emacs: Use `dolist' instead of `mapcar' for side-effects

2020-04-25 Thread Jonas Bernoulli
As recommended by the byte-compiler. --- test/emacs-attachment-warnings.el | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/emacs-attachment-warnings.el b/test/emacs-attachment-warnings.el index a23692d7..8f4918ef 100644 ---

[PATCH v3 2/3] emacs: Add simple make target to compile emacs lisp tests

2020-04-25 Thread Jonas Bernoulli
--- test/Makefile.local | 4 1 file changed, 4 insertions(+) diff --git a/test/Makefile.local b/test/Makefile.local index 47244e8f..3c043717 100644 --- a/test/Makefile.local +++ b/test/Makefile.local @@ -78,6 +78,10 @@ endif check: test +compile-elisp-tests: + $(EMACS) --batch -L

Re: [PATCH] emacs: Use `cl-lib' instead of deprecated `cl'

2020-04-25 Thread Jonas Bernoulli
I have fixed the remaining issues and added two small commits. See v3. > Or of course you can/should get the tests running locally. The problem was that there are incompatible changes in Emacs 27. I am using Emacs 26 for the time being but will look into these breaking changes later. The

Re: easy (?) elisp project for notmuch [it's mostly DONE]

2020-04-14 Thread Jonas Bernoulli
> As of Emacs 27, Emacs will start issuing deprecation warnings for > packages that load cl.el. I _think_ it's just a matter of replacing > functions and macros from cl.el with cl- prefixed ones, but I > haven't really investigated. > If someone is looking for an easy way to contribute, this

Re: [PATCH v3 2/3] emacs: Add simple make target to compile emacs lisp tests

2020-05-26 Thread Jonas Bernoulli
David Bremner writes: > Jonas Bernoulli writes: > >> +compile-elisp-tests: >> +$(EMACS) --batch -L emacs -L test -l notmuch.el -l test-lib.el -f \ >> +batch-byte-compile test/*.el >> + > > Can you explain a bit (perhaps in an updated commit message) w

Re: [PATCH v3 0/4] Adjust test for changes in Emacs 27

2020-07-29 Thread Jonas Bernoulli
David Bremner writes: > Applied v3 to master. Thanks. Cheers! Jonas ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org

Re: [PATCH 03/23] emacs: Fix indentation

2020-08-01 Thread Jonas Bernoulli
Tomi Ollila writes: > On Sun, Jul 26 2020, Jonas Bernoulli wrote: >> @@ -473,7 +473,7 @@ (defun notmuch-mua-new-forward-messages (messages >> prompt-for-sender) >>(when (or prompt-for-sender notmuch-always-prompt-for-sender) >> (list (cons 'From (no

Re: [PATCH 00/23] A great number of cosmetic changes

2020-08-01 Thread Jonas Bernoulli
Tomi Ollila writes: > Series looks good to me (as far as I can tell). That one comment > indentation in id:20200726165818.400-4-jo...@bernoul.li is what popped up > in my review (I did review only diff patch, and don't know how that > actually look -- like in those spaces after do in my previous

[PATCH v2 06/23] emacs: Use cl-incf where appropriate

2020-08-06 Thread Jonas Bernoulli
It's shorter. That's it pretty much. --- emacs/notmuch-hello.el | 2 +- emacs/notmuch-lib.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 89e03c36..1c084bf7 100644 --- a/emacs/notmuch-hello.el +++

[PATCH v2 05/23] emacs: Only set one variable per setq form

2020-08-06 Thread Jonas Bernoulli
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

[PATCH v2 03/23] emacs: Fix indentation

2020-08-06 Thread Jonas Bernoulli
--- emacs/coolj.el | 16 ++--- emacs/notmuch-address.el | 18 +++--- emacs/notmuch-compat.el| 86 - emacs/notmuch-draft.el | 18 +++--- emacs/notmuch-hello.el | 24 +++ emacs/notmuch-lib.el | 56

[PATCH v2 12/23] emacs: Fix some function declarations

2020-08-06 Thread Jonas Bernoulli
--- emacs/notmuch-tag.el | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index e71de041..1cef17e1 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -32,9 +32,10 @@ (require 'crm) (require 'notmuch-lib)

[PATCH v2 00/23] A great number of cosmetic changes

2020-08-06 Thread Jonas Bernoulli
I have addressed the feedback from v1, making a change to commit (1), leading to a minor conflict in commit (2). Otherwise this is unchanged. Cheers, Jonas Jonas Bernoulli (23): emacs: Shorten long lines emacs: Remove excess empty lines 1 emacs: Fix indentation emacs: Closing

[PATCH v2 04/23] emacs: Closing parenthesis go on the same line

2020-08-06 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 6 ++ emacs/notmuch-show.el | 19 --- emacs/notmuch-tree.el | 4 ++-- emacs/notmuch.el | 6 ++ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 7994d5ad..f8958a91 100644

[PATCH v2 10/23] emacs: Use one or three lines for 'if' forms

2020-08-06 Thread Jonas Bernoulli
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. --- emacs/notmuch-lib.el | 6 -- emacs/notmuch-tag.el | 3 ++- emacs/notmuch-tree.el | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff

[PATCH v2 01/23] emacs: Shorten long lines

2020-08-06 Thread Jonas Bernoulli
--- emacs/coolj.el | 2 +- emacs/notmuch-address.el | 38 +++-- emacs/notmuch-company.el | 17 -- emacs/notmuch-crypto.el | 16 +++--- emacs/notmuch-draft.el | 12 ++-- emacs/notmuch-hello.el | 43 ++- emacs/notmuch-jump.el

[PATCH v2 18/23] emacs: Autoload notmuch-jump using an autoload cookie

2020-08-06 Thread Jonas Bernoulli
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". --- emacs/notmuch-jump.el | 1 + emacs/notmuch-tag.el | 3 +-- 2 files changed, 2 insertions(+), 2

[PATCH v2 13/23] emacs: No longer define notmuch-hello-mode-map as a function

2020-08-06 Thread Jonas Bernoulli
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. --- emacs/notmuch-hello.el | 1 - 1 file changed, 1 deletion(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index

[PATCH v2 07/23] emacs: Use 'and' instead of 'when' when the return value matters

2020-08-06 Thread Jonas Bernoulli
Also do so for some 'if' forms that lack an ELSE part. Even go as far as using 'and' and 'not' instead of 'unless'. --- emacs/coolj.el | 12 +++--- emacs/notmuch-address.el | 72 ++-- emacs/notmuch-crypto.el | 2 +- emacs/notmuch-draft.el

[PATCH v2 02/23] emacs: Remove excess empty lines

2020-08-06 Thread Jonas Bernoulli
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

[PATCH v2 16/23] emacs: Improve doc-strings

2020-08-06 Thread Jonas Bernoulli
- 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

[PATCH v2 08/23] emacs: Use 'unless' instead of 'when' and 'not'

2020-08-06 Thread Jonas Bernoulli
Also use 'unless' in a few cases where previously 'if' was used with 'not' but without an ELSE part. --- emacs/notmuch-hello.el | 6 +++--- emacs/notmuch-mua.el| 4 ++-- emacs/notmuch-parser.el | 2 +- emacs/notmuch-show.el | 3 +-- emacs/notmuch-tag.el| 4 ++-- emacs/notmuch-tree.el

[PATCH v2 22/23] .dir-locals.el: Set variables for correct "shell" mode

2020-08-06 Thread Jonas Bernoulli
The major mode used for shell scripts is named 'sh-mode'. 'shell-mode' on the other hand implements an interactive shell in emacs-lisp. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index fc75ae61..b3ddffe8 100644 ---

[PATCH v2 23/23] test: Fix indentation

2020-08-06 Thread Jonas Bernoulli
Fix it to consistently match the style we have configured in ".dir-locals.el". --- test/test-lib.sh | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 31c858d1..167fa621 100644 --- a/test/test-lib.sh

[PATCH v2 20/23] emacs: Increase consistency of library headers

2020-08-06 Thread Jonas Bernoulli
--- emacs/notmuch-company.el | 36 +++-- emacs/notmuch-compat.el | 15 ++ emacs/notmuch-crypto.el | 2 +- emacs/notmuch-lib.el | 2 -- emacs/notmuch-maildir-fcc.el | 39 ++-- emacs/notmuch-print.el

[PATCH v2 19/23] emacs: Various cosmetic changes

2020-08-06 Thread Jonas Bernoulli
--- emacs/make-deps.el | 3 ++- emacs/notmuch-lib.el| 8 +++- emacs/notmuch-parser.el | 9 +++-- emacs/notmuch-show.el | 18 +++--- emacs/rstdoc.el | 9 - test/test-lib.el| 31 +++ 6 files changed, 34

[PATCH v2 21/23] Fix typos

2020-08-06 Thread Jonas Bernoulli
--- NEWS | 2 +- bindings/python-cffi/notmuch2/__init__.py | 2 +- bindings/python-cffi/notmuch2/_base.py | 6 +++--- bindings/python-cffi/notmuch2/_database.py | 8 bindings/python-cffi/notmuch2/_message.py | 4 ++--

[PATCH v2 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part

2020-08-06 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 8 ++-- emacs/notmuch-compat.el | 6 +-- emacs/notmuch-hello.el | 8 ++-- emacs/notmuch-jump.el| 54 ++--- emacs/notmuch-lib.el | 10 ++-- emacs/notmuch-mua.el | 24 +- emacs/notmuch-query.el | 4 +-

[PATCH v2 17/23] emacs: Autoload notmuch-jump-search only once

2020-08-06 Thread Jonas Bernoulli
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:

[PATCH v2 14/23] emacs: notmuch-poll: Let the user know we are polling

2020-08-06 Thread Jonas Bernoulli
It is done synchronously and it can take a while, so we should let the user know what is going on. --- emacs/notmuch-lib.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index fc76fd67..069a19e9 100644 --- a/emacs/notmuch-lib.el

[PATCH v2 15/23] emacs: Use makefile-gmake-mode in Makefile*s

2020-08-06 Thread Jonas Bernoulli
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

[PATCH v2 11/23] emacs: Extend face to window edge again

2020-08-06 Thread Jonas Bernoulli
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

[PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing

2020-08-08 Thread Jonas Bernoulli
Use `cl-letf*' instead. --- test/T310-emacs.sh | 14 -- test/test-lib.el | 8 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index 5f74305d..78ac19a8 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -40,12

[PATCH v3 34/34] try-emacs-mua: Trim `require' advice for Emacs 25

2020-08-08 Thread Jonas Bernoulli
- 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

[PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr

2020-08-08 Thread Jonas Bernoulli
Also because we now only support Emacs >= 25, we can remove the check for Emacs >= 24. --- emacs/notmuch-lib.el | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 91c94781..118faf1e 100644 --- a/emacs/notmuch-lib.el +++

[PATCH v3 31/34] emacs: Drop old advices that were only need for Emacs 23

2020-08-08 Thread Jonas Bernoulli
--- emacs/notmuch-mua.el | 14 -- test/test-lib.el | 17 - 2 files changed, 31 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index f321e0c6..dcddca76 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -425,20 +425,6 @@

[PATCH v3 28/34] emacs: Use cl-incf where appropriate

2020-08-08 Thread Jonas Bernoulli
It's shorter. That's it pretty much. --- emacs/notmuch-hello.el | 2 +- emacs/notmuch-lib.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 876d8ef1..c127bba9 100644 --- a/emacs/notmuch-hello.el +++

[PATCH v3 30/34] emacs: Remove notmuch-read-char-choice

2020-08-08 Thread Jonas Bernoulli
Just use `read-char-choice', which existed since Emacs 24.1. --- emacs/notmuch-compat.el | 56 emacs/notmuch-maildir-fcc.el | 4 +-- 2 files changed, 2 insertions(+), 58 deletions(-) diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el index

[PATCH v3 02/34] emacs: Remove excess empty lines

2020-08-08 Thread Jonas Bernoulli
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

[PATCH v3 17/34] emacs: Autoload notmuch-jump using an autoload cookie

2020-08-08 Thread Jonas Bernoulli
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". --- emacs/notmuch-jump.el | 1 + emacs/notmuch-tag.el | 3 +-- 2 files changed, 2 insertions(+), 2

[PATCH v3 01/34] emacs: Shorten long lines

2020-08-08 Thread Jonas Bernoulli
--- emacs/coolj.el | 2 +- emacs/notmuch-address.el | 38 +++-- emacs/notmuch-company.el | 17 -- emacs/notmuch-crypto.el | 16 +++--- emacs/notmuch-draft.el | 12 ++-- emacs/notmuch-hello.el | 43 ++- emacs/notmuch-jump.el

[PATCH v3 08/34] emacs: Use 'when' instead of 'if' when there is no ELSE part

2020-08-08 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 8 ++-- emacs/notmuch-compat.el | 6 +-- emacs/notmuch-hello.el | 8 ++-- emacs/notmuch-jump.el| 54 ++--- emacs/notmuch-lib.el | 10 ++-- emacs/notmuch-mua.el | 24 +- emacs/notmuch-query.el | 4 +-

[PATCH v3 12/34] emacs: No longer define notmuch-hello-mode-map as a function

2020-08-08 Thread Jonas Bernoulli
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. --- emacs/notmuch-hello.el | 1 - 1 file changed, 1 deletion(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index

[PATCH v3 16/34] emacs: Autoload notmuch-jump-search only once

2020-08-08 Thread Jonas Bernoulli
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:

[PATCH v3 03/34] emacs: Fix indentation

2020-08-08 Thread Jonas Bernoulli
--- emacs/coolj.el | 16 ++--- emacs/notmuch-address.el | 18 +++--- emacs/notmuch-compat.el| 86 - emacs/notmuch-draft.el | 18 +++--- emacs/notmuch-hello.el | 24 +++ emacs/notmuch-lib.el | 56

[PATCH v3 15/34] emacs: Improve doc-strings

2020-08-08 Thread Jonas Bernoulli
- 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

[PATCH v3 21/34] .dir-locals.el: Set variables for correct "shell" mode

2020-08-08 Thread Jonas Bernoulli
The major mode used for shell scripts is named 'sh-mode'. 'shell-mode' on the other hand implements an interactive shell in emacs-lisp. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index fc75ae61..b3ddffe8 100644 ---

[PATCH v3 05/34] emacs: Only set one variable per setq form

2020-08-08 Thread Jonas Bernoulli
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

[PATCH v3 13/34] emacs: notmuch-poll: Let the user know we are polling

2020-08-08 Thread Jonas Bernoulli
It is done synchronously and it can take a while, so we should let the user know what is going on. --- emacs/notmuch-lib.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 4496ecd2..6ff351d7 100644 --- a/emacs/notmuch-lib.el

[PATCH v3 11/34] emacs: Fix some function declarations

2020-08-08 Thread Jonas Bernoulli
--- emacs/notmuch-tag.el | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index e71de041..1cef17e1 100644 --- a/emacs/notmuch-tag.el +++ b/emacs/notmuch-tag.el @@ -32,9 +32,10 @@ (require 'crm) (require 'notmuch-lib)

[PATCH v3 06/34] emacs: Use 'and' instead of 'when' when the return value matters

2020-08-08 Thread Jonas Bernoulli
Also do so for some 'if' forms that lack an ELSE part. Even go as far as using 'and' and 'not' instead of 'unless'. --- emacs/coolj.el | 12 +++--- emacs/notmuch-address.el | 72 ++-- emacs/notmuch-crypto.el | 2 +- emacs/notmuch-draft.el

[PATCH v3 18/34] emacs: Various cosmetic changes

2020-08-08 Thread Jonas Bernoulli
--- emacs/make-deps.el | 3 ++- emacs/notmuch-lib.el| 8 +++- emacs/notmuch-parser.el | 9 +++-- emacs/notmuch-show.el | 18 +++--- emacs/rstdoc.el | 9 - test/test-lib.el| 31 +++ 6 files changed, 34

[PATCH v3 22/34] test: Fix indentation

2020-08-08 Thread Jonas Bernoulli
Fix it to consistently match the style we have configured in ".dir-locals.el". --- test/test-lib.sh | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 527c9e8b..c23a0d20 100644 --- a/test/test-lib.sh

[PATCH v3 19/34] emacs: Increase consistency of library headers

2020-08-08 Thread Jonas Bernoulli
--- emacs/make-deps.el| 2 +- emacs/notmuch-company.el | 37 +++-- emacs/notmuch-compat.el | 22 +--- emacs/notmuch-crypto.el | 2 +- emacs/notmuch-lib.el | 2 -- emacs/notmuch-maildir-fcc.el | 39

[PATCH v3 24/34] emacs: Provide 'rstdoc' feature at end of file

2020-08-08 Thread Jonas Bernoulli
Features should nearly always be provided at the very end of their libraries. This feature isn't one of the rare exceptions. --- emacs/rstdoc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el index 41390bbe..63fa2794 100644 ---

[PATCH v3 25/34] emacs: Add end-of-file line to libraries that lack it

2020-08-08 Thread Jonas Bernoulli
--- emacs/notmuch-compat.el | 2 ++ emacs/notmuch-tag.el| 2 ++ 2 files changed, 4 insertions(+) diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el index 9d82a729..370cafa1 100644 --- a/emacs/notmuch-compat.el +++ b/emacs/notmuch-compat.el @@ -107,3 +107,5 @@ (if (fboundp

[PATCH v3 20/34] Fix typos

2020-08-08 Thread Jonas Bernoulli
--- NEWS | 2 +- bindings/python-cffi/notmuch2/__init__.py | 2 +- bindings/python-cffi/notmuch2/_base.py | 6 +++--- bindings/python-cffi/notmuch2/_database.py | 8 bindings/python-cffi/notmuch2/_message.py | 4 ++--

[PATCH v3 09/34] emacs: Use one or three lines for 'if' forms

2020-08-08 Thread Jonas Bernoulli
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. --- emacs/notmuch-lib.el | 6 -- emacs/notmuch-tag.el | 3 ++- emacs/notmuch-tree.el | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff

[PATCH v3 07/34] emacs: Use 'unless' instead of 'when' and 'not'

2020-08-08 Thread Jonas Bernoulli
Also use 'unless' in a few cases where previously 'if' was used with 'not' but without an ELSE part. --- emacs/notmuch-hello.el | 6 +++--- emacs/notmuch-mua.el| 4 ++-- emacs/notmuch-parser.el | 2 +- emacs/notmuch-show.el | 3 +-- emacs/notmuch-tag.el| 4 ++-- emacs/notmuch-tree.el

[PATCH v3 00/34] A great number of cosmetic changes

2020-08-08 Thread Jonas Bernoulli
). That resulted in a few new commits of course, marked with * below. And since I had to add some commit anyway, I also added three other minor commits, marked with ^ below. Cheers, Jonas Jonas Bernoulli (34): emacs: Shorten long lines emacs: Remove excess empty lines emacs:

[PATCH v3 04/34] emacs: Closing parenthesis go on the same line

2020-08-08 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 6 ++ emacs/notmuch-show.el | 19 --- emacs/notmuch-tree.el | 4 ++-- emacs/notmuch.el | 6 ++ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 7994d5ad..f8958a91 100644

[PATCH v3 10/34] emacs: Extend face to window edge again

2020-08-08 Thread Jonas Bernoulli
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

[PATCH v3 23/34] .gitignore: Sort using sort-lines

2020-08-08 Thread Jonas Bernoulli
--- .gitignore | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 8f3ebec0..3edd1768 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,20 @@ -/.first-build-message -/Makefile.config -/sh.config -/version.stamp -TAGS

[PATCH v3 14/34] emacs: Use makefile-gmake-mode in Makefile*s

2020-08-08 Thread Jonas Bernoulli
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

[PATCH v3 26/34] NEWS: Add stub for 0.31

2020-08-08 Thread Jonas Bernoulli
--- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 9f0db031..3790204b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Notmuch 0.31 (UNRELEASED) += + Notmuch 0.30 (2020-07-10) = -- 2.28.0

[PATCH v3 27/34] NEWS: At least Emacs 25.1 is required now

2020-08-08 Thread Jonas Bernoulli
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. --- NEWS | 5 + emacs/notmuch-pkg.el.tmpl | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS

[PATCH v3 29/34] emacs: Remove notmuch-setq-local

2020-08-08 Thread Jonas Bernoulli
Just use setq-local, which existed since Emacs 24.3. --- emacs/notmuch-address.el | 4 ++-- emacs/notmuch-company.el | 2 +- emacs/notmuch-compat.el | 8 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index

Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
Tomi Ollila writes: > I made a quick check of release dates of emacs 25.1, gmime 3 and xapian 1.4 > -- gmime 3 released early 2017, xapian 1.4 middle of 2016 and emacs 25.1 > sept 2016 -- so requiring emacs 25.1 is pretty much aligned to those > releases and therefore dropping emacs 24 support

Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
Đoàn Trần Công Danh writes: > On 2020-08-09 09:09:39-0300, David Bremner wrote: >> Jonas Bernoulli writes: >> > >> > Jonas Bernoulli (34): >> > emacs: Shorten long lines >> > emacs: Remove excess empty lines >> >> >> These

Re: [PATCH v3 00/34] A great number of cosmetic changes

2020-08-09 Thread Jonas Bernoulli
David Bremner writes: > A short term fix would be to fetch a ref from somewhere. You can fetch it with: git fetch https://github.com/tarsiiformes/notmuch.git cleanup Jonas ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send

Re: [PATCH v2 06/23] emacs: Use cl-incf where appropriate

2020-08-06 Thread Jonas Bernoulli
David Bremner writes: > "cl-incf is a Lisp macro in ‘aquamacs-tools.el’." > > What the actual heck? Indeed. Did you follow the link to the definition to figure out what's going on? Ah... I found this: https://github.com/dholm/tabbar/commit/6d5a6935879. IMO it's wrong to do that, but that is of

Re: [PATCH 1/3] gitignore: Ignore generated sphinx.config

2020-07-24 Thread Jonas Bernoulli
David Bremner writes: > I don't think the patch dos what you think it does? Indeed. I'll post the correct commit in v2 but will wait for the rest of the review before posting that. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe

[PATCH 0/3] Adjust test for changes in Emacs 27

2020-07-24 Thread Jonas Bernoulli
Without these changes many tests fail on upcoming Emacs 27.1. The details are in the commit messages. Cheers, Jonas Bernoulli (3): gitignore: Ignore generated sphinx.config test: Deal with Emacs 27 switching to lexical scope by default test: Explicitly state that we want to sign

[PATCH 3/3] test: Explicitly state that we want to sign with sender

2020-07-24 Thread Jonas Bernoulli
Since Emacs 27 'mml-secure-epg-sign' errors out if we don't opt-in to signing as the sender using 'mml-secure-openpgp-sign-with-sender'. --- test/test-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 8c331b88..90e26639 100644

[PATCH 2/3] test: Deal with Emacs 27 switching to lexical scope by default

2020-07-24 Thread Jonas Bernoulli
Starting with Emacs 27 undeclared variables in evaluated interactive code uses lexical scope. This includes code passed with '--eval' as we do in the Emacs tests, which also happen to assume dynamic scope. This can affect variables defined by libraries that we use. We let- bind such variables

[PATCH 1/3] gitignore: Ignore generated sphinx.config

2020-07-24 Thread Jonas Bernoulli
--- sphinx.config | 4 1 file changed, 4 insertions(+) create mode 100644 sphinx.config diff --git a/sphinx.config b/sphinx.config new file mode 100644 index ..207614b4 --- /dev/null +++ b/sphinx.config @@ -0,0 +1,4 @@ +# Generated by configure, run from doc/conf.py

[PATCH 06/23] emacs: Use cl-incf where appropriate

2020-07-26 Thread Jonas Bernoulli
It's shorter. That's it pretty much. --- emacs/notmuch-hello.el | 2 +- emacs/notmuch-lib.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 89e03c36..1c084bf7 100644 --- a/emacs/notmuch-hello.el +++

[PATCH 05/23] emacs: Only set one variable per setq form

2020-07-26 Thread Jonas Bernoulli
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

[PATCH 01/23] emacs: Shorten long lines

2020-07-26 Thread Jonas Bernoulli
--- emacs/coolj.el | 2 +- emacs/notmuch-address.el | 38 +++-- emacs/notmuch-company.el | 17 -- emacs/notmuch-crypto.el | 16 +++--- emacs/notmuch-draft.el | 12 ++-- emacs/notmuch-hello.el | 43 ++- emacs/notmuch-jump.el

[PATCH 10/23] emacs: Use one or three lines for 'if' forms

2020-07-26 Thread Jonas Bernoulli
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. --- emacs/notmuch-lib.el | 6 -- emacs/notmuch-tag.el | 3 ++- emacs/notmuch-tree.el | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff

[PATCH 03/23] emacs: Fix indentation

2020-07-26 Thread Jonas Bernoulli
--- emacs/coolj.el | 16 ++--- emacs/notmuch-address.el | 18 +++--- emacs/notmuch-compat.el| 86 - emacs/notmuch-draft.el | 18 +++--- emacs/notmuch-hello.el | 24 +++ emacs/notmuch-lib.el | 56

[PATCH 04/23] emacs: Closing parenthesis go on the same line

2020-07-26 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 6 ++ emacs/notmuch-show.el | 19 --- emacs/notmuch-tree.el | 4 ++-- emacs/notmuch.el | 6 ++ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 7994d5ad..f8958a91 100644

[PATCH 00/23] A create number of cosmetic changes

2020-07-26 Thread Jonas Bernoulli
, Jonas Jonas Bernoulli (23): emacs: Shorten long lines emacs: Remove excess empty lines emacs: Fix indentation emacs: Closing parenthesis go on the same line emacs: Only set one variable per setq form emacs: Use cl-incf where appropriate emacs: Use 'and' instead of 'when' when

[PATCH 08/23] emacs: Use 'unless' instead of 'when' and 'not'

2020-07-26 Thread Jonas Bernoulli
Also use 'unless' in a few cases where previously 'if' was used with 'not' but without an ELSE part. --- emacs/notmuch-hello.el | 6 +++--- emacs/notmuch-mua.el| 4 ++-- emacs/notmuch-parser.el | 2 +- emacs/notmuch-show.el | 3 +-- emacs/notmuch-tag.el| 4 ++-- emacs/notmuch-tree.el

[PATCH 11/23] emacs: Extend face to window edge again

2020-07-26 Thread Jonas Bernoulli
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

[PATCH 17/23] emacs: Autoload notmuch-jump-search only once

2020-07-26 Thread Jonas Bernoulli
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:

[PATCH 13/23] emacs: No longer define notmuch-hello-mode-map as a function

2020-07-26 Thread Jonas Bernoulli
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. --- emacs/notmuch-hello.el | 1 - 1 file changed, 1 deletion(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index

[PATCH 14/23] emacs: notmuch-poll: Let the user know we are polling

2020-07-26 Thread Jonas Bernoulli
It is done synchronously and it can take a while, so we should let the user know what is going on. --- emacs/notmuch-lib.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index fc76fd67..069a19e9 100644 --- a/emacs/notmuch-lib.el

[PATCH 22/23] .dir-locals.el: Set variables for correct "shell" mode

2020-07-26 Thread Jonas Bernoulli
The major mode used for shell scripts is named 'sh-mode'. 'shell-mode' on the other hand implements an interactive shell in emacs-lisp. --- .dir-locals.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index fc75ae61..b3ddffe8 100644 ---

[PATCH 18/23] emacs: Autoload notmuch-jump using an autoload cookie

2020-07-26 Thread Jonas Bernoulli
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". --- emacs/notmuch-jump.el | 1 + emacs/notmuch-tag.el | 3 +-- 2 files changed, 2 insertions(+), 2

[PATCH 02/23] emacs: Remove excess empty lines

2020-07-26 Thread Jonas Bernoulli
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

  1   2   3   >