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

2020-07-26 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 21/23] Fix typos

2020-07-26 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 23/23] test: Fix indentation

2020-07-26 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 90e26639..a4058660 100644 --- a/test/test-lib.sh

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

2020-07-26 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 20/23] emacs: Increase consistency of library headers

2020-07-26 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 16/23] emacs: Improve doc-strings

2020-07-26 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 19/23] emacs: Various cosmetic changes

2020-07-26 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 15/23] emacs: Use makefile-gmake-mode in Makefile*s

2020-07-26 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 12/23] emacs: Fix some function declarations

2020-07-26 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 0/3] Adjust test for changes in Emacs 27

2020-07-26 Thread Jonas Bernoulli
The first commit didn't do what the commit message claimed, as pointed out by David. I have fixed that, and also a second issue that I have missed because I still had some parts of 'mml-sec.el' commented out when testing the fixes to the tests... it was a long day. Jonas Bernoulli (3

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

2020-07-26 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-26 Thread Jonas Bernoulli
--- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1c8705ec..8f3ebec0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ tags /.stamps *.stamp /bindings/python-cffi/build/ +/sphinx.config -- 2.26.0

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

2020-07-26 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 8c331b88..31c858d1 100644

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

2020-07-26 Thread Jonas Bernoulli
Sean Whitton writes: > On Sun 26 Jul 2020 at 06:58PM +02, Jonas Bernoulli wrote: > >> Also do so for some 'if' forms that lack an ELSE part. >> Even go as far as using 'and' and 'not' instead of 'unless'. > > I don't follow "when the return value matters"

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

2020-07-27 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

[PATCH v3 3/4] test: Remove misguided emacs testing utilities

2020-07-27 Thread Jonas Bernoulli
The goal of this abstraction was to save space. But that failed as the result actually was that four trivial lines got replace with 15 fairly complicated lines. The opposite of what it was supposed to do. Also it made it harder to come up with the fix in the previous commit; simply grepping for

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

2020-07-27 Thread Jonas Bernoulli
This reroll explains why the variable's default value is -100. It also adds an additional commit, which removes a misguided abstraction that is related to those very same variables. Jonas Bernoulli (4): gitignore: Ignore generated sphinx.config test: Deal with Emacs 27 switching to lexical

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

2020-07-27 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 8c331b88..31c858d1 100644

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

2020-07-27 Thread Jonas Bernoulli
--- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1c8705ec..8f3ebec0 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ tags /.stamps *.stamp /bindings/python-cffi/build/ +/sphinx.config -- 2.26.0

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

