[lieer] Release v1.1
Hi, lieer v1.1 has been released with a bunch of minor fixes, and also the ability to (experimentally) send e-mail as a primitive sendmail stand-in. https://github.com/gauteh/lieer "Fast email-fetching and sending and two-way tag synchronization between notmuch and GMail" git shortlog: * Gaute Hope * Aurélien Ooms * Radu Butoi Regards, Gaute pgpIzIBdOPvi9.pgp Description: PGP signature ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] emacs: Use `cl-lib' instead of deprecated `cl'
From: 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 symbols. A few replacements do not follow that simple pattern; e.g. `first' is replaced with `car', even though the alias `cl-first' exists, because the latter is not idiomatic emacs-lisp. In a few cases we start using `pcase-let' or `pcase-lambda' instead of renaming e.g. `first' to `car'. That way we can remind the reader of the meaning of the various parts of the data that is being deconstructed. An obsolete `lexical-let' and a `lexical-let*' are replaced with their regular variants `let' and `let*' even though we do not at the same time enable `lexical-binding' for that file. That is the right thing to do because it does not actually make a difference in those cases whether lexical bindings are used or not, and because this should be enabled in a separate commit. We need to explicitly depend on the `cl-lib' package because Emacs 24.1 and 24.2 lack that library. When using these releases we end up using the backport from GNU Elpa. We need to explicitly require the `pcase' library because `pcase-dolist' was not autoloaded until Emacs 25.1. --- Thanks Jonas! I couldn't get this patch to cleanly apply, so I've rebased it on master for anyone who wants to test. Cheers, Will emacs/notmuch-company.el | 5 +- emacs/notmuch-draft.el | 2 +- emacs/notmuch-hello.el | 147 ++- emacs/notmuch-jump.el| 45 +-- emacs/notmuch-lib.el | 18 ++--- emacs/notmuch-maildir-fcc.el | 35 + emacs/notmuch-mua.el | 76 +- emacs/notmuch-parser.el | 18 ++--- emacs/notmuch-pkg.el.tmpl| 3 +- emacs/notmuch-show.el| 103 emacs/notmuch-tag.el | 45 ++- emacs/notmuch-tree.el| 20 ++--- emacs/notmuch.el | 62 +++ test/test-lib.el | 2 +- 14 files changed, 292 insertions(+), 289 deletions(-) diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index 3e12e7a9..ac998f9b 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -27,7 +27,8 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) + (require 'notmuch-lib) (defvar notmuch-company-last-prefix nil) @@ -65,7 +66,7 @@ (require 'company) (let ((case-fold-search t) (completion-ignore-case t)) -(case command +(cl-case command (interactive (company-begin-backend 'notmuch-company)) (prefix (and (derived-mode-p 'message-mode) (looking-back (concat notmuch-address-completion-headers-regexp ".*") diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el index e22e0d16..504b33be 100644 --- a/emacs/notmuch-draft.el +++ b/emacs/notmuch-draft.el @@ -152,7 +152,7 @@ Used when a new version is saved, or the message is sent." "Checks if we should save a message that should be encrypted. `notmuch-draft-save-plaintext' controls the behaviour." - (case notmuch-draft-save-plaintext + (cl-case notmuch-draft-save-plaintext ((ask) (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning) This message contains mml tags that suggest it is intended to be encrypted. diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index ab6ee798..bdf584e6 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -21,7 +21,8 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) + (require 'widget) (require 'wid-edit) ; For `widget-forward'. @@ -47,17 +48,19 @@ lists (NAME QUERY COUNT-QUERY)." ((keywordp (car saved-search)) (plist-get saved-search field)) ;; It is not a plist so it is an old-style entry. - ((consp (cdr saved-search)) ;; It is a list (NAME QUERY COUNT-QUERY) -(case field - (:name (first saved-search)) - (:query (second saved-search)) - (:count-query (third saved-search)) - (t nil))) - (t ;; It is a cons-cell (NAME . QUERY) -(case field - (:name (car saved-search)) - (:query (cdr saved-search)) - (t nil) + ((consp (cdr saved-search)) +(pcase-let ((`(,name ,query ,count-query) saved-search)) + (cl-case field + (:name name) + (:query query) + (:count-query count-query) + (t nil + (t +(pcase-let ((`(,name . ,query) saved-search)) + (cl-case field + (:name name) + (:query query) + (t nil)) (defun notmuch-hello-saved-search-to-plist (saved-search) "Return a copy of SAVED-SEARCH in plist form. @@ -66,7 +69,7 @@ If saved search is a plist then just return a copy. In other cases, for backwards com
Re: [PATCH 4/4] emacs: Use `cl-lib' instead of deprecated `cl'
By inspection this looks good, though I haven't tested, so... On Wednesday, 2020-04-15 at 20:28:22 +02, Jonas Bernoulli wrote: > 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 symbols. A few replacements do not > follow that simple pattern; e.g. `first' is replaced with `car', > even though the alias `cl-first' exists, because the latter is not > idiomatic emacs-lisp. > > In a few cases we start using `pcase-let' or `pcase-lambda' instead > of renaming e.g. `first' to `car'. That way we can remind the reader > of the meaning of the various parts of the data that is being > deconstructed. > > An obsolete `lexical-let' and a `lexical-let*' are replaced with their > regular variants `let' and `let*' even though we do not at the same > time enable `lexical-binding' for that file. That is the right thing > to do because it does not actually make a difference in those cases > whether lexical bindings are used or not, and because this should be > enabled in a separate commit. > > We need to explicitly depend on the `cl-lib' package because Emacs > 24.1 and 24.2 lack that library. When using these releases we end > up using the backport from GNU Elpa. > > We need to explicitly require the `pcase' library because > `pcase-dolist' was not autoloaded until Emacs 25.1. Reviewed-by: David Edmondson > --- > emacs/notmuch-company.el | 5 +- > emacs/notmuch-draft.el | 2 +- > emacs/notmuch-hello.el | 147 ++- > emacs/notmuch-jump.el| 45 +-- > emacs/notmuch-lib.el | 18 ++--- > emacs/notmuch-maildir-fcc.el | 35 + > emacs/notmuch-mua.el | 76 +- > emacs/notmuch-parser.el | 18 ++--- > emacs/notmuch-pkg.el.tmpl| 3 +- > emacs/notmuch-show.el| 103 > emacs/notmuch-tag.el | 45 ++- > emacs/notmuch-tree.el| 20 ++--- > emacs/notmuch.el | 62 +++ > test/test-lib.el | 2 +- > 14 files changed, 292 insertions(+), 289 deletions(-) > > diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el > index 3e12e7a9..ac998f9b 100644 > --- a/emacs/notmuch-company.el > +++ b/emacs/notmuch-company.el > @@ -27,7 +27,8 @@ > > ;;; Code: > > -(eval-when-compile (require 'cl)) > +(eval-when-compile (require 'cl-lib)) > + > (require 'notmuch-lib) > > (defvar notmuch-company-last-prefix nil) > @@ -65,7 +66,7 @@ (defun notmuch-company (command &optional arg &rest _ignore) >(require 'company) >(let ((case-fold-search t) > (completion-ignore-case t)) > -(case command > +(cl-case command >(interactive (company-begin-backend 'notmuch-company)) >(prefix (and (derived-mode-p 'message-mode) > (looking-back (concat > notmuch-address-completion-headers-regexp ".*") > diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el > index e22e0d16..504b33be 100644 > --- a/emacs/notmuch-draft.el > +++ b/emacs/notmuch-draft.el > @@ -152,7 +152,7 @@ (defun notmuch-draft--query-encryption () >"Checks if we should save a message that should be encrypted. > > `notmuch-draft-save-plaintext' controls the behaviour." > - (case notmuch-draft-save-plaintext > + (cl-case notmuch-draft-save-plaintext > ((ask) >(unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to > avoid this warning) > This message contains mml tags that suggest it is intended to be encrypted. > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el > index aff8beb5..74996636 100644 > --- a/emacs/notmuch-hello.el > +++ b/emacs/notmuch-hello.el > @@ -21,7 +21,8 @@ > > ;;; Code: > > -(eval-when-compile (require 'cl)) > +(eval-when-compile (require 'cl-lib)) > + > (require 'widget) > (require 'wid-edit) ; For `widget-forward'. > > @@ -44,17 +45,19 @@ (defun notmuch-saved-search-get (saved-search field) > ((keywordp (car saved-search)) > (plist-get saved-search field)) > ;; It is not a plist so it is an old-style entry. > - ((consp (cdr saved-search)) ;; It is a list (NAME QUERY COUNT-QUERY) > -(case field > - (:name (first saved-search)) > - (:query (second saved-search)) > - (:count-query (third saved-search)) > - (t nil))) > - (t ;; It is a cons-cell (NAME . QUERY) > -(case field > - (:name (car saved-search)) > - (:query (cdr saved-search)) > - (t nil) > + ((consp (cdr saved-search)) > +(pcase-let ((`(,name ,query ,count-query) saved-search)) > + (cl-case field > + (:name name) > + (:query query) > + (:count-query count-query) > + (t nil > + (t > +(pcase-let ((`(,name . ,query) saved-search)) > + (cl-c
Re: [PATCH] emacs: introduce notmuch-search-by-tag
Keegan Carruthers-Smith writes: > This is like notmuch-search-filter-by-tag, but creates a new search > rather than filtering the current search. We add this to > notmuch-common-keymap since this can be used by many contexts. We bind > to the key "t", which is the same key used by > notmuch-search-filter-by-tag in notmuch-search-mode-map. This is done > intentionally since the keybinding for notmuch-search-mode-map can be > seen as a specialization of creating a new search. pushed d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] gzerror() after gzclose_r() is a use after free
Olivier Taïbi writes: > As suggested by David Bremner in > https://notmuchmail.org/pipermail/notmuch/2020/029288.html > here is a separate patch for bug #2: calling gzerror() (indirectly via > gzerror_str()) after gzclose_r is a use after free, according to zlib's > manual. pushed, with revised commit message d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls
Keegan Carruthers-Smith writes: > This is the non-deprecated way to use completing-read. Additionally > the old use was broken when using ivy for completing-read. For user's > using completing-read-default they won't see the default URL now, but > if they hit enter it will be visited. Alternatively they can select > it with M-n. pushed, d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] after gzgets(), Z_STREAM_END means EOF, not error
Olivier Taïbi writes: > As suggested by David Bremner in > https://notmuchmail.org/pipermail/notmuch/2020/029288.html > here is the patch for bug #3: after gzgets() returns NULL (meaning EOF > or error), the error code Z_STREAM_END means EOF and not error. pushed, with revised commit message. d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 2/4] emacs: Declare function notmuch-show-get-message-id
Jonas Bernoulli writes: pushed the first 3. d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch