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

2020-07-30 Thread Tomi Ollila
On Sun, Jul 26 2020, Jonas Bernoulli wrote:

> Hello,
>
> Please forgive me for this wall of unsolicited cleanup; I blame it
> on a mild form of ocd.  I made most of these changes a few months
> ago when I was splitting the libraries into `outline-minor-mode'
> compatible sections.  To do so I had to have some understanding of the
> code I was splitting up and that closer look led to me discovering
> issues and once I had ran into a bunch of issue of the same kind it
> made sense to systematically look for that kind across all elisp
> files.
>
> Well, one thing led to another and here we are with 23 cleanup
> commits, some of which are fairly big on their own.  I just looked
> at very change again; everything looks to be in order.
>
> I am intentionally leaving out that one commit that actually does
> what I originally set out to do.  In some cases I will need to gain
> a deeper understanding before I can finish splitting libraries into
> sections.

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

One thing that come into my minw while browsing through patches -- does
changing if's to when's accumulate any bloat -- or does byte compiler
optimize that "extra" 'progn out in  (list 'if cond (cons 'progn body))).


>
>  Cheers,
>  Jonas

Tomi


>
> Jonas Bernoulli (23):
>   emacs: Shorten long lines
>   emacs: Remove excess empty lines
>   emacs: Fix indentation
>   emacs: Closing parenthesis go on the same line
>   emacs: Only set one variable per setq form
>   emacs: Use cl-incf where appropriate
>   emacs: Use 'and' instead of 'when' when the return value matters
>   emacs: Use 'unless' instead of 'when' and 'not'
>   emacs: Use 'when' instead of 'if' when there is no ELSE part
>   emacs: Use one or three lines for 'if' forms
>   emacs: Extend face to window edge again
>   emacs: Fix some function declarations
>   emacs: No longer define notmuch-hello-mode-map as a function
>   emacs: notmuch-poll: Let the user know we are polling
>   emacs: Use makefile-gmake-mode in Makefile*s
>   emacs: Improve doc-strings
>   emacs: Autoload notmuch-jump-search only once
>   emacs: Autoload notmuch-jump using an autoload cookie
>   emacs: Various cosmetic changes
>   emacs: Increase consistency of library headers
>   Fix typos
>   .dir-locals.el: Set variables for correct "shell" mode
>   test: Fix indentation
>
>  .dir-locals.el |   2 +-
>  Makefile.global|   1 +
>  Makefile.local |   2 +-
>  NEWS   |   2 +-
>  bindings/Makefile.local|   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 +-
>  bindings/python-cffi/notmuch2/_tags.py |   8 +-
>  bindings/python-cffi/tests/conftest.py |   2 +-
>  bindings/python/notmuch/database.py|  12 +-
>  bindings/python/notmuch/query.py   |   2 +-
>  compat/Makefile.local  |   2 +-
>  completion/Makefile.local  |   2 +-
>  doc/Makefile.local |   2 +-
>  emacs/Makefile.local   |   2 +-
>  emacs/coolj.el |  24 +-
>  emacs/make-deps.el |   5 +-
>  emacs/notmuch-address.el   | 186 -
>  emacs/notmuch-company.el   |  53 ++-
>  emacs/notmuch-compat.el|  99 +++--
>  emacs/notmuch-crypto.el|  49 ++-
>  emacs/notmuch-draft.el |  24 +-
>  emacs/notmuch-hello.el | 102 +++--
>  emacs/notmuch-jump.el  |  61 ++-
>  emacs/notmuch-lib.el   | 204 +-
>  emacs/notmuch-maildir-fcc.el   | 122 +++---
>  emacs/notmuch-message.el   |   3 +-
>  emacs/notmuch-mua.el   | 181 -
>  emacs/notmuch-parser.el|  16 +-
>  emacs/notmuch-print.el |   2 +-
>  emacs/notmuch-query.el |  29 +-
>  emacs/notmuch-show.el  | 439 ++---
>  emacs/notmuch-tag.el   |  38 +-
>  emacs/notmuch-tree.el  | 189 -
>  emacs/notmuch-wash.el  | 109 +++--
>  emacs/notmuch.el   | 276 ++---
>  emacs/rstdoc.el|  18 +-
>  lib/Makefile.local |   2 +-
>  lib/notmuch.h  |   4 +-
>  parse-time-string/Makefile.local   |   2 +
>  performanc

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

2020-07-30 Thread Tomi Ollila
On Sun, Jul 26 2020, Jonas Bernoulli wrote:

> ---
>  emacs/coolj.el |  16 ++---
>  emacs/notmuch-address.el   |  18 +++---
>  emacs/notmuch-compat.el|  86 -
>  emacs/notmuch-draft.el |  18 +++---
>  emacs/notmuch-hello.el |  24 +++
>  emacs/notmuch-lib.el   |  56 -
>  emacs/notmuch-maildir-fcc.el   |  58 -
>  emacs/notmuch-mua.el   |  34 +-
>  emacs/notmuch-query.el |   6 +-
>  emacs/notmuch-show.el  | 111 +
>  emacs/notmuch-tag.el   |   4 +-
>  emacs/notmuch-tree.el  | 102 +++---
>  emacs/notmuch-wash.el  |   2 +-
>  emacs/notmuch.el   |  76 +++---
>  test/emacs-address-cleaning.el |   2 +-
>  15 files changed, 307 insertions(+), 306 deletions(-)
>
> diff --git a/emacs/coolj.el b/emacs/coolj.el
> index 5d311170..961db606 100644
> --- a/emacs/coolj.el
> +++ b/emacs/coolj.el
> @@ -108,11 +108,11 @@ (defun coolj-set-breakpoint (prefix)
>  line."
>(move-to-column fill-column)
>(if (and (re-search-forward "[^ ]" (line-end-position) 1)
> -   (> (current-column) fill-column))
> +(> (current-column) fill-column))
>;; This line is too long.  Can we break it?
>(or (coolj-find-break-backward prefix)
> -  (progn (move-to-column fill-column)
> - (coolj-find-break-forward)
> +   (progn (move-to-column fill-column)
> +  (coolj-find-break-forward)
>  
>  (defun coolj-find-break-backward (prefix)
>"Move point backward to the first available breakpoint and return t.
> @@ -135,12 +135,12 @@ (defun coolj-find-break-forward ()
>  If no break point is found, return nil."
>(and (search-forward " " (line-end-position) 1)
> (progn (skip-chars-forward " " (line-end-position))
> -  (null (eolp)))
> +   (null (eolp)))
> (if (and fill-nobreak-predicate
> -(run-hook-with-args-until-success
> - 'fill-nobreak-predicate))
> -   (coolj-find-break-forward)
> - t)))
> + (run-hook-with-args-until-success
> +  'fill-nobreak-predicate))
> +(coolj-find-break-forward)
> +  t)))
>  
>  (provide 'coolj)
>  
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index ca4da3f3..09dda247 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -153,14 +153,14 @@ (defcustom notmuch-address-use-company t
>  
>  (defun notmuch-address-setup ()
>(let* ((setup-company (and notmuch-address-use-company
> -(require 'company nil t)))
> +  (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)
> +  #'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)
>  
>  (defun notmuch-address-toggle-internal-completion ()
>"Toggle use of internal completion for current buffer.
> @@ -323,7 +323,7 @@ (defun notmuch-address-harvest (&optional addr-prefix 
> synchronous callback)
>,query)))
>  (if synchronous
>   (mapc #'notmuch-address-harvest-addr
> -(apply 'notmuch-call-notmuch-sexp args))
> +   (apply 'notmuch-call-notmuch-sexp args))
>;; Asynchronous
>(let* ((current-proc (if addr-prefix
>  (car notmuch-address-harvest-procs)
> @@ -390,7 +390,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
> diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
> index 2cedd39d..388ef70f 100644
> --- a/emacs/notmuch-compat.el
> +++ b/emacs/notmuch-compat.el
> @@ -35,7 +35,7 @@ (if (fboundp 'setq-local)
>  (if (fboundp 'read-char-choice)
>  (defalias 'notmuch-read-char-choice 'read-char-choice)
>(defun notmuch-read-char-choice (prompt chars &optional 
> inhibit-keyboard-quit)
> -  "Read and return one of CHARS, prompting for PROMPT.
> +"Read and return one of CHARS, prompting for PROMPT.
>  Any input that is not