2020-07-27 Thread Jonas Bernoulli
Tomi Ollila writes: > On Sun, Jul 26 2020, Jonas Bernoulli wrote: >> ;; Outer single and double quotes, which might be nested. >> (cl-loop with start-of-loop >> - do (setq start-of-loop p-name) >> - >> + do (setq start-of-l

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

2020-07-27 Thread Jonas Bernoulli
Tomi Ollila writes: > On Sun, Jul 26 2020, Jonas Bernoulli wrote: > >> --- >> .gitignore | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/.gitignore b/.gitignore >> index 1c8705ec..8f3ebec0 100644 >> --- a/.gitignore >> +

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

2020-07-27 Thread Jonas Bernoulli
Tomi Ollila writes: > On Sun, Jul 26 2020, Jonas Bernoulli wrote: >> (defun notmuch-maildir-add-file-style-fcc-header (subdir) >> @@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert >> (fcc-header create) >>;; typo, or just the user want

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

2020-07-27 Thread Jonas Bernoulli
Sean Whitton writes: > Hello, > > On Mon 27 Jul 2020 at 12:02AM +02, Jonas Bernoulli wrote: > >> Sean Whitton writes: >> >>> On Sun 26 Jul 2020 at 06:58PM +02, Jonas Bernoulli wrote: >>> >>>> Also do so for some 'if' form

Re: [PATCH] Emacs: Fix notmuch-message-summary-face definition

2020-08-16 Thread Jonas Bernoulli
Teemu Likonen writes: > 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

Re: [PATCH 0/4] emacs: avoid type errors due to nil as content-type

2021-01-12 Thread Jonas Bernoulli
Tomi Ollila writes: > Note that messages > > 20210110140112.25930-11-jo...@bernoul.li and > 20210110140112.25930-12-jo...@bernoul.li > > have base64 -encoded content, with CRLF line endings > so those don't apply as is, but CR's from the encoded > content must be deleted. Do you know why git

Re: [PATCH v2 23/23] emacs: various cosmetic improvements

2020-12-14 Thread Jonas Bernoulli
David Bremner writes: > Apologies for the delay, I missed the second review. No problem, I probably should just have pinged after a week or so. Will do that next time. Sorry for being slow to respond myself! By the way, you seem to have missed some more patch series of mine: -

[PATCH 01/32] emacs: use setq instead of set

2020-12-14 Thread Jonas Bernoulli
Commonly `set' is only used if there is no way around it; i.e. when the variable cannot be known until runtime. --- emacs/notmuch-tree.el | 2 +- emacs/notmuch.el | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-tree.el

[PATCH 00/32] [emacs] Add outline headings and switch to lexical scope

2020-12-14 Thread Jonas Bernoulli
ssary" these bindings are is somewhat subjective. Cheers, Jonas PS: Don't worry. I do NOT have another large patch series waiting after this. Future changes should be more focused or even come in the form of independent extensions. Jonas Bernoulli (32): emacs: use se

[PATCH 04/32] emacs: notmuch-start-notmuch: remove backward compatibility code

2020-12-14 Thread Jonas Bernoulli
We no longer support Emacs releases before version 25.1. Also adjust the sentinels which only had to deal with an error file when using an older Emacs release was used. --- emacs/notmuch-lib.el | 64 1 file changed, 17 insertions(+), 47 deletions(-)

[PATCH 02/32] emacs: sanitize dedicated widget action/notify functions

2020-12-14 Thread Jonas Bernoulli
These functions are used as action/notify functions. That dictates the appropriate function signatures but even though these functions are not used for anything else they use incompatible signatures, forcing the callers to use lambda expressions to deal with these incompatibilities. Fix that by

[PATCH 09/32] emacs: avoid killing process buffer when process is still alive

2020-12-14 Thread Jonas Bernoulli
In practice this probably does not make a difference or we would have heard about it many times, but better be safe than sorry. Process sentinels are called not only when the process has finished but also on other state changes. --- emacs/notmuch-lib.el | 7 --- 1 file changed, 4

[PATCH 07/32] emacs: notmuch-start-notmuch: avoid storing process buffer twice

2020-12-14 Thread Jonas Bernoulli
The buffer of the error process is accessible using `process-buffer'. We still have to store the error-buffer in the non-error process because for that process `process-buffer' obviously returns its own buffer. --- emacs/notmuch-lib.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH 03/32] emacs: define new notmuch-search-item widget type

2020-12-14 Thread Jonas Bernoulli
This is complex enough to warrant a dedicated widget type, which will make future improvements less messy to implement. --- emacs/notmuch-hello.el | 92 +- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/emacs/notmuch-hello.el

[PATCH 08/32] emacs: avoid passing around some redundant information

2020-12-14 Thread Jonas Bernoulli
When running "notmuch" we use its full path but when displaying the command to the user we show just its name for readability reasons. Avoid passing around both representations because it is very easy to get the name from the path. Notmuch itself uses the involved functions just for "notmuch" but

[PATCH 11/32] emacs: use lexical-bindings in all libraries

2020-12-14 Thread Jonas Bernoulli
Doing so causes many new compile warnings. Some of these warnings concern genuine changes in behavior that have to be addressed right away. Many other warnings are due to unused variables. Nothing has changed here, except that the byte-compiler can now detect these pre-existing and harmless

[PATCH 12/32] emacs: deal with unused lexical arguments and variables

2020-12-14 Thread Jonas Bernoulli
The previous commit switched to lexical-binding but without dealing with the new warnings about unused lexical arguments and variables. This commit deals with most of them, in most cases by either removing leftover bindings that are actually unnecessary, or by marking certain arguments as "known

[PATCH 13/32] emacs: notmuch-tag--get-formats: silence byte-compiler

2020-12-14 Thread Jonas Bernoulli
`format-alist' is a global variable and the byte-compiler is unhappy when a lexical function argument shadows a global (dynamic) binding. --- emacs/notmuch-tag.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el index

[PATCH 19/32] emacs: notmuch-wash.el: require diff-mode at beginning of code

2020-12-14 Thread Jonas Bernoulli
That's what we usually do. Also do not declare variable `diff-file-header-re' because it is defined in `diff-mode.el', which we always require. --- emacs/notmuch-wash.el | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index

[PATCH 21/32] emacs: notmuch-mua.el: move all options into "Options" section

2020-12-14 Thread Jonas Bernoulli
This is how we do it in other libraries. --- emacs/notmuch-mua.el | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 2d0b7169..74ffd8f2 100644 --- a/emacs/notmuch-mua.el +++

[PATCH 16/32] emacs: silence compiler wrt notmuch-show-insert-part-text/plain

2020-12-14 Thread Jonas Bernoulli
`notmuch-show-insert-part-text/plain' calls `notmuch-show-insert-text/plain-hook' with two arguments MSG and DEPTH. Currently all hook functions ignore MSG but third-party functions may not. One hook function uses DEPTH. --- emacs/notmuch-wash.el | 8 1 file changed, 4 insertions(+), 4

[PATCH 14/32] emacs: inline notmuch-sexp-eof into only caller

2020-12-14 Thread Jonas Bernoulli
This function had a few issues. - Neither its name nor the old comment before it is called made it clear what it does. - It took one argument but didn't do anything with it. - It's doc-string made a few claims, which are untrue and generally focused on details instead of that its purpose is.

[PATCH 05/32] emacs: notmuch-start-notmuch-error-sentinel: assert buffer is alive

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 76387779..21fa2582 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -956,7 +956,8 @@ (defun notmuch-start-notmuch-sentinel (proc event)

[PATCH 06/32] emacs: notmuch-start-notmuch-sentinel: assert buffer is alive

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 21fa2582..06ca8cdc 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -917,7 +917,8 @@ (defun notmuch-start-notmuch (name buffer sentinel

[PATCH 31/32] emacs: use string-empty-p

2020-12-14 Thread Jonas Bernoulli
Unfortunately that means we have to explicitly require subr-x, which arguably should always be loaded without packages having to require it, but the Emacs developers decided otherwise. Loading it explicitly most likely comes without any additional cost because almost certainly some other packages

[PATCH 25/32] emacs: various doc-string improvements

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-draft.el | 12 ++- emacs/notmuch-maildir-fcc.el | 21 +- emacs/notmuch-mua.el | 9 emacs/notmuch-tag.el | 41 ++-- emacs/notmuch-tree.el| 10 - emacs/notmuch.el |

[PATCH 32/32] emacs: notmuch-tree-get-match: No longer define as command

2020-12-14 Thread Jonas Bernoulli
When called from code, then this function returns non-nil when the message at point is a matched message. However it does nothing at all to present that information to the user when it called interactively. It is therefore safe to conclude that nobody is using this as a command. ---

[PATCH 10/32] emacs: make headings outline-minor-mode compatible

2020-12-14 Thread Jonas Bernoulli
`outline-minor-mode' treats comments that begin with three or more semicolons as headings. That makes it very convenient to navigate code and to show/hide parts of a file. Elips libraries typically have four top-level sections, e.g.: ;;; notmuch.el --- run notmuch within emacs... ;;;

[PATCH 29/32] emacs: reorder notmuch.el a bit

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch.el | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 0fb9874b..24b930bf 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -70,6 +70,8 @@ (eval-when-compile (require

[PATCH 23/32] emacs: various cosmetic improvements

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 22 -- emacs/notmuch-hello.el | 24 --- emacs/notmuch-jump.el| 4 +- emacs/notmuch-lib.el | 26 +-- emacs/notmuch-maildir-fcc.el | 61 +++--- emacs/notmuch-mua.el | 28 ++--

[PATCH 26/32] emacs: remove variable notmuch-search-disjunctive-regexp

2020-12-14 Thread Jonas Bernoulli
The value is the only possible value, it is only used in one place, and using a global variable serves no purpose but to make things more complicated. --- emacs/notmuch.el | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index

[PATCH 22/32] emacs: notmuch-crypto-status-button-type: fix potential bug

2020-12-14 Thread Jonas Bernoulli
The "help-echo" can potentially contain an unintended %-spec so we have to make sure it would not be treated as such. --- emacs/notmuch-crypto.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 50a3de46..db7cb75d 100644

[PATCH 28/32] emacs: notmuch-search-stash-thread-id: use notmuch-search-query-string

2020-12-14 Thread Jonas Bernoulli
No longer use the function `notmuch-search-get-query', which does nothing but return the value of that variable. That function was added in [1: f47eeac0] for use in `notmuch-read-query' along-side related `notmuch-show-get-query' and `notmuch-tree-get-query' but using it here makes little sense.

[PATCH 27/32] emacs: define a few variables as automatically buffer-local

2020-12-14 Thread Jonas Bernoulli
Define these variables as automatically buffer-local, meaning that they always become buffer-local when set unless explicitly told otherwise using `setq-default' or when using the Custom interface. Previously they were declared, which keeps the byte-compiler quiet but is not actually the same as

[PATCH 30/32] emacs: avoid unnecessary let-bindings

2020-12-14 Thread Jonas Bernoulli
To some extend this is a personal preference, but the preference is strongly dependent on whether one is used to a language that makes it necessary to use variables like this. This makes it perfectly clear that we are first getting and then using a "foo": (use-foo (get-foo)) Sure this has to

[PATCH 15/32] emacs: notmuch-wash-region-to-button: remove unused MSG argument

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-wash.el | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 36041904..4fbb4e12 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -200,7 +200,7 @@ (defun notmuch-wash-button-label

[PATCH 18/32] emacs: notmuch-message-apply-queued-tag-changes: cosmetics

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-message.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el index 9dc8d056..abeff53a 100644 --- a/emacs/notmuch-message.el +++ b/emacs/notmuch-message.el @@ -62,9 +62,8 @@ (defvar-local

[PATCH 24/32] emacs: various comment improvements

2020-12-14 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 5 ++--- emacs/notmuch-hello.el | 4 +--- emacs/notmuch-lib.el | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 2f0ec9b3..1f22e377 100644 --- a/emacs/notmuch-address.el +++

[PATCH 17/32] emacs: define notmuch-message-queued-tag-changes as buffer-local

2020-12-14 Thread Jonas Bernoulli
Also improve the doc-string. --- emacs/notmuch-message.el | 14 +++--- emacs/notmuch-mua.el | 12 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el index f0e9ffcc..9dc8d056 100644 ---

[PATCH 20/32] emacs: notmuch-mua-prompt-for-sender: don't force Ido on users

2020-12-14 Thread Jonas Bernoulli
We shouldn't force `ido-completion-read' on users who do not otherwise use Ido. Unfortunately simply turning on `ido-mode' does not change every `completing-read' into a `ido-completing-read', instead it only changes file and buffer completion. I do realize that existing Ido users will initially

[PATCH] Revert "emacs: notmuch-search: avoid wiping out buffer-local variables"

2020-11-08 Thread Jonas Bernoulli
This reverts commit f9fbd1ee3bfd679175d88af403752d87a730349f. Emacs provides a mechanism for avoiding wiping out buffer-local variables: marking them as "permanent local", which essentially means "don't wip out the local value when enabling major-mode". (put 'the-variable 'permanent-local t)

[PATCH 00/27] Another set up Emacs cleanup

2020-11-08 Thread Jonas Bernoulli
I did it again; looked at some code and cleaned it up along the way. Cheers, Jonas Jonas Bernoulli (27): emacs: silence byte-compiler emacs: define notmuch-message-mode-map explicitly emacs: add doc-string to notmuch-tree-mode-map emacs: don't fset keymaps emacs: remove

[PATCH 02/27] emacs: define notmuch-message-mode-map explicitly

2020-11-08 Thread Jonas Bernoulli
Key bindings should not be defined at the top-level but inside a `defvar' form. Doing it at the top-level makes it harder to reliably customize key bindings. --- emacs/notmuch-mua.el | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-mua.el

[PATCH 07/27] emacs: remove kludge for Emacs 23 from notmuch-mua-mail

2020-11-08 Thread Jonas Bernoulli
Notmuch requires at least Emacs version 25. The `return-action' argument was added prior to Emacs 24.1 in 25ca2e61403f97b5a023164f2924d5f8aca2492a. --- emacs/notmuch-mua.el | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el

[PATCH 09/27] emacs: sanitize function that displays version

2020-11-08 Thread Jonas Bernoulli
Previously it was defined in "notmuch-hello.el" and its name contained "hello" solely because it replaced an anonymous function that was mistakenly only bound in `notmuch-hello-mode-map'. But it makes more sense to bind it in all notmuch modes and even if we did not change that aspect it still

[PATCH 15/27] emacs: misc doc-string improvements

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 6 +++--- emacs/notmuch-crypto.el | 4 ++-- emacs/notmuch-mua.el | 7 --- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 561cc140..04353522 100644 --- a/emacs/notmuch-address.el +++

[PATCH 08/27] emacs: more cleanup since dropping support for Emacs 24

2020-11-08 Thread Jonas Bernoulli
Notmuch requires at least version 25 of Emacs now. Adjust comments that previously referenced version 24 specifically, even though they also apply to later releases. Remove documentation and code that no longer applies. - `mm-shr' no longer references `gnus-inhibit-images'. ---

[PATCH 06/27] emacs: fix old bug in notmuch-mua-mail

2020-11-08 Thread Jonas Bernoulli
This fixes a regression introduced in [1: 7e20d264]. If the argument RETURN-ACTION was non-nil then we should pass along the value of that argument. Instead we passed along the constant symbol `return-action'. 1: 7e20d26480553f57d53bd9ec28cae163c1ac91e3 emacs: Fix mail composition under

[PATCH 01/27] emacs: silence byte-compiler

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-tree.el | 5 + 1 file changed, 5 insertions(+) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index f342f85a..7b1e34ca 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -42,6 +42,11 @@ (declare-function notmuch-read-query "notmuch" (prompt))

[PATCH 25/27] emacs: do not quote self-quoting t

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-draft.el | 6 +++--- emacs/notmuch-maildir-fcc.el | 10 +- emacs/notmuch-mua.el | 6 +++--- emacs/notmuch-show.el| 2 +- emacs/notmuch-tag.el | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-draft.el

[PATCH 27/27] emacs: various cosmetic improvements

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-address.el | 31 ++ emacs/notmuch-hello.el | 28 + emacs/notmuch-lib.el | 38 + emacs/notmuch-mua.el | 10 ++--- emacs/notmuch-tag.el | 2 +- emacs/notmuch.el | 88 6 files

[PATCH 22/27] emacs: use defvar-local

2020-11-08 Thread Jonas Bernoulli
It is available since Emacs 24.3 and we require at least Emacs 25. --- emacs/coolj.el | 4 +--- emacs/notmuch-company.el | 4 ++-- emacs/notmuch-draft.el | 3 +-- emacs/notmuch-lib.el | 8 ++-- emacs/notmuch-show.el| 18 ++ emacs/notmuch-tree.el| 27

[PATCH 14/27] emacs: always use elisp quoting style in doc-strings

2020-11-08 Thread Jonas Bernoulli
Emacs doc-strings use neither markdown nor lisp symbol quoting. --- emacs/notmuch-address.el | 2 +- emacs/notmuch-draft.el | 8 emacs/notmuch-hello.el | 4 ++-- emacs/notmuch-maildir-fcc.el | 2 +- emacs/notmuch-tag.el | 20 ++--

[PATCH 10/27] emacs: define notmuch-hello-url as a constant

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-hello.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 69d0ad64..003bec33 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -282,7 +282,7 @@ (defcustom notmuch-hello-refresh-hook nil

[PATCH 17/27] emacs: remove unnecessary notmuch-remove-if-not

2020-11-08 Thread Jonas Bernoulli
We could just have switched to using `cl-remove-if-not' instead, but the two uses of the *remove-if-not function are pretty strange to begin with so we refactor to not use any such function at all. --- emacs/notmuch-hello.el | 43 -- emacs/notmuch-lib.el

[PATCH 26/27] emacs: avoid binding unnamed commands in keymaps

2020-11-08 Thread Jonas Bernoulli
One should never bind unnamed commands in keymaps because doing that makes it needlessly hard for users to change these bindings. Replace such anonymous bindings with named commands that are generated using macros and some boilerplate. Using macros is better than using a simple loop because that

[PATCH 23/27] emacs: use setq-local

2020-11-08 Thread Jonas Bernoulli
It is available since Emacs 24.3 and we require at least Emacs 25. It makes the variable buffer-local if it isn't always buffer-local anyway. --- emacs/notmuch-company.el | 3 +-- emacs/notmuch-parser.el | 5 ++--- emacs/notmuch.el | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-)

[PATCH 21/27] emacs: inline notmuch-split-content-type

2020-11-08 Thread Jonas Bernoulli
This trivial helper function actually made things slightly *less* readable by adding an unnecessary indirection. --- emacs/notmuch-lib.el | 8 ++-- emacs/notmuch-show.el | 16 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/emacs/notmuch-lib.el

[PATCH 24/27] emacs: use setq instead set

2020-11-08 Thread Jonas Bernoulli
Commonly `set' is only used if there is no way around it; i.e. when the variable cannot be known until runtime. --- emacs/notmuch-tree.el | 2 +- emacs/notmuch.el | 14 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-tree.el

[PATCH 18/27] emacs: remove unused notmuch-address-locate-command

2020-11-08 Thread Jonas Bernoulli
We stopped using it in [1: 0e671478]. 1: 0e671478c6f37018973392f049979da5e1a8ff99 emacs: replace use of notmuch-address-message-insinuate --- emacs/notmuch-address.el | 19 --- 1 file changed, 19 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el

[PATCH 19/27] emacs: remove unnecessary notmuch-tree-button-activate

2020-11-08 Thread Jonas Bernoulli
Since [1: f8bdba37] no key is bound to this command and it is redundant because the behavior of `push-command' is identical when called as a command. 1: f8bdba37d3f4c877e05e17b5b1c7d2d512106538 emacs: tree: remove binding for pressing button in message pane --- emacs/notmuch-tree.el | 8

[PATCH 20/27] emacs: inline notmuch-documentation-first-line

2020-11-08 Thread Jonas Bernoulli
Inline a simplified version of `notmuch-documentation-first-line' into its only caller. The new code snippet differs from the removed function in that it returns nil instead of the empty string for symbols that have no function documentation. That value is ultimately used as an argument to

[PATCH 16/27] emacs: remove deprecated notmuch-folder command

2020-11-08 Thread Jonas Bernoulli
It has been deprecated for a decade and it's time to let go. --- emacs/notmuch-hello.el | 5 - 1 file changed, 5 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bc07c29c..f5d9e0ec 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -987,11

[PATCH 04/27] emacs: don't fset keymaps

2020-11-08 Thread Jonas Bernoulli
These keymaps are never invoked as commands so the function definitions serve no purpose. --- emacs/notmuch-show.el | 1 - emacs/notmuch-tree.el | 1 - emacs/notmuch.el | 1 - 3 files changed, 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index b08ceb97..ec22fd94

[PATCH 13/27] emacs: place complete first sentence on first doc-string line

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-crypto.el | 3 +-- emacs/notmuch-hello.el | 3 +-- emacs/notmuch-mua.el| 11 --- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 276c9859..4fab215a 100644 --- a/emacs/notmuch-crypto.el +++

[PATCH 11/27] emacs: shorten/replace first sentence of a few doc-strings

2020-11-08 Thread Jonas Bernoulli
The first sentence should fit on the first line. It is okay if the first sentence/line does not contain all the information that the rest of the doc-string covers. --- emacs/notmuch-show.el | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el

[PATCH 03/27] emacs: add doc-string to notmuch-tree-mode-map

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-tree.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 7b1e34ca..ea6a5cf3 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -359,7 +359,8 @@ (defvar notmuch-tree-mode-map (define-key

[PATCH 05/27] emacs: remove redundant notmuch-hello-trim

2020-11-08 Thread Jonas Bernoulli
Use `string-trim', which exists since Emacs 24.4. --- emacs/notmuch-hello.el | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bb60a890..b67a5e19 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@

[PATCH 12/27] emacs: place only first sentence on first doc-string line

2020-11-08 Thread Jonas Bernoulli
--- emacs/notmuch-mua.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 49bad00d..9d08c2c9 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -62,8 +62,8 @@ (defcustom notmuch-mua-compose-in 'current-window

Re: Debugging slow down over time

2020-11-11 Thread Jonas Bernoulli
Sebastian Fischmeister writes: > For some time already I experience a slowdown of the emacs notmuch > interface over time. Please check if my recent patch in id:20201108174929.1227-1-jo...@bernoul.li fixes that. Cheers, Jonas ___ notmuch

Re: [PATCH 01/27] emacs: silence byte-compiler

2020-11-11 Thread Jonas Bernoulli
William Casarin writes: > LGTM, I have a similar patch here: id:20200908171536.20679-1-j...@jb55.com So if I understood correctly the problem with that was that you were unable to run the tests and therefore couldn't confirm that you fixed the issue or even that there was an issue in the first

Re: [PATCH 13/27] emacs: place complete first sentence on first doc-string line

2020-11-16 Thread Jonas Bernoulli
David Edmondson writes: > On Sunday, 2020-11-08 at 20:02:57 +01, Jonas Bernoulli wrote: > > With a suggested rewording below... > > Reviewed-by: David Edmondson > >> --- >> emacs/notmuch-crypto.el | 3 +-- >> emacs/notmuch-hello.el | 3 +-- >> emac

[PATCH v2 13/23] emacs: remove unnecessary notmuch-remove-if-not

2020-11-16 Thread Jonas Bernoulli
We could just have switched to using `cl-remove-if-not' instead, but the two uses of the *remove-if-not function are pretty strange to begin with so we refactor to not use any such function at all. --- emacs/notmuch-hello.el | 43 -- emacs/notmuch-lib.el

[PATCH v2 06/23] emacs: define notmuch-hello-url as a constant

2020-11-16 Thread Jonas Bernoulli
--- emacs/notmuch-hello.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 69d0ad64..003bec33 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -282,7 +282,7 @@ (defcustom notmuch-hello-refresh-hook nil

[PATCH v2 02/23] emacs: fix old bug in notmuch-mua-mail

2020-11-16 Thread Jonas Bernoulli
This fixes a regression introduced in [1: 7e20d264]. If the argument RETURN-ACTION was non-nil then we should pass along the value of that argument. Instead we passed along the constant symbol `return-action'. 1: 7e20d26480553f57d53bd9ec28cae163c1ac91e3 emacs: Fix mail composition under

[PATCH v2 01/23] emacs: remove redundant notmuch-hello-trim

2020-11-16 Thread Jonas Bernoulli
Use `string-trim', which exists since Emacs 24.4. --- emacs/notmuch-hello.el | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bb60a890..b67a5e19 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@

[PATCH v2 03/23] emacs: remove kludge for Emacs 23 from notmuch-mua-mail

2020-11-16 Thread Jonas Bernoulli
Notmuch requires at least Emacs version 25. The `return-action' argument was added prior to Emacs 24.1 in 25ca2e61403f97b5a023164f2924d5f8aca2492a. --- emacs/notmuch-mua.el | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el

[PATCH v2 04/23] emacs: more cleanup since dropping support for Emacs 24

2020-11-16 Thread Jonas Bernoulli
Notmuch requires at least version 25 of Emacs now. Adjust comments that previously referenced version 24 specifically, even though they also apply to later releases. Remove documentation and code that no longer applies. - `mm-shr' no longer references `gnus-inhibit-images'. ---

[PATCH v2 08/23] emacs: place only first sentence on first doc-string line

2020-11-16 Thread Jonas Bernoulli
--- emacs/notmuch-mua.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 49bad00d..9d08c2c9 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -62,8 +62,8 @@ (defcustom notmuch-mua-compose-in 'current-window

[PATCH v2 07/23] emacs: shorten/replace first sentence of a few doc-strings

2020-11-16 Thread Jonas Bernoulli
The first sentence should fit on the first line. It is okay if the first sentence/line does not contain all the information that the rest of the doc-string covers. --- emacs/notmuch-show.el | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el

[PATCH 00/23] Another set up Emacs cleanup

2020-11-16 Thread Jonas Bernoulli
This remove the first four commits, which have already been applied to master. It also makes requested minor changes to the three marked commits. Jonas Bernoulli (23): emacs: remove redundant notmuch-hello-trim emacs: fix old bug in notmuch-mua-mail emacs: remove kludge for Emacs 23 from

<    1   2   3   >