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

2020-12-14 Thread David Bremner
Jonas Bernoulli  writes:

> David Bremner  writes:
>
> You seem to have accidentally dropped another commits, which is why
> this commit did not apply.  I have another series with a "few" commits
> waiting for submissions and will just lead that with these two commits
> from the last series.

Sounds good. Sorry for the extra work.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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:20201108231150.5419-1-jo...@bernoul.li
  Improves notmuch-address.el a bit.

- id:20201108174929.1227-1-jo...@bernoul.li
  Fixes a regression that also came up in id:877dqtkqs9@uwaterloo.ca
  I had the same issue as mentioned there.  Since applying this patch, I
  haven't seen it.

> I've applied the first 22, but this last one is not applying to
> (current) master for me.

You seem to have accidentally dropped another commits, which is why
this commit did not apply.  I have another series with a "few" commits
waiting for submissions and will just lead that with these two commits
from the last series.

 Jonas
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2020-12-06 Thread David Bremner
Jonas Bernoulli  writes:

> ---
>  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 changed, 91 insertions(+), 106 deletions(-)
>

Apologies for the delay, I missed the second review. I've applied the
first 22, but this last one is not applying to (current) master for me.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[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 changed, 91 insertions(+), 106 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 71985ed7..a00ca8d7 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -21,6 +21,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-lib))
+
 (require 'message)
 (require 'notmuch-parser)
 (require 'notmuch-lib)
@@ -154,15 +156,12 @@ (defcustom notmuch-address-use-company t
   :group 'notmuch-address)
 
 (defun notmuch-address-setup ()
-  (let* ((setup-company (and notmuch-address-use-company
-(require 'company nil t)))
-(pair (cons notmuch-address-completion-headers-regexp
-#'notmuch-address-expand-name)))
-(when setup-company
-  (notmuch-company-setup))
-(unless (member pair message-completion-alist)
-  (setq message-completion-alist
-   (push pair message-completion-alist)
+  (when (and notmuch-address-use-company
+(require 'company nil t))
+(notmuch-company-setup))
+  (cl-pushnew (cons notmuch-address-completion-headers-regexp
+   #'notmuch-address-expand-name)
+ message-completion-alist :test #'equal))
 
 (defun notmuch-address-toggle-internal-completion ()
   "Toggle use of internal completion for current buffer.
@@ -251,11 +250,8 @@ (defun notmuch-address-expand-name ()
(t nil)))
 
 (defun notmuch-address-harvest-addr (result)
-  (let ((name-addr (plist-get result :name-addr)))
-(puthash name-addr t notmuch-address-completions)))
-
-(defun notmuch-address-harvest-handle-result (obj)
-  (notmuch-address-harvest-addr obj))
+  (puthash (plist-get result :name-addr)
+  t notmuch-address-completions))
 
 (defun notmuch-address-harvest-filter (proc string)
   (when (buffer-live-p (process-buffer proc))
@@ -264,7 +260,7 @@ (defun notmuch-address-harvest-filter (proc string)
(goto-char (point-max))
(insert string))
   (notmuch-sexp-parse-partial-list
-   'notmuch-address-harvest-handle-result (process-buffer proc)
+   'notmuch-address-harvest-addr (process-buffer proc)
 
 (defvar notmuch-address-harvest-procs '(nil . nil)
   "The currently running harvests.
@@ -375,7 +371,7 @@ (defun notmuch-address--load-address-hash ()
 (defun notmuch-address--save-address-hash ()
   (when notmuch-address-save-filename
 (if (or (not (file-exists-p notmuch-address-save-filename))
-   ;; The file exists, check it is a file we saved
+   ;; The file exists, check it is a file we saved.
(notmuch-address--get-address-hash))
(with-temp-file notmuch-address-save-filename
  (let ((save-plist
@@ -398,8 +394,7 @@ (defun notmuch-address-harvest-trigger ()
nil nil
(lambda (proc event)
 ;; If harvest fails, we want to try
-;; again when the trigger is next
-;; called
+;; again when the trigger is next called.
 (if (string= event "finished\n")
 (progn
   (notmuch-address--save-address-hash)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index fa31694f..80af7544 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -402,8 +402,7 @@ (defun notmuch-hello-add-saved-search (widget)
 ;; If an existing saved search with this name exists, remove it.
 (setq notmuch-saved-searches
  (cl-loop for elem in notmuch-saved-searches
-  if (not (equal name
- (notmuch-saved-search-get elem :name)))
+  unless (equal name (notmuch-saved-search-get elem :name))
   collect elem))
 ;; Add the new one.
 (customize-save-variable 'notmuch-saved-searches
@@ -446,18 +445,14 @@ (defun notmuch-hello-reflect (list ncols)
 append (notmuch-hello-reflect-generate-row ncols nrows row list
 
 (defun notmuch-hello-widget-search (widget  ignore)
-  (cond
-   ((eq (widget-get widget :notmuch-search-type) 'tree)
-(notmuch-tree (widget-get widget
- :notmuch-search-terms)))
-   ((eq (widget-get widget :notmuch-search-type) 'unthreaded)
-(notmuch-unthreaded (widget-get widget
-   :notmuch-search-terms)))
+  (cl-case (widget-get widget :notmuch-search-type)
+   (tree
+(notmuch-tree (widget-get widget :notmuch-search-terms)))
+   (unthreaded
+(notmuch-unthreaded (widget-get widget :notmuch-search-terms)))
(t
-(notmuch-search (widget-get widget
-   :notmuch-search-terms)
-   (widget-get widget
-   :notmuch-search-oldest-first)
+(notmuch-search