Variable used to detect reply prefixes in Subject

2022-01-23 Thread Jonas Bernoulli
Hello, Please tell me what variable I have to customize to recognize additional unusual prefixes that some people add to the subject when they send a reply. I searched using some strings I would expect to appear in the value of that variable but either got no results or way too many. Thanks

[PATCH] emacs: notmuch-fcc-header-setup: fix regression

2021-08-04 Thread Jonas Bernoulli
With [1: 16b2db09] we lost the (undocumented) option to use no Fcc header only for From addresses matching a regexp. This brings back that feature and documents it. 1: 2021-01-15 16b2db0986ce0ed7c420a69d0a98bb41e9ca4bd8 emacs: various cosmetic improvements --- emacs/notmuch-maildir-fcc.el | 2

Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

2021-07-23 Thread Jonas Bernoulli
David Bremner writes: > Jonas Bernoulli writes: > >> >> Please merge the proposed fix; IMO it is sound. My follow-up, the reply >> to Tomi, seems quite confused though. But just because we are uncertain >> whether there is further room for improvement, that sh

[PATCH 5/5] emacs: shorten lines in two doc-strings

2021-07-19 Thread Jonas Bernoulli
The byte-compiler wasn't happy about those. --- emacs/notmuch-draft.el | 2 +- emacs/notmuch-hello.el | 8 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el index a68b7d8d..aeb6c588 100644 --- a/emacs/notmuch-draft.el +++ b/emac

[PATCH 4/5] emacs: notmuch-show-pipe-message: cosmetics

2021-07-19 Thread Jonas Bernoulli
--- emacs/notmuch-show.el | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9a95eb34..b14db1dd 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -2076,19 +2076,19 @@ (defun notmuch-sh

[PATCH 3/5] emacs: fix some option type declarations

2021-07-19 Thread Jonas Bernoulli
Also improve their doc-strings. --- emacs/notmuch-tree.el | 66 +-- emacs/notmuch.el | 13 + 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index b288c05d..d11ef38c 100644 --- a/ema

[PATCH 2/5] emacs: add some function declarations

2021-07-19 Thread Jonas Bernoulli
--- emacs/notmuch-jump.el | 4 1 file changed, 4 insertions(+) diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index c0760638..555ecd1f 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -25,6 +25,10 @@ (require 'notmuch-lib) (require 'notmuch-hello) +(declare-f

[PATCH 1/5] emacs: use closures instead of backquoted lambdas

2021-07-19 Thread Jonas Bernoulli
--- emacs/notmuch-hello.el | 16 emacs/notmuch-jump.el | 26 ++ emacs/notmuch-tag.el | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 1e66555b..c1b67e22 100644 --- a/emacs/not

[PATCH 0/5] Use closures and other emacs cleanup

2021-07-19 Thread Jonas Bernoulli
Some assorted emacs cleanup and fixes. The big one is the switch to using closures instead of backquoted lambdas. The other commits for the most part just deal with things the compiler complained about. Jonas Bernoulli (5): emacs: use closures instead of backquoted lambdas emacs: add some

Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

2021-07-19 Thread Jonas Bernoulli
David Bremner writes: > Jonas Bernoulli writes: > >> Hm, when no tree buffer is involved, then `notmuch-show-command-hook' >> probably is required. Anyway, there seems to be some undead code and >> rethinking all this would be a good idea. > > I'm not

Re: [PATCH] emacs: remove useless lexically bound variable

2021-07-19 Thread Jonas Bernoulli
+1 (I was gonna suggest the same change.) David Bremner writes: > A let binding without a value is just an obfuscated way of saying > nil, especially if you are not going to mutate the variable. > --- > emacs/notmuch-tree.el | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > dif

Re: [PATCH 2/2] NEWS: summarize changes to emacs interface.

2021-04-28 Thread Jonas Bernoulli
David Bremner writes: I couldn't wait until tonight. ;) > This my attempt at a summary based on git log. You have mostly covers the important bits that users need to know about. The only thing I would add is: Some keymaps used to contain bindings for unnamed commands. These lambda expression

Re: Release process for 0.32

2021-04-28 Thread Jonas Bernoulli
David Bremner writes: > Jonas, I know a lot of what you contributed is not user visible, > but a patch for NEWS listing some of the user visible changes > (particularly things like dropped variables and functions) would be > appreciated. I missed this request at the time, sorry. I'll try to go o

Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

2021-02-26 Thread Jonas Bernoulli
Hm, when no tree buffer is involved, then `notmuch-show-command-hook' probably is required. Anyway, there seems to be some undead code and rethinking all this would be a good idea. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send a

Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read

2021-02-26 Thread Jonas Bernoulli
> I try to understand whether adding notmuch-tree-command-hook to > post-command-hook in notmuch-tree.el (not in this change) actually > have any effect. You're right, that's unnecessary, and it gets worse. `notmuch-tree-command-hook' is unnecessary too and if it weren't, then it would fail becau

[PATCH] emacs: notmuch-tree: mark the initial message at point as read

2021-02-15 Thread Jonas Bernoulli
When moving between message in a tree or show buffer, the message at point is marked as read. Likewise when creating such a buffer, then the message that is initially at point is supposed to be marked as read as well. The latter worked for `notmuch-show' but not for `notmuch-tree'. Press "RET" or

Re: [PATCH v2 00/36] [emacs] Add outline headings and switch to lexical scope

2021-01-13 Thread Jonas Bernoulli
David Bremner writes: > I pushed applied the first 22 patches to master. Thanks! > "[PATCH v2 23/36] emacs: various cosmetic improvements" leads to some > test failures. FWIW, I'm using Emacs 27.1 on Debian testing. Sorry about, it seems I did not rerun the tests after making the responsible c

[PATCH v3 23/36] emacs: various cosmetic improvements

2021-01-13 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 ++-- emacs/

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 wou

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

2021-01-10 Thread Jonas Bernoulli
David Edmondson writes: > On Sunday, 2021-01-10 at 19:47:18 +01, Jonas Bernoulli wrote: > >> The fourth commit tries to address the issue raised in >> id:87k0sxa6c3@fifthhorseman.net. >> >> The output of "notmuch show --format=sexp --format-version

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

2021-01-10 Thread Jonas Bernoulli
The output of "notmuch show --format=sexp --format-version=4" may contain `:content-type' entries with `nil' as the value, when it fails to detect the correct value. Account for that in a few places where we would otherwise risk a type error. Note that `string=' does not choke on `nil' because it

[PATCH 3/4] emacs: notmuch-show--get-cid-content: cosmetics

2021-01-10 Thread Jonas Bernoulli
--- emacs/notmuch-show.el | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 21133611..8c846fb2 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -599,16 +599,13 @@ (defun notmuch-show--get-cid-

[PATCH 2/4] emacs: notmuch-show--register-cids: fix names of bindings

2021-01-10 Thread Jonas Bernoulli
--- emacs/notmuch-show.el | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index fdf4ab3c..21133611 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -581,13 +581,13 @@ (defun notmuch-show--register-cids (msg

[PATCH 1/4] emacs: notmuch-mua-add-more-hidden-headers: use local binding

2021-01-10 Thread Jonas Bernoulli
--- emacs/notmuch-mua.el | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 08c73c16..bbf059a2 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -217,11 +217,10 @@ (defun notmuch-mua-add-more-hidden-headers ()

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

2021-01-10 Thread Jonas Bernoulli
for that in a few places where we would otherwise risk a type error. The other three commits cleanup the code I had to look at to do the above, because I just can't help myself. This does not apply without first applying id:20201214162401.19569-1-jo...@bernoul.li. Jonas Jonas Bernoulli

Re: [PATCH] emacs/notmuch-show: Work around errors where a part lacks a content-type

2021-01-10 Thread Jonas Bernoulli
I accidentally responded off-list. Here is (part of) Daniel's response to that message: On Wed 2021-01-06 18:48:09 +0100, Jonas Bernoulli wrote: > Okay, I'll prepare a patch that does that. Thanks! > I wasn't so much worried having to deal with this in multiple places in

[PATCH v2 36/36] emacs: notmuch-address-expand-name: use the actual initial-input

2021-01-10 Thread Jonas Bernoulli
Users may type some text into the buffer on an address line, before actually invoking address completion. We now use that text as the initial input when we begin address completion. Previously we did knowingly replace the actual initial input with some completion candidate that happens to match.

[PATCH v2 35/36] emacs: allow opting out of notmuch's address completion

2021-01-10 Thread Jonas Bernoulli
IMO Notmuch should not override the default completion mechanism by default, at least not globally. But since users are already used to this behavior it is probably too late to change it. Do the next best thing and at least allow users to opt out. --- emacs/notmuch-address.el | 48

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

2021-01-10 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. --- emacs/notmuch

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

2021-01-10 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 b

[PATCH v2 31/36] emacs: improve how cl-lib and pcase are required

2021-01-10 Thread Jonas Bernoulli
We need to load `cl-lib' at run-time because we use more from it than just macros. Never-the-less many, but not all libraries required it only at compile-time, which we got away with because at least some libraries already required it at run-time as well. We use `cl-lib' and (currently to a lesse

[PATCH v2 33/36] emacs: use string-empty-p

2021-01-10 Thread Jonas Bernoulli
--- emacs/notmuch-lib.el | 2 +- emacs/notmuch-mua.el | 2 +- emacs/notmuch-show.el | 4 ++-- emacs/notmuch-tag.el | 2 +- emacs/notmuch.el | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 05d3be10..bc550dc2 100644 -

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

2021-01-10 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 481a0e0a..40b730df 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -70,6 +70,8 @@ (eval-when-compile (require 'cl-l

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

2021-01-10 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 f8c97c5d

[PATCH v2 32/36] emacs: make subr-x available in all libraries

2021-01-10 Thread Jonas Bernoulli
Like `cl-lib' and `pcase', which are already available in all libraries, `subr-x' also provided many useful functions that we would like to use. Making `subr-x' available in every library from the get-go means that we can use the functions it defines without having to double check every single tim

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

2021-01-10 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... ;;; Commentary:

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

2021-01-10 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 | 2

[PATCH v2 24/36] emacs: various comment improvements

2021-01-10 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 +++ b/em

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

2021-01-10 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 b

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

2021-01-10 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 v2 23/36] emacs: various cosmetic improvements

2021-01-10 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 ++-- emacs/

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

2021-01-10 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 v2 21/36] emacs: notmuch-mua.el: move all options into "Options" section

2021-01-10 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 +++ b/emacs/notmuch-mua.el

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

2021-01-10 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 d61

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

2021-01-10 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 notmuch-message-qu

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

2021-01-10 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 d

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

2021-01-10 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 v2 17/36] emacs: define notmuch-message-queued-tag-changes as buffer-local

2021-01-10 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 --- a/emacs/notmuch-messag

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

2021-01-10 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 t

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

2021-01-10 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 issu

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

2021-01-10 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 (overlay

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

2021-01-10 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 v2 09/36] emacs: avoid killing process buffer when process is still alive

2021-01-10 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 insertions(+

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

2021-01-10 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 v2 13/36] emacs: notmuch-tag--get-formats: silence byte-compiler

2021-01-10 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 fa376b02..a55

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

2021-01-10 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 &r

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

2021-01-10 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(-) di

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

2021-01-10 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 v2 03/36] emacs: define new notmuch-search-item widget type

2021-01-10 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 b/emacs/notmuch

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

2021-01-10 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 a

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

2021-01-10 Thread Jonas Bernoulli
. The remaining two new commits (4,5) I have already submitted earlier in a separate thread. Unfortunately they did not get merged or even just discussed so far, so I am including them here again. Cheers, Jonas Jonas Bernoulli (36): emacs: use setq instead of set emacs: sanitize

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

2021-01-10 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(-) d

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

2021-01-10 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 b/emacs/notmuch-tree.el

Re: failure in emacs notmuch-show: notmuch-show--register-cids: Wrong type argument: char-or-string-p, nil

2021-01-02 Thread Jonas Bernoulli
Daniel Kahn Gillmor writes: > My elisp is too weak to know how to debug this well. suggestions > welcome! "M-x toggle-debug-on-error" and then trying to show the message should give you a backtrace. But before doing that also "M-x eval-buffer" in "notmuch-show.el" to make it more meaningful.

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

2020-12-30 Thread Jonas Bernoulli
Tomi Ollila writes: > The patch series did not apply for me (fully) anymore. Since you got it applied now I am not sending a second iteration just yet, or should I? By the way, a regularly rebased version can be found in the "pending" branch at https://github.com/tarsiiformes/notmuch.git. Curr

[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 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. --- emacs/notmuch

[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 | 2

[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 ++-- emacs/

[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 b

[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 'cl-l

[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... ;;; Commentary:

[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 b

[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 20d2f095

[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 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 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 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 +++ b/em

[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 notmuch-message-qu

[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 (overlay

[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 --- a/emacs/notmuch-messag

[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 +++ b/emacs/notmuch-mua.el

[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 d61

[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 t

[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 d

[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 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 fa376b02..a55

[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 issu

[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 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 &r

[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 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(-) di

[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 insertions(+

[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 b/emacs/notmuch

[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 a

[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(-) d

[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 b/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: u

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: - id:2020110823115

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

2020-11-16 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 cha

  1   2   3   >