unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 00/23] A create number of cosmetic changes
@ 2020-07-26 16:57 Jonas Bernoulli
  2020-07-26 16:57 ` [PATCH 01/23] emacs: Shorten long lines Jonas Bernoulli
                   ` (25 more replies)
  0 siblings, 26 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:57 UTC (permalink / raw)
  To: notmuch

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.

     Cheers,
     Jonas

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 +
 performance-test/Makefile.local            |   2 +-
 tag-util.c                                 |   2 +-
 tag-util.h                                 |   2 +-
 test/Makefile.local                        |   2 +-
 test/T610-message-property.sh              |   2 +-
 test/T710-message-id.sh                    |   2 +-
 test/emacs-address-cleaning.el             |   2 +-
 test/random-corpus.c                       |   2 +-
 test/test-lib.el                           |  47 ++-
 test/test-lib.sh                           |  36 +-
 util/Makefile.local                        |   2 +-
 53 files changed, 1189 insertions(+), 1210 deletions(-)

-- 
2.26.0

^ permalink raw reply	[flat|nested] 108+ messages in thread

* [PATCH 01/23] emacs: Shorten long lines
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
@ 2020-07-26 16:57 ` Jonas Bernoulli
  2020-07-27 17:52   ` Tomi Ollila
  2020-07-26 16:57 ` [PATCH 02/23] emacs: Remove excess empty lines Jonas Bernoulli
                   ` (24 subsequent siblings)
  25 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:57 UTC (permalink / raw)
  To: notmuch

---
 emacs/coolj.el               |   2 +-
 emacs/notmuch-address.el     |  38 +++++++------
 emacs/notmuch-company.el     |  17 ++++--
 emacs/notmuch-crypto.el      |  16 +++---
 emacs/notmuch-draft.el       |  12 ++--
 emacs/notmuch-hello.el       |  43 ++++++++++-----
 emacs/notmuch-jump.el        |   7 ++-
 emacs/notmuch-lib.el         |  62 +++++++++++++--------
 emacs/notmuch-maildir-fcc.el |  14 ++---
 emacs/notmuch-message.el     |   3 +-
 emacs/notmuch-mua.el         |  78 +++++++++++++++-----------
 emacs/notmuch-show.el        | 103 +++++++++++++++++++++++------------
 emacs/notmuch-tag.el         |  14 +++--
 emacs/notmuch-tree.el        |  55 +++++++++++++------
 emacs/notmuch-wash.el        |  19 +++++--
 emacs/notmuch.el             |  27 ++++++---
 emacs/rstdoc.el              |   3 +-
 17 files changed, 326 insertions(+), 187 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 350d537f..5d311170 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -1,6 +1,6 @@
 ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
 
-;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
 ;; Authors:    Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;;             Alex Schroeder <alex@gnu.org>
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 0d56fba7..2a9c411a 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
       ;; First, run quick synchronous harvest based on what the user
-      ;; entered so far
+      ;; entered so far.
       (notmuch-address-harvest original t))
     (prog1 (notmuch-address-matching original)
-      ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+      ;; Then start the (potentially long-running) full asynchronous
+      ;; harvest if necessary.
       (notmuch-address-harvest-trigger)))
    (t
     (process-lines notmuch-address-command original))))
@@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
 	    (push chosen notmuch-address-history)
 	    (delete-region beg end)
 	    (insert chosen)
-	    (run-hook-with-args 'notmuch-address-post-completion-functions chosen))
+	    (run-hook-with-args 'notmuch-address-post-completion-functions
+				chosen))
 	(message "No matches.")
 	(ding))))
    (t nil)))
@@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
 	      ;; 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 (list :version notmuch-address--save-hash-version
-				  :completion-settings notmuch-address-internal-completion
-				  :last-harvest notmuch-address-last-harvest
-				  :completions notmuch-address-completions)))
+	  (let ((save-plist
+		 (list :version notmuch-address--save-hash-version
+		       :completion-settings notmuch-address-internal-completion
+		       :last-harvest notmuch-address-last-harvest
+		       :completions notmuch-address-completions)))
 	    (print "notmuch-address-hash" (current-buffer))
 	    (print save-plist (current-buffer))))
       (message "\
@@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
   (let ((now (float-time)))
     (when (> (- now notmuch-address-last-harvest) 86400)
       (setq notmuch-address-last-harvest now)
-      (notmuch-address-harvest nil nil
-			       (lambda (proc event)
-				 ;; If harvest fails, we want to try
-				 ;; again when the trigger is next
-				 ;; called
-				 (if (string= event "finished\n")
-				     (progn
-				       (notmuch-address--save-address-hash)
-				       (setq notmuch-address-full-harvest-finished t))
-				   (setq notmuch-address-last-harvest 0)))))))
+      (notmuch-address-harvest
+       nil nil
+       (lambda (proc event)
+	 ;; If harvest fails, we want to try
+	 ;; again when the trigger is next
+	 ;; called
+	 (if (string= event "finished\n")
+	     (progn
+	       (notmuch-address--save-address-hash)
+	       (setq notmuch-address-full-harvest-finished t))
+	   (setq notmuch-address-last-harvest 0)))))))
 
 ;;
 
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index ac998f9b..c1f3594e 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -69,9 +69,11 @@ (defun notmuch-company (command &optional arg &rest _ignore)
     (cl-case command
       (interactive (company-begin-backend 'notmuch-company))
       (prefix (and (derived-mode-p 'message-mode)
-		   (looking-back (concat notmuch-address-completion-headers-regexp ".*")
-				 (line-beginning-position))
-		   (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
+		   (looking-back
+		    (concat notmuch-address-completion-headers-regexp ".*")
+		    (line-beginning-position))
+		   (setq notmuch-company-last-prefix
+			 (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
       (candidates (cond
 		   ((notmuch-address--harvest-ready)
 		    ;; Update harvested addressed from time to time
@@ -80,17 +82,20 @@ (defun notmuch-company (command &optional arg &rest _ignore)
 		   (t
 		    (cons :async
 			  (lambda (callback)
-			    ;; First run quick asynchronous harvest based on what the user entered so far
+			    ;; First run quick asynchronous harvest
+			    ;; based on what the user entered so far
 			    (notmuch-address-harvest
 			     arg nil
 			     (lambda (_proc _event)
 			       (funcall callback (notmuch-address-matching arg))
-			       ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+			       ;; Then start the (potentially long-running)
+			       ;; full asynchronous harvest if necessary
 			       (notmuch-address-harvest-trigger))))))))
       (match (if (string-match notmuch-company-last-prefix arg)
 		 (match-end 0)
 	       0))
-      (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg))
+      (post-completion
+       (run-hook-with-args 'notmuch-address-post-completion-functions arg))
       (no-cache t))))
 
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index c201d0d7..2327ff1f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -161,7 +161,8 @@ (defun notmuch-crypto-sigstatus-good-callback (button)
 	(goto-char (point-max))
 	(insert (format "-- Key %s in message %s:\n"
 			fingerprint id))
-	(call-process notmuch-crypto-gpg-program nil t t "--batch" "--no-tty" "--list-keys" fingerprint))
+	(call-process notmuch-crypto-gpg-program nil t t
+		      "--batch" "--no-tty" "--list-keys" fingerprint))
       (recenter -1))))
 
 (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
@@ -220,12 +221,13 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	  (with-current-buffer buffer
 	    (goto-char (point-max))
 	    (insert (format "--- Retrieving key %s:\n" keyid)))
-	  (let ((p (make-process :name "notmuch GPG key retrieval"
-				 :connection-type 'pipe
-				 :buffer buffer
-				 :stderr buffer
-				 :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
-				 :sentinel #'notmuch-crypto--async-key-sentinel)))
+	  (let ((p (make-process
+		    :name "notmuch GPG key retrieval"
+		    :connection-type 'pipe
+		    :buffer buffer
+		    :stderr buffer
+		    :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
+		    :sentinel #'notmuch-crypto--async-key-sentinel)))
 	    (process-put p :gpg-key-id keyid)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index 27abc7d9..c3cb619f 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -154,12 +154,14 @@ (defun notmuch-draft--query-encryption ()
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
 	((ask)
-	 (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+	 (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.
 Really save and index an unencrypted copy? ")
 	   (error "Save aborted")))
 	((nil)
-	 (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')"))
+	 (error "Refusing to save draft with encryption tags (see `%s')"
+		'notmuch-draft-save-plaintext))
 	((t)
 	 (ignore))))
 
@@ -192,14 +194,16 @@ (defun notmuch-draft-save ()
        (message-remove-header "Message-ID")
        (message-add-header (concat "Message-ID: <" id ">")))
       (t
-       (message "You have customized emacs so Message-ID is not a deletable header, so not changing it")
+       (message "You have customized emacs so Message-ID is not a %s"
+		"deletable header, so not changing it")
        (setq id nil)))
      (cond
       ((member 'Date message-deletable-headers)
        (message-remove-header "Date")
        (message-add-header (concat "Date: " (message-make-date))))
       (t
-       (message "You have customized emacs so Date is not a deletable header, so not changing it")))
+       (message "You have customized emacs so Date is not a deletable %s"
+		"header, so not changing it")))
      (message-add-header "X-Notmuch-Emacs-Draft: True")
      (notmuch-draft-quote-some-mml)
      (notmuch-maildir-setup-message-for-saving)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 0ff5aaff..11c625ea 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -29,7 +29,8 @@ (require 'wid-edit) ; For `widget-forward'.
 (require 'notmuch-lib)
 (require 'notmuch-mua)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 (declare-function notmuch-tree "notmuch-tree"
 		  (&optional query query-context target buffer-name open-target unthreaded))
@@ -91,18 +92,28 @@ (define-widget 'notmuch-saved-search-plist 'list
   :tag "Saved Search"
   :args '((list :inline t
 		:format "%v"
-		(group :format "%v" :inline t (const :format "   Name: " :name) (string :format "%v"))
-		(group :format "%v" :inline t (const :format "  Query: " :query) (string :format "%v")))
+		(group :format "%v" :inline t
+		       (const :format "   Name: " :name)
+		       (string :format "%v"))
+		(group :format "%v" :inline t
+		       (const :format "  Query: " :query)
+		       (string :format "%v")))
 	  (checklist :inline t
 		     :format "%v"
-		     (group :format "%v" :inline t (const :format "Shortcut key: " :key) (key-sequence :format "%v"))
-		     (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))
-		     (group :format "%v" :inline t (const :format "" :sort-order)
+		     (group :format "%v" :inline t
+			    (const :format "Shortcut key: " :key)
+			    (key-sequence :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "Count-Query: " :count-query)
+			    (string :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "" :sort-order)
 			    (choice :tag " Sort Order"
 				    (const :tag "Default" nil)
 				    (const :tag "Oldest-first" oldest-first)
 				    (const :tag "Newest-first" newest-first)))
-		     (group :format "%v" :inline t (const :format "" :search-type)
+		     (group :format "%v" :inline t
+			    (const :format "" :search-type)
 			    (choice :tag " Search Type"
 				    (const :tag "Search mode" nil)
 				    (const :tag "Tree mode" tree)
@@ -474,7 +485,8 @@ (defun notmuch-hello-tags-per-line (widest)
 
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
-		  (proposed-width (max (* available-width notmuch-column-control) widest)))
+		  (proposed-width (max (* available-width notmuch-column-control)
+				       widest)))
 	     (floor available-width proposed-width)))
 
 	  (t
@@ -536,8 +548,9 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
-      (notmuch-logged-error "notmuch count --batch failed"
-			    "Please check that the notmuch CLI is new enough to support `count
+      (notmuch-logged-error
+       "notmuch count --batch failed"
+       "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
 
@@ -553,7 +566,8 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 				search-query (plist-get options :filter)))
 	       (message-count (prog1 (read (current-buffer))
 				(forward-line 1))))
-	  (when (and filtered-query (or (plist-get options :show-empty-searches) (> message-count 0)))
+	  (when (and filtered-query (or (plist-get options :show-empty-searches)
+					(> message-count 0)))
 	    (setq elem-plist (plist-put elem-plist :query filtered-query))
 	    (plist-put elem-plist :count message-count))))
       query-list))))
@@ -740,7 +754,9 @@ (defun notmuch-hello-insert-header ()
       ;; dark background.
       (setq image (cons 'image
 			(append (cdr image)
-				(list :background (face-background 'notmuch-hello-logo-background)))))
+				(list :background
+				      (face-background
+				       'notmuch-hello-logo-background)))))
       (insert-image image))
     (widget-insert "  "))
 
@@ -760,7 +776,8 @@ (defun notmuch-hello-insert-header ()
 			     (notmuch-hello-update))
 		   :help-echo "Refresh"
 		   (notmuch-hello-nice-number
-		    (string-to-number (car (process-lines notmuch-command "count")))))
+		    (string-to-number
+		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
 
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 84fe2b9c..6d8cd97f 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -70,7 +70,8 @@ (defun notmuch-jump-search ()
 
     (if action-map
 	(notmuch-jump action-map "Search: ")
-      (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches."))))
+      (error "To use notmuch-jump, \
+please customize shortcut keys in notmuch-saved-searches."))))
 
 (defvar notmuch-jump--action nil)
 
@@ -200,7 +201,9 @@ (defun notmuch-jump--make-keymap (action-map prompt)
 	      (define-key map keystr
 		`(lambda () (interactive)
 		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump action-submap new-prompt))
+			 ',(apply-partially #'notmuch-jump
+					    action-submap
+					    new-prompt))
 		   (exit-minibuffer)))))))
     map))
 
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0bb08eb2..9339f9d0 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -316,8 +316,10 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		tail)))
       ;; Documentation for command
       (push (cons key-string
-		  (or (and (symbolp binding) (get binding 'notmuch-doc))
-		      (and (functionp binding) (notmuch-documentation-first-line binding))))
+		  (or (and (symbolp binding)
+			   (get binding 'notmuch-doc))
+		      (and (functionp binding)
+			   (notmuch-documentation-first-line binding))))
 	    tail)))
     tail)
 
@@ -327,13 +329,13 @@ (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; binding whose "key" is 'remap, and whose "binding" is itself a
   ;; keymap that maps not from keys to commands, but from old (remapped)
   ;; functions to the commands to use in their stead.
-  (map-keymap
-   (lambda (command binding)
-     (mapc
-      (lambda (actual-key)
-	(setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))
-      (where-is-internal command base-keymap)))
-   remap-keymap)
+  (map-keymap (lambda (command binding)
+		(mapc (lambda (actual-key)
+			(setq tail
+			      (notmuch-describe-key actual-key binding
+						    prefix ua-keys tail)))
+		      (where-is-internal command base-keymap)))
+	      remap-keymap)
   tail)
 
 (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
@@ -356,9 +358,13 @@ (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail
 		      (notmuch-describe-remaps
 		       binding ua-keys base-keymap prefix tail)
 		    (notmuch-describe-keymap
-		     binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))
+		     binding ua-keys base-keymap
+		     (notmuch-prefix-key-description key)
+		     tail))))
 	   (binding
-	    (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
+	    (setq tail
+		  (notmuch-describe-key (vector key)
+					binding prefix ua-keys tail)))))
    keymap)
   tail)
 
@@ -368,11 +374,15 @@ (defun notmuch-substitute-command-keys (doc)
     (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)
       (let ((desc
 	     (save-match-data
-	       (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
+	       (let* ((keymap-name (substring doc
+					      (match-beginning 1)
+					      (match-end 1)))
 		      (keymap (symbol-value (intern keymap-name)))
 		      (ua-keys (where-is-internal 'universal-argument keymap t))
 		      (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
-		      (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))
+		      (desc-list (mapcar (lambda (arg)
+					   (concat (car arg) "\t" (cdr arg)))
+					 desc-alist)))
 		 (mapconcat #'identity desc-list "\n")))))
 	(setq doc (replace-match desc 1 1 doc)))
       (setq beg (match-end 0)))
@@ -391,7 +401,8 @@ (defun notmuch-help ()
 of its command symbol."
   (interactive)
   (let* ((mode major-mode)
-	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
+	 (doc (substitute-command-keys
+	       (notmuch-substitute-command-keys (documentation mode t)))))
     (with-current-buffer (generate-new-buffer "*notmuch-help*")
       (insert doc)
       (goto-char (point-min))
@@ -411,8 +422,10 @@ (defun notmuch-subkeymap-help ()
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-	   (desc-alist (notmuch-describe-keymap subkeymap ua-keys subkeymap prefix-string))
-	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))
+	   (desc-alist (notmuch-describe-keymap
+			subkeymap ua-keys subkeymap prefix-string))
+	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg)))
+			      desc-alist))
 	   (desc (mapconcat #'identity desc-list "\n")))
       (with-help-window (help-buffer)
 	(with-current-buffer standard-output
@@ -547,7 +560,8 @@ (defvar notmuch-multipart/alternative-discouraged
   '(
     ;; Avoid HTML parts.
     "text/html"
-    ;; multipart/related usually contain a text/html part and some associated graphics.
+    ;; multipart/related usually contain a text/html part and some
+    ;; associated graphics.
     "multipart/related"
     ))
 
@@ -602,8 +616,9 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
-			      (let ((coding-system (mm-charset-to-coding-system
-						    (plist-get part :content-charset))))
+			      (let ((coding-system
+				     (mm-charset-to-coding-system
+				      (plist-get part :content-charset))))
 				;; Sadly,
 				;; `mm-charset-to-coding-system' seems
 				;; to return things that are not
@@ -615,7 +630,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				  ;; charset is US-ASCII. RFC6657
 				  ;; complicates this somewhat.
 				  'us-ascii)))))
-		       (apply #'call-process notmuch-command nil '(t nil) nil args)
+		       (apply #'call-process
+			      notmuch-command nil '(t nil) nil args)
 		       (buffer-string))))))
     (when (and cache data)
       (plist-put part plist-elem data))
@@ -670,7 +686,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       (let* ((have-content (plist-member part :content))
 	     (charset (if have-content 'gnus-decoded
 			(plist-get part :content-charset)))
-	     (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))
+	     (handle (mm-make-handle (current-buffer)
+				     `(,content-type (charset . ,charset)))))
 	;; If the user wants the part inlined, insert the content and
 	;; test whether we are able to inline it (which includes both
 	;; capability and suitability tests).
@@ -786,7 +803,8 @@ (defun notmuch-check-async-exit-status (proc msg &optional command err)
 	   ((exit) (process-exit-status proc))
 	   ((signal) msg))))
     (when exit-status
-      (notmuch-check-exit-status exit-status (or command (process-command proc))
+      (notmuch-check-exit-status exit-status
+				 (or command (process-command proc))
 				 nil err))))
 
 (defun notmuch-check-exit-status (exit-status command &optional output err)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index e95de63b..4b10a731 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -135,8 +135,9 @@ (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; really want this header inserted.
 
   (when (or (not (= (elt subdir 0) ?/))
-	    (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
-			      subdir)))
+	    (y-or-n-p
+	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
+Insert header anyway? " subdir)))
     (message-add-header (concat "Fcc: " subdir))))
 
 (defun notmuch-maildir-add-file-style-fcc-header (subdir)
@@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
       ;; typo, or just the user want a new folder, let the user decide
       ;; how to deal with it.
       (error
-       (let ((response (notmuch-read-char-choice
-			"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
-			'(?r ?c ?i ?e))))
+       (let ((response (notmuch-read-char-choice "Insert failed: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
 	   (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
@@ -333,8 +333,8 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
       (notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
     ;; The fcc-header is not a valid maildir see if the user wants to
     ;; fix it in some way.
-    (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or  (e)dit the header? "
-			   fcc-header))
+    (let* ((prompt (format "Fcc %s is not a maildir: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
 	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 0164472f..c2242070 100644
--- a/emacs/notmuch-message.el
+++ b/emacs/notmuch-message.el
@@ -60,7 +60,8 @@ (defconst notmuch-message-queued-tag-changes nil
 be applied to the matching messages.")
 
 (defun notmuch-message-apply-queued-tag-changes ()
-  ;; Apply the tag changes queued in the buffer-local variable notmuch-message-queued-tag-changes.
+  ;; Apply the tag changes queued in the buffer-local variable
+  ;; notmuch-message-queued-tag-changes.
   (dolist (query-and-tags notmuch-message-queued-tag-changes)
     (notmuch-tag (car query-and-tags)
 		 (cdr query-and-tags))))
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 1efc88ea..74dfb384 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -205,10 +205,12 @@ (defun notmuch-mua-add-more-hidden-headers ()
 (defun notmuch-mua-reply-crypto (parts)
   "Add mml sign-encrypt flag if any part of original message is encrypted."
   (cl-loop for part in parts
-	   if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")
-	     do (mml-secure-message-sign-encrypt)
-	   else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
-	     do (notmuch-mua-reply-crypto (plist-get part :content))))
+	   if (notmuch-match-content-type (plist-get part :content-type)
+					  "multipart/encrypted")
+	   do (mml-secure-message-sign-encrypt)
+	   else if (notmuch-match-content-type (plist-get part :content-type)
+					       "multipart/*")
+	   do (notmuch-mua-reply-crypto (plist-get part :content))))
 
 ;; There is a bug in emacs 23's message.el that results in a newline
 ;; not being inserted after the References header, so the next header
@@ -250,8 +252,9 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
 
-	;; We modify message-header-format-alist to get around a bug in message.el.
-	;; See the comment above on notmuch-mua-insert-references.
+	;; We modify message-header-format-alist to get around
+	;; a bug in message.el.  See the comment above on
+	;; notmuch-mua-insert-references.
 	(let ((message-header-format-alist
 	       (cl-loop for pair in message-header-format-alist
 			if (eq (car pair) 'References)
@@ -266,7 +269,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the reply
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
@@ -293,27 +297,29 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
 
-	(insert (with-temp-buffer
-		  (let
-		      ;; Don't attempt to clean up messages, excerpt
-		      ;; citations, etc. in the original message before
-		      ;; quoting.
-		      ((notmuch-show-insert-text/plain-hook nil)
-		       ;; Don't omit long parts.
-		       (notmuch-show-max-text-part-size 0)
-		       ;; Insert headers for parts as appropriate for replying.
-		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
-		       ;; Ensure that any encrypted parts are
-		       ;; decrypted during the generation of the reply
-		       ;; text.
-		       (notmuch-show-process-crypto process-crypto)
-		       ;; Don't indent multipart sub-parts.
-		       (notmuch-show-indent-multipart nil))
-		    ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
-		    (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
-			      ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
-		      (notmuch-show-insert-body original (plist-get original :body) 0)
-		      (buffer-substring-no-properties (point-min) (point-max))))))
+	(insert
+	 (with-temp-buffer
+	   (let
+	       ;; Don't attempt to clean up messages, excerpt
+	       ;; citations, etc. in the original message before
+	       ;; quoting.
+	       ((notmuch-show-insert-text/plain-hook nil)
+		;; Don't omit long parts.
+		(notmuch-show-max-text-part-size 0)
+		;; Insert headers for parts as appropriate for replying.
+		(notmuch-show-insert-header-p-function
+		 notmuch-mua-reply-insert-header-p-function)
+		;; Ensure that any encrypted parts are
+		;; decrypted during the generation of the reply
+		;; text.
+		(notmuch-show-process-crypto process-crypto)
+		;; Don't indent multipart sub-parts.
+		(notmuch-show-indent-multipart nil))
+	     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
+	     (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
+		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
+	       (notmuch-show-insert-body original (plist-get original :body) 0)
+	       (buffer-substring-no-properties (point-min) (point-max))))))
 
 	(set-mark (point))
 	(goto-char start)
@@ -383,10 +389,13 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
-		       (notmuch-user-name) (notmuch-user-primary-email))) other-headers))
+		       (notmuch-user-name)
+		       (notmuch-user-primary-email)))
+	  other-headers))
 
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
-			     (or switch-function (notmuch-mua-get-switch-function)))
+			     (or switch-function
+				 (notmuch-mua-get-switch-function)))
   (let ((headers
 	 (append
 	  ;; The following is copied from `message-mail'
@@ -499,7 +508,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		(with-current-buffer temp-buffer
 		  (erase-buffer)
 		  (let ((coding-system-for-read 'no-conversion))
-		    (call-process notmuch-command nil t nil "show" "--format=raw" id))
+		    (call-process notmuch-command nil t nil
+				  "show" "--format=raw" id))
 		  ;; Because we process the messages in reverse order,
 		  ;; always generate a forwarded subject, then use the
 		  ;; last (i.e. first) one.
@@ -524,7 +534,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the message
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the message.
       (when notmuch-message-forwarded-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (cl-loop for id in forward-queries
@@ -609,7 +620,8 @@ (defun notmuch-mua-send-common (arg &optional exit)
   (run-hooks 'notmuch-mua-send-hook)
   (when (and (notmuch-mua-check-no-misplaced-secure-tag)
 	     (notmuch-mua-check-secure-tag-has-newline))
-    (cl-letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
+    (cl-letf (((symbol-function 'message-do-fcc)
+	       #'notmuch-maildir-message-do-fcc))
       (if exit
 	  (message-send-and-exit arg)
 	(message-send arg)))))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c9170466..26b41603 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -51,7 +51,8 @@ (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))
 (declare-function notmuch-count-attachments "notmuch" (mm-handle))
 (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))
 (declare-function notmuch-tree "notmuch-tree"
-		  (&optional query query-context target buffer-name open-target unthreaded))
+		  (&optional query query-context target buffer-name
+			     open-target unthreaded))
 (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
 (declare-function notmuch-unthreaded
 		  (&optional query query-context target buffer-name open-target))
@@ -95,10 +96,11 @@ (defcustom notmuch-show-hook '(notmuch-show-turn-on-visual-line-mode)
   :group 'notmuch-show
   :group 'notmuch-hooks)
 
-(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
-						 notmuch-wash-tidy-citations
-						 notmuch-wash-elide-blank-lines
-						 notmuch-wash-excerpt-citations)
+(defcustom notmuch-show-insert-text/plain-hook
+  '(notmuch-wash-wrap-long-lines
+    notmuch-wash-tidy-citations
+    notmuch-wash-elide-blank-lines
+    notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
@@ -348,7 +350,9 @@ (defun notmuch-show-with-message-as-text (fn)
     (with-temp-buffer
       (insert all)
       (if indenting
-	  (indent-rigidly (point-min) (point-max) (- (* notmuch-show-indent-messages-width depth))))
+	  (indent-rigidly (point-min)
+			  (point-max)
+			  (- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -395,7 +399,9 @@ (defun notmuch-show-update-tags (tags)
     (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
 	(let ((inhibit-read-only t))
 	  (replace-match (concat "("
-				 (notmuch-tag-format-tags tags (notmuch-show-get-prop :orig-tags))
+				 (notmuch-tag-format-tags
+				  tags
+				  (notmuch-show-get-prop :orig-tags))
 				 ")"))))))
 
 (defun notmuch-clean-address (address)
@@ -475,7 +481,8 @@ (defun notmuch-show-insert-headerline (headers date tags depth)
 	    ") ("
 	    (notmuch-tag-format-tags tags tags)
 	    ")\n")
-    (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
+    (overlay-put (make-overlay start (point))
+		 'face 'notmuch-message-summary-face)))
 
 (defun notmuch-show-insert-header (header header-value)
   "Insert a single header."
@@ -502,7 +509,8 @@ (define-button-type 'notmuch-show-part-button-type
   'face 'message-mml
   :supertype 'notmuch-button-type)
 
-(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
+(defun notmuch-show-insert-part-header (nth content-type declared-type
+					    &optional name comment)
   (let ((button)
 	(base-label (concat (when name (concat name ": "))
 			    declared-type
@@ -526,8 +534,9 @@ (defun notmuch-show-toggle-part-invisibility (&optional button)
     (when button
       (let ((overlay (button-get button 'overlay))
 	    (lazy-part (button-get button :notmuch-lazy-part)))
-	;; We have a part to toggle if there is an overlay or if there is a lazy part.
-	;; If neither is present we cannot toggle the part so we just return nil.
+	;; We have a part to toggle if there is an overlay or if there
+	;; is a lazy part.  If neither is present we cannot toggle the
+	;; part so we just return nil.
 	(when (or overlay lazy-part)
 	  (let* ((show (button-get button :notmuch-part-hidden))
 		 (new-start (button-start button))
@@ -628,7 +637,8 @@ (defun notmuch-show-multipart/*-to-list (part)
 	  (plist-get part :content)))
 
 (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth button)
-  (let ((chosen-type (car (notmuch-multipart/alternative-choose msg (notmuch-show-multipart/*-to-list part))))
+  (let ((chosen-type (car (notmuch-multipart/alternative-choose
+			   msg (notmuch-show-multipart/*-to-list part))))
 	(inner-parts (plist-get part :content))
 	(start (point)))
     ;; This inserts all parts of the chosen type rather than just one,
@@ -764,7 +774,8 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 	      (unwind-protect
 		  (progn
 		    (unless (icalendar-import-buffer file t)
-		      (error "Icalendar import error. See *icalendar-errors* for more information"))
+		      (error "Icalendar import error. %s"
+			     "See *icalendar-errors* for more information"))
 		    (set-buffer (get-file-buffer file))
 		    (setq result (buffer-substring (point-min) (point-max)))
 		    (set-buffer-modified-p nil)
@@ -782,10 +793,13 @@ (if (version< emacs-version "25.3")
     ;;
     ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
     ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched (msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function enriched-decode-display-prop
-      ;; is defined before it will be shadowed by the letf below. Otherwise the version
-      ;; in enriched.el may be loaded a bit later and used instead (for the first time).
+    (defun notmuch-show-insert-part-text/enriched
+	(msg part content-type nth depth button)
+      ;; By requiring enriched below, we ensure that the function
+      ;; enriched-decode-display-prop is defined before it will be
+      ;; shadowed by the letf below. Otherwise the version in
+      ;; enriched.el may be loaded a bit later and used instead (for
+      ;; the first time).
       (require 'enriched)
       (cl-letf (((symbol-function 'enriched-decode-display-prop)
 		 (lambda (start end &optional param) (list start end))))
@@ -943,7 +957,9 @@ (defun notmuch-show-lazy-part (part-args button)
 	(narrow-to-region part-beg part-end)
 	(delete-region part-beg part-end)
 	(apply #'notmuch-show-insert-bodypart-internal part-args)
-	(indent-rigidly part-beg part-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly part-beg
+			part-end
+			(* notmuch-show-indent-messages-width depth)))
       (goto-char part-end)
       (delete-char 1)
       (notmuch-show-record-part-information (cadr part-args)
@@ -1001,12 +1017,14 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (nth (plist-get part :id))
 	 (long (and (notmuch-match-content-type mime-type "text/*")
 		    (> notmuch-show-max-text-part-size 0)
-		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
+		    (> (length (plist-get part :content))
+		       notmuch-show-max-text-part-size)))
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
 	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
+		   (notmuch-show-insert-part-header nth mime-type content-type
+						    (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1104,13 +1122,17 @@ (defun notmuch-show-insert-msg (msg depth)
 
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
-	(indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly content-start
+			content-end
+			(* notmuch-show-indent-messages-width depth)))
 
     (setq message-end (point-max-marker))
 
     ;; Save the extents of this message over the whole text of the
     ;; message.
-    (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
+    (put-text-property message-start message-end
+		       :notmuch-message-extent
+		       (cons message-start message-end))
 
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
@@ -1144,7 +1166,8 @@ (defun notmuch-show-toggle-process-crypto ()
 (defun notmuch-show-toggle-elide-non-matching ()
   "Toggle the display of non-matching messages."
   (interactive)
-  (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))
+  (setq notmuch-show-elide-non-matching-messages
+	(not notmuch-show-elide-non-matching-messages))
   (message (if notmuch-show-elide-non-matching-messages
 	       "Showing matching messages only."
 	     "Showing all messages."))
@@ -1411,8 +1434,9 @@ (defun notmuch-show-apply-state (state)
 
     ;; Open those that were open.
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (member (notmuch-show-get-message-id) open))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
 
     (dolist (win-msg-pair win-msg-alist)
@@ -1645,7 +1669,8 @@ (defun notmuch-show-headers-visible (props visible-p)
 (defun notmuch-show-set-message-properties (props)
   (save-excursion
     (notmuch-show-move-to-message-top)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point) (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-show-get-message-properties ()
   "Return the properties of the current message as a plist.
@@ -1798,8 +1823,9 @@ (defun notmuch-show-command-hook ()
 	   (setq notmuch-show--seen-has-errored 't)
 	   (setq header-line-format
 		 (concat header-line-format
-			 (propertize "  [some mark read tag changes may have failed]"
-				     'face font-lock-warning-face)))))))))
+			 (propertize
+			  "  [some mark read tag changes may have failed]"
+			  'face font-lock-warning-face)))))))))
 
 (defun notmuch-show-filter-thread (query)
   "Filter or LIMIT the current thread based on a new query string.
@@ -1821,7 +1847,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
       (goto-char (point-min))
       (while (not done)
 	(if (notmuch-show-message-visible-p)
-	    (setq message-ids (append message-ids (list (notmuch-show-get-message-id)))))
+	    (setq message-ids
+		  (append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next)))
 	)
       message-ids
@@ -1885,7 +1912,8 @@ (defun notmuch-show-advance-and-archive ()
       (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
-  "Backup through the thread (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
+  "Backup through the thread (reverse scrolling compared to \
+\\[notmuch-show-advance-and-archive]).
 
 Specifically, if the beginning of the previous email is fewer
 than `window-height' lines from the current point, move to it
@@ -2077,11 +2105,14 @@ (defun notmuch-show-pipe-message (entire-thread command)
 	(setq shell-command
 	      (concat notmuch-command " show --format=mbox --exclude=false "
 		      (shell-quote-argument
-		       (mapconcat 'identity (notmuch-show-get-message-ids-for-open-messages) " OR "))
+		       (mapconcat 'identity
+				  (notmuch-show-get-message-ids-for-open-messages)
+				  " OR "))
 		      " | " command))
       (setq shell-command
 	    (concat notmuch-command " show --format=raw "
-		    (shell-quote-argument (notmuch-show-get-message-id)) " | " command)))
+		    (shell-quote-argument (notmuch-show-get-message-id))
+		    " | " command)))
     (let ((cwd default-directory)
 	  (buf (get-buffer-create (concat "*notmuch-pipe*"))))
       (with-current-buffer buf
@@ -2182,8 +2213,9 @@ (defun notmuch-show-open-or-close-all ()
   (interactive)
   (save-excursion
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (not current-prefix-arg))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (not current-prefix-arg))
 	     until (not (notmuch-show-goto-message-next))))
   (force-window-update))
 
@@ -2515,7 +2547,8 @@ (defun notmuch-show-choose-mime-of-part (mime-type)
   (interactive
    (list (completing-read "Mime type to use (default text/plain): "
 			  (mailcap-mime-types) nil nil nil nil "text/plain")))
-  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
+  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part
+					     mime-type))
 
 (defun notmuch-show-imenu-prev-index-position-function ()
   "Move point to previous message in notmuch-show buffer.
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index c54e6ad0..34cd493a 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -44,7 +44,9 @@ (define-widget 'notmuch-tag-key-type 'list
   :args '((list :inline t
 		:format "%v"
 		(key-sequence :tag "Key")
-		(radio :tag "Tag operations" (repeat :tag "Tag list" (string :format "%v" :tag "change"))
+		(radio :tag "Tag operations"
+		       (repeat :tag "Tag list"
+			       (string :format "%v" :tag "change"))
 		       (variable :tag "Tag variable"))
 		(string :tag "Name"))))
 
@@ -316,7 +318,9 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 `notmuch-tag-formats'."
   (let* ((tag-state (cond ((not (member tag tags)) 'deleted)
 			  ((not (member tag orig-tags)) 'added)))
-	 (formatted-tag (gethash (cons tag tag-state) notmuch-tag--format-cache 'missing)))
+	 (formatted-tag (gethash (cons tag tag-state)
+				 notmuch-tag--format-cache
+				 'missing)))
     (when (eq formatted-tag 'missing)
       (let ((base (notmuch-tag--get-formats tag notmuch-tag-formats))
 	    (over (cl-case tag-state
@@ -338,9 +342,9 @@ (defun notmuch-tag-format-tags (tags orig-tags &optional face)
     (notmuch-apply-face
      (mapconcat #'identity
 		;; nil indicated that the tag was deliberately hidden
-		(delq nil (mapcar
-			   (apply-partially #'notmuch-tag-format-tag tags orig-tags)
-			   all-tags))
+		(delq nil (mapcar (apply-partially #'notmuch-tag-format-tag
+						   tags orig-tags)
+				  all-tags))
 		" ")
      face
      t)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index ab90f652..fcfb972d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -34,7 +34,8 @@ (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line))
 (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
 (declare-function notmuch-read-query "notmuch" (prompt))
 (declare-function notmuch-search-find-thread-id "notmuch" (&optional bare))
@@ -284,15 +285,18 @@ (defvar notmuch-tree-mode-map
     (set-keymap-parent map notmuch-common-keymap)
     ;; The following override the global keymap.
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-help] (notmuch-tree-close-message-pane-and #'notmuch-help))
+    (define-key map [remap notmuch-help]
+      (notmuch-tree-close-message-pane-and #'notmuch-help))
     ;; Override because we first close message pane and then close tree buffer.
     (define-key map [remap notmuch-bury-or-kill-this-buffer] 'notmuch-tree-quit)
     ;; Override because we close message pane after the search query is entered.
     (define-key map [remap notmuch-search] 'notmuch-tree-to-search)
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
+    (define-key map [remap notmuch-mua-new-mail]
+      (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-jump-search] (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
+    (define-key map [remap notmuch-jump-search]
+      (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
 
     (define-key map "S" 'notmuch-search-from-tree-current-query)
     (define-key map "U" 'notmuch-unthreaded-from-tree-current-query)
@@ -306,16 +310,24 @@ (defvar notmuch-tree-mode-map
     (define-key map "b" 'notmuch-show-resend-message)
 
     ;; these apply to the message pane
-    (define-key map (kbd "M-TAB") (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "<backtab>")  (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "TAB") (notmuch-tree-to-message-pane #'notmuch-show-next-button))
-    (define-key map "$" (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
+    (define-key map (kbd "M-TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "<backtab>")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-next-button))
+    (define-key map "$"
+      (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
 
     ;; bindings from show (or elsewhere) but we close the message pane first.
-    (define-key map "f" (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
-    (define-key map "r" (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
-    (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
-    (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
+    (define-key map "f"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
+    (define-key map "r"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
+    (define-key map "R"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
+    (define-key map "V"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
 
     ;; The main tree view bindings
     (define-key map (kbd "RET") 'notmuch-tree-show-message)
@@ -354,7 +366,9 @@ (defun notmuch-tree-get-message-properties ()
 (defun notmuch-tree-set-message-properties (props)
   (save-excursion
     (beginning-of-line)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point)
+		       (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-tree-set-prop (prop val &optional props)
   (let ((inhibit-read-only t)
@@ -407,7 +421,8 @@ (defun notmuch-tree-refresh-result ()
     ;; from overwriting the buffer local copy of
     ;; notmuch-tree-previous-subject if this is called while the
     ;; buffer is displaying.
-    (let ((notmuch-tree-previous-subject (notmuch-tree-get-prop :previous-subject)))
+    (let ((notmuch-tree-previous-subject
+	   (notmuch-tree-get-prop :previous-subject)))
       (delete-region (point) (1+ (line-end-position)))
       (notmuch-tree-insert-msg msg))
     (let ((new-end (line-end-position)))
@@ -596,7 +611,8 @@ (defun notmuch-tree-close-message-window ()
   "Close the message-window. Return t if close succeeds."
   (interactive)
   (when (and (window-live-p notmuch-tree-message-window)
-	     (eq (window-buffer notmuch-tree-message-window) notmuch-tree-message-buffer))
+	     (eq (window-buffer notmuch-tree-message-window)
+		 notmuch-tree-message-buffer))
     (delete-window notmuch-tree-message-window)
     (unless (get-buffer-window-list notmuch-tree-message-buffer)
       (kill-buffer notmuch-tree-message-buffer))
@@ -611,7 +627,8 @@ (defun notmuch-tree-archive-message (&optional unarchive)
 `notmuch-archive-tags' will be reversed."
   (interactive "P")
   (when notmuch-archive-tags
-    (notmuch-tree-tag (notmuch-tag-change-list notmuch-archive-tags unarchive))))
+    (notmuch-tree-tag
+     (notmuch-tag-change-list notmuch-archive-tags unarchive))))
 
 (defun notmuch-tree-archive-message-then-next (&optional unarchive)
   "Archive the current message and move to next matching message."
@@ -786,7 +803,8 @@ (defun notmuch-tree-format-field (field format-string msg)
       (let ((face (if match
 		      'notmuch-tree-match-date-face
 		    'notmuch-tree-no-match-date-face)))
-	(propertize (format format-string (plist-get msg :date_relative)) 'face face)))
+	(propertize (format format-string (plist-get msg :date_relative))
+		    'face face)))
 
      ((string-equal field "tree")
       (let ((tree-status (plist-get msg :tree-status))
@@ -880,7 +898,8 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
        ((and (< 0 depth) last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) first last)
-;;	  (push "─" tree-status)) choice between this and next line is matter of taste.
+	;; Choice between these two variants is a matter of taste.
+	;; (push "─" tree-status))
 	(push " " tree-status))
        ((and (eq 0 depth) first (not last))
 	  (push "┬" tree-status))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index fd0314cc..3a9ffdd0 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -25,7 +25,9 @@
 
 (require 'coolj)
 (require 'notmuch-lib)
-(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
+
+(declare-function notmuch-show-insert-bodypart "notmuch-show"
+		  (msg part depth &optional hide))
 (defvar notmuch-show-indent-messages-width)
 
 ;;
@@ -186,9 +188,12 @@ (defun notmuch-wash-button-label (overlay)
   (let* ((type (overlay-get overlay 'type))
 	 (invis-spec (overlay-get overlay 'invisible))
 	 (state (if (invisible-p invis-spec) "hidden" "visible"))
-	 (label-format (symbol-value (intern-soft (concat "notmuch-wash-button-"
-							  type "-" state "-format"))))
-	 (lines-count (count-lines (overlay-start overlay) (overlay-end overlay))))
+	 (label-format (symbol-value
+			(intern-soft
+			 (format "notmuch-wash-button-%s-%s-format"
+				 type state))))
+	 (lines-count (count-lines (overlay-start overlay)
+				   (overlay-end overlay))))
     (format label-format lines-count)))
 
 (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
@@ -238,7 +243,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
     (let* ((cite-start (match-beginning 0))
 	   (cite-end (match-end 0))
 	   (cite-lines (count-lines cite-start cite-end)))
-      (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
+      (overlay-put (make-overlay cite-start cite-end)
+		   'face 'notmuch-wash-cited-text)
       (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
 			     notmuch-wash-citation-lines-suffix
 			     1))
@@ -260,7 +266,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 		  (sig-end-marker (make-marker)))
 	      (set-marker sig-start-marker sig-start)
 	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text)
+	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
+			   'face 'message-cited-text)
 	      (notmuch-wash-region-to-button
 	       msg sig-start-marker sig-end-marker
 	       "signature"))))))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c97997fe..07a58da7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -516,7 +516,9 @@ (defun notmuch-search-show-thread (&optional elide-toggle)
 		      (current-buffer)
 		      notmuch-search-query-string
 		      ;; Name the buffer based on the subject.
-		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
+		      (concat "*"
+			      (truncate-string-to-width subject 30 nil nil t)
+			      "*"))
       (message "End of search results."))))
 
 (defun notmuch-tree-from-search-current-query ()
@@ -800,7 +802,9 @@ (defun notmuch-search-insert-authors (format-string authors)
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-	(setq visible-string (propertize visible-string 'help-echo (concat "..." invisible-string))))
+	(setq visible-string
+	      (propertize visible-string
+			  'help-echo (concat "..." invisible-string))))
 
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
@@ -892,7 +896,8 @@ (defun notmuch-search-buffer-title (query)
 		(longest-length 0))
 	    (cl-loop for tuple in notmuch-saved-searches
 		     if (let ((quoted-query
-			       (regexp-quote (notmuch-saved-search-get tuple :query))))
+			       (regexp-quote
+				(notmuch-saved-search-get tuple :query))))
 			  (and (string-match (concat "^" quoted-query) query)
 			       (> (length (match-string 0 query))
 				  longest-length)))
@@ -905,9 +910,10 @@ (defun notmuch-search-buffer-title (query)
 	   (concat "*notmuch-saved-search-" saved-search-name "*"))
 	  (saved-search
 	   (concat "*notmuch-search-"
-		   (replace-regexp-in-string (concat "^" (regexp-quote saved-search-query))
-					     (concat "[ " saved-search-name " ]")
-					     query)
+		   (replace-regexp-in-string
+		    (concat "^" (regexp-quote saved-search-query))
+		    (concat "[ " saved-search-name " ]")
+		    query)
 		   "*"))
 	  (t
 	   (concat "*notmuch-search-" query "*"))
@@ -926,7 +932,8 @@ (defun notmuch-read-query (prompt)
 		       "subject:" "attachment:")
 		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
 		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
+		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			 (mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
@@ -1078,8 +1085,10 @@ (defun notmuch-search-filter-by-tag (tag)
 Runs a new search matching only messages that match both the
 current search results AND that are tagged with the given tag."
   (interactive
-   (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
-  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
+   (list (notmuch-select-tag-with-completion "Filter by tag: "
+					     notmuch-search-query-string)))
+  (notmuch-search (concat notmuch-search-query-string " and tag:" tag)
+		  notmuch-search-oldest-first))
 
 (defun notmuch-search-by-tag (tag)
   "Display threads matching TAG in a notmuch-search buffer."
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2225aefc..2af91186 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -63,7 +63,8 @@ (defun rstdoc-extract (in-file out-file)
 
 (defun rstdoc--insert-docstring (symbol docstring)
   (insert (format "\n.. |docstring::%s| replace::\n" symbol))
-  (insert (replace-regexp-in-string "^" "    " (rstdoc--rst-quote-string docstring)))
+  (insert (replace-regexp-in-string "^" "    "
+				    (rstdoc--rst-quote-string docstring)))
   (insert "\n"))
 
 (defvar rst--escape-alist
-- 
2.26.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 02/23] emacs: Remove excess empty lines
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
  2020-07-26 16:57 ` [PATCH 01/23] emacs: Shorten long lines Jonas Bernoulli
@ 2020-07-26 16:57 ` Jonas Bernoulli
  2020-07-27 18:00   ` Tomi Ollila
  2020-07-26 16:57 ` [PATCH 03/23] emacs: Fix indentation Jonas Bernoulli
                   ` (23 subsequent siblings)
  25 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:57 UTC (permalink / raw)
  To: notmuch

Most people who write lots of lisp tend to only sparsely use empty
"separator" lines within forms.  In lisp they feel unnecessary and
since most files stick to this convention we get a bit confused
when there are extra empty lines.  It feels like the s-expressions
are falling into pieces.

All of this is especially true between a function's doc-string and
body because the doc-string is colored differently, which visually
already separates it quite sufficiently from the code that follows.
---
 emacs/make-deps.el           |  2 -
 emacs/notmuch-address.el     |  2 -
 emacs/notmuch-crypto.el      |  4 --
 emacs/notmuch-hello.el       | 18 ---------
 emacs/notmuch-jump.el        |  5 ---
 emacs/notmuch-lib.el         | 10 -----
 emacs/notmuch-maildir-fcc.el |  7 ----
 emacs/notmuch-mua.el         | 26 -------------
 emacs/notmuch-parser.el      |  5 ---
 emacs/notmuch-show.el        | 75 ++----------------------------------
 emacs/notmuch-tag.el         |  3 --
 emacs/notmuch-tree.el        |  9 -----
 emacs/notmuch-wash.el        | 18 +--------
 emacs/notmuch.el             |  7 ----
 14 files changed, 5 insertions(+), 186 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index 5b6db698..dcac319c 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -23,7 +23,6 @@
 
 (defun batch-make-deps ()
   "Invoke `make-deps' for each file on the command line."
-
   (setq debug-on-error t)
   (dolist (file command-line-args-left)
     (let ((default-directory command-line-default-directory))
@@ -37,7 +36,6 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-
   (setq dir (or dir default-directory))
   (save-excursion
     (goto-char (point-min))
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2a9c411a..ca4da3f3 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 Address harvesting may take some time so the address collection runs
 asynchronously unless SYNCHRONOUS is t. In case of asynchronous
 execution, CALLBACK is called when harvesting finishes."
-
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
 	 (prefix-query (when addr-prefix
@@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 	;; Kill any existing process
 	(when current-proc
 	  (kill-buffer (process-buffer current-proc))) ; this also kills the process
-
 	(setq current-proc
 	      (apply 'notmuch-start-notmuch proc-name proc-buf
 		     callback				; process sentinel
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 2327ff1f..58947a20 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 		face 'notmuch-crypto-signature-good-key))
 	(setq button-action 'notmuch-crypto-sigstatus-good-callback
 	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
-
      ((string= status "error")
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
 	    button-action 'notmuch-crypto-sigstatus-error-callback
 	    help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
-
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")")
 	    face 'notmuch-crypto-signature-bad))
-
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
@@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
 	    (message "Getting the GPG key %s asynchronously..." keyid)))
-
       (let ((window (display-buffer buffer)))
 	(with-selected-window window
 	  (with-current-buffer buffer
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 11c625ea..e71e55f3 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches
 ;; The saved-search format is also used by the all-tags notmuch-hello
 ;; section. This section generates its own saved-search list in one of
 ;; the latter two forms.
-
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -482,20 +481,17 @@ (defun notmuch-hello-tags-per-line (widest)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 (max notmuch-column-control widest)))))
-
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
 		  (proposed-width (max (* available-width notmuch-column-control)
 				       widest)))
 	     (floor available-width proposed-width)))
-
 	  (t
 	   (max 1
 		(/ (- (window-width) notmuch-hello-indent)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 widest)))))))
-
     (cons tags-per-line (/ (max 1
 				(- (window-width) notmuch-hello-indent
 				   ;; Count is 9 wide (8 digits plus
@@ -545,7 +541,6 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
 	  "\n")))
-
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -553,9 +548,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
        "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
-
     (goto-char (point-min))
-
     (notmuch-remove-if-not
      #'identity
      (mapcar
@@ -621,7 +614,6 @@ (defun notmuch-hello-insert-buttons (searches)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
 	  reordered-list)
-
     ;; If the last line was not full (and hence did not include a
     ;; carriage return), insert one now.
     (unless (eq (% count tags-per-line) 0)
@@ -780,7 +772,6 @@ (defun notmuch-hello-insert-header ()
 		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
-
 (defun notmuch-hello-insert-saved-searches ()
   "Insert the saved-searches section."
   (let ((searches (notmuch-hello-query-counts
@@ -977,7 +968,6 @@ (defun notmuch-hello-insert-footer ()
 (defun notmuch-hello (&optional no-display)
   "Run notmuch and display saved searches, known tags, etc."
   (interactive)
-
   (notmuch-assert-cli-sane)
   ;; This may cause a window configuration change, so if the
   ;; auto-refresh hook is already installed, avoid recursive refresh.
@@ -985,32 +975,25 @@ (defun notmuch-hello (&optional no-display)
     (if no-display
 	(set-buffer "*notmuch-hello*")
       (switch-to-buffer "*notmuch-hello*")))
-
   ;; Install auto-refresh hook
   (when notmuch-hello-auto-refresh
     (add-hook 'window-configuration-change-hook
 	      #'notmuch-hello-window-configuration-change))
-
   (let ((target-line (line-number-at-pos))
 	(target-column (current-column))
 	(inhibit-read-only t))
-
     ;; Delete all editable widget fields.  Editable widget fields are
     ;; tracked in a buffer local variable `widget-field-list' (and
     ;; others).  If we do `erase-buffer' without properly deleting the
     ;; widgets, some widget-related functions are confused later.
     (mapc 'widget-delete widget-field-list)
-
     (erase-buffer)
-
     (unless (eq major-mode 'notmuch-hello-mode)
       (notmuch-hello-mode))
-
     (let ((all (overlay-lists)))
       ;; Delete all the overlays.
       (mapc 'delete-overlay (car all))
       (mapc 'delete-overlay (cdr all)))
-
     (mapc
      (lambda (section)
        (let ((point-before (point)))
@@ -1023,7 +1006,6 @@ (defun notmuch-hello (&optional no-display)
 	   (widget-insert "\n"))))
      notmuch-hello-sections)
     (widget-setup)
-
     ;; Move point back to where it was before refresh. Use line and
     ;; column instead of point directly to be insensitive to additions
     ;; and removals of text within earlier lines.
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 6d8cd97f..adf79650 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -43,7 +43,6 @@ (defun notmuch-jump-search ()
 Typically these shortcuts are a single key long, so this is a
 fast way to jump to a saved search from anywhere in Notmuch."
   (interactive)
-
   ;; Build the action map
   (let (action-map)
     (dolist (saved-search notmuch-saved-searches)
@@ -67,7 +66,6 @@ (defun notmuch-jump-search ()
 			  `(lambda () (notmuch-search ',query ',oldest-first)))))
 		  action-map)))))
     (setq action-map (nreverse action-map))
-
     (if action-map
 	(notmuch-jump action-map "Search: ")
       (error "To use notmuch-jump, \
@@ -90,7 +88,6 @@ (defun notmuch-jump (action-map prompt)
 the buffer, and ACTION is a nullary function to call.  LABEL may
 be null, in which case the action will still be bound, but will
 not appear in the pop-up buffer."
-
   (let* ((items (notmuch-jump--format-actions action-map))
 	 ;; Format the table of bindings and the full prompt
 	 (table
@@ -115,7 +112,6 @@ (defun notmuch-jump (action-map prompt)
 	 (notmuch-jump--action nil))
     ;; Read the action
     (read-from-minibuffer full-prompt nil minibuffer-map)
-
     ;; If we got an action, do it
     (when notmuch-jump--action
       (funcall notmuch-jump--action))))
@@ -126,7 +122,6 @@ (defun notmuch-jump--format-actions (action-map)
 Returns a list of strings, one for each item with a label in
 ACTION-MAP.  These strings can be inserted into a tabular
 buffer."
-
   ;; Compute the maximum key description width
   (let ((key-width 1))
     (pcase-dolist (`(,key ,desc) action-map)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9339f9d0..615207ed 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -418,7 +418,6 @@ (defun notmuch-subkeymap-help ()
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
-
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
@@ -486,7 +485,6 @@ (defun notmuch-escape-boolean-term (term)
 The caller is responsible for prepending the term prefix and a
 colon.  This performs minimal escaping in order to produce
 user-friendly queries."
-
   (save-match-data
     (if (or (equal term "")
 	    ;; To be pessimistic, only pass through terms composed
@@ -731,7 +729,6 @@ (defun notmuch-apply-face (object face &optional below start end)
 attributes, or a list of these.  If START and/or END are omitted,
 they default to the beginning/end of OBJECT.  For convenience
 when applied to strings, this returns OBJECT."
-
   ;; A face property can have three forms: a face name (a string or
   ;; symbol), a property list, or a list of these two forms.  In the
   ;; list case, the faces will be combined, with the earlier faces
@@ -774,7 +771,6 @@ (defun notmuch-logged-error (msg &optional extra)
 signals MSG as an error.  If EXTRA is non-nil, text referring the
 user to the *Notmuch errors* buffer will be appended to the
 signaled error.  This function does not return."
-
   (with-current-buffer (get-buffer-create "*Notmuch errors*")
     (goto-char (point-max))
     (unless (bobp)
@@ -819,7 +815,6 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 giving the output of command.  ERR, if provided, is the error
 output of command.  OUTPUT and ERR will be included in the error
 message."
-
   (cond
    ((eq exit-status 0) t)
    ((eq exit-status 20)
@@ -865,7 +860,6 @@ (defun notmuch-call-notmuch--helper (destination args)
 This wraps `call-process'.  DESTINATION has the same meaning as
 for `call-process'.  ARGS is as described for
 `notmuch-call-notmuch-process'."
-
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
@@ -903,7 +897,6 @@ (defun notmuch-call-notmuch-sexp (&rest args)
 Like `notmuch-call-notmuch-process', if notmuch exits with a
 non-zero status, this will report its output and signal an
 error."
-
   (with-temp-buffer
     (let ((err-file (make-temp-file "nmerr")))
       (unwind-protect
@@ -931,7 +924,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 invoke `set-process-sentinel' directly on the returned process,
 as that will interfere with the handling of stderr and the exit
 status."
-
   (let (err-file err-buffer proc err-proc
 	;; Find notmuch using Emacs' `exec-path'
 	(command (or (executable-find notmuch-command)
@@ -956,7 +948,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 	  (process-put err-proc 'err-file err-file)
 	  (process-put err-proc 'err-buffer err-buffer)
 	  (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel))
-
       ;; On Emacs versions before 25, there is no way to capture
       ;; stdout and stderr separately for asynchronous processes, or
       ;; even to redirect stderr to a file, so we use a trivial shell
@@ -969,7 +960,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 			  "exec 2>\"$1\"; shift; exec \"$0\" \"$@\""
 			  command err-file args)))
       (process-put proc 'err-file err-file))
-
     (process-put proc 'sub-sentinel sentinel)
     (process-put proc 'real-command (cons notmuch-command args))
     (set-process-sentinel proc #'notmuch-start-notmuch-sentinel)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 4b10a731..66f32fd4 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -94,22 +94,18 @@ (defun notmuch-fcc-header-setup ()
 
 Originally intended to be use a hook function, but now called directly
 by notmuch-mua-mail."
-
   (let ((subdir
 	 (cond
 	  ((or (not notmuch-fcc-dirs)
 	       (message-field-value "Fcc"))
 	   ;; Nothing set or an existing header.
 	   nil)
-
 	  ((stringp notmuch-fcc-dirs)
 	   notmuch-fcc-dirs)
-
 	  ((and (listp notmuch-fcc-dirs)
 		(stringp (car notmuch-fcc-dirs)))
 	   ;; Old style - no longer works.
 	   (error "Invalid `notmuch-fcc-dirs' setting (old style)"))
-
 	  ((listp notmuch-fcc-dirs)
 	   (let* ((from (message-field-value "From"))
 		  (match
@@ -121,10 +117,8 @@ (defun notmuch-fcc-header-setup ()
 		 (cdr match)
 	       (message "No Fcc header added.")
 	       nil)))
-
 	  (t
 	   (error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
-
     (when subdir
       (if notmuch-maildir-use-notmuch-insert
 	  (notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
@@ -133,7 +127,6 @@ (defun notmuch-fcc-header-setup ()
 (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; Notmuch insert does not accept absolute paths, so check the user
   ;; really want this header inserted.
-
   (when (or (not (= (elt subdir 0) ?/))
 	    (y-or-n-p
 	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 74dfb384..3bc06b4b 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -228,22 +228,17 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	original)
     (when process-crypto
       (setq args (append args '("--decrypt=true"))))
-
     (if reply-all
 	(setq args (append args '("--reply-to=all")))
       (setq args (append args '("--reply-to=sender"))))
     (setq args (append args (list query-string)))
-
     ;; Get the reply object as SEXP, and parse it into an elisp object.
     (setq reply (apply #'notmuch-call-notmuch-sexp args))
-
     ;; Extract the original message to simplify the following code.
     (setq original (plist-get reply :original))
-
     ;; Extract the headers of both the reply and the original message.
     (let* ((original-headers (plist-get original :headers))
 	   (reply-headers (plist-get reply :reply-headers)))
-
       ;; If sender is non-nil, set the From: header to its value.
       (when sender
 	(plist-put reply-headers :From sender))
@@ -251,7 +246,6 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; Overlay the composition window on that being used to read
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
-
 	;; We modify message-header-format-alist to get around
 	;; a bug in message.el.  See the comment above on
 	;; notmuch-mua-insert-references.
@@ -268,13 +262,11 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-sanitize (plist-get reply-headers :Subject))
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
-
       ;; Insert the message body - but put it in front of the signature
       ;; if one is present, and after any other content
       ;; message*setup-hooks may have added to the message body already.
@@ -286,17 +278,14 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	    (if message-signature-insert-empty-line
 		(forward-line -1))
 	  (goto-char (point-max))))
-
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
 	    (start (point)))
-
 	;; notmuch-mua-cite-function constructs a citation line based
 	;; on the From and Date headers of the original message, which
 	;; are assumed to be in the buffer.
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
-
 	(insert
 	 (with-temp-buffer
 	   (let
@@ -320,22 +309,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
 	       (notmuch-show-insert-body original (plist-get original :body) 0)
 	       (buffer-substring-no-properties (point-min) (point-max))))))
-
 	(set-mark (point))
 	(goto-char start)
 	;; Quote the original message according to the user's configured style.
 	(funcall notmuch-mua-cite-function)))
-
     ;; Crypto processing based crypto content of the original message
     (when process-crypto
       (notmuch-mua-reply-crypto (plist-get original :body))))
-
   ;; Push mark right before signature, if any.
   (message-goto-signature)
   (unless (eobp)
     (end-of-line -1))
   (push-mark)
-
   (message-goto-body)
   (set-buffer-modified-p nil))
 
@@ -381,18 +366,15 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 				   return-action &rest ignored)
   "Invoke the notmuch mail composition window."
   (interactive)
-
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
       (when (not (string= "" user-agent))
 	(push (cons 'User-Agent user-agent) other-headers))))
-
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
 		       (notmuch-user-name)
 		       (notmuch-user-primary-email)))
 	  other-headers))
-
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
 			     (or switch-function
 				 (notmuch-mua-get-switch-function)))
@@ -422,7 +404,6 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (message-hide-headers)
   (set-buffer-modified-p nil)
   (notmuch-mua-maybe-set-window-dedicated)
-
   (message-goto-to))
 
 (defcustom notmuch-identities nil
@@ -495,10 +476,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 			  ;; applied later.
 	 forward-references ;; List of accumulated message-references of forwarded messages
 	 forward-queries) ;; List of corresponding message-query
-
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
-
     (save-excursion
       ;; Insert all of the forwarded messages.
       (mapc (lambda (id)
@@ -524,7 +503,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	    ;; `message-forward-make-body' always puts the message at
 	    ;; the top, so do them in reverse order.
 	    (reverse messages))
-
       ;; Add in the appropriate subject.
       (save-restriction
 	(message-narrow-to-headers)
@@ -533,7 +511,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-remove-header "References")
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the message.
       (when notmuch-message-forwarded-tags
@@ -541,7 +518,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		    (cl-loop for id in forward-queries
 			     collect
 			     (cons id notmuch-message-forwarded-tags))))
-
       ;; `message-forward-make-body' shows the User-agent header.  Hide
       ;; it again.
       (message-hide-headers)
@@ -553,7 +529,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-
 ;; In current emacs (24.3) select-active-regions is set to t by
 ;; default. The reply insertion code sets the region to the quoted
 ;; message to make it easy to delete (kill-region or C-w). These two
@@ -565,7 +540,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 ;; primary selection was previously in a non-emacs window but not if
 ;; it was in an emacs window. To avoid the problem in the latter case
 ;; we deactivate mark.
-
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index dc9fbe2f..06e7487b 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -38,7 +38,6 @@ (defun notmuch-sexp-create-parser ()
 The parser always consumes input from point in the current
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
-
   (vector 'notmuch-sexp-parser
 	  ;; List depth
 	  0
@@ -60,7 +59,6 @@ (defun notmuch-sexp-read (sp)
 list, this moves point just past the terminator and returns 'end.
 Otherwise, this moves point to just past the end of the value and
 returns the value."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\))
@@ -134,7 +132,6 @@ (defun notmuch-sexp-begin-list (sp)
 returns t.  Later calls to `notmuch-sexp-read' will return the
 elements inside the list.  If the input in buffer is not the
 beginning of a list, throw invalid-read-syntax."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\()
@@ -151,7 +148,6 @@ (defun notmuch-sexp-eof (sp)
 
 Moves point to the beginning of any trailing data or to the end
 of the buffer if there is only trailing whitespace."
-
   (skip-chars-forward " \n\r\t")
   (unless (eobp)
     (error "Trailing garbage following expression")))
@@ -173,7 +169,6 @@ (defun notmuch-sexp-parse-partial-list (result-function result-buffer)
 be called whenever the input buffer has been extended with
 additional data.  The caller just needs to ensure it does not
 move point in the input buffer."
-
   ;; Set up the initial state
   (unless (local-variable-p 'notmuch-sexp--parser)
     (set (make-local-variable 'notmuch-sexp--parser)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 26b41603..6e23a980 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -320,7 +320,6 @@ (defun notmuch-show-with-message-as-text (fn)
 
 FN is called with one argument, the message properties. It should
 operation on the contents of the current buffer."
-
   ;; Remake the header to ensure that all information is available.
   (let* ((to (notmuch-show-get-to))
 	 (cc (notmuch-show-get-cc))
@@ -329,7 +328,6 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (date (notmuch-show-get-date))
 	 (tags (notmuch-show-get-tags))
 	 (depth (notmuch-show-get-depth))
-
 	 (header (concat
 		  "Subject: " subject "\n"
 		  "To: " to "\n"
@@ -375,7 +373,6 @@ (defun notmuch-show-fontify-header ()
 		'message-header-subject)
 	       (t
 		'message-header-other))))
-
     (overlay-put (make-overlay (point) (re-search-forward ":"))
 		 'face 'message-header-name)
     (overlay-put (make-overlay (point) (re-search-forward ".*$"))
@@ -421,39 +418,30 @@ (defun notmuch-clean-address (address)
        ((string-match "\\(.*\\) <\\(.*\\)>" address)
 	(setq p-name (match-string 1 address)
 	      p-address (match-string 2 address)))
-
        ;; "<user@dom.ain>" style.
        ((string-match "<\\(.*\\)>" address)
 	(setq p-address (match-string 1 address)))
-
        ;; Everything else.
        (t
 	(setq p-address address)))
-
       (when p-name
 	;; Remove elements of the mailbox part that are not relevant for
 	;; display, even if they are required during transport:
 	;;
 	;; Backslashes.
 	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-
 	;; 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-loop p-name)
 		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 until (string= start-of-loop p-name)))
-
       ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
       ;; 'foo@bar.com'.
       (when (string= p-name p-address)
 	(setq p-name nil))
-
       (cons p-address p-name))
     (error (cons address nil))))
 
@@ -517,7 +505,6 @@ (defun notmuch-show-insert-part-header (nth content-type declared-type
 			    (unless (string-equal declared-type content-type)
 			      (concat " (as " content-type ")"))
 			    comment)))
-
     (setq button
 	  (insert-button
 	   (concat "[ " base-label " ]")
@@ -658,14 +645,12 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
 (defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth button)
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
-
     ;; Render the primary part.  FIXME: Support RFC 2387 Start header.
     (notmuch-show-insert-bodypart msg (car inner-parts) depth)
     ;; Add hidden buttons for the rest
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth t))
 	  (cdr inner-parts))
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -673,18 +658,15 @@ (defun notmuch-show-insert-part-multipart/related (msg part content-type nth dep
 (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -692,21 +674,17 @@ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth dept
 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the encryption status.
   (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -721,7 +699,6 @@ (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth but
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -730,19 +707,15 @@ (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth
   (let* ((message (car (plist-get part :content)))
 	 (body (car (plist-get message :body)))
 	 (start (point)))
-
     ;; Override `notmuch-message-headers' to force `From' to be
     ;; displayed.
     (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
       (notmuch-show-insert-headers (plist-get message :headers)))
-
     ;; Blank line after headers to be compatible with the normal
     ;; message display.
     (insert "\n")
-
     ;; Show the body
     (notmuch-show-insert-bodypart msg body depth)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -826,7 +799,6 @@ (defun notmuch-show-insert-part-text/html (msg part content-type nth depth butto
       ;; It's easier to drive shr ourselves than to work around the
       ;; goofy things `mm-shr' does (like irreversibly taking over
       ;; content ID handling).
-
       ;; FIXME: If we block an image, offer a button to load external
       ;; images.
       (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
@@ -902,7 +874,6 @@ (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth bu
 
 (defun notmuch-show-create-part-overlays (button beg end)
   "Add an overlay to the part between BEG and END."
-
   ;; If there is no button (i.e., the part is text/plain and the first
   ;; part) or if the part has no content then we don't make the part
   ;; toggleable.
@@ -913,7 +884,6 @@ (defun notmuch-show-create-part-overlays (button beg end)
 
 (defun notmuch-show-record-part-information (part beg end)
   "Store PART as a text property from BEG to END."
-
   ;; Record part information.  Since we already inserted subparts,
   ;; don't override existing :notmuch-part properties.
   (notmuch-map-text-property beg end :notmuch-part
@@ -1011,7 +981,6 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 HIDE determines whether to show or hide the part and the button
 as follows: If HIDE is nil, show the part and the button. If HIDE
 is t, hide the part initially and show the button."
-
   (let* ((content-type (downcase (plist-get part :content-type)))
 	 (mime-type (notmuch-show-mime-type part))
 	 (nth (plist-get part :id))
@@ -1030,16 +999,13 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (show-part (not (or (equal hide t)
 			     (and long button))))
 	 (content-beg (point)))
-
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
-
     (if show-part
         (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
-
     ;; Some of the body part handlers leave point somewhere up in the
     ;; part, so we make sure that we're down at the end.
     (goto-char (point-max))
@@ -1056,12 +1022,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 
 (defun notmuch-show-insert-body (msg body depth)
   "Insert the body BODY at depth DEPTH in the current thread."
-
   ;; Register all content IDs for this message.  According to RFC
   ;; 2392, content IDs are *global*, but it's okay if an MUA treats
   ;; them as only global within a message.
   (notmuch-show--register-cids msg (car body))
-
   (mapc (lambda (part) (notmuch-show-insert-bodypart msg part depth)) body))
 
 (defun notmuch-show-make-symbol (type)
@@ -1082,18 +1046,14 @@ (defun notmuch-show-insert-msg (msg depth)
 	 content-start content-end
 	 headers-start headers-end
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
-
     (setq message-start (point-marker))
-
     (notmuch-show-insert-headerline headers
 				    (or (if notmuch-show-relative-dates
 					    (plist-get msg :date_relative)
 					  nil)
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
-
     (setq content-start (point-marker))
-
     ;; Set `headers-start' to point after the 'Subject:' header to be
     ;; compatible with the existing implementation. This just sets it
     ;; to after the first header.
@@ -1108,9 +1068,7 @@ (defun notmuch-show-insert-msg (msg depth)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
-
     (setq notmuch-show-previous-subject bare-subject)
-
     ;; A blank line between the headers and the body.
     (insert "\n")
     (notmuch-show-insert-body msg (plist-get msg :body)
@@ -1119,36 +1077,28 @@ (defun notmuch-show-insert-msg (msg depth)
     (unless (bolp)
       (insert "\n"))
     (setq content-end (point-marker))
-
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
 	(indent-rigidly content-start
 			content-end
 			(* notmuch-show-indent-messages-width depth)))
-
     (setq message-end (point-max-marker))
-
     ;; Save the extents of this message over the whole text of the
     ;; message.
     (put-text-property message-start message-end
 		       :notmuch-message-extent
 		       (cons message-start message-end))
-
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
     (plist-put msg :message-overlay (make-overlay headers-start content-end))
-
     (plist-put msg :depth depth)
-
     ;; Save the properties for this message. Currently this saves the
     ;; entire message (augmented it with other stuff), which seems
     ;; like overkill. We might save a reduced subset (for example, not
     ;; the content).
     (notmuch-show-set-message-properties msg)
-
     ;; Set header visibility.
     (notmuch-show-headers-visible msg notmuch-message-headers-visible)
-
     ;; Message visibility depends on whether it matched the search
     ;; criteria.
     (notmuch-show-message-visible msg (and (plist-get msg :match)
@@ -1296,9 +1246,7 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     (switch-to-buffer (get-buffer-create buffer-name))
     ;; No need to track undo information for this buffer.
     (setq buffer-undo-list t)
-
     (notmuch-show-mode)
-
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
@@ -1307,24 +1255,19 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
 	  notmuch-show-query-context (if (or (string= query-context "")
 					     (string= query-context "*"))
 					 nil query-context)
-
 	  notmuch-show-process-crypto notmuch-crypto-process-mime
 	  ;; If `elide-toggle', invert the default value.
 	  notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
-
     (add-hook 'post-command-hook #'notmuch-show-command-hook nil t)
     (jit-lock-register #'notmuch-show-buttonise-links)
-
     (notmuch-tag-clear-cache)
-
     (let ((inhibit-read-only t))
       (if (notmuch-show--build-buffer)
 	  ;; Messages were inserted into the buffer.
 	  (current-buffer)
-
 	;; No messages were inserted - presumably none matched the
 	;; query.
 	(kill-buffer (current-buffer))
@@ -1367,26 +1310,21 @@ (defun notmuch-show--build-buffer (&optional state)
       (setq queries (cdr queries)))
     (when forest
       (notmuch-show-insert-forest forest)
-
       ;; Store the original tags for each message so that we can
       ;; display changes.
       (notmuch-show-mapc
        (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
-
       ;; Set the header line to the subject of the first message.
       (setq header-line-format
 	    (replace-regexp-in-string "%" "%%"
 				      (notmuch-sanitize
 				       (notmuch-show-strip-re
 					(notmuch-show-get-subject)))))
-
       (run-hooks 'notmuch-show-hook)
-
       (if state
 	  (notmuch-show-apply-state state)
 	;; With no state to apply, just go to the first message.
 	(notmuch-show-goto-first-wanted-message)))
-
     ;; Report back to the caller whether any messages matched.
     forest))
 
@@ -1431,14 +1369,12 @@ (defun notmuch-show-apply-state (state)
  - moving to the correct current message in every displayed window."
   (let ((win-msg-alist (car state))
 	(open (cadr state)))
-
     ;; Open those that were open.
     (goto-char (point-min))
     (cl-loop do (notmuch-show-message-visible
 		 (notmuch-show-get-message-properties)
 		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
-
     (dolist (win-msg-pair win-msg-alist)
       (with-selected-window (car win-msg-pair)
 	;; Go to the previously open message in this window
@@ -1460,7 +1396,6 @@ (defun notmuch-show-refresh-view (&optional reset-state)
     ;; manually.
     (remove-overlays)
     (erase-buffer)
-
     (unless (notmuch-show--build-buffer state)
       ;; No messages were inserted.
       (kill-buffer (current-buffer))
@@ -1881,16 +1816,13 @@ (defun notmuch-show-advance ()
 	   (> visible-end-of-this-message (window-end)))
       ;; The bottom of this message is not visible - scroll.
       (scroll-up nil))
-
      ((not (= end-of-this-message (point-max)))
       ;; This is not the last message - move to the next visible one.
       (notmuch-show-next-open-message))
-
      ((not (= (point) (point-max)))
       ;; This is the last message, but the cursor is not at the end of
       ;; the buffer. Move it there.
       (goto-char (point-max)))
-
      (t
       ;; This is the last message - change the return value
       (setq ret t)))
@@ -2527,7 +2459,6 @@ (defun notmuch-show-pipe-part ()
   (interactive)
   (notmuch-show-apply-to-current-part-handle #'mm-pipe-part))
 
-
 (defun notmuch-show--mm-display-part (handle)
   "Use mm-display-part to display HANDLE in a new buffer.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 34cd493a..85c80f54 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -331,7 +331,6 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 		    (otherwise nil))))
 	(setq formatted-tag (notmuch-tag--do-format tag tag base))
 	(setq formatted-tag (notmuch-tag--do-format tag formatted-tag over))
-
 	(puthash (cons tag tag-state) formatted-tag notmuch-tag--format-cache)))
     formatted-tag))
 
@@ -356,7 +355,6 @@ (defcustom notmuch-before-tag-hook nil
 a list of strings of the form \"+TAG\" or \"-TAG\".
 'query' will be a string containing the search query that determines
 the messages that are about to be tagged."
-
   :type 'hook
   :options '(notmuch-hl-line-mode)
   :group 'notmuch-hooks)
@@ -406,7 +404,6 @@ (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)
 non-nil, is the query string to present in the minibuffer.  It
 defaults to \"Tags\".  INITIAL-INPUT, if non-nil, will be the
 initial input in the minibuffer."
-
   (let* ((all-tag-list (notmuch-tag-completions))
 	 (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))
 	 (remove-tag-list (mapcar (apply-partially 'concat "-") current-tags))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index fcfb972d..d90f2aa0 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -891,7 +891,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-
       (cond
        ((and (< 0 depth) (not last))
 	(push "├" tree-status))
@@ -907,7 +906,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) (not first) (not last))
 	(push "├" tree-status)))
-
       (push (concat (if replies "┬" "─") "►") tree-status)
       (setq msg (plist-put msg :first (and first (eq 0 depth))))
       (setq msg (plist-put msg :tree-status tree-status))
@@ -915,11 +913,9 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
       (notmuch-tree-goto-and-insert-msg msg)
       (pop tree-status)
       (pop tree-status)
-
       (if last
 	  (push " " tree-status)
 	(push "│" tree-status))
-
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -958,7 +954,6 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 Complete list of currently available key bindings:
 
 \\{notmuch-tree-mode-map}"
-
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
   (setq buffer-read-only t
@@ -1022,7 +1017,6 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   ;; (such as reply) do. It is a buffer local variable so setting it
   ;; will not affect genuine show buffers.
   (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
-
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
@@ -1079,13 +1073,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
 						(if unthreaded "unthreaded-" "tree-")
 						query "*")))))
 	(inhibit-read-only t))
-
     (switch-to-buffer buffer))
   ;; Don't track undo information for this buffer
   (set 'buffer-undo-list t)
-
   (notmuch-tree-worker query query-context target open-target unthreaded)
-
   (setq truncate-lines t))
 
 (defun notmuch-unthreaded (&optional query query-context target buffer-name open-target)
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 3a9ffdd0..c3b24cb9 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -203,12 +203,10 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
 \"citation\" or \"signature\". Optional PREFIX is some arbitrary
 text to insert before the button, probably for indentation.  Note
 that PREFIX should not include a newline."
-
   ;; This uses some slightly tricky conversions between strings and
   ;; symbols because of the way the button code works. Note that
   ;; replacing intern-soft with make-symbol will cause this to fail,
   ;; since the newly created symbol has no plist.
-
   (let ((overlay (make-overlay beg end))
 	(button-type (intern-soft (concat "notmuch-wash-button-"
 					  type "-toggle-type"))))
@@ -276,25 +274,20 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 
 (defun notmuch-wash-elide-blank-lines (msg depth)
   "Elide leading, trailing and successive blank lines."
-
   ;; Algorithm derived from `article-strip-multiple-blank-lines' in
   ;; `gnus-art.el'.
-
   ;; Make all blank lines empty.
   (goto-char (point-min))
   (while (re-search-forward "^[[:space:]\t]+$" nil t)
     (replace-match "" nil t))
-
   ;; Replace multiple empty lines with a single empty line.
   (goto-char (point-min))
   (while (re-search-forward "^\n\\(\n+\\)" nil t)
     (delete-region (match-beginning 1) (match-end 1)))
-
   ;; Remove a leading blank line.
   (goto-char (point-min))
   (if (looking-at "\n")
       (delete-region (match-beginning 0) (match-end 0)))
-
   ;; Remove a trailing blank line.
   (goto-char (point-max))
   (if (looking-at "\n")
@@ -313,20 +306,15 @@ (defun notmuch-wash-tidy-citations (msg depth)
   text,
 - Remove citation trailers standing alone after a block of cited
   text."
-
   ;; Remove lines of repeated citation leaders with no other content.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\{2,\\}" nil t)
     (replace-match "\\1"))
-
-  ;; Remove citation leaders standing alone before a block of cited
-  ;; text.
+  ;; Remove citation leaders standing alone before a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(\n\\|^[^>].*\\)\n\\(^>[> ]*\n\\)" nil t)
     (replace-match "\\1\n"))
-
-  ;; Remove citation trailers standing alone after a block of cited
-  ;; text.
+  ;; Remove citation trailers standing alone after a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
     (replace-match "\\2")))
@@ -341,7 +329,6 @@ (defun notmuch-wash-wrap-long-lines (msg depth)
 its value. Otherwise, this function will wrap long lines in the
 message at the window width. When doing so, citation leaders in
 the wrapped text are maintained."
-
   (let* ((coolj-wrap-follows-window-size nil)
 	 (indent (* depth notmuch-show-indent-messages-width))
 	 (limit (if (numberp notmuch-wash-wrap-lines-length)
@@ -405,7 +392,6 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 Given that this function guesses whether a buffer includes a
 patch and then guesses the extent of the patch, there is scope
 for error."
-
   (goto-char (point-min))
   (when (re-search-forward diff-file-header-re nil t)
     (beginning-of-line -1)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 07a58da7..04334c76 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -755,7 +755,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (visible-string formatted-authors)
 	   (invisible-string "")
 	   (padding ""))
-
       ;; Truncate the author string to fit the specification.
       (if (> (length formatted-authors)
 	     (length formatted-sample))
@@ -782,7 +781,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 					  (length visible-string)
 					  (length "..."))
 				       ? ))))
-
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -798,14 +796,12 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; The invisible string may contain both matching and
 	      ;; non-matching authors.
 	      invisible-string (notmuch-search-author-propertize invisible-string)))
-
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
-
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
       (when (not (string= invisible-string ""))
@@ -831,11 +827,9 @@ (defun notmuch-search-insert-field (field format-string result)
     (insert (propertize (format format-string
 				(notmuch-sanitize (plist-get result :subject)))
 			'face 'notmuch-search-subject)))
-
    ((string-equal field "authors")
     (notmuch-search-insert-authors
      format-string (notmuch-sanitize (plist-get result :authors))))
-
    ((string-equal field "tags")
     (let ((tags (plist-get result :tags))
 	  (orig-tags (plist-get result :orig-tags)))
@@ -1118,7 +1112,6 @@ (defun notmuch-cycle-notmuch-buffers ()
 If the current buffer is the only notmuch buffer, bury it. If no
 notmuch buffers exist, run `notmuch'."
   (interactive)
-
   (let (start first)
     ;; If the current buffer is a notmuch buffer, remember it and then
     ;; bury it.
-- 
2.26.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 03/23] emacs: Fix indentation
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
  2020-07-26 16:57 ` [PATCH 01/23] emacs: Shorten long lines Jonas Bernoulli
  2020-07-26 16:57 ` [PATCH 02/23] emacs: Remove excess empty lines Jonas Bernoulli
@ 2020-07-26 16:57 ` Jonas Bernoulli
  2020-07-30 20:07   ` Tomi Ollila
  2020-07-26 16:57 ` [PATCH 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
                   ` (22 subsequent siblings)
  25 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:57 UTC (permalink / raw)
  To: notmuch

---
 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 one of CHARS is ignored.
 
 If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
@@ -44,49 +44,49 @@ (if (fboundp 'read-char-choice)
 This is an exact copy of this function from emacs 24 for use on
 emacs 23, except with the one emacs 24 only function it calls
 inlined."
-  (unless (consp chars)
-    (error "Called `read-char-choice' without valid char choices"))
-  (let (char done show-help (helpbuf " *Char Help*"))
-    (let ((cursor-in-echo-area t)
-          (executing-kbd-macro executing-kbd-macro)
-	  (esc-flag nil))
-      (save-window-excursion	      ; in case we call help-form-show
-	(while (not done)
-	  (unless (get-text-property 0 'face prompt)
-	    (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
-	  (setq char (let ((inhibit-quit inhibit-keyboard-quit))
-		       (read-key prompt)))
-	  (and show-help (buffer-live-p (get-buffer helpbuf))
-	       (kill-buffer helpbuf))
-	  (cond
-	   ((not (numberp char)))
-	   ;; If caller has set help-form, that's enough.
-	   ;; They don't explicitly have to add help-char to chars.
-	   ((and help-form
-		 (eq char help-char)
-		 (setq show-help t)
-		 ;; This is an inlined copy of help-form-show as that
-		 ;; was introduced in emacs 24 too.
-		 (let ((msg (eval help-form)))
-		   (if (stringp msg)
-		       (with-output-to-temp-buffer " *Char Help*"
-			 (princ msg))))))
-	   ((memq char chars)
-	    (setq done t))
-	   ((and executing-kbd-macro (= char -1))
-	    ;; read-event returns -1 if we are in a kbd macro and
-	    ;; there are no more events in the macro.  Attempt to
-	    ;; get an event interactively.
-	    (setq executing-kbd-macro nil))
-	   ((not inhibit-keyboard-quit)
+    (unless (consp chars)
+      (error "Called `read-char-choice' without valid char choices"))
+    (let (char done show-help (helpbuf " *Char Help*"))
+      (let ((cursor-in-echo-area t)
+	    (executing-kbd-macro executing-kbd-macro)
+	    (esc-flag nil))
+	(save-window-excursion	      ; in case we call help-form-show
+	  (while (not done)
+	    (unless (get-text-property 0 'face prompt)
+	      (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
+	    (setq char (let ((inhibit-quit inhibit-keyboard-quit))
+			 (read-key prompt)))
+	    (and show-help (buffer-live-p (get-buffer helpbuf))
+		 (kill-buffer helpbuf))
 	    (cond
-	     ((and (null esc-flag) (eq char ?\e))
-	      (setq esc-flag t))
-	     ((memq char '(?\C-g ?\e))
-	      (keyboard-quit))))))))
-    ;; Display the question with the answer.  But without cursor-in-echo-area.
-    (message "%s%s" prompt (char-to-string char))
-    char)))
+	     ((not (numberp char)))
+	     ;; If caller has set help-form, that's enough.
+	     ;; They don't explicitly have to add help-char to chars.
+	     ((and help-form
+		   (eq char help-char)
+		   (setq show-help t)
+		   ;; This is an inlined copy of help-form-show as that
+		   ;; was introduced in emacs 24 too.
+		   (let ((msg (eval help-form)))
+		     (if (stringp msg)
+			 (with-output-to-temp-buffer " *Char Help*"
+			   (princ msg))))))
+	     ((memq char chars)
+	      (setq done t))
+	     ((and executing-kbd-macro (= char -1))
+	      ;; read-event returns -1 if we are in a kbd macro and
+	      ;; there are no more events in the macro.  Attempt to
+	      ;; get an event interactively.
+	      (setq executing-kbd-macro nil))
+	     ((not inhibit-keyboard-quit)
+	      (cond
+	       ((and (null esc-flag) (eq char ?\e))
+		(setq esc-flag t))
+	       ((memq char '(?\C-g ?\e))
+		(keyboard-quit))))))))
+      ;; Display the question with the answer.  But without cursor-in-echo-area.
+      (message "%s%s" prompt (char-to-string char))
+      char)))
 
 ;; End of compatibility functions
 
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index c3cb619f..ea995379 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -153,17 +153,17 @@ (defun notmuch-draft--query-encryption ()
 
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
-	((ask)
-	 (unless (yes-or-no-p
-		  "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+    ((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.
 Really save and index an unencrypted copy? ")
-	   (error "Save aborted")))
-	((nil)
-	 (error "Refusing to save draft with encryption tags (see `%s')"
-		'notmuch-draft-save-plaintext))
-	((t)
-	 (ignore))))
+       (error "Save aborted")))
+    ((nil)
+     (error "Refusing to save draft with encryption tags (see `%s')"
+	    'notmuch-draft-save-plaintext))
+    ((t)
+     (ignore))))
 
 (defun notmuch-draft--make-message-id ()
   ;; message-make-message-id gives the id inside a "<" ">" pair,
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e71e55f3..89e03c36 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -147,9 +147,9 @@ (defcustom notmuch-saved-searches
 
 Other accepted forms are a cons cell of the form (NAME . QUERY)
 or a list of the form (NAME QUERY COUNT-QUERY)."
-;; The saved-search format is also used by the all-tags notmuch-hello
-;; section. This section generates its own saved-search list in one of
-;; the latter two forms.
+  ;; The saved-search format is also used by the all-tags notmuch-hello
+  ;; section. This section generates its own saved-search list in one of
+  ;; the latter two forms.
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -382,10 +382,10 @@ (defun notmuch-hello-nice-number (n)
       (setq n (/ n 1000)))
     (setq result (or result '(0)))
     (apply #'concat
-     (number-to-string (car result))
-     (mapcar (lambda (elem)
-	      (format "%s%03d" notmuch-hello-thousands-separator elem))
-	     (cdr result)))))
+	   (number-to-string (car result))
+	   (mapcar (lambda (elem)
+		     (format "%s%03d" notmuch-hello-thousands-separator elem))
+		   (cdr result)))))
 
 (defun notmuch-hello-trim (search)
   "Trim whitespace."
@@ -540,7 +540,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 	  (notmuch-hello-filtered-query count-query
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
-	  "\n")))
+	 "\n")))
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -690,7 +690,7 @@ (defvar notmuch-hello-mode-map
 (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
- "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
+  "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
 
 Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
 or click on a saved search to view matching threads. Edit saved
@@ -720,9 +720,9 @@ (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
 Complete list of currently available key bindings:
 
 \\{notmuch-hello-mode-map}"
- (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
- ;;(setq buffer-read-only t)
-)
+  (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
+  ;;(setq buffer-read-only t)
+  )
 
 (defun notmuch-hello-generate-tag-alist (&optional hide-tags)
   "Return an alist from tags to queries to display in the all-tags section."
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 615207ed..7994d5ad 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -211,7 +211,7 @@ (defun notmuch-assert-cli-sane ()
   (unless (notmuch-cli-sane-p)
     (notmuch-logged-error
      "notmuch cli seems misconfigured or unconfigured."
-"Perhaps you haven't run \"notmuch setup\" yet? Try running this
+     "Perhaps you haven't run \"notmuch setup\" yet? Try running this
 on the command line, and then retry your notmuch command")))
 
 (defun notmuch-cli-version ()
@@ -321,7 +321,7 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		      (and (functionp binding)
 			   (notmuch-documentation-first-line binding))))
 	    tail)))
-    tail)
+  tail)
 
 (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; Remappings are represented as a binding whose first "event" is
@@ -413,8 +413,8 @@ (defun notmuch-subkeymap-help ()
   "Show help for a subkeymap."
   (interactive)
   (let* ((key (this-command-keys-vector))
-	(prefix (make-vector (1- (length key)) nil))
-	(i 0))
+	 (prefix (make-vector (1- (length key)) nil))
+	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
@@ -527,7 +527,7 @@ (defun notmuch-remove-if-not (predicate list)
   (let (out)
     (while list
       (when (funcall predicate (car list))
-        (push (car list) out))
+	(push (car list) out))
       (setq list (cdr list)))
     (nreverse out)))
 
@@ -835,24 +835,24 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		       command " "))
 	   (extra
 	    (concat "command: " command-string "\n"
-	     (if (integerp exit-status)
-		 (format "exit status: %s\n" exit-status)
-	       (format "exit signal: %s\n" exit-status))
-	     (when err
-	       (concat "stderr:\n" err))
-	     (when output
-	       (concat "stdout:\n" output)))))
-	(if err
-	    ;; We have an error message straight from the CLI.
-	    (notmuch-logged-error
-	     (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
-	  ;; We only have combined output from the CLI; don't inundate
-	  ;; the user with it.  Mimic `process-lines'.
-	  (notmuch-logged-error (format "%s exited with status %s"
-					(car command) exit-status)
-				extra))
-	;; `notmuch-logged-error' does not return.
-	))))
+		    (if (integerp exit-status)
+			(format "exit status: %s\n" exit-status)
+		      (format "exit signal: %s\n" exit-status))
+		    (when err
+		      (concat "stderr:\n" err))
+		    (when output
+		      (concat "stdout:\n" output)))))
+      (if err
+	  ;; We have an error message straight from the CLI.
+	  (notmuch-logged-error
+	   (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
+	;; We only have combined output from the CLI; don't inundate
+	;; the user with it.  Mimic `process-lines'.
+	(notmuch-logged-error (format "%s exited with status %s"
+				      (car command) exit-status)
+			      extra))
+      ;; `notmuch-logged-error' does not return.
+      ))))
 
 (defun notmuch-call-notmuch--helper (destination args)
   "Helper for synchronous notmuch invocation commands.
@@ -925,9 +925,9 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 as that will interfere with the handling of stderr and the exit
 status."
   (let (err-file err-buffer proc err-proc
-	;; Find notmuch using Emacs' `exec-path'
-	(command (or (executable-find notmuch-command)
-		     (error "Command not found: %s" notmuch-command))))
+		 ;; Find notmuch using Emacs' `exec-path'
+		 (command (or (executable-find notmuch-command)
+			      (error "Command not found: %s" notmuch-command))))
     (if (fboundp 'make-process)
 	(progn
 	  (setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
@@ -1030,8 +1030,8 @@ (defun notmuch-interactive-region ()
     (list (point) (point))))
 
 (define-obsolete-function-alias
-    'notmuch-search-interactive-region
-    'notmuch-interactive-region
+  'notmuch-search-interactive-region
+  'notmuch-interactive-region
   "notmuch 0.29")
 
 (provide 'notmuch-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 66f32fd4..7d001b2d 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -31,7 +31,7 @@ (require 'notmuch-lib)
 (defvar notmuch-maildir-fcc-count 0)
 
 (defcustom notmuch-fcc-dirs "sent"
- "Determines the Fcc Header which says where to save outgoing mail.
+  "Determines the Fcc Header which says where to save outgoing mail.
 
 Three types of values are permitted:
 
@@ -69,13 +69,13 @@ (defcustom notmuch-fcc-dirs "sent"
 In all cases you will be prompted to create the folder or
 directory if it does not exist yet when sending a mail."
 
- :type '(choice
-	 (const :tag "No FCC header" nil)
-	 (string :tag "A single folder")
-	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder"))))
- :require 'notmuch-fcc-initialization
- :group 'notmuch-send)
+  :type '(choice
+	  (const :tag "No FCC header" nil)
+	  (string :tag "A single folder")
+	  (repeat :tag "A folder based on the From header"
+		  (cons regexp (string :tag "Folder"))))
+  :require 'notmuch-fcc-initialization
+  :group 'notmuch-send)
 
 (defcustom notmuch-maildir-use-notmuch-insert 't
   "Should fcc use notmuch insert instead of simple fcc."
@@ -267,16 +267,16 @@ (defun notmuch-maildir-fcc-host-fixer (hostname)
 			    t))
 
 (defun notmuch-maildir-fcc-make-uniq-maildir-id ()
-   (let* ((ftime (float-time))
-	  (microseconds (mod (* 1000000 ftime) 1000000))
-	  (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
-     (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
-     (format "%d.%d_%d_%d.%s"
-	     ftime
-	     (emacs-pid)
-	     microseconds
-	     notmuch-maildir-fcc-count
-	     hostname)))
+  (let* ((ftime (float-time))
+	 (microseconds (mod (* 1000000 ftime) 1000000))
+	 (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
+    (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
+    (format "%d.%d_%d_%d.%s"
+	    ftime
+	    (emacs-pid)
+	    microseconds
+	    notmuch-maildir-fcc-count
+	    hostname)))
 
 (defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
   (and (file-exists-p (concat dir "/cur/"))
@@ -328,17 +328,17 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
     ;; fix it in some way.
     (let* ((prompt (format "Fcc %s is not a maildir: \
 \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
-	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
-	 (cl-case response
-	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?c (if (file-writable-p fcc-header)
-		   (notmuch-maildir-fcc-create-maildir fcc-header)
-		 (message "No permission to create %s." fcc-header)
-		 (sit-for 2))
-	       (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?i 't)
-	   (?e (notmuch-maildir-fcc-file-fcc
-		(read-from-minibuffer "Fcc header: " fcc-header)))))))
+	   (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
+      (cl-case response
+	(?r (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?c (if (file-writable-p fcc-header)
+		(notmuch-maildir-fcc-create-maildir fcc-header)
+	      (message "No permission to create %s." fcc-header)
+	      (sit-for 2))
+	    (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?i 't)
+	(?e (notmuch-maildir-fcc-file-fcc
+	     (read-from-minibuffer "Fcc header: " fcc-header)))))))
 
 (defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
   "Writes the current buffer to maildir destdir. If mark-seen is
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 3bc06b4b..90b02e34 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -58,7 +58,7 @@ (defcustom notmuch-mua-compose-in 'current-window
 You may want to customize `message-kill-buffer-on-exit'
 accordingly."
    (when (< emacs-major-version 24)
-	   " Due to a known bug in Emacs 23, you should not set
+     " Due to a known bug in Emacs 23, you should not set
 this to `new-window' if `message-kill-buffer-on-exit' is
 disabled: this would result in an incorrect behavior."))
   :group 'notmuch-send
@@ -106,13 +106,13 @@ (defcustom notmuch-mua-reply-insert-header-p-function
 This function specifies which parts of a mime message with
 multiple parts get a header."
   :type '(radio (const :tag "No part headers"
-		               notmuch-show-reply-insert-header-p-never)
+		       notmuch-show-reply-insert-header-p-never)
 		(const :tag "All except multipart/* and hidden parts"
-		               notmuch-show-reply-insert-header-p-trimmed)
+		       notmuch-show-reply-insert-header-p-trimmed)
 		(const :tag "Only for included text parts"
-			       notmuch-show-reply-insert-header-p-minimal)
+		       notmuch-show-reply-insert-header-p-minimal)
 		(const :tag "Exactly as in show view"
-			       notmuch-show-insert-header-p)
+		       notmuch-show-insert-header-p)
 		(function :tag "Other"))
   :group 'notmuch-reply)
 
@@ -473,7 +473,7 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
 	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
 	 forward-subject  ;; Comes from the first message and is
-			  ;; applied later.
+	 ;; applied later.
 	 forward-references ;; List of accumulated message-references of forwarded messages
 	 forward-queries) ;; List of corresponding message-query
     ;; Generate the template for the outgoing message.
@@ -529,17 +529,17 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-;; In current emacs (24.3) select-active-regions is set to t by
-;; default. The reply insertion code sets the region to the quoted
-;; message to make it easy to delete (kill-region or C-w). These two
-;; things combine to put the quoted message in the primary selection.
-;;
-;; This is not what the user wanted and is a privacy risk (accidental
-;; pasting of the quoted message). We can avoid some of the problems
-;; by let-binding select-active-regions to nil. This fixes if the
-;; primary selection was previously in a non-emacs window but not if
-;; it was in an emacs window. To avoid the problem in the latter case
-;; we deactivate mark.
+  ;; In current emacs (24.3) select-active-regions is set to t by
+  ;; default. The reply insertion code sets the region to the quoted
+  ;; message to make it easy to delete (kill-region or C-w). These two
+  ;; things combine to put the quoted message in the primary selection.
+  ;;
+  ;; This is not what the user wanted and is a privacy risk (accidental
+  ;; pasting of the quoted message). We can avoid some of the problems
+  ;; by let-binding select-active-regions to nil. This fixes if the
+  ;; primary selection was previously in a non-emacs window but not if
+  ;; it was in an emacs window. To avoid the problem in the latter case
+  ;; we deactivate mark.
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 3a835a00..1db9d7ca 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -42,9 +42,9 @@ (defun notmuch-query-map-aux  (mapper function seq)
   "Private function to do the actual mapping and flattening."
   (apply 'append
 	 (mapcar
-	   (lambda (tree)
-	     (funcall mapper function tree))
-	   seq)))
+	  (lambda (tree)
+	    (funcall mapper function tree))
+	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
   "Apply FN to every thread in THREADS. Flatten results to a list.
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6e23a980..f38866b0 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -272,7 +272,7 @@ (defmacro with-current-notmuch-show-message (&rest body)
   `(save-excursion
      (let ((id (notmuch-show-get-message-id)))
        (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
-         (with-current-buffer buf
+	 (with-current-buffer buf
 	   (let ((coding-system-for-read 'no-conversion))
 	     (call-process notmuch-command nil t nil "show" "--format=raw" id))
 	   ,@body)
@@ -303,7 +303,7 @@ (defun notmuch-show-view-all-mime-parts ()
 				  ("multipart/alternative" ignore identity)
 				  ("multipart/mixed" ignore identity)
 				  ("multipart/related" ignore identity)
-				 )))
+				  )))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -406,43 +406,44 @@ (defun notmuch-clean-address (address)
 cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
 parsing fails."
   (condition-case nil
-    (let (p-name p-address)
-      ;; It would be convenient to use `mail-header-parse-address',
-      ;; but that expects un-decoded mailbox parts, whereas our
-      ;; mailbox parts are already decoded (and hence may contain
-      ;; UTF-8). Given that notmuch should handle most of the awkward
-      ;; cases, some simple string deconstruction should be sufficient
-      ;; here.
-      (cond
-       ;; "User <user@dom.ain>" style.
-       ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	(setq p-name (match-string 1 address)
-	      p-address (match-string 2 address)))
-       ;; "<user@dom.ain>" style.
-       ((string-match "<\\(.*\\)>" address)
-	(setq p-address (match-string 1 address)))
-       ;; Everything else.
-       (t
-	(setq p-address address)))
-      (when p-name
-	;; Remove elements of the mailbox part that are not relevant for
-	;; display, even if they are required during transport:
-	;;
-	;; Backslashes.
-	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-	;; Outer single and double quotes, which might be nested.
-	(cl-loop with start-of-loop
-		 do   (setq start-of-loop p-name)
-		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 until (string= start-of-loop p-name)))
-      ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
-      ;; 'foo@bar.com'.
-      (when (string= p-name p-address)
-	(setq p-name nil))
-      (cons p-address p-name))
+      (let (p-name p-address)
+	;; It would be convenient to use `mail-header-parse-address',
+	;; but that expects un-decoded mailbox parts, whereas our
+	;; mailbox parts are already decoded (and hence may contain
+	;; UTF-8). Given that notmuch should handle most of the awkward
+	;; cases, some simple string deconstruction should be sufficient
+	;; here.
+	(cond
+	 ;; "User <user@dom.ain>" style.
+	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
+	  (setq p-name (match-string 1 address)
+		p-address (match-string 2 address)))
+
+	 ;; "<user@dom.ain>" style.
+	 ((string-match "<\\(.*\\)>" address)
+	  (setq p-address (match-string 1 address)))
+	 ;; Everything else.
+	 (t
+	  (setq p-address address)))
+	(when p-name
+	  ;; Remove elements of the mailbox part that are not relevant for
+	  ;; display, even if they are required during transport:
+	  ;;
+	  ;; Backslashes.
+	  (setq p-name (replace-regexp-in-string "\\\\" "" p-name))
+	  ;; Outer single and double quotes, which might be nested.
+	  (cl-loop with start-of-loop
+		   do   (setq start-of-loop p-name)
+		   when (string-match "^\"\\(.*\\)\"$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   when (string-match "^'\\(.*\\)'$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   until (string= start-of-loop p-name)))
+	;; If the address is 'foo@bar.com <foo@bar.com>' then show just
+	;; 'foo@bar.com'.
+	(when (string= p-name p-address)
+	  (setq p-name nil))
+	(cons p-address p-name))
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
@@ -601,9 +602,9 @@ (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
   (if (boundp 'w3m-cid-retrieve-function-alist)
-    (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-      (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	    w3m-cid-retrieve-function-alist)))
+      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
+	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	      w3m-cid-retrieve-function-alist)))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -633,8 +634,8 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
     ;; should be chosen if there are more than one that match?
     (mapc (lambda (inner-part)
 	    (let* ((inner-type (plist-get inner-part :content-type))
-		  (hide (not (or notmuch-show-all-multipart/alternative-parts
-			   (string= chosen-type inner-type)))))
+		   (hide (not (or notmuch-show-all-multipart/alternative-parts
+				  (string= chosen-type inner-type)))))
 	      (notmuch-show-insert-bodypart msg inner-part depth hide)))
 	  inner-parts)
 
@@ -1002,7 +1003,7 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
     (if show-part
-        (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
+	(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
@@ -1515,9 +1516,9 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
   (setq buffer-read-only t
 	truncate-lines t)
   (setq imenu-prev-index-position-function
-        #'notmuch-show-imenu-prev-index-position-function)
+	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-show-imenu-extract-index-name-function))
+	#'notmuch-show-imenu-extract-index-name-function))
 
 (defun notmuch-tree-from-show-current-query ()
   "Call notmuch tree with the current query."
@@ -1740,8 +1741,8 @@ (defun notmuch-show-seen-current-message (start end)
 user decision and we should not override it."
   (when (and (notmuch-show-message-visible-p)
 	     (not (notmuch-show-get-prop :seen)))
-	(notmuch-show-mark-read)
-	(notmuch-show-set-prop :seen t)))
+    (notmuch-show-mark-read)
+    (notmuch-show-set-prop :seen t)))
 
 (defvar notmuch-show--seen-has-errored nil)
 (make-variable-buffer-local 'notmuch-show--seen-has-errored)
@@ -1860,9 +1861,9 @@ (defun notmuch-show-rewind ()
   (let ((start-of-message (notmuch-show-message-top))
 	(start-of-window (window-start)))
     (cond
-      ;; Either this message is properly aligned with the start of the
-      ;; window or the start of this message is not visible on the
-      ;; screen - scroll.
+     ;; Either this message is properly aligned with the start of the
+     ;; window or the start of this message is not visible on the
+     ;; screen - scroll.
      ((or (= start-of-message start-of-window)
 	  (< start-of-message start-of-window))
       (scroll-down)
@@ -2506,9 +2507,9 @@ (defmacro notmuch-show--with-currently-shown-message (&rest body)
 message."
   `(save-excursion
      (save-restriction
-      (let ((extent (notmuch-show-message-extent)))
-	(narrow-to-region (car extent) (cdr extent))
-	,@body))))
+       (let ((extent (notmuch-show-message-extent)))
+	 (narrow-to-region (car extent) (cdr extent))
+	 ,@body))))
 
 (defun notmuch-show--gather-urls ()
   "Gather any URLs in the current message."
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 85c80f54..2fcf5a9e 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -236,7 +236,7 @@ (defun notmuch-tag-format-image-data (tag data)
 (defun notmuch-tag-star-icon ()
   "Return SVG data representing a star icon.
 This can be used with `notmuch-tag-format-image-data'."
-"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
+  "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
 <svg version=\"1.1\" width=\"16\" height=\"16\">
   <g transform=\"translate(-242.81601,-315.59635)\">
     <path
@@ -536,7 +536,7 @@ (defun notmuch-tag-jump (reverse)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
-		     `(lambda () (,tag-function ',tag-change)))
+		    `(lambda () (,tag-function ',tag-change)))
 	      action-map)))
     (push (list notmuch-tag-jump-reverse-key
 		(if reverse
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index d90f2aa0..6ac0c62d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -245,7 +245,7 @@ (defun notmuch-tree-to-message-pane (func)
 which executes function FUNC in the message pane if it is
 open (if the message pane is closed it does nothing)."
   `(lambda ()
-      ,(concat "(In message pane) " (documentation func t))
+     ,(concat "(In message pane) " (documentation func t))
      (interactive)
      (when (window-live-p notmuch-tree-message-window)
        (with-selected-window notmuch-tree-message-window
@@ -273,7 +273,7 @@ (defun notmuch-tree-close-message-pane-and (func)
 which closes the message pane if open and then executes function
 FUNC."
   `(lambda ()
-      ,(concat "(Close message pane and) " (documentation func t))
+     ,(concat "(Close message pane and) " (documentation func t))
      (interactive)
      (let ((notmuch-show-process-crypto
 	    (notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
@@ -891,31 +891,31 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-      (cond
-       ((and (< 0 depth) (not last))
-	(push "├" tree-status))
-       ((and (< 0 depth) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) first last)
-	;; Choice between these two variants is a matter of taste.
-	;; (push "─" tree-status))
-	(push " " tree-status))
-       ((and (eq 0 depth) first (not last))
-	  (push "┬" tree-status))
-       ((and (eq 0 depth) (not first) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) (not first) (not last))
-	(push "├" tree-status)))
-      (push (concat (if replies "┬" "─") "►") tree-status)
-      (setq msg (plist-put msg :first (and first (eq 0 depth))))
-      (setq msg (plist-put msg :tree-status tree-status))
-      (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
-      (notmuch-tree-goto-and-insert-msg msg)
-      (pop tree-status)
-      (pop tree-status)
-      (if last
-	  (push " " tree-status)
-	(push "│" tree-status))
+    (cond
+     ((and (< 0 depth) (not last))
+      (push "├" tree-status))
+     ((and (< 0 depth) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) first last)
+      ;; Choice between these two variants is a matter of taste.
+      ;; (push "─" tree-status))
+      (push " " tree-status))
+     ((and (eq 0 depth) first (not last))
+      (push "┬" tree-status))
+     ((and (eq 0 depth) (not first) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) (not first) (not last))
+      (push "├" tree-status)))
+    (push (concat (if replies "┬" "─") "►") tree-status)
+    (setq msg (plist-put msg :first (and first (eq 0 depth))))
+    (setq msg (plist-put msg :tree-status tree-status))
+    (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
+    (notmuch-tree-goto-and-insert-msg msg)
+    (pop tree-status)
+    (pop tree-status)
+    (if last
+	(push " " tree-status)
+      (push "│" tree-status))
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -966,34 +966,34 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(exit-status (process-exit-status proc))
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
-        (kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (tree view process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.")
-		    (unless (= exit-status 0)
-		      (insert (format " (process returned %d)" exit-status)))
-		    (insert "\n")))))))))
+      (kill-buffer (process-get proc 'parse-buf))
+      (if (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(if (eq status 'signal)
+		    (insert "Incomplete search results (tree view process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.")
+		  (unless (= exit-status 0)
+		    (insert (format " (process returned %d)" exit-status)))
+		  (insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
   (let ((results-buf (process-buffer proc))
-        (parse-buf (process-get proc 'parse-buf))
-        (inhibit-read-only t)
-        done)
+	(parse-buf (process-get proc 'parse-buf))
+	(inhibit-read-only t)
+	done)
     (if (not (buffer-live-p results-buf))
-        (delete-process proc)
+	(delete-process proc)
       (with-current-buffer parse-buf
-        ;; Insert new data
-        (save-excursion
-          (goto-char (point-max))
-          (insert string))
+	;; Insert new data
+	(save-excursion
+	  (goto-char (point-max))
+	  (insert string))
 	(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
 					 results-buf)))))
 
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-		       (if query-context (concat " and (" query-context ")"))
-		       ))
+			      (if query-context (concat " and (" query-context ")"))
+			      ))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index c3b24cb9..00ac45b6 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -373,7 +373,7 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
   (when (string-match
 	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
 	 subject)
-      (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 04334c76..2e84cd34 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -117,23 +117,23 @@ (defvar notmuch-query-history nil
 
 (defun notmuch-foreach-mime-part (function mm-handle)
   (cond ((stringp (car mm-handle))
-         (dolist (part (cdr mm-handle))
-           (notmuch-foreach-mime-part function part)))
-        ((bufferp (car mm-handle))
-         (funcall function mm-handle))
-        (t (dolist (part mm-handle)
-             (notmuch-foreach-mime-part function part)))))
+	 (dolist (part (cdr mm-handle))
+	   (notmuch-foreach-mime-part function part)))
+	((bufferp (car mm-handle))
+	 (funcall function mm-handle))
+	(t (dolist (part mm-handle)
+	     (notmuch-foreach-mime-part function part)))))
 
 (defun notmuch-count-attachments (mm-handle)
   (let ((count 0))
     (notmuch-foreach-mime-part
      (lambda (p)
        (let ((disposition (mm-handle-disposition p)))
-         (and (listp disposition)
-              (or (equal (car disposition) "attachment")
-                  (and (equal (car disposition) "inline")
-                       (assq 'filename disposition)))
-              (cl-incf count))))
+	 (and (listp disposition)
+	      (or (equal (car disposition) "attachment")
+		  (and (equal (car disposition) "inline")
+		       (assq 'filename disposition)))
+	      (cl-incf count))))
      mm-handle)
     count))
 
@@ -142,13 +142,13 @@ (defun notmuch-save-attachments (mm-handle &optional queryp)
    (lambda (p)
      (let ((disposition (mm-handle-disposition p)))
        (and (listp disposition)
-            (or (equal (car disposition) "attachment")
-                (and (equal (car disposition) "inline")
-                     (assq 'filename disposition)))
-            (or (not queryp)
-                (y-or-n-p
-                 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
-            (mm-save-part p))))
+	    (or (equal (car disposition) "attachment")
+		(and (equal (car disposition) "inline")
+		     (assq 'filename disposition)))
+	    (or (not queryp)
+		(y-or-n-p
+		 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
+	    (mm-save-part p))))
    mm-handle))
 
 (require 'hl-line)
@@ -272,11 +272,11 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
- '((((class color) (background light)) (:background "#f0f0f0"))
-   (((class color) (background dark)) (:background "#303030")))
- "Face for the single-line message summary in notmuch-show-mode."
- :group 'notmuch-show
- :group 'notmuch-faces)
+  '((((class color) (background light)) (:background "#f0f0f0"))
+    (((class color) (background dark)) (:background "#303030")))
+  "Face for the single-line message summary in notmuch-show-mode."
+  :group 'notmuch-show
+  :group 'notmuch-faces)
 
 (defface notmuch-search-date
   '((t :inherit default))
@@ -392,9 +392,9 @@ (define-derived-mode notmuch-search-mode fundamental-mode "notmuch-search"
   (setq truncate-lines t)
   (setq buffer-read-only t)
   (setq imenu-prev-index-position-function
-        #'notmuch-search-imenu-prev-index-position-function)
+	#'notmuch-search-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-search-imenu-extract-index-name-function))
+	#'notmuch-search-imenu-extract-index-name-function))
 
 (defun notmuch-search-get-result (&optional pos)
   "Return the result object for the thread at POS (or point).
@@ -689,9 +689,9 @@ (defun notmuch-search-process-sentinel (proc msg)
 			     (not (string= notmuch-search-target-thread "found")))
 			(set 'never-found-target-thread t)))))
 	      (when (and never-found-target-thread
-		       notmuch-search-target-line)
-		  (goto-char (point-min))
-		  (forward-line (1- notmuch-search-target-line)))))))))
+			 notmuch-search-target-line)
+		(goto-char (point-min))
+		(forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -711,7 +711,7 @@ (defcustom notmuch-search-line-faces
  (the following text would be placed in your ~/.emacs file):
 
  (setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
-                                   (\"deleted\" . (:foreground \"red\"
+				   (\"deleted\" . (:foreground \"red\"
 						  :background \"blue\"))))
 
 The FACE must be a face name (a symbol or string), a property
@@ -722,7 +722,7 @@ (defcustom notmuch-search-line-faces
 background."
   :type '(alist :key-type (string)
 		:value-type (radio (face :tag "Face name")
-				    (notmuch--custom-face-edit)))
+				   (notmuch--custom-face-edit)))
   :group 'notmuch-search
   :group 'notmuch-faces)
 
@@ -919,15 +919,15 @@ (defun notmuch-read-query (prompt)
 PROMPT is the string to prompt with."
   (let*
       ((all-tags
-        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
-                (process-lines notmuch-command "search" "--output=tags" "*")))
+	(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+		(process-lines notmuch-command "search" "--output=tags" "*")))
        (completions
-	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
-		       "subject:" "attachment:")
-		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
-		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
-			 (mailcap-mime-types)))))
+	(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
+		      "subject:" "attachment:")
+		(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+		(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
+		(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			(mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el
index 8423245f..6eda0ebc 100644
--- a/test/emacs-address-cleaning.el
+++ b/test/emacs-address-cleaning.el
@@ -1,6 +1,6 @@
 (defun notmuch-test-address-cleaning-1 ()
   (notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
-			"dme@dme.org"))
+			     "dme@dme.org"))
 
 (defun notmuch-test-address-cleaning-2 ()
   (let* ((input '("foo@bar.com"
-- 
2.26.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 04/23] emacs: Closing parenthesis go on the same line
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (2 preceding siblings ...)
  2020-07-26 16:57 ` [PATCH 03/23] emacs: Fix indentation Jonas Bernoulli
@ 2020-07-26 16:57 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:57 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-lib.el  |  6 ++----
 emacs/notmuch-show.el | 19 ++++++++-----------
 emacs/notmuch-tree.el |  4 ++--
 emacs/notmuch.el      |  6 ++----
 4 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 7994d5ad..f8958a91 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -555,13 +555,11 @@ (defun notmuch-match-content-type (t1 t2)
       (string= (downcase t1) (downcase t2)))))
 
 (defvar notmuch-multipart/alternative-discouraged
-  '(
-    ;; Avoid HTML parts.
+  '(;; Avoid HTML parts.
     "text/html"
     ;; multipart/related usually contain a text/html part and some
     ;; associated graphics.
-    "multipart/related"
-    ))
+    "multipart/related"))
 
 (defun notmuch-multipart/alternative-determine-discouraged (msg)
   "Return the discouraged alternatives for the specified message."
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f38866b0..8592936f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -297,13 +297,12 @@ (defun notmuch-show-view-all-mime-parts ()
    ;;
    ;; Any MIME part not explicitly mentioned here will be handled by an
    ;; external viewer as configured in the various mailcap files.
-   (let ((mm-inline-media-tests '(
-				  ("text/.*" ignore identity)
-				  ("application/pgp-signature" ignore identity)
-				  ("multipart/alternative" ignore identity)
-				  ("multipart/mixed" ignore identity)
-				  ("multipart/related" ignore identity)
-				  )))
+   (let ((mm-inline-media-tests
+	  '(("text/.*" ignore identity)
+	    ("application/pgp-signature" ignore identity)
+	    ("multipart/alternative" ignore identity)
+	    ("multipart/mixed" ignore identity)
+	    ("multipart/related" ignore identity))))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -1785,10 +1784,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
 	(if (notmuch-show-message-visible-p)
 	    (setq message-ids
 		  (append message-ids (list (notmuch-show-get-message-id)))))
-	(setq done (not (notmuch-show-goto-message-next)))
-	)
-      message-ids
-      )))
+	(setq done (not (notmuch-show-goto-message-next))))
+      message-ids)))
 
 ;; Commands typically bound to keys.
 
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6ac0c62d..b1bb40b1 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context (concat " and (" query-context ")"))
-			      ))
+			      (if query-context
+				  (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 2e84cd34..d6e0a9d5 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -910,8 +910,7 @@ (defun notmuch-search-buffer-title (query)
 		    query)
 		   "*"))
 	  (t
-	   (concat "*notmuch-search-" query "*"))
-	  )))
+	   (concat "*notmuch-search-" query "*")))))
 
 (defun notmuch-read-query (prompt)
   "Read a notmuch-query from the minibuffer with completion.
@@ -1003,8 +1002,7 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
       (if proc
-	  (error "notmuch search process already running for query `%s'" query)
-	)
+	  (error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 05/23] emacs: Only set one variable per setq form
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (3 preceding siblings ...)
  2020-07-26 16:57 ` [PATCH 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

It's a bit weird to avoid having to write the "(setq ... )" more than
once, just because we can.  In a language that uses '=' for the same
purpose we also happily use that once per assignment.

While there are no benefit to using just one 'setq' there are some
drawbacks.  It is not always clear on first what is a key and what a
value and as a result it is easy to make a mistake.  Also it becomes
harder to comment out just one assignment.
---
 emacs/notmuch-address.el |  6 +++---
 emacs/notmuch-crypto.el  | 23 ++++++++++++-----------
 emacs/notmuch-lib.el     |  8 ++++----
 emacs/notmuch-show.el    | 26 ++++++++++++++------------
 emacs/notmuch-tree.el    |  4 ++--
 emacs/notmuch.el         | 35 ++++++++++++++++++-----------------
 6 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 09dda247..4db7096c 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -381,9 +381,9 @@ (defun notmuch-address--load-address-hash ()
 		      notmuch-address-internal-completion)
 	       (equal (plist-get load-plist :version)
 		      notmuch-address--save-hash-version))
-      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest)
-	    notmuch-address-completions (plist-get load-plist :completions)
-	    notmuch-address-full-harvest-finished t)
+      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest))
+      (setq notmuch-address-completions (plist-get load-plist :completions))
+      (setq notmuch-address-full-harvest-finished t)
       ;; Return t to say load was successful.
       t)))
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 58947a20..420b008f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -117,20 +117,21 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 	    (userid (plist-get sigstatus :userid)))
 	;; If userid is present it has full or greater validity.
 	(if userid
-	    (setq label (concat "Good signature by: " userid)
-		  face 'notmuch-crypto-signature-good)
-	  (setq label (concat "Good signature by key: " fingerprint)
-		face 'notmuch-crypto-signature-good-key))
-	(setq button-action 'notmuch-crypto-sigstatus-good-callback
-	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
+	    (progn
+	      (setq label (concat "Good signature by: " userid))
+	      (setq face 'notmuch-crypto-signature-good))
+	  (setq label (concat "Good signature by key: " fingerprint))
+	  (setq face 'notmuch-crypto-signature-good-key))
+	(setq button-action 'notmuch-crypto-sigstatus-good-callback)
+	(setq help-msg (concat "Click to list key ID 0x" fingerprint "."))))
      ((string= status "error")
-      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
-	    button-action 'notmuch-crypto-sigstatus-error-callback
-	    help-msg (concat "Click to retrieve key ID " keyid
+      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
+      (setq button-action 'notmuch-crypto-sigstatus-error-callback)
+      (setq help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
      ((string= status "bad")
-      (setq label (concat "Bad signature (claimed key ID " keyid ")")
-	    face 'notmuch-crypto-signature-bad))
+      (setq label (concat "Bad signature (claimed key ID " keyid ")"))
+      (setq face 'notmuch-crypto-signature-bad))
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index f8958a91..886da99f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -861,8 +861,8 @@ (defun notmuch-call-notmuch--helper (destination args)
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
-	(:stdin-string (setq stdin-string (cadr args)
-			     args (cddr args)))
+	(:stdin-string (setq stdin-string (cadr args))
+		       (setq args (cddr args)))
 	(otherwise
 	 (error "Unknown keyword argument: %s" (car args)))))
     (if (null stdin-string)
@@ -939,8 +939,8 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 		      :buffer buffer
 		      :command (cons command args)
 		      :connection-type 'pipe
-		      :stderr err-buffer)
-		err-proc (get-buffer-process err-buffer))
+		      :stderr err-buffer))
+	  (setq err-proc (get-buffer-process err-buffer))
 	  (process-put proc 'err-buffer err-buffer)
 
 	  (process-put err-proc 'err-file err-file)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 8592936f..a0a6c09d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -415,8 +415,8 @@ (defun notmuch-clean-address (address)
 	(cond
 	 ;; "User <user@dom.ain>" style.
 	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	  (setq p-name (match-string 1 address)
-		p-address (match-string 2 address)))
+	  (setq p-name (match-string 1 address))
+	  (setq p-address (match-string 2 address)))
 
 	 ;; "<user@dom.ain>" style.
 	 ((string-match "<\\(.*\\)>" address)
@@ -1250,14 +1250,16 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
-    (setq notmuch-show-thread-id thread-id
-	  notmuch-show-parent-buffer parent-buffer
-	  notmuch-show-query-context (if (or (string= query-context "")
-					     (string= query-context "*"))
-					 nil query-context)
-	  notmuch-show-process-crypto notmuch-crypto-process-mime
-	  ;; If `elide-toggle', invert the default value.
-	  notmuch-show-elide-non-matching-messages
+    (setq notmuch-show-thread-id thread-id)
+    (setq notmuch-show-parent-buffer parent-buffer)
+    (setq notmuch-show-query-context
+	  (if (or (string= query-context "")
+		  (string= query-context "*"))
+	      nil
+	    query-context))
+    (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
+    ;; If `elide-toggle', invert the default value.
+    (setq notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
@@ -1512,8 +1514,8 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
 
 \\{notmuch-show-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
-  (setq buffer-read-only t
-	truncate-lines t)
+  (setq buffer-read-only t)
+  (setq truncate-lines t)
   (setq imenu-prev-index-position-function
 	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b1bb40b1..827acebf 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -956,8 +956,8 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 \\{notmuch-tree-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
-  (setq buffer-read-only t
-	truncate-lines t))
+  (setq buffer-read-only t)
+  (setq truncate-lines t))
 
 (defun notmuch-tree-process-sentinel (proc msg)
   "Add a message to let user know when \"notmuch tree\" exits."
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index d6e0a9d5..6ce2b1f9 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -443,8 +443,8 @@ (defun notmuch-search-foreach-result (beg end fn)
     (while (and pos (or (< pos end) first))
       (when (notmuch-search-get-result pos)
 	(funcall fn pos))
-      (setq pos (notmuch-search-result-end pos)
-	    first nil))))
+      (setq pos (notmuch-search-result-end pos))
+      (setq first nil))))
 ;; Unindent the function argument of notmuch-search-foreach-result so
 ;; the indentation of callers doesn't get out of hand.
 (put 'notmuch-search-foreach-result 'lisp-indent-function 2)
@@ -589,8 +589,8 @@ (defun notmuch-search-tag (tag-changes &optional beg end only-matched)
 If ONLY-MATCHED is non-nil, only tag matched messages."
   (interactive (notmuch-search-interactive-tag-changes))
   (unless (and beg end)
-    (setq beg (car (notmuch-interactive-region))
-	  end (cadr (notmuch-interactive-region))))
+    (setq beg (car (notmuch-interactive-region)))
+    (setq end (cadr (notmuch-interactive-region))))
   (let ((search-string (notmuch-search-find-stable-query-region
 			beg end only-matched)))
     (notmuch-tag search-string tag-changes)
@@ -762,8 +762,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 				   (length "... "))))
 	    ;; Truncate the visible string according to the width of
 	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length)
-		  invisible-string (substring formatted-authors visible-length))
+	    (setq visible-string (substring formatted-authors 0 visible-length))
+	    (setq invisible-string (substring formatted-authors visible-length))
 	    ;; If possible, truncate the visible string at a natural
 	    ;; break (comma or pipe), as incremental search doesn't
 	    ;; match across the visible/invisible border.
@@ -771,8 +771,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; Second clause is destructive on `visible-string', so
 	      ;; order is important.
 	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string)
-		    visible-string (concat (match-string 1 visible-string)
+					     invisible-string))
+	      (setq visible-string (concat (match-string 1 visible-string)
 					   (match-string 2 visible-string))))
 	    ;; `visible-string' may be shorter than the space allowed
 	    ;; by `format-string'. If so we must insert some padding
@@ -785,17 +785,18 @@ (defun notmuch-search-insert-authors (format-string authors)
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
 	  ;; non-matching authors.
-	  (setq visible-string (notmuch-search-author-propertize visible-string)
-		;; The invisible string must contain only non-matching
-		;; authors, as the visible-string contains both.
-		invisible-string (propertize invisible-string
-					     'face 'notmuch-search-non-matching-authors))
+	  (progn
+	    (setq visible-string (notmuch-search-author-propertize visible-string))
+	    ;; The invisible string must contain only non-matching
+	    ;; authors, as the visible-string contains both.
+	    (setq invisible-string (propertize invisible-string
+					       'face 'notmuch-search-non-matching-authors)))
 	;; The visible string contains only matching authors.
 	(setq visible-string (propertize visible-string
-					 'face 'notmuch-search-matching-authors)
-	      ;; The invisible string may contain both matching and
-	      ;; non-matching authors.
-	      invisible-string (notmuch-search-author-propertize invisible-string)))
+					 'face 'notmuch-search-matching-authors))
+	;; The invisible string may contain both matching and
+	;; non-matching authors.
+	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 06/23] emacs: Use cl-incf where appropriate
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (4 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

It's shorter.  That's it pretty much.
---
 emacs/notmuch-hello.el | 2 +-
 emacs/notmuch-lib.el   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 89e03c36..1c084bf7 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -609,7 +609,7 @@ (defun notmuch-hello-insert-buttons (searches)
 			       name)
 		(setq column-indent
 		      (1+ (max 0 (- column-width (length name)))))))
-	    (setq count (1+ count))
+	    (cl-incf count)
 	    (when (eq (% count tags-per-line) 0)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 886da99f..5d0c373a 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -417,7 +417,7 @@ (defun notmuch-subkeymap-help ()
 	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
-      (setq i (1+ i)))
+      (cl-incf i))
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (5 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 21:27   ` Sean Whitton
  2020-07-26 16:58 ` [PATCH 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
                   ` (18 subsequent siblings)
  25 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

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       |  2 +-
 emacs/notmuch-lib.el         | 37 +++++++++---------
 emacs/notmuch-maildir-fcc.el |  4 +-
 emacs/notmuch-mua.el         | 13 +++----
 emacs/notmuch-show.el        | 45 +++++++++++-----------
 emacs/notmuch-tree.el        |  4 +-
 emacs/notmuch-wash.el        |  8 ++--
 emacs/notmuch.el             | 28 ++++++++------
 11 files changed, 114 insertions(+), 113 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 961db606..39a8de2b 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -107,12 +107,12 @@ (defun coolj-set-breakpoint (prefix)
 If the line should not be broken, return nil; point remains on the
 line."
   (move-to-column fill-column)
-  (if (and (re-search-forward "[^ ]" (line-end-position) 1)
-	   (> (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)))))
+  (and (re-search-forward "[^ ]" (line-end-position) 1)
+       (> (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)))))
 
 (defun coolj-find-break-backward (prefix)
   "Move point backward to the first available breakpoint and return t.
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 4db7096c..2dd08661 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -252,20 +252,20 @@ (defun notmuch-address-expand-name ()
 (defun notmuch-address-locate-command (command)
   "Return non-nil if `command' is an executable either on
 `exec-path' or an absolute pathname."
-  (when (stringp command)
-    (if (and (file-name-absolute-p command)
-	     (file-executable-p command))
-	command
-      (setq command (file-name-nondirectory command))
-      (catch 'found-command
-	(let (bin)
-	  (dolist (dir exec-path)
-	    (setq bin (expand-file-name command dir))
-	    (when (or (and (file-executable-p bin)
-			   (not (file-directory-p bin)))
-		      (and (file-executable-p (setq bin (concat bin ".exe")))
-			   (not (file-directory-p bin))))
-	      (throw 'found-command bin))))))))
+  (and (stringp command)
+       (if (and (file-name-absolute-p command)
+		(file-executable-p command))
+	   command
+	 (setq command (file-name-nondirectory command))
+	 (catch 'found-command
+	   (let (bin)
+	     (dolist (dir exec-path)
+	       (setq bin (expand-file-name command dir))
+	       (when (or (and (file-executable-p bin)
+			      (not (file-directory-p bin)))
+			 (and (file-executable-p (setq bin (concat bin ".exe")))
+			      (not (file-directory-p bin))))
+		 (throw 'found-command bin))))))))
 
 (defun notmuch-address-harvest-addr (result)
   (let ((name-addr (plist-get result :name-addr)))
@@ -304,18 +304,20 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 execution, CALLBACK is called when harvesting finishes."
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
-	 (prefix-query (when addr-prefix
-			 (format "%s:%s*" (if sent "to" "from") addr-prefix)))
+	 (prefix-query (and addr-prefix
+			    (format "%s:%s*"
+				    (if sent "to" "from")
+				    addr-prefix)))
 	 (from-or-to-me-query
 	  (mapconcat (lambda (x)
 		       (concat (if sent "from:" "to:") x))
 		     (notmuch-user-emails) " or "))
 	 (query (if (or prefix-query config-query)
 		    (concat (format "(%s)" from-or-to-me-query)
-			    (when prefix-query
-			      (format " and (%s)" prefix-query))
-			    (when config-query
-			      (format " and (%s)" config-query)))
+			    (and prefix-query
+				 (format " and (%s)" prefix-query))
+			    (and config-query
+				 (format " and (%s)" config-query)))
 		  from-or-to-me-query))
 	 (args `("address" "--format=sexp" "--format-version=4"
 		 ,(if sent "--output=recipients" "--output=sender")
@@ -354,21 +356,21 @@ (defun notmuch-address--get-address-hash ()
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
-  (when notmuch-address-save-filename
-    (condition-case nil
-	(with-temp-buffer
-	  (insert-file-contents notmuch-address-save-filename)
-	  (let ((name (read (current-buffer)))
-		(plist (read (current-buffer))))
-	    ;; We do two simple sanity checks on the loaded file. We just
-	    ;; check a version is specified, not that it is the current
-	    ;; version, as we are allowed to over-write and a save-file with
-	    ;; an older version.
-	    (when (and (string= name "notmuch-address-hash")
-		       (plist-get plist :version))
-	      plist)))
-      ;; The error case catches any of the reads failing.
-      (error nil))))
+  (and notmuch-address-save-filename
+       (condition-case nil
+	   (with-temp-buffer
+	     (insert-file-contents notmuch-address-save-filename)
+	     (let ((name (read (current-buffer)))
+		   (plist (read (current-buffer))))
+	       ;; We do two simple sanity checks on the loaded file.
+	       ;; We just check a version is specified, not that
+	       ;; it is the current version, as we are allowed to
+	       ;; over-write and a save-file with an older version.
+	       (and (string= name "notmuch-address-hash")
+		    (plist-get plist :version)
+		    plist)))
+	 ;; The error case catches any of the reads failing.
+	 (error nil))))
 
 (defun notmuch-address--load-address-hash ()
   "Read the saved address hash and set the corresponding variables."
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 420b008f..e6bf8339 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -253,7 +253,7 @@ (defun notmuch-crypto-insert-encstatus-button (encstatus)
 	       "Decryption error")
 	      (t
 	       (concat "Unknown encryption status"
-		       (if status (concat ": " status))))))
+		       (and status (concat ": " status))))))
 	   " ]")
    :type 'notmuch-crypto-status-button-type
    'face 'notmuch-crypto-decryption
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index ea995379..759e6c9e 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -263,7 +263,7 @@ (defun notmuch-draft-resume (id)
       ;; If the resumed message was a draft then set the draft
       ;; message-id so that we can delete the current saved draft if the
       ;; message is resaved or sent.
-      (setq notmuch-draft-id (when draft id)))))
+      (setq notmuch-draft-id (and draft id)))))
 
 
 (add-hook 'message-send-hook 'notmuch-draft--mark-deleted)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 5d0c373a..9b02cd66 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -608,7 +608,7 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 		       (set-buffer-multibyte nil))
 		     (let ((args `("show" "--format=raw"
 				   ,(format "--part=%s" (plist-get part :id))
-				   ,@(when process-crypto '("--decrypt=true"))
+				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
@@ -781,8 +781,8 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s" (concat msg (when extra
-			    " (see *Notmuch errors* for more details)"))))
+  (error "%s"
+	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
@@ -836,10 +836,8 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		    (if (integerp exit-status)
 			(format "exit status: %s\n" exit-status)
 		      (format "exit signal: %s\n" exit-status))
-		    (when err
-		      (concat "stderr:\n" err))
-		    (when output
-		      (concat "stdout:\n" output)))))
+		    (and err    (concat "stderr:\n" err))
+		    (and output (concat "stdout:\n" output)))))
       (if err
 	  ;; We have an error message straight from the CLI.
 	  (notmuch-logged-error
@@ -968,8 +966,8 @@ (defun notmuch-start-notmuch-sentinel (proc event)
   (let* ((err-file (process-get proc 'err-file))
 	 (err-buffer (or (process-get proc 'err-buffer)
 			 (find-file-noselect err-file)))
-	 (err (when (not (zerop (buffer-size err-buffer)))
-		(with-current-buffer err-buffer (buffer-string))))
+	 (err (and (not (zerop (buffer-size err-buffer)))
+		   (with-current-buffer err-buffer (buffer-string))))
 	 (sub-sentinel (process-get proc 'sub-sentinel))
 	 (real-command (process-get proc 'real-command)))
     (condition-case err
@@ -987,16 +985,17 @@ (defun notmuch-start-notmuch-sentinel (proc event)
 	  ;; If that didn't signal an error, then any error output was
 	  ;; really warning output.  Show warnings, if any.
 	  (let ((warnings
-		 (when err
-		   (with-current-buffer err-buffer
-		     (goto-char (point-min))
-		     (end-of-line)
-		     ;; Show first line; stuff remaining lines in the
-		     ;; errors buffer.
-		     (let ((l1 (buffer-substring (point-min) (point))))
-		       (skip-chars-forward "\n")
-		       (cons l1 (unless (eobp)
-				  (buffer-substring (point) (point-max)))))))))
+		 (and err
+		      (with-current-buffer err-buffer
+			(goto-char (point-min))
+			(end-of-line)
+			;; Show first line; stuff remaining lines in the
+			;; errors buffer.
+			(let ((l1 (buffer-substring (point-min) (point))))
+			  (skip-chars-forward "\n")
+			  (cons l1 (and (not (eobp))
+					(buffer-substring (point)
+							  (point-max)))))))))
 	    (when warnings
 	      (notmuch-logged-error (car warnings) (cdr warnings)))))
       (error
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 7d001b2d..1027e1a7 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -215,7 +215,7 @@ (defun notmuch-maildir-notmuch-insert-current-buffer (folder &optional create ta
 database in folder FOLDER. If CREATE is non-nil it will supply
 the --create-folder flag to create the folder if necessary. TAGS
 should be a list of tag changes to apply to the inserted message."
-  (let* ((args (append (when create (list "--create-folder"))
+  (let* ((args (append (and create (list "--create-folder"))
 		       (list (concat "--folder=" folder))
 		       tags)))
     (apply 'notmuch-call-notmuch-process
@@ -315,7 +315,7 @@ (defun notmuch-maildir-fcc-move-tmp-to-new (destdir msg-id)
 (defun notmuch-maildir-fcc-move-tmp-to-cur (destdir msg-id &optional mark-seen)
   (add-name-to-file
    (concat destdir "/tmp/" msg-id)
-   (concat destdir "/cur/" msg-id ":2," (when mark-seen "S"))))
+   (concat destdir "/cur/" msg-id ":2," (and mark-seen "S"))))
 
 (defun notmuch-maildir-fcc-file-fcc (fcc-header)
   "Write the message to the file specified by FCC-HEADER.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 90b02e34..3fe513ab 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -460,8 +460,8 @@ (defun notmuch-mua-new-mail (&optional prompt-for-sender)
 the From: address first."
   (interactive "P")
   (let ((other-headers
-	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	   (list (cons 'From (notmuch-mua-prompt-for-sender))))))
+	 (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	      (list (cons 'From (notmuch-mua-prompt-for-sender))))))
     (notmuch-mua-mail nil nil other-headers nil (notmuch-mua-get-switch-function))))
 
 (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
@@ -470,8 +470,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 If PROMPT-FOR-SENDER is non-nil, the user will be prompteed for
 the From: address."
   (let* ((other-headers
-	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
+	  (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	       (list (cons 'From (notmuch-mua-prompt-for-sender)))))
 	 forward-subject  ;; Comes from the first message and is
 	 ;; applied later.
 	 forward-references ;; List of accumulated message-references of forwarded messages
@@ -540,9 +540,8 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
   ;; primary selection was previously in a non-emacs window but not if
   ;; it was in an emacs window. To avoid the problem in the latter case
   ;; we deactivate mark.
-  (let ((sender
-	 (when prompt-for-sender
-	   (notmuch-mua-prompt-for-sender)))
+  (let ((sender (and prompt-for-sender
+		     (notmuch-mua-prompt-for-sender)))
 	(select-active-regions nil))
     (notmuch-mua-reply query-string sender reply-all)
     (deactivate-mark)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a0a6c09d..211be091 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -500,10 +500,10 @@ (define-button-type 'notmuch-show-part-button-type
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
   (let ((button)
-	(base-label (concat (when name (concat name ": "))
+	(base-label (concat (and name (concat name ": "))
 			    declared-type
-			    (unless (string-equal declared-type content-type)
-			      (concat " (as " content-type ")"))
+			    (and (not (string-equal declared-type content-type))
+				 (concat " (as " content-type ")"))
 			    comment)))
     (setq button
 	  (insert-button
@@ -781,18 +781,15 @@ (if (version< emacs-version "25.3")
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
   ;; we return that.
-  (if (plist-get part :filename)
-      (let ((extension (file-name-extension (plist-get part :filename)))
-	    mime-type)
-	(if extension
-	    (progn
-	      (mailcap-parse-mimetypes)
-	      (setq mime-type (mailcap-extension-to-mime extension))
-	      (if (and mime-type
-		       (not (string-equal mime-type "application/octet-stream")))
-		  mime-type
-		nil))
-	  nil))))
+  (and (plist-get part :filename)
+       (let ((extension (file-name-extension (plist-get part :filename))))
+	 (and extension
+	      (progn
+		(mailcap-parse-mimetypes)
+		(let ((mime-type (mailcap-extension-to-mime extension)))
+		  (and mime-type
+		       (not (string-equal mime-type "application/octet-stream"))
+		       mime-type)))))))
 
 (defun notmuch-show-insert-part-text/html (msg part content-type nth depth button)
   (if (eq mm-text-html-renderer 'shr)
@@ -991,9 +988,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
-	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type
-						    (plist-get part :filename))))
+	 (button (and (funcall notmuch-show-insert-header-p-function part hide)
+		      (notmuch-show-insert-part-header
+		       nth mime-type content-type
+		       (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1048,9 +1046,8 @@ (defun notmuch-show-insert-msg (msg depth)
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
     (setq message-start (point-marker))
     (notmuch-show-insert-headerline headers
-				    (or (if notmuch-show-relative-dates
-					    (plist-get msg :date_relative)
-					  nil)
+				    (or (and notmuch-show-relative-dates
+					     (plist-get msg :date_relative))
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
     (setq content-start (point-marker))
@@ -1297,8 +1294,8 @@ (defun notmuch-show--build-buffer (&optional state)
 
 If no messages match the query return NIL."
   (let* ((cli-args (cons "--exclude=false"
-			 (when notmuch-show-elide-non-matching-messages
-			   (list "--entire-thread=false"))))
+			 (and notmuch-show-elide-non-matching-messages
+			      (list "--entire-thread=false"))))
 	 (queries (notmuch-show--build-queries
 		   notmuch-show-thread-id notmuch-show-query-context))
 	 (forest nil)
@@ -2406,7 +2403,7 @@ (defun notmuch-show-current-part-handle (&optional mime-type)
 	 (buf (notmuch-show-generate-part-buffer msg part))
 	 (computed-type (or mime-type (plist-get part :computed-type)))
 	 (filename (plist-get part :filename))
-	 (disposition (if filename `(attachment (filename . ,filename)))))
+	 (disposition (and filename `(attachment (filename . ,filename)))))
     (mm-make-handle buf (list computed-type) nil nil disposition)))
 
 (defun notmuch-show-apply-to-current-part-handle (fn &optional mime-type)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 827acebf..37a5d1c8 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context
-				  (concat " and (" query-context ")"))))
+			      (and query-context
+				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 00ac45b6..31fda61f 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -370,10 +370,10 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
 
 Return the patch sequence number N from the last \"[PATCH N/M]\"
 style prefix in SUBJECT, or nil if such a prefix can't be found."
-  (when (string-match
-	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
-	 subject)
-    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+  (and (string-match
+	"^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
+	subject)
+       (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6ce2b1f9..41207643 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -264,7 +264,8 @@ (defun notmuch-search-last-thread ()
   (goto-char (point-max))
   (forward-line -2)
   (let ((beg (notmuch-search-result-beginning)))
-    (when beg (goto-char beg))))
+    (when beg
+      (goto-char beg))))
 
 (defun notmuch-search-first-thread ()
   "Select the first thread in the search results."
@@ -406,11 +407,12 @@ (defun notmuch-search-result-beginning (&optional pos)
   "Return the point at the beginning of the thread at POS (or point).
 
 If there is no thread at POS (or point), returns nil."
-  (when (notmuch-search-get-result pos)
-    ;; We pass 1+point because previous-single-property-change starts
-    ;; searching one before the position we give it.
-    (previous-single-property-change (1+ (or pos (point)))
-				     'notmuch-search-result nil (point-min))))
+  (and (notmuch-search-get-result pos)
+       ;; We pass 1+point because previous-single-property-change starts
+       ;; searching one before the position we give it.
+       (previous-single-property-change (1+ (or pos (point)))
+					'notmuch-search-result nil
+					(point-min))))
 
 (defun notmuch-search-result-end (&optional pos)
   "Return the point at the end of the thread at POS (or point).
@@ -418,9 +420,10 @@ (defun notmuch-search-result-end (&optional pos)
 The returned point will be just after the newline character that
 ends the result line.  If there is no thread at POS (or point),
 returns nil."
-  (when (notmuch-search-get-result pos)
-    (next-single-property-change (or pos (point)) 'notmuch-search-result
-				 nil (point-max))))
+  (and (notmuch-search-get-result pos)
+       (next-single-property-change (or pos (point))
+				    'notmuch-search-result nil
+				    (point-max))))
 
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
@@ -461,7 +464,8 @@ (defun notmuch-search-find-thread-id (&optional bare)
 
 If BARE is set then do not prefix with \"thread:\"."
   (let ((thread (plist-get (notmuch-search-get-result) :thread)))
-    (when thread (concat (unless bare "thread:") thread))))
+    (when thread
+      (concat (and (not bare) "thread:") thread))))
 
 (defun notmuch-search-find-stable-query ()
   "Return the stable queries for the current thread.
@@ -482,8 +486,8 @@ (defun notmuch-search-find-stable-query-region (beg end &optional only-matched)
 	(push (car queries) query-list))
       (when (and all (cadr queries))
 	(push (cadr queries) query-list)))
-    (when query-list
-      (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
+    (and query-list
+	 (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
 
 (defun notmuch-search-find-authors ()
   "Return the authors for the current thread."
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 08/23] emacs: Use 'unless' instead of 'when' and 'not'
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (6 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

Also use 'unless' in a few cases where previously 'if' was used with
'not' but without an ELSE part.
---
 emacs/notmuch-hello.el  | 6 +++---
 emacs/notmuch-mua.el    | 4 ++--
 emacs/notmuch-parser.el | 2 +-
 emacs/notmuch-show.el   | 3 +--
 emacs/notmuch-tag.el    | 4 ++--
 emacs/notmuch-tree.el   | 8 ++++----
 emacs/notmuch.el        | 4 ++--
 test/test-lib.el        | 6 +++---
 8 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 1c084bf7..25e28a52 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -638,7 +638,7 @@ (defun notmuch-hello-window-configuration-change ()
     (dolist (window (window-list))
       (let ((last-buf (window-parameter window 'notmuch-hello-last-buffer))
 	    (cur-buf (window-buffer window)))
-	(when (not (eq last-buf cur-buf))
+	(unless (eq last-buf cur-buf)
 	  ;; This window changed or is new.  Update recorded buffer
 	  ;; for next time.
 	  (set-window-parameter window 'notmuch-hello-last-buffer cur-buf)
@@ -652,7 +652,7 @@ (defun notmuch-hello-window-configuration-change ()
       ;; 24, we can't do it right here because something in this
       ;; hook's call stack overrides hello's point placement.
       (run-at-time nil nil #'notmuch-hello t))
-    (when (null hello-buf)
+    (unless hello-buf
       ;; Clean up hook
       (remove-hook 'window-configuration-change-hook
 		   #'notmuch-hello-window-configuration-change))))
@@ -908,7 +908,7 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
 				(notmuch-hello-update))
 		     "hide"))
     (widget-insert "\n")
-    (when (not is-hidden)
+    (unless is-hidden
       (let ((searches (apply 'notmuch-hello-query-counts query-list options)))
 	(when (or (not (plist-get options :hide-if-empty))
 		  searches)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 3fe513ab..6e7f1569 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -198,7 +198,7 @@ (defun notmuch-mua-user-agent-emacs ()
 (defun notmuch-mua-add-more-hidden-headers ()
   "Add some headers to the list that are hidden by default."
   (mapc (lambda (header)
-	  (when (not (member header message-hidden-headers))
+	  (unless (member header message-hidden-headers)
 	    (push header message-hidden-headers)))
 	notmuch-mua-hidden-headers))
 
@@ -368,7 +368,7 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (interactive)
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
-      (when (not (string= "" user-agent))
+      (unless (string= "" user-agent)
 	(push (cons 'User-Agent user-agent) other-headers))))
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index 06e7487b..fbcfc2ef 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -78,7 +78,7 @@ (defun notmuch-sexp-read (sp)
 	 ;; parse, extend the partial parse to figure out when we
 	 ;; have a complete list.
 	 (catch 'return
-	   (when (null (notmuch-sexp--partial-state sp))
+	   (unless (notmuch-sexp--partial-state sp)
 	     (let ((start (point)))
 	       (condition-case nil
 		   (throw 'return (read (current-buffer)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 211be091..6102ca2e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1060,8 +1060,7 @@ (defun notmuch-show-insert-msg (msg depth)
       ;; If the subject of this message is the same as that of the
       ;; previous message, don't display it when this message is
       ;; collapsed.
-      (when (not (string= notmuch-show-previous-subject
-			  bare-subject))
+      (unless (string= notmuch-show-previous-subject bare-subject)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 2fcf5a9e..1067f185 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -382,8 +382,8 @@ (defun notmuch-tag-completions (&rest search-terms)
   "Return a list of tags for messages matching SEARCH-TERMS.
 
 Returns all tags if no search terms are given."
-  (if (null search-terms)
-      (setq search-terms (list "*")))
+  (unless search-terms
+    (setq search-terms (list "*")))
   (split-string
    (with-output-to-string
      (with-current-buffer standard-output
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 37a5d1c8..a5ae0edb 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1063,10 +1063,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
   OPEN-TARGET: If TRUE open the target message in the message pane.
   UNTHREADED: If TRUE only show matching messages in an unthreaded view."
   (interactive)
-  (if (null query)
-      (setq query (notmuch-read-query (concat "Notmuch "
-					      (if unthreaded "unthreaded " "tree ")
-					      "view search: "))))
+  (unless query
+    (setq query (notmuch-read-query (concat "Notmuch "
+					    (if unthreaded "unthreaded " "tree ")
+					    "view search: "))))
   (let ((buffer (get-buffer-create (generate-new-buffer-name
 				    (or buffer-name
 					(concat "*notmuch-"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 41207643..93e92b39 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -803,13 +803,13 @@ (defun notmuch-search-insert-authors (format-string authors)
 	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(let ((start (point))
 	      overlay)
 	  (insert invisible-string)
diff --git a/test/test-lib.el b/test/test-lib.el
index 579a20d5..8947fbef 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -81,7 +81,7 @@ (defun visible-buffer-substring (start end)
   (let (str)
     (while (< start end)
       (let ((next-pos (next-char-property-change start end)))
-	(when (not (invisible-p start))
+	(unless (invisible-p start)
 	  (setq str (concat str (buffer-substring-no-properties
 				 start next-pos))))
 	(setq start next-pos)))
@@ -97,8 +97,8 @@ (defun test-process-running (pid)
 (defun orphan-watchdog-check (pid)
   "Periodically check that the process with id PID is still
 running, quit if it terminated."
-  (if (not (test-process-running pid))
-      (kill-emacs)))
+  (unless (test-process-running pid)
+    (kill-emacs)))
 
 (defun orphan-watchdog (pid)
   "Initiate orphan watchdog check."
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (7 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

---
 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 +-
 emacs/notmuch-show.el    |  93 ++++++++++++++++++------------------
 emacs/notmuch-tree.el    |  30 ++++++------
 emacs/notmuch-wash.el    |  68 +++++++++++++-------------
 emacs/notmuch.el         | 100 +++++++++++++++++++--------------------
 test/test-lib.el         |   8 ++--
 12 files changed, 208 insertions(+), 205 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2dd08661..85531489 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -171,10 +171,10 @@ (defun notmuch-address-toggle-internal-completion ()
   (if (local-variable-p 'notmuch-address-command)
       (kill-local-variable 'notmuch-address-command)
     (notmuch-setq-local notmuch-address-command 'internal))
-  (if (boundp 'company-idle-delay)
-      (if (local-variable-p 'company-idle-delay)
-	  (kill-local-variable 'company-idle-delay)
-	(notmuch-setq-local company-idle-delay nil))))
+  (when (boundp 'company-idle-delay)
+    (if (local-variable-p 'company-idle-delay)
+	(kill-local-variable 'company-idle-delay)
+      (notmuch-setq-local company-idle-delay nil))))
 
 (defun notmuch-address-matching (substring)
   "Returns a list of completion candidates matching SUBSTRING.
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 388ef70f..3340918f 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -68,9 +68,9 @@ (if (fboundp 'read-char-choice)
 		   ;; This is an inlined copy of help-form-show as that
 		   ;; was introduced in emacs 24 too.
 		   (let ((msg (eval help-form)))
-		     (if (stringp msg)
-			 (with-output-to-temp-buffer " *Char Help*"
-			   (princ msg))))))
+		     (when (stringp msg)
+		       (with-output-to-temp-buffer " *Char Help*"
+			 (princ msg))))))
 	     ((memq char chars)
 	      (setq done t))
 	     ((and executing-kbd-macro (= char -1))
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 25e28a52..3127de86 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -589,8 +589,8 @@ (defun notmuch-hello-insert-buttons (searches)
     (mapc (lambda (elem)
 	    ;; (not elem) indicates an empty slot in the matrix.
 	    (when elem
-	      (if (> column-indent 0)
-		  (widget-insert (make-string column-indent ? )))
+	      (when (> column-indent 0)
+		(widget-insert (make-string column-indent ? )))
 	      (let* ((name (plist-get elem :name))
 		     (query (plist-get elem :query))
 		     (oldest-first (cl-case (plist-get elem :sort-order)
@@ -890,8 +890,8 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
    the same values as :filter. If :filter and :filter-count are specified, this
    will be used instead of :filter, not in conjunction with it."
   (widget-insert title ": ")
-  (if (and notmuch-hello-first-run (plist-get options :initially-hidden))
-      (add-to-list 'notmuch-hello-hidden-sections title))
+  (when (and notmuch-hello-first-run (plist-get options :initially-hidden))
+    (add-to-list 'notmuch-hello-hidden-sections title))
   (let ((is-hidden (member title notmuch-hello-hidden-sections))
 	(start (point)))
     (if is-hidden
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index adf79650..e302fe00 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -169,37 +169,37 @@ (defun notmuch-jump--make-keymap (action-map prompt)
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map notmuch-jump-minibuffer-map)
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (= (length key) 1)
-	  (define-key map key
-	    `(lambda () (interactive)
-	       (setq notmuch-jump--action ',fn)
-	       (exit-minibuffer)))))
+      (when (= (length key) 1)
+	(define-key map key
+	  `(lambda () (interactive)
+	     (setq notmuch-jump--action ',fn)
+	     (exit-minibuffer)))))
     ;; By doing this in two passes (and checking if we already have a
     ;; binding) we avoid problems if the user specifies a binding which
     ;; is a prefix of another binding.
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (> (length key) 1)
-	  (let* ((key (elt key 0))
-		 (keystr (string key))
-		 (new-prompt (concat prompt (format-kbd-macro keystr) " "))
-		 (action-submap nil))
-	    (unless (lookup-key map keystr)
-	      (pcase-dolist (`(,k ,n ,f) action-map)
-		(when (= key (elt k 0))
-		  (push (list (substring k 1) n f) action-submap)))
-	      ;; We deal with backspace specially
-	      (push (list (kbd "DEL")
-			  "Backup"
-			  (apply-partially #'notmuch-jump action-map prompt))
-		    action-submap)
-	      (setq action-submap (nreverse action-submap))
-	      (define-key map keystr
-		`(lambda () (interactive)
-		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump
-					    action-submap
-					    new-prompt))
-		   (exit-minibuffer)))))))
+      (when (> (length key) 1)
+	(let* ((key (elt key 0))
+	       (keystr (string key))
+	       (new-prompt (concat prompt (format-kbd-macro keystr) " "))
+	       (action-submap nil))
+	  (unless (lookup-key map keystr)
+	    (pcase-dolist (`(,k ,n ,f) action-map)
+	      (when (= key (elt k 0))
+		(push (list (substring k 1) n f) action-submap)))
+	    ;; We deal with backspace specially
+	    (push (list (kbd "DEL")
+			"Backup"
+			(apply-partially #'notmuch-jump action-map prompt))
+		  action-submap)
+	    (setq action-submap (nreverse action-submap))
+	    (define-key map keystr
+	      `(lambda () (interactive)
+		 (setq notmuch-jump--action
+		       ',(apply-partially #'notmuch-jump
+					  action-submap
+					  new-prompt))
+		 (exit-minibuffer)))))))
     map))
 
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9b02cd66..6110e45d 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -664,11 +664,11 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
 ;; is loaded.
-(if (>= emacs-major-version 24)
-    (defadvice mm-shr (before load-gnus-arts activate)
-      (require 'gnus-art nil t)
-      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
-      (ad-activate 'mm-shr)))
+(when (>= emacs-major-version 24)
+  (defadvice mm-shr (before load-gnus-arts activate)
+    (require 'gnus-art nil t)
+    (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
+    (ad-activate 'mm-shr)))
 
 (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
   "Use the mm-decode/mm-view functions to display a part in the
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 6e7f1569..af9afe41 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -275,8 +275,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(narrow-to-region (point) (point-max))
 	(goto-char (point-max))
 	(if (re-search-backward message-signature-separator nil t)
-	    (if message-signature-insert-empty-line
-		(forward-line -1))
+	    (when message-signature-insert-empty-line
+	      (forward-line -1))
 	  (goto-char (point-max))))
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
@@ -388,7 +388,8 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 	  ;; https://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
 	  ;; We need to convert any string input, eg from rmail-start-mail.
 	  (dolist (h other-headers other-headers)
-	    (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))
+	    (when (stringp (car h))
+	      (setcar h (intern (capitalize (car h))))))))
 	(args (list yank-action send-actions))
 	;; Cause `message-setup-1' to do things relevant for mail,
 	;; such as observe `message-default-mail-headers'.
@@ -428,14 +429,15 @@ (defvar notmuch-mua-sender-history nil)
 ;; without some explicit initialization fill freeze the operation.
 ;; Hence, we advice `ido-completing-read' to ensure required initialization
 ;; is done.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 4))
-    (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
-      (ido-init-completion-maps)
-      (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
-      (add-hook 'choose-completion-string-functions
-		'ido-choose-completion-string)
-      (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
-      (ad-activate 'ido-completing-read)))
+(when (and (= emacs-major-version 23)
+	   (< emacs-minor-version 4))
+  (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
+    (ido-init-completion-maps)
+    (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+    (add-hook 'choose-completion-string-functions
+	      'ido-choose-completion-string)
+    (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
+    (ad-activate 'ido-completing-read)))
 
 (defun notmuch-mua-prompt-for-sender ()
   "Prompt for a sender from the user's configured identities."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 1db9d7ca..a8e5d11f 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -30,8 +30,8 @@ (defun notmuch-query-get-threads (search-terms)
 list where the first element is a message, and the second element
 is a possibly empty forest of replies."
   (let ((args '("show" "--format=sexp" "--format-version=4")))
-    (if notmuch-show-process-crypto
-	(setq args (append args '("--decrypt=true"))))
+    (when notmuch-show-process-crypto
+      (setq args (append args '("--decrypt=true"))))
     (setq args (append args search-terms))
     (apply #'notmuch-call-notmuch-sexp args)))
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6102ca2e..f9418a94 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -346,10 +346,10 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (indenting notmuch-show-indent-content))
     (with-temp-buffer
       (insert all)
-      (if indenting
-	  (indent-rigidly (point-min)
-			  (point-max)
-			  (- (* notmuch-show-indent-messages-width depth))))
+      (when indenting
+	(indent-rigidly (point-min)
+			(point-max)
+			(- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -392,13 +392,13 @@ (defun notmuch-show-update-tags (tags)
   "Update the displayed tags of the current message."
   (save-excursion
     (goto-char (notmuch-show-message-top))
-    (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
-	(let ((inhibit-read-only t))
-	  (replace-match (concat "("
-				 (notmuch-tag-format-tags
-				  tags
-				  (notmuch-show-get-prop :orig-tags))
-				 ")"))))))
+    (when (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
+      (let ((inhibit-read-only t))
+	(replace-match (concat "("
+			       (notmuch-tag-format-tags
+				tags
+				(notmuch-show-get-prop :orig-tags))
+			       ")"))))))
 
 (defun notmuch-clean-address (address)
   "Try to clean a single email ADDRESS for display. Return a cons
@@ -482,9 +482,9 @@ (defun notmuch-show-insert-headers (headers)
     (mapc (lambda (header)
 	    (let* ((header-symbol (intern (concat ":" header)))
 		   (header-value (plist-get headers header-symbol)))
-	      (if (and header-value
-		       (not (string-equal "" header-value)))
-		  (notmuch-show-insert-header header header-value))))
+	      (when (and header-value
+			 (not (string-equal "" header-value)))
+		(notmuch-show-insert-header header header-value))))
 	  notmuch-message-headers)
     (save-excursion
       (save-restriction
@@ -600,10 +600,10 @@ (defun notmuch-show--get-cid-content (cid)
 (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
-  (if (boundp 'w3m-cid-retrieve-function-alist)
-      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	      w3m-cid-retrieve-function-alist)))
+  (when (and (boundp 'w3m-cid-retrieve-function-alist)
+	     (not (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)))
+    (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	  w3m-cid-retrieve-function-alist))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -761,22 +761,22 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 (defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth button)
   (notmuch-show-insert-part-text/calendar msg part content-type nth depth button))
 
-(if (version< emacs-version "25.3")
-    ;; https://bugs.gnu.org/28350
-    ;;
-    ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
-    ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched
-	(msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function
-      ;; enriched-decode-display-prop is defined before it will be
-      ;; shadowed by the letf below. Otherwise the version in
-      ;; enriched.el may be loaded a bit later and used instead (for
-      ;; the first time).
-      (require 'enriched)
-      (cl-letf (((symbol-function 'enriched-decode-display-prop)
-		 (lambda (start end &optional param) (list start end))))
-	(notmuch-show-insert-part-*/* msg part content-type nth depth button))))
+(when (version< emacs-version "25.3")
+  ;; https://bugs.gnu.org/28350
+  ;;
+  ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
+  ;; (see notmuch-show-handlers-for)
+  (defun notmuch-show-insert-part-text/enriched
+      (msg part content-type nth depth button)
+    ;; By requiring enriched below, we ensure that the function
+    ;; enriched-decode-display-prop is defined before it will be
+    ;; shadowed by the letf below. Otherwise the version in
+    ;; enriched.el may be loaded a bit later and used instead (for
+    ;; the first time).
+    (require 'enriched)
+    (cl-letf (((symbol-function 'enriched-decode-display-prop)
+	       (lambda (start end &optional param) (list start end))))
+      (notmuch-show-insert-part-*/* msg part content-type nth depth button))))
 
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
@@ -843,8 +843,8 @@ (defun notmuch-show-handlers-for (content-type)
   "Return a list of content handlers for a part of type CONTENT-TYPE."
   (let (result)
     (mapc (lambda (func)
-	    (if (functionp func)
-		(push func result)))
+	    (when (functionp func)
+	      (push func result)))
 	  ;; Reverse order of prefrence.
 	  (list (intern (concat "notmuch-show-insert-part-*/*"))
 		(intern (concat
@@ -1074,10 +1074,10 @@ (defun notmuch-show-insert-msg (msg depth)
       (insert "\n"))
     (setq content-end (point-marker))
     ;; Indent according to the depth in the thread.
-    (if notmuch-show-indent-content
-	(indent-rigidly content-start
-			content-end
-			(* notmuch-show-indent-messages-width depth)))
+    (when notmuch-show-indent-content
+      (indent-rigidly content-start
+		      content-end
+		      (* notmuch-show-indent-messages-width depth)))
     (setq message-end (point-max-marker))
     ;; Save the extents of this message over the whole text of the
     ;; message.
@@ -1282,7 +1282,8 @@ (defun notmuch-show--build-queries (thread context)
 fallback if the prior matches no messages."
   (let (queries)
     (push (list thread) queries)
-    (if context (push (list thread "and (" context ")") queries))
+    (when context
+      (push (list thread "and (" context ")") queries))
     queries))
 
 (defun notmuch-show--build-buffer (&optional state)
@@ -1779,9 +1780,9 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
     (let (message-ids done)
       (goto-char (point-min))
       (while (not done)
-	(if (notmuch-show-message-visible-p)
-	    (setq message-ids
-		  (append message-ids (list (notmuch-show-get-message-id)))))
+	(when (notmuch-show-message-visible-p)
+	  (setq message-ids
+		(append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next))))
       message-ids)))
 
@@ -1836,8 +1837,8 @@ (defun notmuch-show-advance-and-archive ()
 thread from the search from which this thread was originally
 shown."
   (interactive)
-  (if (notmuch-show-advance)
-      (notmuch-show-archive-thread-then-next)))
+  (when (notmuch-show-advance)
+    (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
   "Backup through the thread (reverse scrolling compared to \
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index a5ae0edb..6a619ec2 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -967,19 +967,19 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
       (kill-buffer (process-get proc 'parse-buf))
-      (if (buffer-live-p buffer)
-	  (with-current-buffer buffer
-	    (save-excursion
-	      (let ((inhibit-read-only t)
-		    (atbob (bobp)))
-		(goto-char (point-max))
-		(if (eq status 'signal)
-		    (insert "Incomplete search results (tree view process was killed).\n"))
-		(when (eq status 'exit)
-		  (insert "End of search results.")
-		  (unless (= exit-status 0)
-		    (insert (format " (process returned %d)" exit-status)))
-		  (insert "\n")))))))))
+      (when (buffer-live-p buffer)
+	(with-current-buffer buffer
+	  (save-excursion
+	    (let ((inhibit-read-only t)
+		  (atbob (bobp)))
+	      (goto-char (point-max))
+	      (when (eq status 'signal)
+		(insert "Incomplete search results (tree view process was killed).\n"))
+	      (when (eq status 'exit)
+		(insert "End of search results.")
+		(unless (= exit-status 0)
+		  (insert (format " (process returned %d)" exit-status)))
+		(insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
@@ -1023,8 +1023,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
 			      (and query-context
 				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
-    (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
-	(setq search-args basic-query))
+    (when (equal (car (process-lines notmuch-command "count" search-args)) "0")
+      (setq search-args basic-query))
     (notmuch-tag-clear-cache)
     (let ((proc (notmuch-start-notmuch
 		 "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 31fda61f..ce4b9637 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -216,8 +216,8 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
     (goto-char (1+ end))
     (save-excursion
       (goto-char beg)
-      (if prefix
-	  (insert-before-markers prefix))
+      (when prefix
+	(insert-before-markers prefix))
       (let ((button-beg (point)))
 	(insert-before-markers (notmuch-wash-button-label overlay) "\n")
 	(let ((button (make-button button-beg (1- (point))
@@ -229,13 +229,13 @@ (defun notmuch-wash-excerpt-citations (msg depth)
   "Excerpt citations and up to one signature."
   (goto-char (point-min))
   (beginning-of-line)
-  (if (and (< (point) (point-max))
-	   (re-search-forward notmuch-wash-original-regexp nil t))
-      (let* ((msg-start (match-beginning 0))
-	     (msg-end (point-max))
-	     (msg-lines (count-lines msg-start msg-end)))
-	(notmuch-wash-region-to-button
-	 msg msg-start msg-end "original")))
+  (when (and (< (point) (point-max))
+	     (re-search-forward notmuch-wash-original-regexp nil t))
+    (let* ((msg-start (match-beginning 0))
+	   (msg-end (point-max))
+	   (msg-lines (count-lines msg-start msg-end)))
+      (notmuch-wash-region-to-button
+       msg msg-start msg-end "original")))
   (while (and (< (point) (point-max))
 	      (re-search-forward notmuch-wash-citation-regexp nil t))
     (let* ((cite-start (match-beginning 0))
@@ -254,21 +254,21 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 	  (notmuch-wash-region-to-button
 	   msg hidden-start (point-marker)
 	   "citation")))))
-  (if (and (not (eobp))
-	   (re-search-forward notmuch-wash-signature-regexp nil t))
-      (let* ((sig-start (match-beginning 0))
-	     (sig-end (match-end 0))
-	     (sig-lines (count-lines sig-start (point-max))))
-	(if (<= sig-lines notmuch-wash-signature-lines-max)
-	    (let ((sig-start-marker (make-marker))
-		  (sig-end-marker (make-marker)))
-	      (set-marker sig-start-marker sig-start)
-	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
-			   'face 'message-cited-text)
-	      (notmuch-wash-region-to-button
-	       msg sig-start-marker sig-end-marker
-	       "signature"))))))
+  (when (and (not (eobp))
+	     (re-search-forward notmuch-wash-signature-regexp nil t))
+    (let* ((sig-start (match-beginning 0))
+	   (sig-end (match-end 0))
+	   (sig-lines (count-lines sig-start (point-max))))
+      (when (<= sig-lines notmuch-wash-signature-lines-max)
+	(let ((sig-start-marker (make-marker))
+	      (sig-end-marker (make-marker)))
+	  (set-marker sig-start-marker sig-start)
+	  (set-marker sig-end-marker (point-max))
+	  (overlay-put (make-overlay sig-start-marker sig-end-marker)
+		       'face 'message-cited-text)
+	  (notmuch-wash-region-to-button
+	   msg sig-start-marker sig-end-marker
+	   "signature"))))))
 
 ;;
 
@@ -286,12 +286,12 @@ (defun notmuch-wash-elide-blank-lines (msg depth)
     (delete-region (match-beginning 1) (match-end 1)))
   ;; Remove a leading blank line.
   (goto-char (point-min))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0)))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0)))
   ;; Remove a trailing blank line.
   (goto-char (point-max))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0))))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0))))
 
 ;;
 
@@ -399,12 +399,12 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 	  (patch-end (point-max))
 	  part)
       (goto-char patch-start)
-      (if (or
-	   ;; Patch ends with signature.
-	   (re-search-forward notmuch-wash-signature-regexp nil t)
-	   ;; Patch ends with bugtraq comment.
-	   (re-search-forward "^\\*\\*\\* " nil t))
-	  (setq patch-end (match-beginning 0)))
+      (when (or
+	     ;; Patch ends with signature.
+	     (re-search-forward notmuch-wash-signature-regexp nil t)
+	     ;; Patch ends with bugtraq comment.
+	     (re-search-forward "^\\*\\*\\* " nil t))
+	(setq patch-end (match-beginning 0)))
       (save-restriction
 	(narrow-to-region patch-start patch-end)
 	(setq part (plist-put part :content-type "inline patch"))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 93e92b39..4fc338e2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -674,28 +674,28 @@ (defun notmuch-search-process-sentinel (proc msg)
     (when (memq status '(exit signal))
       (catch 'return
 	(kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (search process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.\n")
-		    ;; For version mismatch, there's no point in
-		    ;; showing the search buffer
-		    (when (or (= exit-status 20) (= exit-status 21))
-		      (kill-buffer)
-		      (throw 'return nil))
-		    (if (and atbob
+	(when (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(when (eq status 'signal)
+		  (insert "Incomplete search results (search process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.\n")
+		  ;; For version mismatch, there's no point in
+		  ;; showing the search buffer
+		  (when (or (= exit-status 20) (= exit-status 21))
+		    (kill-buffer)
+		    (throw 'return nil))
+		  (when (and atbob
 			     (not (string= notmuch-search-target-thread "found")))
-			(set 'never-found-target-thread t)))))
-	      (when (and never-found-target-thread
-			 notmuch-search-target-line)
-		(goto-char (point-min))
-		(forward-line (1- notmuch-search-target-line)))))))))
+		    (set 'never-found-target-thread t)))))
+	    (when (and never-found-target-thread
+		       notmuch-search-target-line)
+	      (goto-char (point-min))
+	      (forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -760,31 +760,31 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (invisible-string "")
 	   (padding ""))
       ;; Truncate the author string to fit the specification.
-      (if (> (length formatted-authors)
-	     (length formatted-sample))
-	  (let ((visible-length (- (length formatted-sample)
-				   (length "... "))))
-	    ;; Truncate the visible string according to the width of
-	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length))
-	    (setq invisible-string (substring formatted-authors visible-length))
-	    ;; If possible, truncate the visible string at a natural
-	    ;; break (comma or pipe), as incremental search doesn't
-	    ;; match across the visible/invisible border.
-	    (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
-	      ;; Second clause is destructive on `visible-string', so
-	      ;; order is important.
-	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string))
-	      (setq visible-string (concat (match-string 1 visible-string)
-					   (match-string 2 visible-string))))
-	    ;; `visible-string' may be shorter than the space allowed
-	    ;; by `format-string'. If so we must insert some padding
-	    ;; after `invisible-string'.
-	    (setq padding (make-string (- (length formatted-sample)
-					  (length visible-string)
-					  (length "..."))
-				       ? ))))
+      (when (> (length formatted-authors)
+	       (length formatted-sample))
+	(let ((visible-length (- (length formatted-sample)
+				 (length "... "))))
+	  ;; Truncate the visible string according to the width of
+	  ;; the display string.
+	  (setq visible-string (substring formatted-authors 0 visible-length))
+	  (setq invisible-string (substring formatted-authors visible-length))
+	  ;; If possible, truncate the visible string at a natural
+	  ;; break (comma or pipe), as incremental search doesn't
+	  ;; match across the visible/invisible border.
+	  (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
+	    ;; Second clause is destructive on `visible-string', so
+	    ;; order is important.
+	    (setq invisible-string (concat (match-string 3 visible-string)
+					   invisible-string))
+	    (setq visible-string (concat (match-string 1 visible-string)
+					 (match-string 2 visible-string))))
+	  ;; `visible-string' may be shorter than the space allowed
+	  ;; by `format-string'. If so we must insert some padding
+	  ;; after `invisible-string'.
+	  (setq padding (make-string (- (length formatted-sample)
+					(length visible-string)
+					(length "..."))
+				     ? ))))
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -1006,8 +1006,8 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (notmuch-tag-clear-cache)
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
-      (if proc
-	  (error "notmuch search process already running for query `%s'" query))
+      (when proc
+	(error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
@@ -1156,7 +1156,7 @@ (setq mail-user-agent 'notmuch-user-agent)
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-(if init-file-user ; don't load init file if the -q option was used.
-    (load notmuch-init-file t t nil t))
+(when init-file-user ; don't load init file if the -q option was used.
+  (load notmuch-init-file t t nil t))
 
 ;;; notmuch.el ends here
diff --git a/test/test-lib.el b/test/test-lib.el
index 8947fbef..680a02ad 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -36,7 +36,7 @@ (setq read-file-name-function (lambda (&rest _) (read)))
 
 ;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents
 ;; noninteractive (kill-emacs) from emacsclient.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 3))
+(when (and (= emacs-major-version 23) (< emacs-minor-version 3))
   (defadvice kill-emacs (before disable-yes-or-no-p activate)
     "Disable yes-or-no-p before executing kill-emacs"
     (defun yes-or-no-p (prompt) t)))
@@ -46,7 +46,7 @@ (if (and (= emacs-major-version 23) (< emacs-minor-version 3))
 ;; seems to be present in Emacs 23.1.
 ;; Running `list-processes' after `accept-process-output' seems to work
 ;; around this problem.
-(if (and (= emacs-major-version 23) (= emacs-minor-version 1))
+(when (and (= emacs-major-version 23) (= emacs-minor-version 1))
   (defadvice accept-process-output (after run-list-processes activate)
     "run list-processes after executing accept-process-output"
     (list-processes)))
@@ -109,8 +109,8 @@ (defun hook-counter (hook)
 `hook'-counter variable value if it is bound, otherwise does
 nothing."
   (let ((counter (intern (concat (symbol-name hook) "-counter"))))
-    (if (boundp counter)
-	(set counter (1+ (symbol-value counter))))))
+    (when (boundp counter)
+      (set counter (1+ (symbol-value counter))))))
 
 (defun add-hook-counter (hook)
   "Add hook to count how many times `hook' is called."
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 10/23] emacs: Use one or three lines for 'if' forms
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (8 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 11/23] emacs: Extend face to window edge again Jonas Bernoulli
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

Putting the COND and THEN parts on the same line but ELSE on a
separate line makes it harder to determine if there actually is
an ELSE part.
---
 emacs/notmuch-lib.el  | 6 ++++--
 emacs/notmuch-tag.el  | 3 ++-
 emacs/notmuch-tree.el | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 6110e45d..fc76fd67 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -611,7 +611,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
-			    (if binaryp 'no-conversion
+			    (if binaryp
+				'no-conversion
 			      (let ((coding-system
 				     (mm-charset-to-coding-system
 				      (plist-get part :content-charset))))
@@ -680,7 +681,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       ;; `gnus-decoded' charset.  Otherwise, we'll fetch the binary
       ;; part content and let mm-* decode it.
       (let* ((have-content (plist-member part :content))
-	     (charset (if have-content 'gnus-decoded
+	     (charset (if have-content
+			  'gnus-decoded
 			(plist-get part :content-charset)))
 	     (handle (mm-make-handle (current-buffer)
 				     `(,content-type (charset . ,charset)))))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1067f185..e71de041 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -532,7 +532,8 @@ (defun notmuch-tag-jump (reverse)
 		       (and (symbolp name)
 			    (symbol-name name))))
 	     (name-string (if name
-			      (if reverse (concat "Reverse " name)
+			      (if reverse
+				  (concat "Reverse " name)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6a619ec2..b498db07 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1009,7 +1009,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (setq notmuch-tree-basic-query basic-query)
   (setq notmuch-tree-query-context (if (or (string= query-context "")
 					   (string= query-context "*"))
-				       nil query-context))
+				       nil
+				     query-context))
   (setq notmuch-tree-target-msg target)
   (setq notmuch-tree-open-target open-target)
   ;; Set the default value for `notmuch-show-process-crypto' in this
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 11/23] emacs: Extend face to window edge again
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (9 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 12/23] emacs: Fix some function declarations Jonas Bernoulli
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

Since Emacs 27 each face has to be explicitly configured to "extend
to the edge of the window".  Without doing that the face used for
the newline character only has an effect that spans "one character"
(i.e. it looks like there is a single trailing space character).

We don't want that so extend the face in Emacs 27, so that it looks
the same as it did in older Emacs releases.  We have to do this
conditionally, otherwise older Emacsen would choke on it.
---
 emacs/notmuch.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 4fc338e2..5562ad10 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -273,8 +273,12 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
-  '((((class color) (background light)) (:background "#f0f0f0"))
-    (((class color) (background dark)) (:background "#303030")))
+  `((((class color) (background light))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#f0f0f0"))
+    (((class color) (background dark))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#303030")))
   "Face for the single-line message summary in notmuch-show-mode."
   :group 'notmuch-show
   :group 'notmuch-faces)
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 12/23] emacs: Fix some function declarations
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (10 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 11/23] emacs: Extend face to window edge again Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

---
 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)
 
-(declare-function notmuch-search-tag "notmuch" tag-changes)
-(declare-function notmuch-show-tag "notmuch-show" tag-changes)
-(declare-function notmuch-tree-tag "notmuch-tree" tag-changes)
+(declare-function notmuch-search-tag "notmuch"
+		  (tag-changes &optional beg end only-matched))
+(declare-function notmuch-show-tag "notmuch-show" (tag-changes))
+(declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
 
 (autoload 'notmuch-jump "notmuch-jump")
 
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 13/23] emacs: No longer define notmuch-hello-mode-map as a function
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (11 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 12/23] emacs: Fix some function declarations Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

It was defined as such for a decade; ever since
a56010ac8b89a2489eee5c78469f05cee85ec858 but there
wasn't a reason to do that then nor is there now.
---
 emacs/notmuch-hello.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 3127de86..c127bba9 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -687,7 +687,6 @@ (defvar notmuch-hello-mode-map
     (define-key map (kbd "<C-tab>") 'widget-backward)
     map)
   "Keymap for \"notmuch hello\" buffers.")
-(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
   "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 14/23] emacs: notmuch-poll: Let the user know we are polling
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (12 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

It is done synchronously and it can take a while,
so we should let the user know what is going on.
---
 emacs/notmuch-lib.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index fc76fd67..069a19e9 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -259,11 +259,13 @@ (defun notmuch-poll ()
 Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
 depending on the value of `notmuch-poll-script'."
   (interactive)
+  (message "Polling mail...")
   (if (stringp notmuch-poll-script)
       (unless (string= notmuch-poll-script "")
 	(unless (equal (call-process notmuch-poll-script nil nil) 0)
 	  (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
-    (notmuch-call-notmuch-process "new")))
+    (notmuch-call-notmuch-process "new"))
+  (message "Polling mail...done"))
 
 (defun notmuch-bury-or-kill-this-buffer ()
   "Undisplay the current buffer.
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 15/23] emacs: Use makefile-gmake-mode in Makefile*s
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (13 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 16/23] emacs: Improve doc-strings Jonas Bernoulli
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

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 are Makefiles (of any flavor).
---
 Makefile.global                  | 1 +
 Makefile.local                   | 2 +-
 bindings/Makefile.local          | 2 +-
 compat/Makefile.local            | 2 +-
 completion/Makefile.local        | 2 +-
 doc/Makefile.local               | 2 +-
 emacs/Makefile.local             | 2 +-
 lib/Makefile.local               | 2 +-
 parse-time-string/Makefile.local | 2 ++
 performance-test/Makefile.local  | 2 +-
 test/Makefile.local              | 2 +-
 util/Makefile.local              | 2 +-
 12 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Makefile.global b/Makefile.global
index 98b6962e..c8812f9d 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -1,3 +1,4 @@
+# -*- makefile-gmake -*-
 # Here's the (hopefully simple) versioning scheme.
 #
 # Releases of notmuch have a two-digit version (0.1, 0.2, etc.). We
diff --git a/Makefile.local b/Makefile.local
index 22577617..77bc9850 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 .PHONY: all
 all: notmuch notmuch-shared build-man build-info ruby-bindings python-cffi-bindings
diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 19ddd6ea..bc960bbc 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := bindings
 
diff --git a/compat/Makefile.local b/compat/Makefile.local
index bcb9f0ec..2ee1b399 100644
--- a/compat/Makefile.local
+++ b/compat/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := compat
 extra_cflags += -I$(srcdir)/$(dir)
diff --git a/completion/Makefile.local b/completion/Makefile.local
index 8e86c9d2..54df463c 100644
--- a/completion/Makefile.local
+++ b/completion/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := completion
 
diff --git a/doc/Makefile.local b/doc/Makefile.local
index 30411341..60bd7184 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := doc
 
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 141f5868..d1b320c3 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := emacs
 emacs_sources := \
diff --git a/lib/Makefile.local b/lib/Makefile.local
index 5dc057c0..a6400126 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := lib
 
diff --git a/parse-time-string/Makefile.local b/parse-time-string/Makefile.local
index 53534f3e..ee8030cc 100644
--- a/parse-time-string/Makefile.local
+++ b/parse-time-string/Makefile.local
@@ -1,3 +1,5 @@
+# -*- makefile-gmake -*-
+
 dir := parse-time-string
 extra_cflags += -I$(srcdir)/$(dir)
 
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index 9dc260e3..b9f580c7 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := performance-test
 
diff --git a/test/Makefile.local b/test/Makefile.local
index 47244e8f..40574739 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := test
 
diff --git a/util/Makefile.local b/util/Makefile.local
index f5d72f79..7ef029a5 100644
--- a/util/Makefile.local
+++ b/util/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := util
 extra_cflags += -I$(srcdir)/$(dir)
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 16/23] emacs: Improve doc-strings
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (14 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

- 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 shouldn't be done.

- Symbols are quoted like `so'.

- There is no clear rule on how to (not) quote non-atomic
  s-expressions, but quoting like '(this) is definitely weird.

- It is a good idea to remember that \" becomes " and to take
  that in mind when adjusting the automatic filling by hand.

- Use the imperative form.

- Arguments are written in all uppercase.
---
 emacs/notmuch-address.el | 42 +++++++++++++++++++++-------------------
 emacs/notmuch-query.el   | 19 +++++++++---------
 emacs/notmuch-show.el    |  4 ++--
 emacs/notmuch-tree.el    |  5 +++--
 emacs/notmuch.el         |  9 ++++-----
 emacs/rstdoc.el          |  6 +++---
 6 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 85531489..cd0ffb67 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -36,9 +36,9 @@ (defvar notmuch-address-completions (make-hash-table :test 'equal)
 This variable is set by calling `notmuch-address-harvest'.")
 
 (defvar notmuch-address-full-harvest-finished nil
-  "t indicates that full completion address harvesting has been
-finished. Use notmuch-address--harvest-ready to access as that
-will load a saved hash if necessary (and available).")
+  "t indicates that full completion address harvesting has been finished.
+Use notmuch-address--harvest-ready to access as that will load a
+saved hash if necessary (and available).")
 
 (defun notmuch-address--harvest-ready ()
   "Return t if there is a full address hash available.
@@ -54,9 +54,9 @@ (defcustom notmuch-address-command 'internal
 which must take a single argument (searched string) and output a
 list of completion candidates, one per line.
 
-Alternatively, it can be the symbol 'internal, in which case
+Alternatively, it can be the symbol `internal', in which case
 internal completion is used; the variable
-`notmuch-address-internal-completion` can be used to customize
+`notmuch-address-internal-completion' can be used to customize
 this case.
 
 Finally, if this variable is nil then address completion is
@@ -72,12 +72,12 @@ (defcustom notmuch-address-command 'internal
 (defcustom notmuch-address-internal-completion '(sent nil)
   "Determines how internal address completion generates candidates.
 
-This should be a list of the form '(DIRECTION FILTER), where
+This should be a list of the form (DIRECTION FILTER), where
 DIRECTION is either sent or received and specifies whether the
 candidates are searched in messages sent by the user or received
 by the user (note received by is much faster), and FILTER is
-either nil or a filter-string, such as \"date:1y..\" to append
-to the query."
+either nil or a filter-string, such as \"date:1y..\" to append to
+the query."
   :type '(list :tag "Use internal address completion"
 	       (radio
 		:tag "Base completion on messages you have"
@@ -101,8 +101,8 @@ (defcustom notmuch-address-save-filename nil
   "Filename to save the cached completion addresses.
 
 All the addresses notmuch uses for address completion will be
-cached in this file. This has obvious privacy implications so you
-should make sure it is not somewhere publicly readable."
+cached in this file.  This has obvious privacy implications so
+you should make sure it is not somewhere publicly readable."
   :type '(choice (const :tag "Off" nil)
 		 (file :tag "Filename"))
   :group 'notmuch-send
@@ -110,12 +110,14 @@ (defcustom notmuch-address-save-filename nil
   :group 'notmuch-external)
 
 (defcustom notmuch-address-selection-function 'notmuch-address-selection-function
-  "The function to select address from given list. The function is
-called with PROMPT, COLLECTION, and INITIAL-INPUT as arguments
-(subset of what `completing-read' can be called with).
-While executed the value of `completion-ignore-case' is t.
-See documentation of function `notmuch-address-selection-function'
-to know how address selection is made by default."
+  "The function to select address from given list.
+
+The function is called with PROMPT, COLLECTION, and INITIAL-INPUT
+as arguments (subset of what `completing-read' can be called
+with).  While executed the value of `completion-ignore-case'
+is t.  See documentation of function
+`notmuch-address-selection-function' to know how address
+selection is made by default."
   :type 'function
   :group 'notmuch-send
   :group 'notmuch-address
@@ -188,9 +190,9 @@ (defun notmuch-address-matching (substring)
     candidates))
 
 (defun notmuch-address-options (original)
-  "Returns a list of completion candidates. Uses either
-elisp-based implementation or older implementation requiring
-external commands."
+  "Return a list of completion candidates.
+Use either elisp-based implementation or older implementation
+requiring external commands."
   (cond
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
@@ -352,7 +354,7 @@ (defvar notmuch-address--save-hash-version 1
   "Version format of the save hash.")
 
 (defun notmuch-address--get-address-hash ()
-  "Returns the saved address hash as a plist.
+  "Return the saved address hash as a plist.
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index a8e5d11f..3cfccbc3 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -47,22 +47,21 @@ (defun notmuch-query-map-aux  (mapper function seq)
 	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
-  "Apply FN to every thread in THREADS. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every thread in THREADS.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-forest fn threads))
 
 (defun notmuch-query-map-forest (fn forest)
-  "Apply function to every message in a forest. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information.
-"
+  "Apply function FN to every message in FOREST.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-tree fn forest))
 
 (defun notmuch-query-map-tree (fn tree)
-  "Apply function FN to every message in TREE. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every message in TREE.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (cons (funcall fn (car tree)) (notmuch-query-map-forest fn (cadr tree))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f9418a94..015edb0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -446,8 +446,8 @@ (defun notmuch-clean-address (address)
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
-  "Try to clean a single email ADDRESS for display.  Return
-unchanged ADDRESS if parsing fails."
+  "Try to clean a single email ADDRESS for display.
+Return unchanged ADDRESS if parsing fails."
   (let* ((clean-address (notmuch-clean-address address))
 	 (p-address (car clean-address))
 	 (p-name (cdr clean-address)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b498db07..364da240 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -587,7 +587,7 @@ (defun notmuch-tree-scroll-message-window ()
 	(scroll-up)))))
 
 (defun notmuch-tree-scroll-message-window-back ()
-  "Scroll the message window back(if it exists)."
+  "Scroll the message window back (if it exists)."
   (interactive)
   (when (window-live-p notmuch-tree-message-window)
     (with-selected-window notmuch-tree-message-window
@@ -596,7 +596,8 @@ (defun notmuch-tree-scroll-message-window-back ()
 	(scroll-down)))))
 
 (defun notmuch-tree-scroll-or-next ()
-  "Scroll the message window. If it at end go to next message."
+  "Scroll the message window.
+If it at end go to next message."
   (interactive)
   (when (notmuch-tree-scroll-message-window)
     (notmuch-tree-next-matching-message)))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5562ad10..75fe6900 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -432,11 +432,10 @@ (defun notmuch-search-result-end (&optional pos)
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
 
-FN should take one argument.  It will be applied to the
-character position of the beginning of each result that overlaps
-the region between points BEG and END.  As a special case, if (=
-BEG END), FN will be applied to the result containing point
-BEG."
+FN should take one argument.  It will be applied to the character
+position of the beginning of each result that overlaps the region
+between points BEG and END.  As a special case, if (= BEG END),
+FN will be applied to the result containing point BEG."
   (let ((pos (notmuch-search-result-beginning beg))
 	;; End must be a marker in case fn changes the
 	;; text.
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2af91186..92a337c8 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -36,11 +36,11 @@
 (provide 'rstdoc)
 
 (defun rstdoc-batch-extract ()
-  "Extract docstrings to and from the files on the command line"
+  "Extract docstrings to and from the files on the command line."
   (apply #'rstdoc-extract command-line-args-left))
 
 (defun rstdoc-extract (in-file out-file)
-  "Write docstrings from IN-FILE to OUT-FILE"
+  "Write docstrings from IN-FILE to OUT-FILE."
   (load-file in-file)
   (let* ((definitions (cdr (assoc (expand-file-name in-file) load-history)))
 	 (doc-hash (make-hash-table :test 'eq)))
@@ -72,7 +72,7 @@ (defvar rst--escape-alist
      ("\\([^\\]\\)'" . "\\1`")
      ("^[[:space:]\t]*$" . "|br|")
      ("^[[:space:]\t]" . "|indent| "))
-    "list of (regex . replacement) pairs")
+  "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
   (with-temp-buffer
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 17/23] emacs: Autoload notmuch-jump-search only once
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (15 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 16/23] emacs: Improve doc-strings Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

This function is being autoloaded using an autoload cookie, so it
shouldn't additionally be autoloaded using an `autoload' form.

When building libraries we don't actually load the autoloads file and
dropping the `autoload' form results in an error, which reveals a so
far unspecified dependency: `notmuch-tree' needs `notmuch-jump'.

Before this commit compiling (or even just loading) `notmuch-tree'
resulted in `notmuch-jump' being loaded because the former requires
`notmuch-lib', which autoloaded `notmuch-jump-search'.

The bug was that this dependency was not explicitly specified, which
we fix by adding the respective `require' form.
---
 emacs/notmuch-lib.el  | 3 ---
 emacs/notmuch-tree.el | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 069a19e9..549161f3 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -35,9 +35,6 @@ (unless (require 'notmuch-version nil t)
   (defconst notmuch-emacs-version "unknown"
     "Placeholder variable when notmuch-version.el[c] is not available."))
 
-(autoload 'notmuch-jump-search "notmuch-jump"
-  "Jump to a saved search by shortcut key." t)
-
 (defgroup notmuch nil
   "Notmuch mail reader for Emacs."
   :group 'mail)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 364da240..b538cef9 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -33,6 +33,7 @@ (require 'notmuch-query)
 (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
+(require 'notmuch-jump)
 
 (declare-function notmuch-search "notmuch"
 		  (&optional query oldest-first target-thread target-line))
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 18/23] emacs: Autoload notmuch-jump using an autoload cookie
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (16 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 19/23] emacs: Various cosmetic changes Jonas Bernoulli
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

Doing that is better than using an `autoload' form because the latter
may result in dependencies getting hidden and indeed it turns out we
have to declare `notmuch-jump' in "notmuch-tag.el".
---
 emacs/notmuch-jump.el | 1 +
 emacs/notmuch-tag.el  | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index e302fe00..1e2d0497 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -73,6 +73,7 @@ (defun notmuch-jump-search ()
 
 (defvar notmuch-jump--action nil)
 
+;;;###autoload
 (defun notmuch-jump (action-map prompt)
   "Interactively prompt for one of the keys in ACTION-MAP.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1cef17e1..ccc1321f 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -36,8 +36,7 @@ (declare-function notmuch-search-tag "notmuch"
 		  (tag-changes &optional beg end only-matched))
 (declare-function notmuch-show-tag "notmuch-show" (tag-changes))
 (declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
-
-(autoload 'notmuch-jump "notmuch-jump")
+(declare-function notmuch-jump "notmuch-jump" (action-map prompt))
 
 (define-widget 'notmuch-tag-key-type 'list
   "A single key tagging binding."
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 19/23] emacs: Various cosmetic changes
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (17 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

---
 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 insertions(+), 44 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index dcac319c..91f4ef3d 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -36,7 +36,8 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-  (setq dir (or dir default-directory))
+  (unless dir
+    (setq dir default-directory))
   (save-excursion
     (goto-char (point-min))
     (condition-case nil
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 549161f3..a057140f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -53,9 +53,8 @@ (defgroup notmuch-show nil
 
 (defgroup notmuch-send nil
   "Sending messages from Notmuch."
-  :group 'notmuch)
-
-(custom-add-to-group 'notmuch-send 'message 'custom-group)
+  :group 'notmuch
+  :group 'message)
 
 (defgroup notmuch-tag nil
   "Tags and tagging in Notmuch."
@@ -782,8 +781,7 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s"
-	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
+  (error "%s%s" msg (if extra " (see *Notmuch errors* for more details)" "")))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index fbcfc2ef..3aa5bd8f 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -39,12 +39,9 @@ (defun notmuch-sexp-create-parser ()
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
   (vector 'notmuch-sexp-parser
-	  ;; List depth
-	  0
-	  ;; Partial parse position marker
-	  nil
-	  ;; Partial parse state
-	  nil))
+	  0     ; List depth
+	  nil   ; Partial parse position marker
+	  nil)) ; Partial parse state
 
 (defmacro notmuch-sexp--depth (sp)         `(aref ,sp 1))
 (defmacro notmuch-sexp--partial-pos (sp)   `(aref ,sp 2))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 015edb0c..5640346f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -499,21 +499,17 @@ (define-button-type 'notmuch-show-part-button-type
 
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
-  (let ((button)
-	(base-label (concat (and name (concat name ": "))
+  (let ((base-label (concat (and name (concat name ": "))
 			    declared-type
 			    (and (not (string-equal declared-type content-type))
 				 (concat " (as " content-type ")"))
 			    comment)))
-    (setq button
-	  (insert-button
-	   (concat "[ " base-label " ]")
-	   :base-label base-label
-	   :type 'notmuch-show-part-button-type
-	   :notmuch-part-hidden nil))
-    (insert "\n")
-    ;; return button
-    button))
+    (prog1 (insert-button
+	    (concat "[ " base-label " ]")
+	    :base-label base-label
+	    :type 'notmuch-show-part-button-type
+	    :notmuch-part-hidden nil)
+      (insert "\n"))))
 
 (defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 92a337c8..41390bbe 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -24,7 +24,6 @@
 ;;
 
 ;;; Commentary:
-;;
 
 ;; Rstdoc provides a facility to extract all of the docstrings defined in
 ;; an elisp source file. Usage:
@@ -68,10 +67,10 @@ (defun rstdoc--insert-docstring (symbol docstring)
   (insert "\n"))
 
 (defvar rst--escape-alist
-  '( ("\\\\='" . "\\\\'")
-     ("\\([^\\]\\)'" . "\\1`")
-     ("^[[:space:]\t]*$" . "|br|")
-     ("^[[:space:]\t]" . "|indent| "))
+  '(("\\\\='" . "\\\\'")
+    ("\\([^\\]\\)'" . "\\1`")
+    ("^[[:space:]\t]*$" . "|br|")
+    ("^[[:space:]\t]" . "|indent| "))
   "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
diff --git a/test/test-lib.el b/test/test-lib.el
index 680a02ad..db31fac3 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -162,22 +162,21 @@ (defun notmuch-test-report-unexpected (output expected)
 
 (defun notmuch-test-expect-equal (output expected)
   "Compare OUTPUT with EXPECTED. Report any discrepencies."
-  (if (equal output expected)
-      t
-    (cond
-     ((and (listp output)
-	   (listp expected))
-      ;; Reporting the difference between two lists is done by
-      ;; reporting differing elements of OUTPUT and EXPECTED
-      ;; pairwise. This is expected to make analysis of failures
-      ;; simpler.
-      (apply #'concat (cl-loop for o in output
-			       for e in expected
-			       if (not (equal o e))
-			       collect (notmuch-test-report-unexpected o e))))
-
-     (t
-      (notmuch-test-report-unexpected output expected)))))
+  (cond
+   ((equal output expected)
+    t)
+   ((and (listp output)
+	 (listp expected))
+    ;; Reporting the difference between two lists is done by
+    ;; reporting differing elements of OUTPUT and EXPECTED
+    ;; pairwise. This is expected to make analysis of failures
+    ;; simpler.
+    (apply #'concat (cl-loop for o in output
+			     for e in expected
+			     if (not (equal o e))
+			     collect (notmuch-test-report-unexpected o e))))
+   (t
+    (notmuch-test-report-unexpected output expected))))
 
 (defun notmuch-post-command ()
   (run-hooks 'post-command-hook))
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 20/23] emacs: Increase consistency of library headers
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (18 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 19/23] emacs: Various cosmetic changes Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 21/23] Fix typos Jonas Bernoulli
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

---
 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       |  2 +-
 emacs/notmuch-show.el        |  2 +-
 emacs/notmuch-tree.el        |  2 +-
 emacs/notmuch.el             |  2 +-
 9 files changed, 60 insertions(+), 42 deletions(-)

diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index c1f3594e..88b1c533 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -1,29 +1,35 @@
 ;;; notmuch-company.el --- Mail address completion for notmuch via company-mode  -*- lexical-binding: t -*-
 
-;; Authors: Trevor Jim <tjim@mac.com>
-;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
+;; Copyright © Trevor Jim
+;; Copyright © Michal Sojka
 ;;
-;; Keywords: mail, completion
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation, either version 3 of the License, or
 ;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Trevor Jim <tjim@mac.com>
+;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
+;;
+;; Keywords: mail, completion
 
 ;;; Commentary:
 
-;; To enable this, install company mode (https://company-mode.github.io/)
+;; Mail address completion for notmuch via company-mode.  To enable
+;; this, install company mode from <https://company-mode.github.io/>.
 ;;
 ;; NB company-minimum-prefix-length defaults to 3 so you don't get
-;; completion unless you type 3 characters
+;; completion unless you type 3 characters.
 
 ;;; Code:
 
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 3340918f..43b60ae3 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -3,6 +3,21 @@
 ;; The functions in this file are copied from more modern versions of
 ;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017
 ;; Free Software Foundation, Inc.
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; emacs master has a bugfix for folding long headers when sending
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index e6bf8339..6df1dd64 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -1,4 +1,4 @@
-;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata.
+;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata
 ;;
 ;; Copyright © Jameson Rollins
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index a057140f..dbdc99c1 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -19,8 +19,6 @@
 ;;
 ;; Authors: Carl Worth <cworth@cworth.org>
 
-;; This is an part of an emacs-based interface to the notmuch mail system.
-
 ;;; Code:
 
 (require 'cl-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 1027e1a7..aa07b26a 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -1,24 +1,23 @@
-;;; notmuch-maildir-fcc.el ---
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published
-;; by the Free Software Foundation; either version 2, or (at your
-;; option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;; notmuch-maildir-fcc.el --- inserting using a fcc handler
+
+;; Copyright © Jesse Rosenthal
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; To use this as the fcc handler for message-mode,
-;; customize the notmuch-fcc-dirs variable
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Jesse Rosenthal <jrosenthal@jhu.edu>
 
 ;;; Code:
 
diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el
index d9b3d449..6dd9f775 100644
--- a/emacs/notmuch-print.el
+++ b/emacs/notmuch-print.el
@@ -1,4 +1,4 @@
-;;; notmuch-print.el --- printing messages from notmuch.
+;;; notmuch-print.el --- printing messages from notmuch
 ;;
 ;; Copyright © David Edmondson
 ;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5640346f..de822357 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1,4 +1,4 @@
-;;; notmuch-show.el --- displaying notmuch forests.
+;;; notmuch-show.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b538cef9..fbba4bb3 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1,4 +1,4 @@
-;;; notmuch-tree.el --- displaying notmuch forests.
+;;; notmuch-tree.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 75fe6900..e3b7289b 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -62,7 +62,7 @@
 ;;
 ;; TL;DR: notmuch-emacs from MELPA and notmuch from distro packages is
 ;; NOT SUPPORTED.
-;;
+
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
-- 
2.26.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 21/23] Fix typos
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (19 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

---
 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 ++--
 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 +-
 emacs/notmuch-crypto.el                    |  2 +-
 emacs/notmuch-lib.el                       |  2 +-
 emacs/notmuch-mua.el                       |  2 +-
 lib/notmuch.h                              |  4 ++--
 tag-util.c                                 |  2 +-
 tag-util.h                                 |  2 +-
 test/T610-message-property.sh              |  2 +-
 test/T710-message-id.sh                    |  2 +-
 test/random-corpus.c                       |  2 +-
 test/test-lib.el                           |  2 +-
 19 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/NEWS b/NEWS
index 0d8b930f..9f0db031 100644
--- a/NEWS
+++ b/NEWS
@@ -116,7 +116,7 @@ information about cryptographic protections for the Subject header.
 Emacs
 -----
 
-Optionally check for missing attachements in outgoing messages (see
+Optionally check for missing attachments in outgoing messages (see
 function `notmuch-mua-attachment-check`).
 
 Bind `B` to browse URLs in current message.
diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py
index 613317e0..f281edc1 100644
--- a/bindings/python-cffi/notmuch2/__init__.py
+++ b/bindings/python-cffi/notmuch2/__init__.py
@@ -10,7 +10,7 @@ should consider their signatures implementation details.
 Errors
 ======
 
-All errors occuring due to errors from the underlying notmuch database
+All errors occurring due to errors from the underlying notmuch database
 are subclasses of the :exc:`NotmuchError`.  Due to memory management
 it is possible to try and use an object after it has been freed.  In
 this case a :exc:`ObjectDestroyedError` will be raised.
diff --git a/bindings/python-cffi/notmuch2/_base.py b/bindings/python-cffi/notmuch2/_base.py
index 31258149..1cf03c88 100644
--- a/bindings/python-cffi/notmuch2/_base.py
+++ b/bindings/python-cffi/notmuch2/_base.py
@@ -29,7 +29,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     However during some peculiar situations, e.g. interpreter
     shutdown, it is possible for the :meth:`__del__` method to have
     been called, whele there are still references to an object.  This
-    could result in child objects asking their memeory to be freed
+    could result in child objects asking their memory to be freed
     after the parent has already freed the memory, making things
     rather unhappy as double frees are not taken lightly in C.  To
     handle this case all objects need to follow the same protocol to
@@ -73,7 +73,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     def _destroy(self):
         """Destroy the object, freeing all memory.
 
-        This method needs to destory the object on the
+        This method needs to destroy the object on the
         libnotmuch-level.  It must ensure it's not been destroyed by
         it's parent object yet before doing so.  It also must be
         idempotent.
@@ -134,7 +134,7 @@ class BinString(str):
 
     Most data in libnotmuch should be valid ASCII or valid UTF-8.
     However since it is a C library these are represented as
-    bytestrings intead which means on an API level we can not
+    bytestrings instead which means on an API level we can not
     guarantee that decoding this to UTF-8 will both succeed and be
     lossless.  This string type converts bytes to unicode in a lossy
     way, but also makes the raw bytes available.
diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py
index 7db5a7f8..5ab0f20a 100644
--- a/bindings/python-cffi/notmuch2/_database.py
+++ b/bindings/python-cffi/notmuch2/_database.py
@@ -422,7 +422,7 @@ class Database(base.NotmuchObject):
            of it as ``dup = db.remove_message(name); if dup: ...``.
         :rtype: bool
 
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ReadOnlyDatabaseError: The database is opened in
            READ_ONLY mode.
         :raises UpgradeRequiredError: The database must be upgraded
@@ -458,7 +458,7 @@ class Database(base.NotmuchObject):
         :raises LookupError: If no message was found.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         msg_pp = capi.ffi.new('notmuch_message_t **')
@@ -489,7 +489,7 @@ class Database(base.NotmuchObject):
            a subclass of :exc:`KeyError`.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
@@ -695,7 +695,7 @@ class AtomicContext:
         """Force ending the atomic section.
 
         This can only be called once __exit__ has been called.  It
-        will attept to close the atomic section (again).  This is
+        will attempt to close the atomic section (again).  This is
         useful if the original exit raised an exception and the atomic
         section is still open.  But things are pretty ugly by now.
 
diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py
index 02de50ad..2f232076 100644
--- a/bindings/python-cffi/notmuch2/_message.py
+++ b/bindings/python-cffi/notmuch2/_message.py
@@ -147,7 +147,7 @@ class Message(base.NotmuchObject):
         """Return an iterator of all files for this message.
 
         If multiple files contained the same message ID they will all
-        be returned here.  The files are returned as intances of
+        be returned here.  The files are returned as instances of
         :class:`pathlib.Path`.
 
         :returns: Iterator yielding :class:`pathlib.Path` instances.
@@ -431,7 +431,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
     means the former will yield duplicate keys while the latter won't.
     It also means ``len(list(iter(this_map)))`` could be different
     than ``len(this_map.keys())``.  ``len(this_map)`` will correspond
-    with the lenght of the default iterator.
+    with the length of the default iterator.
 
     Be aware that libnotmuch exposes all of this as iterators, so
     quite a few operations have O(n) performance instead of the usual
diff --git a/bindings/python-cffi/notmuch2/_tags.py b/bindings/python-cffi/notmuch2/_tags.py
index 3b14c981..ee5d2a34 100644
--- a/bindings/python-cffi/notmuch2/_tags.py
+++ b/bindings/python-cffi/notmuch2/_tags.py
@@ -161,7 +161,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
     """
 
     # Since we subclass ImmutableTagSet we inherit a __hash__.  But we
-    # are mutable, setting it to None will make the Python machinary
+    # are mutable, setting it to None will make the Python machinery
     # recognise us as unhashable.
     __hash__ = None
 
@@ -179,7 +179,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the added tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -204,7 +204,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -286,7 +286,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 class TagsIter(base.NotmuchObject, collections.abc.Iterator):
     """Iterator over tags.
 
-    This is only an interator, not a container so calling
+    This is only an iterator, not a container so calling
     :meth:`__iter__` does not return a new, replenished iterator but
     only itself.
 
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index de7db8e7..6835fd30 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -31,7 +31,7 @@ def notmuch(maildir):
     fixture.
     """
     def run(*args):
-        """Run a notmuch comand.
+        """Run a notmuch command.
 
         This function runs with a timeout error as many notmuch
         commands may block if multiple processes are trying to open
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 88ca836e..8fb507fa 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -65,7 +65,7 @@ class Database(object):
     .. note::
 
         Any function in this class can and will throw an
-        :exc:`NotInitializedError` if the database was not intitialized
+        :exc:`NotInitializedError` if the database was not initialized
         properly.
     """
     _std_db_path = None
@@ -273,9 +273,9 @@ class Database(object):
         return Database._get_version(self._db)
 
     def get_revision (self):
-        """Returns the committed database revison and UUID
+        """Returns the committed database revision and UUID
 
-        :returns: (revison, uuid) The database revision as a positive integer
+        :returns: (revision, uuid) The database revision as a positive integer
         and the UUID of the database.
         """
         self._assert_db_is_initialized()
@@ -574,7 +574,7 @@ class Database(object):
                   in the meantime. In this case, you should close and
                   reopen the database and retry.
             :exc:`NotInitializedError` if
-                    the database was not intitialized.
+                    the database was not initialized.
         """
         self._assert_db_is_initialized()
         msg_p = NotmuchMessageP()
@@ -600,7 +600,7 @@ class Database(object):
                  case, you should close and reopen the database and
                  retry.
         :raises: :exc:`NotInitializedError` if the database was not
-                 intitialized.
+                 initialized.
 
         *Added in notmuch 0.9*"""
         self._assert_db_is_initialized()
@@ -616,7 +616,7 @@ class Database(object):
         """Returns :class:`Tags` with a list of all tags found in the database
 
         :returns: :class:`Tags`
-        :execption: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
+        :exception: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
                     on error
         """
         self._assert_db_is_initialized()
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index bdc18790..ffb86df1 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -95,7 +95,7 @@ class Query(object):
             :exc:`NullPointerError` if the query creation failed
                 (e.g. too little memory).
             :exc:`NotInitializedError` if the underlying db was not
-                intitialized.
+                initialized.
         """
         db._assert_db_is_initialized()
         # create reference to parent db to keep it alive
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 6df1dd64..276c9859 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -128,7 +128,7 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
       (setq button-action 'notmuch-crypto-sigstatus-error-callback)
       (setq help-msg (concat "Click to retrieve key ID " keyid
-			     " from keyserver.")))
+			     " from key server.")))
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")"))
       (setq face 'notmuch-crypto-signature-bad))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index dbdc99c1..91c94781 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -656,7 +656,7 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; Workaround: The call to `mm-display-part' below triggers a bug in
 ;; Emacs 24 if it attempts to use the shr renderer to display an HTML
 ;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and
-;; Fedora 17, though unreproducable in other configurations).
+;; Fedora 17, though unreproducible in other configurations).
 ;; `mm-shr' references the variable `gnus-inhibit-images' without
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index af9afe41..6b635522 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -337,7 +337,7 @@ (define-key notmuch-message-mode-map (kbd "C-x C-s") #'notmuch-draft-save)
 
 (defun notmuch-mua-pop-to-buffer (name switch-function)
   "Pop to buffer NAME, and warn if it already exists and is
-modified. This function is notmuch addaptation of
+modified. This function is notmuch adaptation of
 `message-pop-to-buffer'."
   (let ((buffer (get-buffer name)))
     (if (and buffer
diff --git a/lib/notmuch.h b/lib/notmuch.h
index f9e9cc41..041cc143 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -1642,7 +1642,7 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag);
  *
  * @retval #NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in
  *	read-only mode so message cannot be modified.
- * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an execption was thrown
+ * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an exception was thrown
  *      accessing the database.
  */
 notmuch_status_t
@@ -1874,7 +1874,7 @@ notmuch_message_add_property (notmuch_message_t *message, const char *key, const
 /**
  * Remove a (key,value) pair from a message.
  *
- * It is not an error to remove a non-existant (key,value) pair
+ * It is not an error to remove a non-existent (key,value) pair
  *
  * @returns
  * - NOTMUCH_STATUS_ILLEGAL_ARGUMENT: *key* may not contain an '=' character.
diff --git a/tag-util.c b/tag-util.c
index 1837b1ae..accf299e 100644
--- a/tag-util.c
+++ b/tag-util.c
@@ -323,7 +323,7 @@ tag_op_list_apply (notmuch_message_t *message,
     if (flags & TAG_FLAG_MAILDIR_SYNC) {
 	status = notmuch_message_tags_to_maildir_flags (message);
 	if (status) {
-	    message_error (message, status, "synching tags to maildir");
+	    message_error (message, status, "syncing tags to maildir");
 	    return status;
 	}
     }
diff --git a/tag-util.h b/tag-util.h
index bbe54d99..411e8cae 100644
--- a/tag-util.h
+++ b/tag-util.h
@@ -123,7 +123,7 @@ tag_op_list_append (tag_op_list_t *list,
 /*
  * Apply a list of tag operations, in order, to a given message.
  *
- * Flags can be bitwise ORed; see enum above for possibilies.
+ * Flags can be bitwise ORed; see enum above for possibilities.
  */
 
 notmuch_status_t
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index b8774230..d0e52f4a 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -65,7 +65,7 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
 
-   /* remove non-existant value for key */
+   /* remove non-existent value for key */
    EXPECT0(notmuch_message_remove_property (message, "testkey2", "this value has spaces and = sign"));
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
diff --git a/test/T710-message-id.sh b/test/T710-message-id.sh
index e73d6ba9..5129d84c 100755
--- a/test/T710-message-id.sh
+++ b/test/T710-message-id.sh
@@ -29,7 +29,7 @@ GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
-test_begin_subtest "<> delimeters are required"
+test_begin_subtest "<> delimiters are required"
 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
 <1530507300.raoomurnbf.astroid@strange.none
diff --git a/test/random-corpus.c b/test/random-corpus.c
index 8ed7ff76..ff413252 100644
--- a/test/random-corpus.c
+++ b/test/random-corpus.c
@@ -50,7 +50,7 @@ typedef struct {
 
 /*
  *  Choose about half ascii as test characters, as ascii
- *  punctation and whitespace is the main cause of problems for
+ *  punctuation and whitespace is the main cause of problems for
  *  the (old) restore parser.
  *
  *  We then favour code points with 2 byte encodings. Note that
diff --git a/test/test-lib.el b/test/test-lib.el
index db31fac3..97158447 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -161,7 +161,7 @@ (defun notmuch-test-report-unexpected (output expected)
 	  "Output:\t" (prin1-to-string output) "\n"))
 
 (defun notmuch-test-expect-equal (output expected)
-  "Compare OUTPUT with EXPECTED. Report any discrepencies."
+  "Compare OUTPUT with EXPECTED. Report any discrepancies."
   (cond
    ((equal output expected)
     t)
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 22/23] .dir-locals.el: Set variables for correct "shell" mode
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (20 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 21/23] Fix typos Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-26 16:58 ` [PATCH 23/23] test: Fix indentation Jonas Bernoulli
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

The major mode used for shell scripts is named 'sh-mode'.
'shell-mode' on the other hand implements an interactive
shell in emacs-lisp.
---
 .dir-locals.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index fc75ae61..b3ddffe8 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -15,7 +15,7 @@ ((c-mode
  (emacs-lisp-mode
   (indent-tabs-mode . t)
   (tab-width . 8))
- (shell-mode
+ (sh-mode
   (indent-tabs-mode . t)
   (tab-width . 8)
   (sh-basic-offset . 4)
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH 23/23] test: Fix indentation
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (21 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
@ 2020-07-26 16:58 ` Jonas Bernoulli
  2020-07-30 20:36 ` [PATCH 00/23] A create number of cosmetic changes Tomi Ollila
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 16:58 UTC (permalink / raw)
  To: notmuch

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
+++ b/test/test-lib.sh
@@ -136,16 +136,16 @@ add_gpgsm_home ()
     at_exit_function _gnupg_exit
     mkdir -p -m 0700 "$GNUPGHOME"
     openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
-        < "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
-        gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
+	< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
+	gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
+	      --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
     fpr=$(gpgsm --batch --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
     echo "$fpr S relax" >> "$GNUPGHOME/trustlist.txt"
     gpgsm --quiet --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/ca.crt
     echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$GNUPGHOME/trustlist.txt"
     printf '%s::1\n' include-certs disable-crl-checks | gpgconf --output /dev/null --change-options gpgsm
     gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
+	      --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
     test_debug "cat $GNUPGHOME/import.log"
 }
 
@@ -394,8 +394,8 @@ emacs_fcc_message ()
     local nmn_args subject body
     nmn_args=''
     while [[ "$1" =~ ^-- ]]; do
-        nmn_args="$nmn_args $1"
-        shift
+	nmn_args="$nmn_args $1"
+	shift
     done
     subject="$1"
     body="$2"
@@ -405,7 +405,7 @@ emacs_fcc_message ()
 
     test_emacs \
 	"(let ((message-send-mail-function (lambda () t))
-               (mail-host-address \"example.com\"))
+	       (mail-host-address \"example.com\"))
 	   (notmuch-mua-mail)
 	   (message-goto-to)
 	   (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\")
@@ -523,9 +523,9 @@ test_expect_equal_json () {
     # override Python's stdio encoding defaults.
     script='import json, sys; json.dump(json.load(sys.stdin), sys.stdout, sort_keys=True, indent=4)'
     output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$1")
+	|| echo "$1")
     expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$2")
+	|| echo "$2")
     shift 2
     test_expect_equal "$output" "$expected" "$@"
 }
@@ -539,15 +539,15 @@ test_valid_json () {
 # Sort the top-level list of JSON data from stdin.
 test_sort_json () {
     PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c \
-        "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
+	"import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
 }
 
 # test for json objects:
 # read the source of test/json_check_nodes.py (or the output when
 # invoking it without arguments) for an explanation of the syntax.
 test_json_nodes () {
-        local output
-        exec 1>&6 2>&7		# Restore stdout and stderr
+	local output
+	exec 1>&6 2>&7		# Restore stdout and stderr
 	if [ -z "$inside_subtest" ]; then
 		error "bug in the test script: test_json_eval without test_begin_subtest"
 	fi
@@ -661,7 +661,7 @@ notmuch_json_show_sanitize ()
 	-e 's|"filename": "signature.asc",||g' \
 	-e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \
 	-e 's|"timestamp": 97.......|"timestamp": 42|g' \
-        -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
+	-e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
 }
 
 notmuch_emacs_error_sanitize ()
@@ -672,7 +672,7 @@ notmuch_emacs_error_sanitize ()
     for file in "$@"; do
 	echo "=== $file ==="
 	cat "$file"
-    done | sed  \
+    done | sed \
 	-e 's/^\[.*\]$/[XXX]/' \
 	-e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|"
 }
@@ -928,8 +928,8 @@ test_expect_code () {
 # but is a prefix that can be used in the test script, like:
 #
 #	test_expect_success 'complain and die' '
-#           do something &&
-#           do something else &&
+#	    do something &&
+#	    do something else &&
 #	    test_must_fail git checkout ../outerspace
 #	'
 #
@@ -1019,8 +1019,8 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
 
 # Here's what we are using here:
 #
-# --quick              Use minimal customization. This implies --no-init-file,
-#		       --no-site-file and (emacs 24) --no-site-lisp
+# --quick		Use minimal customization. This implies --no-init-file,
+#			--no-site-file and (emacs 24) --no-site-lisp
 #
 # --directory		Ensure that the local elisp sources are found
 #
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-07-26 16:58 ` [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
@ 2020-07-26 21:27   ` Sean Whitton
  2020-07-26 22:02     ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: Sean Whitton @ 2020-07-26 21:27 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

Hello,

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", could you explain?

Thanks.

-- 
Sean Whitton

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-07-26 21:27   ` Sean Whitton
@ 2020-07-26 22:02     ` Jonas Bernoulli
  2020-07-27 16:43       ` Sean Whitton
  0 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-26 22:02 UTC (permalink / raw)
  To: Sean Whitton, notmuch

Sean Whitton <spwhitton@spwhitton.name> 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", could you explain?

As in "when the caller consumes the returned value".  The alternative
would be for the caller to not care about the value returned by the
callee and to instead call it for the side-effects only.

By using `and' we can signal that care about the return value and by
using `when' that we care about the side-effects instead.

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-07-26 22:02     ` Jonas Bernoulli
@ 2020-07-27 16:43       ` Sean Whitton
  2020-07-27 20:32         ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: Sean Whitton @ 2020-07-27 16:43 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

Hello,

On Mon 27 Jul 2020 at 12:02AM +02, Jonas Bernoulli wrote:

> Sean Whitton <spwhitton@spwhitton.name> 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", could you explain?
>
> As in "when the caller consumes the returned value".  The alternative
> would be for the caller to not care about the value returned by the
> callee and to instead call it for the side-effects only.
>
> By using `and' we can signal that care about the return value and by
> using `when' that we care about the side-effects instead.

Thank you for your reply.  Just to confirm, this is just a convention,
right?  I hadn't come across it yet.

-- 
Sean Whitton

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 01/23] emacs: Shorten long lines
  2020-07-26 16:57 ` [PATCH 01/23] emacs: Shorten long lines Jonas Bernoulli
@ 2020-07-27 17:52   ` Tomi Ollila
  2020-07-27 20:13     ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-07-27 17:52 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

On Sun, Jul 26 2020, Jonas Bernoulli wrote:

> ---
>  emacs/coolj.el               |   2 +-
>  emacs/notmuch-address.el     |  38 +++++++------
>  emacs/notmuch-company.el     |  17 ++++--
>  emacs/notmuch-crypto.el      |  16 +++---
>  emacs/notmuch-draft.el       |  12 ++--
>  emacs/notmuch-hello.el       |  43 ++++++++++-----
>  emacs/notmuch-jump.el        |   7 ++-
>  emacs/notmuch-lib.el         |  62 +++++++++++++--------
>  emacs/notmuch-maildir-fcc.el |  14 ++---
>  emacs/notmuch-message.el     |   3 +-
>  emacs/notmuch-mua.el         |  78 +++++++++++++++-----------
>  emacs/notmuch-show.el        | 103 +++++++++++++++++++++++------------
>  emacs/notmuch-tag.el         |  14 +++--
>  emacs/notmuch-tree.el        |  55 +++++++++++++------
>  emacs/notmuch-wash.el        |  19 +++++--
>  emacs/notmuch.el             |  27 ++++++---
>  emacs/rstdoc.el              |   3 +-
>  17 files changed, 326 insertions(+), 187 deletions(-)
>
> diff --git a/emacs/coolj.el b/emacs/coolj.el
> index 350d537f..5d311170 100644
> --- a/emacs/coolj.el
> +++ b/emacs/coolj.el
> @@ -1,6 +1,6 @@
>  ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
>  
> -;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
> +;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
>  
>  ;; Authors:    Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
>  ;;             Alex Schroeder <alex@gnu.org>
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index 0d56fba7..2a9c411a 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
>     ((eq notmuch-address-command 'internal)
>      (unless (notmuch-address--harvest-ready)
>        ;; First, run quick synchronous harvest based on what the user
> -      ;; entered so far
> +      ;; entered so far.
>        (notmuch-address-harvest original t))
>      (prog1 (notmuch-address-matching original)
> -      ;; Then start the (potentially long-running) full asynchronous harvest if necessary
> +      ;; Then start the (potentially long-running) full asynchronous
> +      ;; harvest if necessary.
>        (notmuch-address-harvest-trigger)))
>     (t
>      (process-lines notmuch-address-command original))))
> @@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
>  	    (push chosen notmuch-address-history)
>  	    (delete-region beg end)
>  	    (insert chosen)
> -	    (run-hook-with-args 'notmuch-address-post-completion-functions chosen))
> +	    (run-hook-with-args 'notmuch-address-post-completion-functions
> +				chosen))
>  	(message "No matches.")
>  	(ding))))
>     (t nil)))
> @@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
>  	      ;; 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 (list :version notmuch-address--save-hash-version
> -				  :completion-settings notmuch-address-internal-completion
> -				  :last-harvest notmuch-address-last-harvest
> -				  :completions notmuch-address-completions)))
> +	  (let ((save-plist
> +		 (list :version notmuch-address--save-hash-version
> +		       :completion-settings notmuch-address-internal-completion
> +		       :last-harvest notmuch-address-last-harvest
> +		       :completions notmuch-address-completions)))
>  	    (print "notmuch-address-hash" (current-buffer))
>  	    (print save-plist (current-buffer))))
>        (message "\
> @@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
>    (let ((now (float-time)))
>      (when (> (- now notmuch-address-last-harvest) 86400)
>        (setq notmuch-address-last-harvest now)
> -      (notmuch-address-harvest nil nil
> -			       (lambda (proc event)
> -				 ;; If harvest fails, we want to try
> -				 ;; again when the trigger is next
> -				 ;; called
> -				 (if (string= event "finished\n")
> -				     (progn
> -				       (notmuch-address--save-address-hash)
> -				       (setq notmuch-address-full-harvest-finished t))
> -				   (setq notmuch-address-last-harvest 0)))))))
> +      (notmuch-address-harvest
> +       nil nil
> +       (lambda (proc event)
> +	 ;; If harvest fails, we want to try
> +	 ;; again when the trigger is next
> +	 ;; called
> +	 (if (string= event "finished\n")
> +	     (progn
> +	       (notmuch-address--save-address-hash)
> +	       (setq notmuch-address-full-harvest-finished t))
> +	   (setq notmuch-address-last-harvest 0)))))))
>  
>  ;;
>  
> diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
> index ac998f9b..c1f3594e 100644
> --- a/emacs/notmuch-company.el
> +++ b/emacs/notmuch-company.el
> @@ -69,9 +69,11 @@ (defun notmuch-company (command &optional arg &rest _ignore)
>      (cl-case command
>        (interactive (company-begin-backend 'notmuch-company))
>        (prefix (and (derived-mode-p 'message-mode)
> -		   (looking-back (concat notmuch-address-completion-headers-regexp ".*")
> -				 (line-beginning-position))
> -		   (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
> +		   (looking-back
> +		    (concat notmuch-address-completion-headers-regexp ".*")
> +		    (line-beginning-position))
> +		   (setq notmuch-company-last-prefix
> +			 (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
>        (candidates (cond
>  		   ((notmuch-address--harvest-ready)
>  		    ;; Update harvested addressed from time to time
> @@ -80,17 +82,20 @@ (defun notmuch-company (command &optional arg &rest _ignore)
>  		   (t
>  		    (cons :async
>  			  (lambda (callback)
> -			    ;; First run quick asynchronous harvest based on what the user entered so far
> +			    ;; First run quick asynchronous harvest
> +			    ;; based on what the user entered so far
>  			    (notmuch-address-harvest
>  			     arg nil
>  			     (lambda (_proc _event)
>  			       (funcall callback (notmuch-address-matching arg))
> -			       ;; Then start the (potentially long-running) full asynchronous harvest if necessary
> +			       ;; Then start the (potentially long-running)
> +			       ;; full asynchronous harvest if necessary
>  			       (notmuch-address-harvest-trigger))))))))
>        (match (if (string-match notmuch-company-last-prefix arg)
>  		 (match-end 0)
>  	       0))
> -      (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg))
> +      (post-completion
> +       (run-hook-with-args 'notmuch-address-post-completion-functions arg))
>        (no-cache t))))
>  
>  
> diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
> index c201d0d7..2327ff1f 100644
> --- a/emacs/notmuch-crypto.el
> +++ b/emacs/notmuch-crypto.el
> @@ -161,7 +161,8 @@ (defun notmuch-crypto-sigstatus-good-callback (button)
>  	(goto-char (point-max))
>  	(insert (format "-- Key %s in message %s:\n"
>  			fingerprint id))
> -	(call-process notmuch-crypto-gpg-program nil t t "--batch" "--no-tty" "--list-keys" fingerprint))
> +	(call-process notmuch-crypto-gpg-program nil t t
> +		      "--batch" "--no-tty" "--list-keys" fingerprint))
>        (recenter -1))))
>  
>  (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
> @@ -220,12 +221,13 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
>  	  (with-current-buffer buffer
>  	    (goto-char (point-max))
>  	    (insert (format "--- Retrieving key %s:\n" keyid)))
> -	  (let ((p (make-process :name "notmuch GPG key retrieval"
> -				 :connection-type 'pipe
> -				 :buffer buffer
> -				 :stderr buffer
> -				 :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
> -				 :sentinel #'notmuch-crypto--async-key-sentinel)))
> +	  (let ((p (make-process
> +		    :name "notmuch GPG key retrieval"
> +		    :connection-type 'pipe
> +		    :buffer buffer
> +		    :stderr buffer
> +		    :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
> +		    :sentinel #'notmuch-crypto--async-key-sentinel)))
>  	    (process-put p :gpg-key-id keyid)
>  	    (process-put p :notmuch-show-buffer (current-buffer))
>  	    (process-put p :notmuch-show-point (point))
> diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
> index 27abc7d9..c3cb619f 100644
> --- a/emacs/notmuch-draft.el
> +++ b/emacs/notmuch-draft.el
> @@ -154,12 +154,14 @@ (defun notmuch-draft--query-encryption ()
>  `notmuch-draft-save-plaintext' controls the behaviour."
>    (cl-case notmuch-draft-save-plaintext
>  	((ask)
> -	 (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
> +	 (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.
>  Really save and index an unencrypted copy? ")
>  	   (error "Save aborted")))
>  	((nil)
> -	 (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')"))
> +	 (error "Refusing to save draft with encryption tags (see `%s')"
> +		'notmuch-draft-save-plaintext))
>  	((t)
>  	 (ignore))))
>  
> @@ -192,14 +194,16 @@ (defun notmuch-draft-save ()
>         (message-remove-header "Message-ID")
>         (message-add-header (concat "Message-ID: <" id ">")))
>        (t
> -       (message "You have customized emacs so Message-ID is not a deletable header, so not changing it")
> +       (message "You have customized emacs so Message-ID is not a %s"
> +		"deletable header, so not changing it")
>         (setq id nil)))
>       (cond
>        ((member 'Date message-deletable-headers)
>         (message-remove-header "Date")
>         (message-add-header (concat "Date: " (message-make-date))))
>        (t
> -       (message "You have customized emacs so Date is not a deletable header, so not changing it")))
> +       (message "You have customized emacs so Date is not a deletable %s"
> +		"header, so not changing it")))
>       (message-add-header "X-Notmuch-Emacs-Draft: True")
>       (notmuch-draft-quote-some-mml)
>       (notmuch-maildir-setup-message-for-saving)
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 0ff5aaff..11c625ea 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -29,7 +29,8 @@ (require 'wid-edit) ; For `widget-forward'.
>  (require 'notmuch-lib)
>  (require 'notmuch-mua)
>  
> -(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
> +(declare-function notmuch-search "notmuch"
> +		  (&optional query oldest-first target-thread target-line continuation))
>  (declare-function notmuch-poll "notmuch" ())
>  (declare-function notmuch-tree "notmuch-tree"
>  		  (&optional query query-context target buffer-name open-target unthreaded))
> @@ -91,18 +92,28 @@ (define-widget 'notmuch-saved-search-plist 'list
>    :tag "Saved Search"
>    :args '((list :inline t
>  		:format "%v"
> -		(group :format "%v" :inline t (const :format "   Name: " :name) (string :format "%v"))
> -		(group :format "%v" :inline t (const :format "  Query: " :query) (string :format "%v")))
> +		(group :format "%v" :inline t
> +		       (const :format "   Name: " :name)
> +		       (string :format "%v"))
> +		(group :format "%v" :inline t
> +		       (const :format "  Query: " :query)
> +		       (string :format "%v")))
>  	  (checklist :inline t
>  		     :format "%v"
> -		     (group :format "%v" :inline t (const :format "Shortcut key: " :key) (key-sequence :format "%v"))
> -		     (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))
> -		     (group :format "%v" :inline t (const :format "" :sort-order)
> +		     (group :format "%v" :inline t
> +			    (const :format "Shortcut key: " :key)
> +			    (key-sequence :format "%v"))
> +		     (group :format "%v" :inline t
> +			    (const :format "Count-Query: " :count-query)
> +			    (string :format "%v"))
> +		     (group :format "%v" :inline t
> +			    (const :format "" :sort-order)
>  			    (choice :tag " Sort Order"
>  				    (const :tag "Default" nil)
>  				    (const :tag "Oldest-first" oldest-first)
>  				    (const :tag "Newest-first" newest-first)))
> -		     (group :format "%v" :inline t (const :format "" :search-type)
> +		     (group :format "%v" :inline t
> +			    (const :format "" :search-type)
>  			    (choice :tag " Search Type"
>  				    (const :tag "Search mode" nil)
>  				    (const :tag "Tree mode" tree)
> @@ -474,7 +485,8 @@ (defun notmuch-hello-tags-per-line (widest)
>  
>  	  ((floatp notmuch-column-control)
>  	   (let* ((available-width (- (window-width) notmuch-hello-indent))
> -		  (proposed-width (max (* available-width notmuch-column-control) widest)))
> +		  (proposed-width (max (* available-width notmuch-column-control)
> +				       widest)))
>  	     (floor available-width proposed-width)))
>  
>  	  (t
> @@ -536,8 +548,9 @@ (defun notmuch-hello-query-counts (query-list &rest options)
>  
>      (unless (= (call-process-region (point-min) (point-max) notmuch-command
>  				    t t nil "count" "--batch") 0)
> -      (notmuch-logged-error "notmuch count --batch failed"
> -			    "Please check that the notmuch CLI is new enough to support `count
> +      (notmuch-logged-error
> +       "notmuch count --batch failed"
> +       "Please check that the notmuch CLI is new enough to support `count
>  --batch'. In general we recommend running matching versions of
>  the CLI and emacs interface."))
>  
> @@ -553,7 +566,8 @@ (defun notmuch-hello-query-counts (query-list &rest options)
>  				search-query (plist-get options :filter)))
>  	       (message-count (prog1 (read (current-buffer))
>  				(forward-line 1))))
> -	  (when (and filtered-query (or (plist-get options :show-empty-searches) (> message-count 0)))
> +	  (when (and filtered-query (or (plist-get options :show-empty-searches)
> +					(> message-count 0)))
>  	    (setq elem-plist (plist-put elem-plist :query filtered-query))
>  	    (plist-put elem-plist :count message-count))))
>        query-list))))
> @@ -740,7 +754,9 @@ (defun notmuch-hello-insert-header ()
>        ;; dark background.
>        (setq image (cons 'image
>  			(append (cdr image)
> -				(list :background (face-background 'notmuch-hello-logo-background)))))
> +				(list :background
> +				      (face-background
> +				       'notmuch-hello-logo-background)))))
>        (insert-image image))
>      (widget-insert "  "))
>  
> @@ -760,7 +776,8 @@ (defun notmuch-hello-insert-header ()
>  			     (notmuch-hello-update))
>  		   :help-echo "Refresh"
>  		   (notmuch-hello-nice-number
> -		    (string-to-number (car (process-lines notmuch-command "count")))))
> +		    (string-to-number
> +		     (car (process-lines notmuch-command "count")))))
>      (widget-insert " messages.\n")))
>  
>  
> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
> index 84fe2b9c..6d8cd97f 100644
> --- a/emacs/notmuch-jump.el
> +++ b/emacs/notmuch-jump.el
> @@ -70,7 +70,8 @@ (defun notmuch-jump-search ()
>  
>      (if action-map
>  	(notmuch-jump action-map "Search: ")
> -      (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches."))))
> +      (error "To use notmuch-jump, \
> +please customize shortcut keys in notmuch-saved-searches."))))
>  
>  (defvar notmuch-jump--action nil)
>  
> @@ -200,7 +201,9 @@ (defun notmuch-jump--make-keymap (action-map prompt)
>  	      (define-key map keystr
>  		`(lambda () (interactive)
>  		   (setq notmuch-jump--action
> -			 ',(apply-partially #'notmuch-jump action-submap new-prompt))
> +			 ',(apply-partially #'notmuch-jump
> +					    action-submap
> +					    new-prompt))
>  		   (exit-minibuffer)))))))
>      map))
>  
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 0bb08eb2..9339f9d0 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -316,8 +316,10 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
>  		tail)))
>        ;; Documentation for command
>        (push (cons key-string
> -		  (or (and (symbolp binding) (get binding 'notmuch-doc))
> -		      (and (functionp binding) (notmuch-documentation-first-line binding))))
> +		  (or (and (symbolp binding)
> +			   (get binding 'notmuch-doc))
> +		      (and (functionp binding)
> +			   (notmuch-documentation-first-line binding))))
>  	    tail)))
>      tail)
>  
> @@ -327,13 +329,13 @@ (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
>    ;; binding whose "key" is 'remap, and whose "binding" is itself a
>    ;; keymap that maps not from keys to commands, but from old (remapped)
>    ;; functions to the commands to use in their stead.
> -  (map-keymap
> -   (lambda (command binding)
> -     (mapc
> -      (lambda (actual-key)
> -	(setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))
> -      (where-is-internal command base-keymap)))
> -   remap-keymap)
> +  (map-keymap (lambda (command binding)
> +		(mapc (lambda (actual-key)
> +			(setq tail
> +			      (notmuch-describe-key actual-key binding
> +						    prefix ua-keys tail)))
> +		      (where-is-internal command base-keymap)))
> +	      remap-keymap)
>    tail)
>  
>  (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
> @@ -356,9 +358,13 @@ (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail
>  		      (notmuch-describe-remaps
>  		       binding ua-keys base-keymap prefix tail)
>  		    (notmuch-describe-keymap
> -		     binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))
> +		     binding ua-keys base-keymap
> +		     (notmuch-prefix-key-description key)
> +		     tail))))
>  	   (binding
> -	    (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
> +	    (setq tail
> +		  (notmuch-describe-key (vector key)
> +					binding prefix ua-keys tail)))))
>     keymap)
>    tail)
>  
> @@ -368,11 +374,15 @@ (defun notmuch-substitute-command-keys (doc)
>      (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)
>        (let ((desc
>  	     (save-match-data
> -	       (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
> +	       (let* ((keymap-name (substring doc
> +					      (match-beginning 1)
> +					      (match-end 1)))
>  		      (keymap (symbol-value (intern keymap-name)))
>  		      (ua-keys (where-is-internal 'universal-argument keymap t))
>  		      (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
> -		      (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))
> +		      (desc-list (mapcar (lambda (arg)
> +					   (concat (car arg) "\t" (cdr arg)))
> +					 desc-alist)))
>  		 (mapconcat #'identity desc-list "\n")))))
>  	(setq doc (replace-match desc 1 1 doc)))
>        (setq beg (match-end 0)))
> @@ -391,7 +401,8 @@ (defun notmuch-help ()
>  of its command symbol."
>    (interactive)
>    (let* ((mode major-mode)
> -	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
> +	 (doc (substitute-command-keys
> +	       (notmuch-substitute-command-keys (documentation mode t)))))
>      (with-current-buffer (generate-new-buffer "*notmuch-help*")
>        (insert doc)
>        (goto-char (point-min))
> @@ -411,8 +422,10 @@ (defun notmuch-subkeymap-help ()
>      (let* ((subkeymap (key-binding prefix))
>  	   (ua-keys (where-is-internal 'universal-argument nil t))
>  	   (prefix-string (notmuch-prefix-key-description prefix))
> -	   (desc-alist (notmuch-describe-keymap subkeymap ua-keys subkeymap prefix-string))
> -	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))
> +	   (desc-alist (notmuch-describe-keymap
> +			subkeymap ua-keys subkeymap prefix-string))
> +	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg)))
> +			      desc-alist))
>  	   (desc (mapconcat #'identity desc-list "\n")))
>        (with-help-window (help-buffer)
>  	(with-current-buffer standard-output
> @@ -547,7 +560,8 @@ (defvar notmuch-multipart/alternative-discouraged
>    '(
>      ;; Avoid HTML parts.
>      "text/html"
> -    ;; multipart/related usually contain a text/html part and some associated graphics.
> +    ;; multipart/related usually contain a text/html part and some
> +    ;; associated graphics.
>      "multipart/related"
>      ))
>  
> @@ -602,8 +616,9 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
>  				   ,(notmuch-id-to-query (plist-get msg :id))))
>  			   (coding-system-for-read
>  			    (if binaryp 'no-conversion
> -			      (let ((coding-system (mm-charset-to-coding-system
> -						    (plist-get part :content-charset))))
> +			      (let ((coding-system
> +				     (mm-charset-to-coding-system
> +				      (plist-get part :content-charset))))
>  				;; Sadly,
>  				;; `mm-charset-to-coding-system' seems
>  				;; to return things that are not
> @@ -615,7 +630,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
>  				  ;; charset is US-ASCII. RFC6657
>  				  ;; complicates this somewhat.
>  				  'us-ascii)))))
> -		       (apply #'call-process notmuch-command nil '(t nil) nil args)
> +		       (apply #'call-process
> +			      notmuch-command nil '(t nil) nil args)
>  		       (buffer-string))))))
>      (when (and cache data)
>        (plist-put part plist-elem data))
> @@ -670,7 +686,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
>        (let* ((have-content (plist-member part :content))
>  	     (charset (if have-content 'gnus-decoded
>  			(plist-get part :content-charset)))
> -	     (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))
> +	     (handle (mm-make-handle (current-buffer)
> +				     `(,content-type (charset . ,charset)))))
>  	;; If the user wants the part inlined, insert the content and
>  	;; test whether we are able to inline it (which includes both
>  	;; capability and suitability tests).
> @@ -786,7 +803,8 @@ (defun notmuch-check-async-exit-status (proc msg &optional command err)
>  	   ((exit) (process-exit-status proc))
>  	   ((signal) msg))))
>      (when exit-status
> -      (notmuch-check-exit-status exit-status (or command (process-command proc))
> +      (notmuch-check-exit-status exit-status
> +				 (or command (process-command proc))
>  				 nil err))))
>  
>  (defun notmuch-check-exit-status (exit-status command &optional output err)
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
> index e95de63b..4b10a731 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -135,8 +135,9 @@ (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
>    ;; really want this header inserted.
>  
>    (when (or (not (= (elt subdir 0) ?/))
> -	    (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
> -			      subdir)))
> +	    (y-or-n-p
> +	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
> +Insert header anyway? " subdir)))
>      (message-add-header (concat "Fcc: " subdir))))
>  
>  (defun notmuch-maildir-add-file-style-fcc-header (subdir)
> @@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
>        ;; typo, or just the user want a new folder, let the user decide
>        ;; how to deal with it.
>        (error
> -       (let ((response (notmuch-read-char-choice
> -			"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
> -			'(?r ?c ?i ?e))))
> +       (let ((response (notmuch-read-char-choice "Insert failed: \
> +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))

Otherwise looks good, but what are these backslashes before (:s in line
above and...

>  	 (cl-case response
>  	   (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
>  	   (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
> @@ -333,8 +333,8 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
>        (notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
>      ;; The fcc-header is not a valid maildir see if the user wants to
>      ;; fix it in some way.
> -    (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or  (e)dit the header? "
> -			   fcc-header))
> +    (let* ((prompt (format "Fcc %s is not a maildir: \
> +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))

...^ here ?

Tomi

>  	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
>  	 (cl-case response
>  	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
> diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
> index 0164472f..c2242070 100644
> --- a/emacs/notmuch-message.el
> +++ b/emacs/notmuch-message.el
> @@ -60,7 +60,8 @@ (defconst notmuch-message-queued-tag-changes nil
>  be applied to the matching messages.")
>  
>  (defun notmuch-message-apply-queued-tag-changes ()
> -  ;; Apply the tag changes queued in the buffer-local variable notmuch-message-queued-tag-changes.
> +  ;; Apply the tag changes queued in the buffer-local variable
> +  ;; notmuch-message-queued-tag-changes.
>    (dolist (query-and-tags notmuch-message-queued-tag-changes)
>      (notmuch-tag (car query-and-tags)
>  		 (cdr query-and-tags))))
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 1efc88ea..74dfb384 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -205,10 +205,12 @@ (defun notmuch-mua-add-more-hidden-headers ()
>  (defun notmuch-mua-reply-crypto (parts)
>    "Add mml sign-encrypt flag if any part of original message is encrypted."
>    (cl-loop for part in parts
> -	   if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")
> -	     do (mml-secure-message-sign-encrypt)
> -	   else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
> -	     do (notmuch-mua-reply-crypto (plist-get part :content))))
> +	   if (notmuch-match-content-type (plist-get part :content-type)
> +					  "multipart/encrypted")
> +	   do (mml-secure-message-sign-encrypt)
> +	   else if (notmuch-match-content-type (plist-get part :content-type)
> +					       "multipart/*")
> +	   do (notmuch-mua-reply-crypto (plist-get part :content))))
>  
>  ;; There is a bug in emacs 23's message.el that results in a newline
>  ;; not being inserted after the References header, so the next header
> @@ -250,8 +252,9 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	  ;; the original message.
>  	  ((same-window-regexps '("\\*mail .*")))
>  
> -	;; We modify message-header-format-alist to get around a bug in message.el.
> -	;; See the comment above on notmuch-mua-insert-references.
> +	;; We modify message-header-format-alist to get around
> +	;; a bug in message.el.  See the comment above on
> +	;; notmuch-mua-insert-references.
>  	(let ((message-header-format-alist
>  	       (cl-loop for pair in message-header-format-alist
>  			if (eq (car pair) 'References)
> @@ -266,7 +269,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  			    (notmuch-headers-plist-to-alist reply-headers)
>  			    nil (notmuch-mua-get-switch-function))))
>  
> -      ;; Create a buffer-local queue for tag changes triggered when sending the reply
> +      ;; Create a buffer-local queue for tag changes triggered when
> +      ;; sending the reply.
>        (when notmuch-message-replied-tags
>  	(setq-local notmuch-message-queued-tag-changes
>  		    (list (cons query-string notmuch-message-replied-tags))))
> @@ -293,27 +297,29 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	(insert "From: " from "\n")
>  	(insert "Date: " date "\n\n")
>  
> -	(insert (with-temp-buffer
> -		  (let
> -		      ;; Don't attempt to clean up messages, excerpt
> -		      ;; citations, etc. in the original message before
> -		      ;; quoting.
> -		      ((notmuch-show-insert-text/plain-hook nil)
> -		       ;; Don't omit long parts.
> -		       (notmuch-show-max-text-part-size 0)
> -		       ;; Insert headers for parts as appropriate for replying.
> -		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
> -		       ;; Ensure that any encrypted parts are
> -		       ;; decrypted during the generation of the reply
> -		       ;; text.
> -		       (notmuch-show-process-crypto process-crypto)
> -		       ;; Don't indent multipart sub-parts.
> -		       (notmuch-show-indent-multipart nil))
> -		    ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
> -		    (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
> -			      ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
> -		      (notmuch-show-insert-body original (plist-get original :body) 0)
> -		      (buffer-substring-no-properties (point-min) (point-max))))))
> +	(insert
> +	 (with-temp-buffer
> +	   (let
> +	       ;; Don't attempt to clean up messages, excerpt
> +	       ;; citations, etc. in the original message before
> +	       ;; quoting.
> +	       ((notmuch-show-insert-text/plain-hook nil)
> +		;; Don't omit long parts.
> +		(notmuch-show-max-text-part-size 0)
> +		;; Insert headers for parts as appropriate for replying.
> +		(notmuch-show-insert-header-p-function
> +		 notmuch-mua-reply-insert-header-p-function)
> +		;; Ensure that any encrypted parts are
> +		;; decrypted during the generation of the reply
> +		;; text.
> +		(notmuch-show-process-crypto process-crypto)
> +		;; Don't indent multipart sub-parts.
> +		(notmuch-show-indent-multipart nil))
> +	     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
> +	     (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
> +		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
> +	       (notmuch-show-insert-body original (plist-get original :body) 0)
> +	       (buffer-substring-no-properties (point-min) (point-max))))))
>  
>  	(set-mark (point))
>  	(goto-char start)
> @@ -383,10 +389,13 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
>  
>    (unless (assq 'From other-headers)
>      (push (cons 'From (message-make-from
> -		       (notmuch-user-name) (notmuch-user-primary-email))) other-headers))
> +		       (notmuch-user-name)
> +		       (notmuch-user-primary-email)))
> +	  other-headers))
>  
>    (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
> -			     (or switch-function (notmuch-mua-get-switch-function)))
> +			     (or switch-function
> +				 (notmuch-mua-get-switch-function)))
>    (let ((headers
>  	 (append
>  	  ;; The following is copied from `message-mail'
> @@ -499,7 +508,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  		(with-current-buffer temp-buffer
>  		  (erase-buffer)
>  		  (let ((coding-system-for-read 'no-conversion))
> -		    (call-process notmuch-command nil t nil "show" "--format=raw" id))
> +		    (call-process notmuch-command nil t nil
> +				  "show" "--format=raw" id))
>  		  ;; Because we process the messages in reverse order,
>  		  ;; always generate a forwarded subject, then use the
>  		  ;; last (i.e. first) one.
> @@ -524,7 +534,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  	(message-add-header (concat "References: "
>  				    (mapconcat 'identity forward-references " "))))
>  
> -      ;; Create a buffer-local queue for tag changes triggered when sending the message
> +      ;; Create a buffer-local queue for tag changes triggered when
> +      ;; sending the message.
>        (when notmuch-message-forwarded-tags
>  	(setq-local notmuch-message-queued-tag-changes
>  		    (cl-loop for id in forward-queries
> @@ -609,7 +620,8 @@ (defun notmuch-mua-send-common (arg &optional exit)
>    (run-hooks 'notmuch-mua-send-hook)
>    (when (and (notmuch-mua-check-no-misplaced-secure-tag)
>  	     (notmuch-mua-check-secure-tag-has-newline))
> -    (cl-letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
> +    (cl-letf (((symbol-function 'message-do-fcc)
> +	       #'notmuch-maildir-message-do-fcc))
>        (if exit
>  	  (message-send-and-exit arg)
>  	(message-send arg)))))
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index c9170466..26b41603 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -51,7 +51,8 @@ (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))
>  (declare-function notmuch-count-attachments "notmuch" (mm-handle))
>  (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))
>  (declare-function notmuch-tree "notmuch-tree"
> -		  (&optional query query-context target buffer-name open-target unthreaded))
> +		  (&optional query query-context target buffer-name
> +			     open-target unthreaded))
>  (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
>  (declare-function notmuch-unthreaded
>  		  (&optional query query-context target buffer-name open-target))
> @@ -95,10 +96,11 @@ (defcustom notmuch-show-hook '(notmuch-show-turn-on-visual-line-mode)
>    :group 'notmuch-show
>    :group 'notmuch-hooks)
>  
> -(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
> -						 notmuch-wash-tidy-citations
> -						 notmuch-wash-elide-blank-lines
> -						 notmuch-wash-excerpt-citations)
> +(defcustom notmuch-show-insert-text/plain-hook
> +  '(notmuch-wash-wrap-long-lines
> +    notmuch-wash-tidy-citations
> +    notmuch-wash-elide-blank-lines
> +    notmuch-wash-excerpt-citations)
>    "Functions used to improve the display of text/plain parts."
>    :type 'hook
>    :options '(notmuch-wash-convert-inline-patch-to-part
> @@ -348,7 +350,9 @@ (defun notmuch-show-with-message-as-text (fn)
>      (with-temp-buffer
>        (insert all)
>        (if indenting
> -	  (indent-rigidly (point-min) (point-max) (- (* notmuch-show-indent-messages-width depth))))
> +	  (indent-rigidly (point-min)
> +			  (point-max)
> +			  (- (* notmuch-show-indent-messages-width depth))))
>        ;; Remove the original header.
>        (goto-char (point-min))
>        (re-search-forward "^$" (point-max) nil)
> @@ -395,7 +399,9 @@ (defun notmuch-show-update-tags (tags)
>      (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
>  	(let ((inhibit-read-only t))
>  	  (replace-match (concat "("
> -				 (notmuch-tag-format-tags tags (notmuch-show-get-prop :orig-tags))
> +				 (notmuch-tag-format-tags
> +				  tags
> +				  (notmuch-show-get-prop :orig-tags))
>  				 ")"))))))
>  
>  (defun notmuch-clean-address (address)
> @@ -475,7 +481,8 @@ (defun notmuch-show-insert-headerline (headers date tags depth)
>  	    ") ("
>  	    (notmuch-tag-format-tags tags tags)
>  	    ")\n")
> -    (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
> +    (overlay-put (make-overlay start (point))
> +		 'face 'notmuch-message-summary-face)))
>  
>  (defun notmuch-show-insert-header (header header-value)
>    "Insert a single header."
> @@ -502,7 +509,8 @@ (define-button-type 'notmuch-show-part-button-type
>    'face 'message-mml
>    :supertype 'notmuch-button-type)
>  
> -(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
> +(defun notmuch-show-insert-part-header (nth content-type declared-type
> +					    &optional name comment)
>    (let ((button)
>  	(base-label (concat (when name (concat name ": "))
>  			    declared-type
> @@ -526,8 +534,9 @@ (defun notmuch-show-toggle-part-invisibility (&optional button)
>      (when button
>        (let ((overlay (button-get button 'overlay))
>  	    (lazy-part (button-get button :notmuch-lazy-part)))
> -	;; We have a part to toggle if there is an overlay or if there is a lazy part.
> -	;; If neither is present we cannot toggle the part so we just return nil.
> +	;; We have a part to toggle if there is an overlay or if there
> +	;; is a lazy part.  If neither is present we cannot toggle the
> +	;; part so we just return nil.
>  	(when (or overlay lazy-part)
>  	  (let* ((show (button-get button :notmuch-part-hidden))
>  		 (new-start (button-start button))
> @@ -628,7 +637,8 @@ (defun notmuch-show-multipart/*-to-list (part)
>  	  (plist-get part :content)))
>  
>  (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth button)
> -  (let ((chosen-type (car (notmuch-multipart/alternative-choose msg (notmuch-show-multipart/*-to-list part))))
> +  (let ((chosen-type (car (notmuch-multipart/alternative-choose
> +			   msg (notmuch-show-multipart/*-to-list part))))
>  	(inner-parts (plist-get part :content))
>  	(start (point)))
>      ;; This inserts all parts of the chosen type rather than just one,
> @@ -764,7 +774,8 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
>  	      (unwind-protect
>  		  (progn
>  		    (unless (icalendar-import-buffer file t)
> -		      (error "Icalendar import error. See *icalendar-errors* for more information"))
> +		      (error "Icalendar import error. %s"
> +			     "See *icalendar-errors* for more information"))
>  		    (set-buffer (get-file-buffer file))
>  		    (setq result (buffer-substring (point-min) (point-max)))
>  		    (set-buffer-modified-p nil)
> @@ -782,10 +793,13 @@ (if (version< emacs-version "25.3")
>      ;;
>      ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
>      ;; (see notmuch-show-handlers-for)
> -    (defun notmuch-show-insert-part-text/enriched (msg part content-type nth depth button)
> -      ;; By requiring enriched below, we ensure that the function enriched-decode-display-prop
> -      ;; is defined before it will be shadowed by the letf below. Otherwise the version
> -      ;; in enriched.el may be loaded a bit later and used instead (for the first time).
> +    (defun notmuch-show-insert-part-text/enriched
> +	(msg part content-type nth depth button)
> +      ;; By requiring enriched below, we ensure that the function
> +      ;; enriched-decode-display-prop is defined before it will be
> +      ;; shadowed by the letf below. Otherwise the version in
> +      ;; enriched.el may be loaded a bit later and used instead (for
> +      ;; the first time).
>        (require 'enriched)
>        (cl-letf (((symbol-function 'enriched-decode-display-prop)
>  		 (lambda (start end &optional param) (list start end))))
> @@ -943,7 +957,9 @@ (defun notmuch-show-lazy-part (part-args button)
>  	(narrow-to-region part-beg part-end)
>  	(delete-region part-beg part-end)
>  	(apply #'notmuch-show-insert-bodypart-internal part-args)
> -	(indent-rigidly part-beg part-end (* notmuch-show-indent-messages-width depth)))
> +	(indent-rigidly part-beg
> +			part-end
> +			(* notmuch-show-indent-messages-width depth)))
>        (goto-char part-end)
>        (delete-char 1)
>        (notmuch-show-record-part-information (cadr part-args)
> @@ -1001,12 +1017,14 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>  	 (nth (plist-get part :id))
>  	 (long (and (notmuch-match-content-type mime-type "text/*")
>  		    (> notmuch-show-max-text-part-size 0)
> -		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
> +		    (> (length (plist-get part :content))
> +		       notmuch-show-max-text-part-size)))
>  	 (beg (point))
>  	 ;; This default header-p function omits the part button for
>  	 ;; the first (or only) part if this is text/plain.
>  	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
> -		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
> +		   (notmuch-show-insert-part-header nth mime-type content-type
> +						    (plist-get part :filename))))
>  	 ;; Hide the part initially if HIDE is t, or if it is too long
>  	 ;; and we have a button to allow toggling.
>  	 (show-part (not (or (equal hide t)
> @@ -1104,13 +1122,17 @@ (defun notmuch-show-insert-msg (msg depth)
>  
>      ;; Indent according to the depth in the thread.
>      (if notmuch-show-indent-content
> -	(indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth)))
> +	(indent-rigidly content-start
> +			content-end
> +			(* notmuch-show-indent-messages-width depth)))
>  
>      (setq message-end (point-max-marker))
>  
>      ;; Save the extents of this message over the whole text of the
>      ;; message.
> -    (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
> +    (put-text-property message-start message-end
> +		       :notmuch-message-extent
> +		       (cons message-start message-end))
>  
>      ;; Create overlays used to control visibility
>      (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
> @@ -1144,7 +1166,8 @@ (defun notmuch-show-toggle-process-crypto ()
>  (defun notmuch-show-toggle-elide-non-matching ()
>    "Toggle the display of non-matching messages."
>    (interactive)
> -  (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))
> +  (setq notmuch-show-elide-non-matching-messages
> +	(not notmuch-show-elide-non-matching-messages))
>    (message (if notmuch-show-elide-non-matching-messages
>  	       "Showing matching messages only."
>  	     "Showing all messages."))
> @@ -1411,8 +1434,9 @@ (defun notmuch-show-apply-state (state)
>  
>      ;; Open those that were open.
>      (goto-char (point-min))
> -    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
> -					      (member (notmuch-show-get-message-id) open))
> +    (cl-loop do (notmuch-show-message-visible
> +		 (notmuch-show-get-message-properties)
> +		 (member (notmuch-show-get-message-id) open))
>  	     until (not (notmuch-show-goto-message-next)))
>  
>      (dolist (win-msg-pair win-msg-alist)
> @@ -1645,7 +1669,8 @@ (defun notmuch-show-headers-visible (props visible-p)
>  (defun notmuch-show-set-message-properties (props)
>    (save-excursion
>      (notmuch-show-move-to-message-top)
> -    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
> +    (put-text-property (point) (+ (point) 1)
> +		       :notmuch-message-properties props)))
>  
>  (defun notmuch-show-get-message-properties ()
>    "Return the properties of the current message as a plist.
> @@ -1798,8 +1823,9 @@ (defun notmuch-show-command-hook ()
>  	   (setq notmuch-show--seen-has-errored 't)
>  	   (setq header-line-format
>  		 (concat header-line-format
> -			 (propertize "  [some mark read tag changes may have failed]"
> -				     'face font-lock-warning-face)))))))))
> +			 (propertize
> +			  "  [some mark read tag changes may have failed]"
> +			  'face font-lock-warning-face)))))))))
>  
>  (defun notmuch-show-filter-thread (query)
>    "Filter or LIMIT the current thread based on a new query string.
> @@ -1821,7 +1847,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
>        (goto-char (point-min))
>        (while (not done)
>  	(if (notmuch-show-message-visible-p)
> -	    (setq message-ids (append message-ids (list (notmuch-show-get-message-id)))))
> +	    (setq message-ids
> +		  (append message-ids (list (notmuch-show-get-message-id)))))
>  	(setq done (not (notmuch-show-goto-message-next)))
>  	)
>        message-ids
> @@ -1885,7 +1912,8 @@ (defun notmuch-show-advance-and-archive ()
>        (notmuch-show-archive-thread-then-next)))
>  
>  (defun notmuch-show-rewind ()
> -  "Backup through the thread (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
> +  "Backup through the thread (reverse scrolling compared to \
> +\\[notmuch-show-advance-and-archive]).
>  
>  Specifically, if the beginning of the previous email is fewer
>  than `window-height' lines from the current point, move to it
> @@ -2077,11 +2105,14 @@ (defun notmuch-show-pipe-message (entire-thread command)
>  	(setq shell-command
>  	      (concat notmuch-command " show --format=mbox --exclude=false "
>  		      (shell-quote-argument
> -		       (mapconcat 'identity (notmuch-show-get-message-ids-for-open-messages) " OR "))
> +		       (mapconcat 'identity
> +				  (notmuch-show-get-message-ids-for-open-messages)
> +				  " OR "))
>  		      " | " command))
>        (setq shell-command
>  	    (concat notmuch-command " show --format=raw "
> -		    (shell-quote-argument (notmuch-show-get-message-id)) " | " command)))
> +		    (shell-quote-argument (notmuch-show-get-message-id))
> +		    " | " command)))
>      (let ((cwd default-directory)
>  	  (buf (get-buffer-create (concat "*notmuch-pipe*"))))
>        (with-current-buffer buf
> @@ -2182,8 +2213,9 @@ (defun notmuch-show-open-or-close-all ()
>    (interactive)
>    (save-excursion
>      (goto-char (point-min))
> -    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
> -					      (not current-prefix-arg))
> +    (cl-loop do (notmuch-show-message-visible
> +		 (notmuch-show-get-message-properties)
> +		 (not current-prefix-arg))
>  	     until (not (notmuch-show-goto-message-next))))
>    (force-window-update))
>  
> @@ -2515,7 +2547,8 @@ (defun notmuch-show-choose-mime-of-part (mime-type)
>    (interactive
>     (list (completing-read "Mime type to use (default text/plain): "
>  			  (mailcap-mime-types) nil nil nil nil "text/plain")))
> -  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
> +  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part
> +					     mime-type))
>  
>  (defun notmuch-show-imenu-prev-index-position-function ()
>    "Move point to previous message in notmuch-show buffer.
> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
> index c54e6ad0..34cd493a 100644
> --- a/emacs/notmuch-tag.el
> +++ b/emacs/notmuch-tag.el
> @@ -44,7 +44,9 @@ (define-widget 'notmuch-tag-key-type 'list
>    :args '((list :inline t
>  		:format "%v"
>  		(key-sequence :tag "Key")
> -		(radio :tag "Tag operations" (repeat :tag "Tag list" (string :format "%v" :tag "change"))
> +		(radio :tag "Tag operations"
> +		       (repeat :tag "Tag list"
> +			       (string :format "%v" :tag "change"))
>  		       (variable :tag "Tag variable"))
>  		(string :tag "Name"))))
>  
> @@ -316,7 +318,9 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
>  `notmuch-tag-formats'."
>    (let* ((tag-state (cond ((not (member tag tags)) 'deleted)
>  			  ((not (member tag orig-tags)) 'added)))
> -	 (formatted-tag (gethash (cons tag tag-state) notmuch-tag--format-cache 'missing)))
> +	 (formatted-tag (gethash (cons tag tag-state)
> +				 notmuch-tag--format-cache
> +				 'missing)))
>      (when (eq formatted-tag 'missing)
>        (let ((base (notmuch-tag--get-formats tag notmuch-tag-formats))
>  	    (over (cl-case tag-state
> @@ -338,9 +342,9 @@ (defun notmuch-tag-format-tags (tags orig-tags &optional face)
>      (notmuch-apply-face
>       (mapconcat #'identity
>  		;; nil indicated that the tag was deliberately hidden
> -		(delq nil (mapcar
> -			   (apply-partially #'notmuch-tag-format-tag tags orig-tags)
> -			   all-tags))
> +		(delq nil (mapcar (apply-partially #'notmuch-tag-format-tag
> +						   tags orig-tags)
> +				  all-tags))
>  		" ")
>       face
>       t)))
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index ab90f652..fcfb972d 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -34,7 +34,8 @@ (require 'notmuch-show)
>  (require 'notmuch-tag)
>  (require 'notmuch-parser)
>  
> -(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line))
> +(declare-function notmuch-search "notmuch"
> +		  (&optional query oldest-first target-thread target-line))
>  (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
>  (declare-function notmuch-read-query "notmuch" (prompt))
>  (declare-function notmuch-search-find-thread-id "notmuch" (&optional bare))
> @@ -284,15 +285,18 @@ (defvar notmuch-tree-mode-map
>      (set-keymap-parent map notmuch-common-keymap)
>      ;; The following override the global keymap.
>      ;; Override because we want to close message pane first.
> -    (define-key map [remap notmuch-help] (notmuch-tree-close-message-pane-and #'notmuch-help))
> +    (define-key map [remap notmuch-help]
> +      (notmuch-tree-close-message-pane-and #'notmuch-help))
>      ;; Override because we first close message pane and then close tree buffer.
>      (define-key map [remap notmuch-bury-or-kill-this-buffer] 'notmuch-tree-quit)
>      ;; Override because we close message pane after the search query is entered.
>      (define-key map [remap notmuch-search] 'notmuch-tree-to-search)
>      ;; Override because we want to close message pane first.
> -    (define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
> +    (define-key map [remap notmuch-mua-new-mail]
> +      (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
>      ;; Override because we want to close message pane first.
> -    (define-key map [remap notmuch-jump-search] (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
> +    (define-key map [remap notmuch-jump-search]
> +      (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
>  
>      (define-key map "S" 'notmuch-search-from-tree-current-query)
>      (define-key map "U" 'notmuch-unthreaded-from-tree-current-query)
> @@ -306,16 +310,24 @@ (defvar notmuch-tree-mode-map
>      (define-key map "b" 'notmuch-show-resend-message)
>  
>      ;; these apply to the message pane
> -    (define-key map (kbd "M-TAB") (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
> -    (define-key map (kbd "<backtab>")  (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
> -    (define-key map (kbd "TAB") (notmuch-tree-to-message-pane #'notmuch-show-next-button))
> -    (define-key map "$" (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
> +    (define-key map (kbd "M-TAB")
> +      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
> +    (define-key map (kbd "<backtab>")
> +      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
> +    (define-key map (kbd "TAB")
> +      (notmuch-tree-to-message-pane #'notmuch-show-next-button))
> +    (define-key map "$"
> +      (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
>  
>      ;; bindings from show (or elsewhere) but we close the message pane first.
> -    (define-key map "f" (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
> -    (define-key map "r" (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
> -    (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
> -    (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
> +    (define-key map "f"
> +      (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
> +    (define-key map "r"
> +      (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
> +    (define-key map "R"
> +      (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
> +    (define-key map "V"
> +      (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
>  
>      ;; The main tree view bindings
>      (define-key map (kbd "RET") 'notmuch-tree-show-message)
> @@ -354,7 +366,9 @@ (defun notmuch-tree-get-message-properties ()
>  (defun notmuch-tree-set-message-properties (props)
>    (save-excursion
>      (beginning-of-line)
> -    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
> +    (put-text-property (point)
> +		       (+ (point) 1)
> +		       :notmuch-message-properties props)))
>  
>  (defun notmuch-tree-set-prop (prop val &optional props)
>    (let ((inhibit-read-only t)
> @@ -407,7 +421,8 @@ (defun notmuch-tree-refresh-result ()
>      ;; from overwriting the buffer local copy of
>      ;; notmuch-tree-previous-subject if this is called while the
>      ;; buffer is displaying.
> -    (let ((notmuch-tree-previous-subject (notmuch-tree-get-prop :previous-subject)))
> +    (let ((notmuch-tree-previous-subject
> +	   (notmuch-tree-get-prop :previous-subject)))
>        (delete-region (point) (1+ (line-end-position)))
>        (notmuch-tree-insert-msg msg))
>      (let ((new-end (line-end-position)))
> @@ -596,7 +611,8 @@ (defun notmuch-tree-close-message-window ()
>    "Close the message-window. Return t if close succeeds."
>    (interactive)
>    (when (and (window-live-p notmuch-tree-message-window)
> -	     (eq (window-buffer notmuch-tree-message-window) notmuch-tree-message-buffer))
> +	     (eq (window-buffer notmuch-tree-message-window)
> +		 notmuch-tree-message-buffer))
>      (delete-window notmuch-tree-message-window)
>      (unless (get-buffer-window-list notmuch-tree-message-buffer)
>        (kill-buffer notmuch-tree-message-buffer))
> @@ -611,7 +627,8 @@ (defun notmuch-tree-archive-message (&optional unarchive)
>  `notmuch-archive-tags' will be reversed."
>    (interactive "P")
>    (when notmuch-archive-tags
> -    (notmuch-tree-tag (notmuch-tag-change-list notmuch-archive-tags unarchive))))
> +    (notmuch-tree-tag
> +     (notmuch-tag-change-list notmuch-archive-tags unarchive))))
>  
>  (defun notmuch-tree-archive-message-then-next (&optional unarchive)
>    "Archive the current message and move to next matching message."
> @@ -786,7 +803,8 @@ (defun notmuch-tree-format-field (field format-string msg)
>        (let ((face (if match
>  		      'notmuch-tree-match-date-face
>  		    'notmuch-tree-no-match-date-face)))
> -	(propertize (format format-string (plist-get msg :date_relative)) 'face face)))
> +	(propertize (format format-string (plist-get msg :date_relative))
> +		    'face face)))
>  
>       ((string-equal field "tree")
>        (let ((tree-status (plist-get msg :tree-status))
> @@ -880,7 +898,8 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
>         ((and (< 0 depth) last)
>  	(push "╰" tree-status))
>         ((and (eq 0 depth) first last)
> -;;	  (push "─" tree-status)) choice between this and next line is matter of taste.
> +	;; Choice between these two variants is a matter of taste.
> +	;; (push "─" tree-status))
>  	(push " " tree-status))
>         ((and (eq 0 depth) first (not last))
>  	  (push "┬" tree-status))
> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
> index fd0314cc..3a9ffdd0 100644
> --- a/emacs/notmuch-wash.el
> +++ b/emacs/notmuch-wash.el
> @@ -25,7 +25,9 @@
>  
>  (require 'coolj)
>  (require 'notmuch-lib)
> -(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
> +
> +(declare-function notmuch-show-insert-bodypart "notmuch-show"
> +		  (msg part depth &optional hide))
>  (defvar notmuch-show-indent-messages-width)
>  
>  ;;
> @@ -186,9 +188,12 @@ (defun notmuch-wash-button-label (overlay)
>    (let* ((type (overlay-get overlay 'type))
>  	 (invis-spec (overlay-get overlay 'invisible))
>  	 (state (if (invisible-p invis-spec) "hidden" "visible"))
> -	 (label-format (symbol-value (intern-soft (concat "notmuch-wash-button-"
> -							  type "-" state "-format"))))
> -	 (lines-count (count-lines (overlay-start overlay) (overlay-end overlay))))
> +	 (label-format (symbol-value
> +			(intern-soft
> +			 (format "notmuch-wash-button-%s-%s-format"
> +				 type state))))
> +	 (lines-count (count-lines (overlay-start overlay)
> +				   (overlay-end overlay))))
>      (format label-format lines-count)))
>  
>  (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
> @@ -238,7 +243,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
>      (let* ((cite-start (match-beginning 0))
>  	   (cite-end (match-end 0))
>  	   (cite-lines (count-lines cite-start cite-end)))
> -      (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
> +      (overlay-put (make-overlay cite-start cite-end)
> +		   'face 'notmuch-wash-cited-text)
>        (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
>  			     notmuch-wash-citation-lines-suffix
>  			     1))
> @@ -260,7 +266,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
>  		  (sig-end-marker (make-marker)))
>  	      (set-marker sig-start-marker sig-start)
>  	      (set-marker sig-end-marker (point-max))
> -	      (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text)
> +	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
> +			   'face 'message-cited-text)
>  	      (notmuch-wash-region-to-button
>  	       msg sig-start-marker sig-end-marker
>  	       "signature"))))))
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index c97997fe..07a58da7 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -516,7 +516,9 @@ (defun notmuch-search-show-thread (&optional elide-toggle)
>  		      (current-buffer)
>  		      notmuch-search-query-string
>  		      ;; Name the buffer based on the subject.
> -		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
> +		      (concat "*"
> +			      (truncate-string-to-width subject 30 nil nil t)
> +			      "*"))
>        (message "End of search results."))))
>  
>  (defun notmuch-tree-from-search-current-query ()
> @@ -800,7 +802,9 @@ (defun notmuch-search-insert-authors (format-string authors)
>        ;; If there is any invisible text, add it as a tooltip to the
>        ;; visible text.
>        (when (not (string= invisible-string ""))
> -	(setq visible-string (propertize visible-string 'help-echo (concat "..." invisible-string))))
> +	(setq visible-string
> +	      (propertize visible-string
> +			  'help-echo (concat "..." invisible-string))))
>  
>        ;; Insert the visible and, if present, invisible author strings.
>        (insert visible-string)
> @@ -892,7 +896,8 @@ (defun notmuch-search-buffer-title (query)
>  		(longest-length 0))
>  	    (cl-loop for tuple in notmuch-saved-searches
>  		     if (let ((quoted-query
> -			       (regexp-quote (notmuch-saved-search-get tuple :query))))
> +			       (regexp-quote
> +				(notmuch-saved-search-get tuple :query))))
>  			  (and (string-match (concat "^" quoted-query) query)
>  			       (> (length (match-string 0 query))
>  				  longest-length)))
> @@ -905,9 +910,10 @@ (defun notmuch-search-buffer-title (query)
>  	   (concat "*notmuch-saved-search-" saved-search-name "*"))
>  	  (saved-search
>  	   (concat "*notmuch-search-"
> -		   (replace-regexp-in-string (concat "^" (regexp-quote saved-search-query))
> -					     (concat "[ " saved-search-name " ]")
> -					     query)
> +		   (replace-regexp-in-string
> +		    (concat "^" (regexp-quote saved-search-query))
> +		    (concat "[ " saved-search-name " ]")
> +		    query)
>  		   "*"))
>  	  (t
>  	   (concat "*notmuch-search-" query "*"))
> @@ -926,7 +932,8 @@ (defun notmuch-read-query (prompt)
>  		       "subject:" "attachment:")
>  		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
>  		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
> -		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
> +		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
> +			 (mailcap-mime-types)))))
>      (let ((keymap (copy-keymap minibuffer-local-map))
>  	  (current-query (cl-case major-mode
>  			   (notmuch-search-mode (notmuch-search-get-query))
> @@ -1078,8 +1085,10 @@ (defun notmuch-search-filter-by-tag (tag)
>  Runs a new search matching only messages that match both the
>  current search results AND that are tagged with the given tag."
>    (interactive
> -   (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
> -  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
> +   (list (notmuch-select-tag-with-completion "Filter by tag: "
> +					     notmuch-search-query-string)))
> +  (notmuch-search (concat notmuch-search-query-string " and tag:" tag)
> +		  notmuch-search-oldest-first))
>  
>  (defun notmuch-search-by-tag (tag)
>    "Display threads matching TAG in a notmuch-search buffer."
> diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
> index 2225aefc..2af91186 100644
> --- a/emacs/rstdoc.el
> +++ b/emacs/rstdoc.el
> @@ -63,7 +63,8 @@ (defun rstdoc-extract (in-file out-file)
>  
>  (defun rstdoc--insert-docstring (symbol docstring)
>    (insert (format "\n.. |docstring::%s| replace::\n" symbol))
> -  (insert (replace-regexp-in-string "^" "    " (rstdoc--rst-quote-string docstring)))
> +  (insert (replace-regexp-in-string "^" "    "
> +				    (rstdoc--rst-quote-string docstring)))
>    (insert "\n"))
>  
>  (defvar rst--escape-alist
> -- 
> 2.26.0
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 02/23] emacs: Remove excess empty lines
  2020-07-26 16:57 ` [PATCH 02/23] emacs: Remove excess empty lines Jonas Bernoulli
@ 2020-07-27 18:00   ` Tomi Ollila
  2020-07-27 20:25     ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-07-27 18:00 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

On Sun, Jul 26 2020, Jonas Bernoulli wrote:

> Most people who write lots of lisp tend to only sparsely use empty
> "separator" lines within forms.  In lisp they feel unnecessary and
> since most files stick to this convention we get a bit confused
> when there are extra empty lines.  It feels like the s-expressions
> are falling into pieces.
>
> All of this is especially true between a function's doc-string and
> body because the doc-string is colored differently, which visually
> already separates it quite sufficiently from the code that follows.
> ---
>  emacs/make-deps.el           |  2 -
>  emacs/notmuch-address.el     |  2 -
>  emacs/notmuch-crypto.el      |  4 --
>  emacs/notmuch-hello.el       | 18 ---------
>  emacs/notmuch-jump.el        |  5 ---
>  emacs/notmuch-lib.el         | 10 -----
>  emacs/notmuch-maildir-fcc.el |  7 ----
>  emacs/notmuch-mua.el         | 26 -------------
>  emacs/notmuch-parser.el      |  5 ---
>  emacs/notmuch-show.el        | 75 ++----------------------------------
>  emacs/notmuch-tag.el         |  3 --
>  emacs/notmuch-tree.el        |  9 -----
>  emacs/notmuch-wash.el        | 18 +--------
>  emacs/notmuch.el             |  7 ----
>  14 files changed, 5 insertions(+), 186 deletions(-)
>
> diff --git a/emacs/make-deps.el b/emacs/make-deps.el
> index 5b6db698..dcac319c 100644
> --- a/emacs/make-deps.el
> +++ b/emacs/make-deps.el
> @@ -23,7 +23,6 @@
>  
>  (defun batch-make-deps ()
>    "Invoke `make-deps' for each file on the command line."
> -
>    (setq debug-on-error t)
>    (dolist (file command-line-args-left)
>      (let ((default-directory command-line-default-directory))
> @@ -37,7 +36,6 @@ (defun make-deps (&optional dir)
>  This prints make dependencies to `standard-output' based on the
>  top-level `require' expressions in the current buffer.  Paths in
>  rules will be given relative to DIR, or `default-directory'."
> -
>    (setq dir (or dir default-directory))
>    (save-excursion
>      (goto-char (point-min))
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index 2a9c411a..ca4da3f3 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
>  Address harvesting may take some time so the address collection runs
>  asynchronously unless SYNCHRONOUS is t. In case of asynchronous
>  execution, CALLBACK is called when harvesting finishes."
> -
>    (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
>  	 (config-query (cadr notmuch-address-internal-completion))
>  	 (prefix-query (when addr-prefix
> @@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
>  	;; Kill any existing process
>  	(when current-proc
>  	  (kill-buffer (process-buffer current-proc))) ; this also kills the process
> -
>  	(setq current-proc
>  	      (apply 'notmuch-start-notmuch proc-name proc-buf
>  		     callback				; process sentinel
> diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
> index 2327ff1f..58947a20 100644
> --- a/emacs/notmuch-crypto.el
> +++ b/emacs/notmuch-crypto.el
> @@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
>  		face 'notmuch-crypto-signature-good-key))
>  	(setq button-action 'notmuch-crypto-sigstatus-good-callback
>  	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
> -
>       ((string= status "error")
>        (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
>  	    button-action 'notmuch-crypto-sigstatus-error-callback
>  	    help-msg (concat "Click to retrieve key ID " keyid
>  			     " from keyserver.")))
> -
>       ((string= status "bad")
>        (setq label (concat "Bad signature (claimed key ID " keyid ")")
>  	    face 'notmuch-crypto-signature-bad))
> -
>       (status
>        (setq label (concat "Unknown signature status: " status)))
>       (t
> @@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
>  	    (process-put p :notmuch-show-buffer (current-buffer))
>  	    (process-put p :notmuch-show-point (point))
>  	    (message "Getting the GPG key %s asynchronously..." keyid)))
> -
>        (let ((window (display-buffer buffer)))
>  	(with-selected-window window
>  	  (with-current-buffer buffer
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 11c625ea..e71e55f3 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches
>  ;; The saved-search format is also used by the all-tags notmuch-hello
>  ;; section. This section generates its own saved-search list in one of
>  ;; the latter two forms.
> -
>    :get 'notmuch-hello--saved-searches-to-plist
>    :type '(repeat notmuch-saved-search-plist)
>    :tag "List of Saved Searches"
> @@ -482,20 +481,17 @@ (defun notmuch-hello-tags-per-line (widest)
>  		   ;; Count is 9 wide (8 digits plus space), 1 for the space
>  		   ;; after the name.
>  		   (+ 9 1 (max notmuch-column-control widest)))))
> -
>  	  ((floatp notmuch-column-control)
>  	   (let* ((available-width (- (window-width) notmuch-hello-indent))
>  		  (proposed-width (max (* available-width notmuch-column-control)
>  				       widest)))
>  	     (floor available-width proposed-width)))
> -
>  	  (t
>  	   (max 1
>  		(/ (- (window-width) notmuch-hello-indent)
>  		   ;; Count is 9 wide (8 digits plus space), 1 for the space
>  		   ;; after the name.
>  		   (+ 9 1 widest)))))))
> -
>      (cons tags-per-line (/ (max 1
>  				(- (window-width) notmuch-hello-indent
>  				   ;; Count is 9 wide (8 digits plus
> @@ -545,7 +541,6 @@ (defun notmuch-hello-query-counts (query-list &rest options)
>  					(or (plist-get options :filter-count)
>  					    (plist-get options :filter))))
>  	  "\n")))
> -
>      (unless (= (call-process-region (point-min) (point-max) notmuch-command
>  				    t t nil "count" "--batch") 0)
>        (notmuch-logged-error
> @@ -553,9 +548,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
>         "Please check that the notmuch CLI is new enough to support `count
>  --batch'. In general we recommend running matching versions of
>  the CLI and emacs interface."))
> -
>      (goto-char (point-min))
> -
>      (notmuch-remove-if-not
>       #'identity
>       (mapcar
> @@ -621,7 +614,6 @@ (defun notmuch-hello-insert-buttons (searches)
>  	      (setq column-indent 0)
>  	      (widget-insert "\n")))
>  	  reordered-list)
> -
>      ;; If the last line was not full (and hence did not include a
>      ;; carriage return), insert one now.
>      (unless (eq (% count tags-per-line) 0)
> @@ -780,7 +772,6 @@ (defun notmuch-hello-insert-header ()
>  		     (car (process-lines notmuch-command "count")))))
>      (widget-insert " messages.\n")))
>  
> -
>  (defun notmuch-hello-insert-saved-searches ()
>    "Insert the saved-searches section."
>    (let ((searches (notmuch-hello-query-counts
> @@ -977,7 +968,6 @@ (defun notmuch-hello-insert-footer ()
>  (defun notmuch-hello (&optional no-display)
>    "Run notmuch and display saved searches, known tags, etc."
>    (interactive)
> -
>    (notmuch-assert-cli-sane)
>    ;; This may cause a window configuration change, so if the
>    ;; auto-refresh hook is already installed, avoid recursive refresh.
> @@ -985,32 +975,25 @@ (defun notmuch-hello (&optional no-display)
>      (if no-display
>  	(set-buffer "*notmuch-hello*")
>        (switch-to-buffer "*notmuch-hello*")))
> -
>    ;; Install auto-refresh hook
>    (when notmuch-hello-auto-refresh
>      (add-hook 'window-configuration-change-hook
>  	      #'notmuch-hello-window-configuration-change))
> -
>    (let ((target-line (line-number-at-pos))
>  	(target-column (current-column))
>  	(inhibit-read-only t))
> -
>      ;; Delete all editable widget fields.  Editable widget fields are
>      ;; tracked in a buffer local variable `widget-field-list' (and
>      ;; others).  If we do `erase-buffer' without properly deleting the
>      ;; widgets, some widget-related functions are confused later.
>      (mapc 'widget-delete widget-field-list)
> -
>      (erase-buffer)
> -
>      (unless (eq major-mode 'notmuch-hello-mode)
>        (notmuch-hello-mode))
> -
>      (let ((all (overlay-lists)))
>        ;; Delete all the overlays.
>        (mapc 'delete-overlay (car all))
>        (mapc 'delete-overlay (cdr all)))
> -
>      (mapc
>       (lambda (section)
>         (let ((point-before (point)))
> @@ -1023,7 +1006,6 @@ (defun notmuch-hello (&optional no-display)
>  	   (widget-insert "\n"))))
>       notmuch-hello-sections)
>      (widget-setup)
> -
>      ;; Move point back to where it was before refresh. Use line and
>      ;; column instead of point directly to be insensitive to additions
>      ;; and removals of text within earlier lines.
> diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
> index 6d8cd97f..adf79650 100644
> --- a/emacs/notmuch-jump.el
> +++ b/emacs/notmuch-jump.el
> @@ -43,7 +43,6 @@ (defun notmuch-jump-search ()
>  Typically these shortcuts are a single key long, so this is a
>  fast way to jump to a saved search from anywhere in Notmuch."
>    (interactive)
> -
>    ;; Build the action map
>    (let (action-map)
>      (dolist (saved-search notmuch-saved-searches)
> @@ -67,7 +66,6 @@ (defun notmuch-jump-search ()
>  			  `(lambda () (notmuch-search ',query ',oldest-first)))))
>  		  action-map)))))
>      (setq action-map (nreverse action-map))
> -
>      (if action-map
>  	(notmuch-jump action-map "Search: ")
>        (error "To use notmuch-jump, \
> @@ -90,7 +88,6 @@ (defun notmuch-jump (action-map prompt)
>  the buffer, and ACTION is a nullary function to call.  LABEL may
>  be null, in which case the action will still be bound, but will
>  not appear in the pop-up buffer."
> -
>    (let* ((items (notmuch-jump--format-actions action-map))
>  	 ;; Format the table of bindings and the full prompt
>  	 (table
> @@ -115,7 +112,6 @@ (defun notmuch-jump (action-map prompt)
>  	 (notmuch-jump--action nil))
>      ;; Read the action
>      (read-from-minibuffer full-prompt nil minibuffer-map)
> -
>      ;; If we got an action, do it
>      (when notmuch-jump--action
>        (funcall notmuch-jump--action))))
> @@ -126,7 +122,6 @@ (defun notmuch-jump--format-actions (action-map)
>  Returns a list of strings, one for each item with a label in
>  ACTION-MAP.  These strings can be inserted into a tabular
>  buffer."
> -
>    ;; Compute the maximum key description width
>    (let ((key-width 1))
>      (pcase-dolist (`(,key ,desc) action-map)
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 9339f9d0..615207ed 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -418,7 +418,6 @@ (defun notmuch-subkeymap-help ()
>      (while (< i (length prefix))
>        (aset prefix i (aref key i))
>        (setq i (1+ i)))
> -
>      (let* ((subkeymap (key-binding prefix))
>  	   (ua-keys (where-is-internal 'universal-argument nil t))
>  	   (prefix-string (notmuch-prefix-key-description prefix))
> @@ -486,7 +485,6 @@ (defun notmuch-escape-boolean-term (term)
>  The caller is responsible for prepending the term prefix and a
>  colon.  This performs minimal escaping in order to produce
>  user-friendly queries."
> -
>    (save-match-data
>      (if (or (equal term "")
>  	    ;; To be pessimistic, only pass through terms composed
> @@ -731,7 +729,6 @@ (defun notmuch-apply-face (object face &optional below start end)
>  attributes, or a list of these.  If START and/or END are omitted,
>  they default to the beginning/end of OBJECT.  For convenience
>  when applied to strings, this returns OBJECT."
> -
>    ;; A face property can have three forms: a face name (a string or
>    ;; symbol), a property list, or a list of these two forms.  In the
>    ;; list case, the faces will be combined, with the earlier faces
> @@ -774,7 +771,6 @@ (defun notmuch-logged-error (msg &optional extra)
>  signals MSG as an error.  If EXTRA is non-nil, text referring the
>  user to the *Notmuch errors* buffer will be appended to the
>  signaled error.  This function does not return."
> -
>    (with-current-buffer (get-buffer-create "*Notmuch errors*")
>      (goto-char (point-max))
>      (unless (bobp)
> @@ -819,7 +815,6 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
>  giving the output of command.  ERR, if provided, is the error
>  output of command.  OUTPUT and ERR will be included in the error
>  message."
> -
>    (cond
>     ((eq exit-status 0) t)
>     ((eq exit-status 20)
> @@ -865,7 +860,6 @@ (defun notmuch-call-notmuch--helper (destination args)
>  This wraps `call-process'.  DESTINATION has the same meaning as
>  for `call-process'.  ARGS is as described for
>  `notmuch-call-notmuch-process'."
> -
>    (let (stdin-string)
>      (while (keywordp (car args))
>        (cl-case (car args)
> @@ -903,7 +897,6 @@ (defun notmuch-call-notmuch-sexp (&rest args)
>  Like `notmuch-call-notmuch-process', if notmuch exits with a
>  non-zero status, this will report its output and signal an
>  error."
> -
>    (with-temp-buffer
>      (let ((err-file (make-temp-file "nmerr")))
>        (unwind-protect
> @@ -931,7 +924,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
>  invoke `set-process-sentinel' directly on the returned process,
>  as that will interfere with the handling of stderr and the exit
>  status."
> -
>    (let (err-file err-buffer proc err-proc
>  	;; Find notmuch using Emacs' `exec-path'
>  	(command (or (executable-find notmuch-command)
> @@ -956,7 +948,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
>  	  (process-put err-proc 'err-file err-file)
>  	  (process-put err-proc 'err-buffer err-buffer)
>  	  (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel))
> -
>        ;; On Emacs versions before 25, there is no way to capture
>        ;; stdout and stderr separately for asynchronous processes, or
>        ;; even to redirect stderr to a file, so we use a trivial shell
> @@ -969,7 +960,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
>  			  "exec 2>\"$1\"; shift; exec \"$0\" \"$@\""
>  			  command err-file args)))
>        (process-put proc 'err-file err-file))
> -
>      (process-put proc 'sub-sentinel sentinel)
>      (process-put proc 'real-command (cons notmuch-command args))
>      (set-process-sentinel proc #'notmuch-start-notmuch-sentinel)
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
> index 4b10a731..66f32fd4 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -94,22 +94,18 @@ (defun notmuch-fcc-header-setup ()
>  
>  Originally intended to be use a hook function, but now called directly
>  by notmuch-mua-mail."
> -
>    (let ((subdir
>  	 (cond
>  	  ((or (not notmuch-fcc-dirs)
>  	       (message-field-value "Fcc"))
>  	   ;; Nothing set or an existing header.
>  	   nil)
> -
>  	  ((stringp notmuch-fcc-dirs)
>  	   notmuch-fcc-dirs)
> -
>  	  ((and (listp notmuch-fcc-dirs)
>  		(stringp (car notmuch-fcc-dirs)))
>  	   ;; Old style - no longer works.
>  	   (error "Invalid `notmuch-fcc-dirs' setting (old style)"))
> -
>  	  ((listp notmuch-fcc-dirs)
>  	   (let* ((from (message-field-value "From"))
>  		  (match
> @@ -121,10 +117,8 @@ (defun notmuch-fcc-header-setup ()
>  		 (cdr match)
>  	       (message "No Fcc header added.")
>  	       nil)))
> -
>  	  (t
>  	   (error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
> -
>      (when subdir
>        (if notmuch-maildir-use-notmuch-insert
>  	  (notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
> @@ -133,7 +127,6 @@ (defun notmuch-fcc-header-setup ()
>  (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
>    ;; Notmuch insert does not accept absolute paths, so check the user
>    ;; really want this header inserted.
> -
>    (when (or (not (= (elt subdir 0) ?/))
>  	    (y-or-n-p
>  	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 74dfb384..3bc06b4b 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -228,22 +228,17 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	original)
>      (when process-crypto
>        (setq args (append args '("--decrypt=true"))))
> -
>      (if reply-all
>  	(setq args (append args '("--reply-to=all")))
>        (setq args (append args '("--reply-to=sender"))))
>      (setq args (append args (list query-string)))
> -
>      ;; Get the reply object as SEXP, and parse it into an elisp object.
>      (setq reply (apply #'notmuch-call-notmuch-sexp args))
> -
>      ;; Extract the original message to simplify the following code.
>      (setq original (plist-get reply :original))
> -
>      ;; Extract the headers of both the reply and the original message.
>      (let* ((original-headers (plist-get original :headers))
>  	   (reply-headers (plist-get reply :reply-headers)))
> -
>        ;; If sender is non-nil, set the From: header to its value.
>        (when sender
>  	(plist-put reply-headers :From sender))
> @@ -251,7 +246,6 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	  ;; Overlay the composition window on that being used to read
>  	  ;; the original message.
>  	  ((same-window-regexps '("\\*mail .*")))
> -
>  	;; We modify message-header-format-alist to get around
>  	;; a bug in message.el.  See the comment above on
>  	;; notmuch-mua-insert-references.
> @@ -268,13 +262,11 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  			    (notmuch-sanitize (plist-get reply-headers :Subject))
>  			    (notmuch-headers-plist-to-alist reply-headers)
>  			    nil (notmuch-mua-get-switch-function))))
> -
>        ;; Create a buffer-local queue for tag changes triggered when
>        ;; sending the reply.
>        (when notmuch-message-replied-tags
>  	(setq-local notmuch-message-queued-tag-changes
>  		    (list (cons query-string notmuch-message-replied-tags))))
> -
>        ;; Insert the message body - but put it in front of the signature
>        ;; if one is present, and after any other content
>        ;; message*setup-hooks may have added to the message body already.
> @@ -286,17 +278,14 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  	    (if message-signature-insert-empty-line
>  		(forward-line -1))
>  	  (goto-char (point-max))))
> -
>        (let ((from (plist-get original-headers :From))
>  	    (date (plist-get original-headers :Date))
>  	    (start (point)))
> -
>  	;; notmuch-mua-cite-function constructs a citation line based
>  	;; on the From and Date headers of the original message, which
>  	;; are assumed to be in the buffer.
>  	(insert "From: " from "\n")
>  	(insert "Date: " date "\n\n")
> -
>  	(insert
>  	 (with-temp-buffer
>  	   (let
> @@ -320,22 +309,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
>  		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
>  	       (notmuch-show-insert-body original (plist-get original :body) 0)
>  	       (buffer-substring-no-properties (point-min) (point-max))))))
> -
>  	(set-mark (point))
>  	(goto-char start)
>  	;; Quote the original message according to the user's configured style.
>  	(funcall notmuch-mua-cite-function)))
> -
>      ;; Crypto processing based crypto content of the original message
>      (when process-crypto
>        (notmuch-mua-reply-crypto (plist-get original :body))))
> -
>    ;; Push mark right before signature, if any.
>    (message-goto-signature)
>    (unless (eobp)
>      (end-of-line -1))
>    (push-mark)
> -
>    (message-goto-body)
>    (set-buffer-modified-p nil))
>  
> @@ -381,18 +366,15 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
>  				   return-action &rest ignored)
>    "Invoke the notmuch mail composition window."
>    (interactive)
> -
>    (when notmuch-mua-user-agent-function
>      (let ((user-agent (funcall notmuch-mua-user-agent-function)))
>        (when (not (string= "" user-agent))
>  	(push (cons 'User-Agent user-agent) other-headers))))
> -
>    (unless (assq 'From other-headers)
>      (push (cons 'From (message-make-from
>  		       (notmuch-user-name)
>  		       (notmuch-user-primary-email)))
>  	  other-headers))
> -
>    (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
>  			     (or switch-function
>  				 (notmuch-mua-get-switch-function)))
> @@ -422,7 +404,6 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
>    (message-hide-headers)
>    (set-buffer-modified-p nil)
>    (notmuch-mua-maybe-set-window-dedicated)
> -
>    (message-goto-to))
>  
>  (defcustom notmuch-identities nil
> @@ -495,10 +476,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  			  ;; applied later.
>  	 forward-references ;; List of accumulated message-references of forwarded messages
>  	 forward-queries) ;; List of corresponding message-query
> -
>      ;; Generate the template for the outgoing message.
>      (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
> -
>      (save-excursion
>        ;; Insert all of the forwarded messages.
>        (mapc (lambda (id)
> @@ -524,7 +503,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  	    ;; `message-forward-make-body' always puts the message at
>  	    ;; the top, so do them in reverse order.
>  	    (reverse messages))
> -
>        ;; Add in the appropriate subject.
>        (save-restriction
>  	(message-narrow-to-headers)
> @@ -533,7 +511,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  	(message-remove-header "References")
>  	(message-add-header (concat "References: "
>  				    (mapconcat 'identity forward-references " "))))
> -
>        ;; Create a buffer-local queue for tag changes triggered when
>        ;; sending the message.
>        (when notmuch-message-forwarded-tags
> @@ -541,7 +518,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  		    (cl-loop for id in forward-queries
>  			     collect
>  			     (cons id notmuch-message-forwarded-tags))))
> -
>        ;; `message-forward-make-body' shows the User-agent header.  Hide
>        ;; it again.
>        (message-hide-headers)
> @@ -553,7 +529,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
>  If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
>  the From: address first.  If REPLY-ALL is non-nil, the message
>  will be addressed to all recipients of the source message."
> -
>  ;; In current emacs (24.3) select-active-regions is set to t by
>  ;; default. The reply insertion code sets the region to the quoted
>  ;; message to make it easy to delete (kill-region or C-w). These two
> @@ -565,7 +540,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
>  ;; primary selection was previously in a non-emacs window but not if
>  ;; it was in an emacs window. To avoid the problem in the latter case
>  ;; we deactivate mark.
> -
>    (let ((sender
>  	 (when prompt-for-sender
>  	   (notmuch-mua-prompt-for-sender)))
> diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
> index dc9fbe2f..06e7487b 100644
> --- a/emacs/notmuch-parser.el
> +++ b/emacs/notmuch-parser.el
> @@ -38,7 +38,6 @@ (defun notmuch-sexp-create-parser ()
>  The parser always consumes input from point in the current
>  buffer.  Hence, the caller is allowed to delete any data before
>  point and may resynchronize after an error by moving point."
> -
>    (vector 'notmuch-sexp-parser
>  	  ;; List depth
>  	  0
> @@ -60,7 +59,6 @@ (defun notmuch-sexp-read (sp)
>  list, this moves point just past the terminator and returns 'end.
>  Otherwise, this moves point to just past the end of the value and
>  returns the value."
> -
>    (skip-chars-forward " \n\r\t")
>    (cond ((eobp) 'retry)
>  	((= (char-after) ?\))
> @@ -134,7 +132,6 @@ (defun notmuch-sexp-begin-list (sp)
>  returns t.  Later calls to `notmuch-sexp-read' will return the
>  elements inside the list.  If the input in buffer is not the
>  beginning of a list, throw invalid-read-syntax."
> -
>    (skip-chars-forward " \n\r\t")
>    (cond ((eobp) 'retry)
>  	((= (char-after) ?\()
> @@ -151,7 +148,6 @@ (defun notmuch-sexp-eof (sp)
>  
>  Moves point to the beginning of any trailing data or to the end
>  of the buffer if there is only trailing whitespace."
> -
>    (skip-chars-forward " \n\r\t")
>    (unless (eobp)
>      (error "Trailing garbage following expression")))
> @@ -173,7 +169,6 @@ (defun notmuch-sexp-parse-partial-list (result-function result-buffer)
>  be called whenever the input buffer has been extended with
>  additional data.  The caller just needs to ensure it does not
>  move point in the input buffer."
> -
>    ;; Set up the initial state
>    (unless (local-variable-p 'notmuch-sexp--parser)
>      (set (make-local-variable 'notmuch-sexp--parser)
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 26b41603..6e23a980 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -320,7 +320,6 @@ (defun notmuch-show-with-message-as-text (fn)
>  
>  FN is called with one argument, the message properties. It should
>  operation on the contents of the current buffer."
> -
>    ;; Remake the header to ensure that all information is available.
>    (let* ((to (notmuch-show-get-to))
>  	 (cc (notmuch-show-get-cc))
> @@ -329,7 +328,6 @@ (defun notmuch-show-with-message-as-text (fn)
>  	 (date (notmuch-show-get-date))
>  	 (tags (notmuch-show-get-tags))
>  	 (depth (notmuch-show-get-depth))
> -
>  	 (header (concat
>  		  "Subject: " subject "\n"
>  		  "To: " to "\n"
> @@ -375,7 +373,6 @@ (defun notmuch-show-fontify-header ()
>  		'message-header-subject)
>  	       (t
>  		'message-header-other))))
> -
>      (overlay-put (make-overlay (point) (re-search-forward ":"))
>  		 'face 'message-header-name)
>      (overlay-put (make-overlay (point) (re-search-forward ".*$"))
> @@ -421,39 +418,30 @@ (defun notmuch-clean-address (address)
>         ((string-match "\\(.*\\) <\\(.*\\)>" address)
>  	(setq p-name (match-string 1 address)
>  	      p-address (match-string 2 address)))
> -
>         ;; "<user@dom.ain>" style.
>         ((string-match "<\\(.*\\)>" address)
>  	(setq p-address (match-string 1 address)))
> -
>         ;; Everything else.
>         (t
>  	(setq p-address address)))
> -
>        (when p-name
>  	;; Remove elements of the mailbox part that are not relevant for
>  	;; display, even if they are required during transport:
>  	;;
>  	;; Backslashes.
>  	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
> -
>  	;; 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-loop p-name)

These changes in spaces after `do` I don't understand...

Otherwise looks good...

Tomi

>  		 when (string-match "^\"\\(.*\\)\"$" p-name)
> -		 do (setq p-name (match-string 1 p-name))
> -
> +		 do   (setq p-name (match-string 1 p-name))
>  		 when (string-match "^'\\(.*\\)'$" p-name)
> -		 do (setq p-name (match-string 1 p-name))
> -
> +		 do   (setq p-name (match-string 1 p-name))
>  		 until (string= start-of-loop p-name)))
> -
>        ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
>        ;; 'foo@bar.com'.
>        (when (string= p-name p-address)
>  	(setq p-name nil))
> -
>        (cons p-address p-name))
>      (error (cons address nil))))
>  
> @@ -517,7 +505,6 @@ (defun notmuch-show-insert-part-header (nth content-type declared-type
>  			    (unless (string-equal declared-type content-type)
>  			      (concat " (as " content-type ")"))
>  			    comment)))
> -
>      (setq button
>  	  (insert-button
>  	   (concat "[ " base-label " ]")
> @@ -658,14 +645,12 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
>  (defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth button)
>    (let ((inner-parts (plist-get part :content))
>  	(start (point)))
> -
>      ;; Render the primary part.  FIXME: Support RFC 2387 Start header.
>      (notmuch-show-insert-bodypart msg (car inner-parts) depth)
>      ;; Add hidden buttons for the rest
>      (mapc (lambda (inner-part)
>  	    (notmuch-show-insert-bodypart msg inner-part depth t))
>  	  (cdr inner-parts))
> -
>      (when notmuch-show-indent-multipart
>        (indent-rigidly start (point) 1)))
>    t)
> @@ -673,18 +658,15 @@ (defun notmuch-show-insert-part-multipart/related (msg part content-type nth dep
>  (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
>    (when button
>      (button-put button 'face 'notmuch-crypto-part-header))
> -
>    ;; Insert a button detailing the signature status.
>    (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
>  					  (notmuch-show-get-header :From msg))
> -
>    (let ((inner-parts (plist-get part :content))
>  	(start (point)))
>      ;; Show all of the parts.
>      (mapc (lambda (inner-part)
>  	    (notmuch-show-insert-bodypart msg inner-part depth))
>  	  inner-parts)
> -
>      (when notmuch-show-indent-multipart
>        (indent-rigidly start (point) 1)))
>    t)
> @@ -692,21 +674,17 @@ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth dept
>  (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
>    (when button
>      (button-put button 'face 'notmuch-crypto-part-header))
> -
>    ;; Insert a button detailing the encryption status.
>    (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
> -
>    ;; Insert a button detailing the signature status.
>    (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
>  					  (notmuch-show-get-header :From msg))
> -
>    (let ((inner-parts (plist-get part :content))
>  	(start (point)))
>      ;; Show all of the parts.
>      (mapc (lambda (inner-part)
>  	    (notmuch-show-insert-bodypart msg inner-part depth))
>  	  inner-parts)
> -
>      (when notmuch-show-indent-multipart
>        (indent-rigidly start (point) 1)))
>    t)
> @@ -721,7 +699,6 @@ (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth but
>      (mapc (lambda (inner-part)
>  	    (notmuch-show-insert-bodypart msg inner-part depth))
>  	  inner-parts)
> -
>      (when notmuch-show-indent-multipart
>        (indent-rigidly start (point) 1)))
>    t)
> @@ -730,19 +707,15 @@ (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth
>    (let* ((message (car (plist-get part :content)))
>  	 (body (car (plist-get message :body)))
>  	 (start (point)))
> -
>      ;; Override `notmuch-message-headers' to force `From' to be
>      ;; displayed.
>      (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
>        (notmuch-show-insert-headers (plist-get message :headers)))
> -
>      ;; Blank line after headers to be compatible with the normal
>      ;; message display.
>      (insert "\n")
> -
>      ;; Show the body
>      (notmuch-show-insert-bodypart msg body depth)
> -
>      (when notmuch-show-indent-multipart
>        (indent-rigidly start (point) 1)))
>    t)
> @@ -826,7 +799,6 @@ (defun notmuch-show-insert-part-text/html (msg part content-type nth depth butto
>        ;; It's easier to drive shr ourselves than to work around the
>        ;; goofy things `mm-shr' does (like irreversibly taking over
>        ;; content ID handling).
> -
>        ;; FIXME: If we block an image, offer a button to load external
>        ;; images.
>        (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
> @@ -902,7 +874,6 @@ (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth bu
>  
>  (defun notmuch-show-create-part-overlays (button beg end)
>    "Add an overlay to the part between BEG and END."
> -
>    ;; If there is no button (i.e., the part is text/plain and the first
>    ;; part) or if the part has no content then we don't make the part
>    ;; toggleable.
> @@ -913,7 +884,6 @@ (defun notmuch-show-create-part-overlays (button beg end)
>  
>  (defun notmuch-show-record-part-information (part beg end)
>    "Store PART as a text property from BEG to END."
> -
>    ;; Record part information.  Since we already inserted subparts,
>    ;; don't override existing :notmuch-part properties.
>    (notmuch-map-text-property beg end :notmuch-part
> @@ -1011,7 +981,6 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>  HIDE determines whether to show or hide the part and the button
>  as follows: If HIDE is nil, show the part and the button. If HIDE
>  is t, hide the part initially and show the button."
> -
>    (let* ((content-type (downcase (plist-get part :content-type)))
>  	 (mime-type (notmuch-show-mime-type part))
>  	 (nth (plist-get part :id))
> @@ -1030,16 +999,13 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>  	 (show-part (not (or (equal hide t)
>  			     (and long button))))
>  	 (content-beg (point)))
> -
>      ;; Store the computed mime-type for later use (e.g. by attachment handlers).
>      (plist-put part :computed-type mime-type)
> -
>      (if show-part
>          (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
>        (when button
>  	(button-put button :notmuch-lazy-part
>  		    (list msg part mime-type nth depth button))))
> -
>      ;; Some of the body part handlers leave point somewhere up in the
>      ;; part, so we make sure that we're down at the end.
>      (goto-char (point-max))
> @@ -1056,12 +1022,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>  
>  (defun notmuch-show-insert-body (msg body depth)
>    "Insert the body BODY at depth DEPTH in the current thread."
> -
>    ;; Register all content IDs for this message.  According to RFC
>    ;; 2392, content IDs are *global*, but it's okay if an MUA treats
>    ;; them as only global within a message.
>    (notmuch-show--register-cids msg (car body))
> -
>    (mapc (lambda (part) (notmuch-show-insert-bodypart msg part depth)) body))
>  
>  (defun notmuch-show-make-symbol (type)
> @@ -1082,18 +1046,14 @@ (defun notmuch-show-insert-msg (msg depth)
>  	 content-start content-end
>  	 headers-start headers-end
>  	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
> -
>      (setq message-start (point-marker))
> -
>      (notmuch-show-insert-headerline headers
>  				    (or (if notmuch-show-relative-dates
>  					    (plist-get msg :date_relative)
>  					  nil)
>  					(plist-get headers :Date))
>  				    (plist-get msg :tags) depth)
> -
>      (setq content-start (point-marker))
> -
>      ;; Set `headers-start' to point after the 'Subject:' header to be
>      ;; compatible with the existing implementation. This just sets it
>      ;; to after the first header.
> @@ -1108,9 +1068,7 @@ (defun notmuch-show-insert-msg (msg depth)
>  	(forward-line 1))
>        (setq headers-start (point-marker)))
>      (setq headers-end (point-marker))
> -
>      (setq notmuch-show-previous-subject bare-subject)
> -
>      ;; A blank line between the headers and the body.
>      (insert "\n")
>      (notmuch-show-insert-body msg (plist-get msg :body)
> @@ -1119,36 +1077,28 @@ (defun notmuch-show-insert-msg (msg depth)
>      (unless (bolp)
>        (insert "\n"))
>      (setq content-end (point-marker))
> -
>      ;; Indent according to the depth in the thread.
>      (if notmuch-show-indent-content
>  	(indent-rigidly content-start
>  			content-end
>  			(* notmuch-show-indent-messages-width depth)))
> -
>      (setq message-end (point-max-marker))
> -
>      ;; Save the extents of this message over the whole text of the
>      ;; message.
>      (put-text-property message-start message-end
>  		       :notmuch-message-extent
>  		       (cons message-start message-end))
> -
>      ;; Create overlays used to control visibility
>      (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
>      (plist-put msg :message-overlay (make-overlay headers-start content-end))
> -
>      (plist-put msg :depth depth)
> -
>      ;; Save the properties for this message. Currently this saves the
>      ;; entire message (augmented it with other stuff), which seems
>      ;; like overkill. We might save a reduced subset (for example, not
>      ;; the content).
>      (notmuch-show-set-message-properties msg)
> -
>      ;; Set header visibility.
>      (notmuch-show-headers-visible msg notmuch-message-headers-visible)
> -
>      ;; Message visibility depends on whether it matched the search
>      ;; criteria.
>      (notmuch-show-message-visible msg (and (plist-get msg :match)
> @@ -1296,9 +1246,7 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
>      (switch-to-buffer (get-buffer-create buffer-name))
>      ;; No need to track undo information for this buffer.
>      (setq buffer-undo-list t)
> -
>      (notmuch-show-mode)
> -
>      ;; Set various buffer local variables to their appropriate initial
>      ;; state. Do this after enabling `notmuch-show-mode' so that they
>      ;; aren't wiped out.
> @@ -1307,24 +1255,19 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
>  	  notmuch-show-query-context (if (or (string= query-context "")
>  					     (string= query-context "*"))
>  					 nil query-context)
> -
>  	  notmuch-show-process-crypto notmuch-crypto-process-mime
>  	  ;; If `elide-toggle', invert the default value.
>  	  notmuch-show-elide-non-matching-messages
>  	  (if elide-toggle
>  	      (not notmuch-show-only-matching-messages)
>  	    notmuch-show-only-matching-messages))
> -
>      (add-hook 'post-command-hook #'notmuch-show-command-hook nil t)
>      (jit-lock-register #'notmuch-show-buttonise-links)
> -
>      (notmuch-tag-clear-cache)
> -
>      (let ((inhibit-read-only t))
>        (if (notmuch-show--build-buffer)
>  	  ;; Messages were inserted into the buffer.
>  	  (current-buffer)
> -
>  	;; No messages were inserted - presumably none matched the
>  	;; query.
>  	(kill-buffer (current-buffer))
> @@ -1367,26 +1310,21 @@ (defun notmuch-show--build-buffer (&optional state)
>        (setq queries (cdr queries)))
>      (when forest
>        (notmuch-show-insert-forest forest)
> -
>        ;; Store the original tags for each message so that we can
>        ;; display changes.
>        (notmuch-show-mapc
>         (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
> -
>        ;; Set the header line to the subject of the first message.
>        (setq header-line-format
>  	    (replace-regexp-in-string "%" "%%"
>  				      (notmuch-sanitize
>  				       (notmuch-show-strip-re
>  					(notmuch-show-get-subject)))))
> -
>        (run-hooks 'notmuch-show-hook)
> -
>        (if state
>  	  (notmuch-show-apply-state state)
>  	;; With no state to apply, just go to the first message.
>  	(notmuch-show-goto-first-wanted-message)))
> -
>      ;; Report back to the caller whether any messages matched.
>      forest))
>  
> @@ -1431,14 +1369,12 @@ (defun notmuch-show-apply-state (state)
>   - moving to the correct current message in every displayed window."
>    (let ((win-msg-alist (car state))
>  	(open (cadr state)))
> -
>      ;; Open those that were open.
>      (goto-char (point-min))
>      (cl-loop do (notmuch-show-message-visible
>  		 (notmuch-show-get-message-properties)
>  		 (member (notmuch-show-get-message-id) open))
>  	     until (not (notmuch-show-goto-message-next)))
> -
>      (dolist (win-msg-pair win-msg-alist)
>        (with-selected-window (car win-msg-pair)
>  	;; Go to the previously open message in this window
> @@ -1460,7 +1396,6 @@ (defun notmuch-show-refresh-view (&optional reset-state)
>      ;; manually.
>      (remove-overlays)
>      (erase-buffer)
> -
>      (unless (notmuch-show--build-buffer state)
>        ;; No messages were inserted.
>        (kill-buffer (current-buffer))
> @@ -1881,16 +1816,13 @@ (defun notmuch-show-advance ()
>  	   (> visible-end-of-this-message (window-end)))
>        ;; The bottom of this message is not visible - scroll.
>        (scroll-up nil))
> -
>       ((not (= end-of-this-message (point-max)))
>        ;; This is not the last message - move to the next visible one.
>        (notmuch-show-next-open-message))
> -
>       ((not (= (point) (point-max)))
>        ;; This is the last message, but the cursor is not at the end of
>        ;; the buffer. Move it there.
>        (goto-char (point-max)))
> -
>       (t
>        ;; This is the last message - change the return value
>        (setq ret t)))
> @@ -2527,7 +2459,6 @@ (defun notmuch-show-pipe-part ()
>    (interactive)
>    (notmuch-show-apply-to-current-part-handle #'mm-pipe-part))
>  
> -
>  (defun notmuch-show--mm-display-part (handle)
>    "Use mm-display-part to display HANDLE in a new buffer.
>  
> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
> index 34cd493a..85c80f54 100644
> --- a/emacs/notmuch-tag.el
> +++ b/emacs/notmuch-tag.el
> @@ -331,7 +331,6 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
>  		    (otherwise nil))))
>  	(setq formatted-tag (notmuch-tag--do-format tag tag base))
>  	(setq formatted-tag (notmuch-tag--do-format tag formatted-tag over))
> -
>  	(puthash (cons tag tag-state) formatted-tag notmuch-tag--format-cache)))
>      formatted-tag))
>  
> @@ -356,7 +355,6 @@ (defcustom notmuch-before-tag-hook nil
>  a list of strings of the form \"+TAG\" or \"-TAG\".
>  'query' will be a string containing the search query that determines
>  the messages that are about to be tagged."
> -
>    :type 'hook
>    :options '(notmuch-hl-line-mode)
>    :group 'notmuch-hooks)
> @@ -406,7 +404,6 @@ (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)
>  non-nil, is the query string to present in the minibuffer.  It
>  defaults to \"Tags\".  INITIAL-INPUT, if non-nil, will be the
>  initial input in the minibuffer."
> -
>    (let* ((all-tag-list (notmuch-tag-completions))
>  	 (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))
>  	 (remove-tag-list (mapcar (apply-partially 'concat "-") current-tags))
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index fcfb972d..d90f2aa0 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -891,7 +891,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
>  message together with all its descendents."
>    (let ((msg (car tree))
>  	(replies (cadr tree)))
> -
>        (cond
>         ((and (< 0 depth) (not last))
>  	(push "├" tree-status))
> @@ -907,7 +906,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
>  	(push "╰" tree-status))
>         ((and (eq 0 depth) (not first) (not last))
>  	(push "├" tree-status)))
> -
>        (push (concat (if replies "┬" "─") "►") tree-status)
>        (setq msg (plist-put msg :first (and first (eq 0 depth))))
>        (setq msg (plist-put msg :tree-status tree-status))
> @@ -915,11 +913,9 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
>        (notmuch-tree-goto-and-insert-msg msg)
>        (pop tree-status)
>        (pop tree-status)
> -
>        (if last
>  	  (push " " tree-status)
>  	(push "│" tree-status))
> -
>      (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
>  
>  (defun notmuch-tree-insert-thread (thread depth tree-status)
> @@ -958,7 +954,6 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
>  Complete list of currently available key bindings:
>  
>  \\{notmuch-tree-mode-map}"
> -
>    (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
>    (hl-line-mode 1)
>    (setq buffer-read-only t
> @@ -1022,7 +1017,6 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
>    ;; (such as reply) do. It is a buffer local variable so setting it
>    ;; will not affect genuine show buffers.
>    (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
> -
>    (erase-buffer)
>    (goto-char (point-min))
>    (let* ((search-args (concat basic-query
> @@ -1079,13 +1073,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
>  						(if unthreaded "unthreaded-" "tree-")
>  						query "*")))))
>  	(inhibit-read-only t))
> -
>      (switch-to-buffer buffer))
>    ;; Don't track undo information for this buffer
>    (set 'buffer-undo-list t)
> -
>    (notmuch-tree-worker query query-context target open-target unthreaded)
> -
>    (setq truncate-lines t))
>  
>  (defun notmuch-unthreaded (&optional query query-context target buffer-name open-target)
> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
> index 3a9ffdd0..c3b24cb9 100644
> --- a/emacs/notmuch-wash.el
> +++ b/emacs/notmuch-wash.el
> @@ -203,12 +203,10 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
>  \"citation\" or \"signature\". Optional PREFIX is some arbitrary
>  text to insert before the button, probably for indentation.  Note
>  that PREFIX should not include a newline."
> -
>    ;; This uses some slightly tricky conversions between strings and
>    ;; symbols because of the way the button code works. Note that
>    ;; replacing intern-soft with make-symbol will cause this to fail,
>    ;; since the newly created symbol has no plist.
> -
>    (let ((overlay (make-overlay beg end))
>  	(button-type (intern-soft (concat "notmuch-wash-button-"
>  					  type "-toggle-type"))))
> @@ -276,25 +274,20 @@ (defun notmuch-wash-excerpt-citations (msg depth)
>  
>  (defun notmuch-wash-elide-blank-lines (msg depth)
>    "Elide leading, trailing and successive blank lines."
> -
>    ;; Algorithm derived from `article-strip-multiple-blank-lines' in
>    ;; `gnus-art.el'.
> -
>    ;; Make all blank lines empty.
>    (goto-char (point-min))
>    (while (re-search-forward "^[[:space:]\t]+$" nil t)
>      (replace-match "" nil t))
> -
>    ;; Replace multiple empty lines with a single empty line.
>    (goto-char (point-min))
>    (while (re-search-forward "^\n\\(\n+\\)" nil t)
>      (delete-region (match-beginning 1) (match-end 1)))
> -
>    ;; Remove a leading blank line.
>    (goto-char (point-min))
>    (if (looking-at "\n")
>        (delete-region (match-beginning 0) (match-end 0)))
> -
>    ;; Remove a trailing blank line.
>    (goto-char (point-max))
>    (if (looking-at "\n")
> @@ -313,20 +306,15 @@ (defun notmuch-wash-tidy-citations (msg depth)
>    text,
>  - Remove citation trailers standing alone after a block of cited
>    text."
> -
>    ;; Remove lines of repeated citation leaders with no other content.
>    (goto-char (point-min))
>    (while (re-search-forward "\\(^>[> ]*\n\\)\\{2,\\}" nil t)
>      (replace-match "\\1"))
> -
> -  ;; Remove citation leaders standing alone before a block of cited
> -  ;; text.
> +  ;; Remove citation leaders standing alone before a block of cited text.
>    (goto-char (point-min))
>    (while (re-search-forward "\\(\n\\|^[^>].*\\)\n\\(^>[> ]*\n\\)" nil t)
>      (replace-match "\\1\n"))
> -
> -  ;; Remove citation trailers standing alone after a block of cited
> -  ;; text.
> +  ;; Remove citation trailers standing alone after a block of cited text.
>    (goto-char (point-min))
>    (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
>      (replace-match "\\2")))
> @@ -341,7 +329,6 @@ (defun notmuch-wash-wrap-long-lines (msg depth)
>  its value. Otherwise, this function will wrap long lines in the
>  message at the window width. When doing so, citation leaders in
>  the wrapped text are maintained."
> -
>    (let* ((coolj-wrap-follows-window-size nil)
>  	 (indent (* depth notmuch-show-indent-messages-width))
>  	 (limit (if (numberp notmuch-wash-wrap-lines-length)
> @@ -405,7 +392,6 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
>  Given that this function guesses whether a buffer includes a
>  patch and then guesses the extent of the patch, there is scope
>  for error."
> -
>    (goto-char (point-min))
>    (when (re-search-forward diff-file-header-re nil t)
>      (beginning-of-line -1)
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 07a58da7..04334c76 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -755,7 +755,6 @@ (defun notmuch-search-insert-authors (format-string authors)
>  	   (visible-string formatted-authors)
>  	   (invisible-string "")
>  	   (padding ""))
> -
>        ;; Truncate the author string to fit the specification.
>        (if (> (length formatted-authors)
>  	     (length formatted-sample))
> @@ -782,7 +781,6 @@ (defun notmuch-search-insert-authors (format-string authors)
>  					  (length visible-string)
>  					  (length "..."))
>  				       ? ))))
> -
>        ;; Use different faces to show matching and non-matching authors.
>        (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
>  	  ;; The visible string contains both matching and
> @@ -798,14 +796,12 @@ (defun notmuch-search-insert-authors (format-string authors)
>  	      ;; The invisible string may contain both matching and
>  	      ;; non-matching authors.
>  	      invisible-string (notmuch-search-author-propertize invisible-string)))
> -
>        ;; If there is any invisible text, add it as a tooltip to the
>        ;; visible text.
>        (when (not (string= invisible-string ""))
>  	(setq visible-string
>  	      (propertize visible-string
>  			  'help-echo (concat "..." invisible-string))))
> -
>        ;; Insert the visible and, if present, invisible author strings.
>        (insert visible-string)
>        (when (not (string= invisible-string ""))
> @@ -831,11 +827,9 @@ (defun notmuch-search-insert-field (field format-string result)
>      (insert (propertize (format format-string
>  				(notmuch-sanitize (plist-get result :subject)))
>  			'face 'notmuch-search-subject)))
> -
>     ((string-equal field "authors")
>      (notmuch-search-insert-authors
>       format-string (notmuch-sanitize (plist-get result :authors))))
> -
>     ((string-equal field "tags")
>      (let ((tags (plist-get result :tags))
>  	  (orig-tags (plist-get result :orig-tags)))
> @@ -1118,7 +1112,6 @@ (defun notmuch-cycle-notmuch-buffers ()
>  If the current buffer is the only notmuch buffer, bury it. If no
>  notmuch buffers exist, run `notmuch'."
>    (interactive)
> -
>    (let (start first)
>      ;; If the current buffer is a notmuch buffer, remember it and then
>      ;; bury it.
> -- 
> 2.26.0

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 01/23] emacs: Shorten long lines
  2020-07-27 17:52   ` Tomi Ollila
@ 2020-07-27 20:13     ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-27 20:13 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> 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 &optional create)
>>        ;; typo, or just the user want a new folder, let the user decide
>>        ;; how to deal with it.
>>        (error
>> -       (let ((response (notmuch-read-char-choice
>> -			"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
>> -			'(?r ?c ?i ?e))))
>> +       (let ((response (notmuch-read-char-choice "Insert failed: \
>> +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
>
> Otherwise looks good, but what are these backslashes before (:s in line
> above

This is necessary because `outline-minor-mode' (and I believe also
commands that move by s-expression) for performance reasons just assume
that any parenthesis at the beginning of a line marks the beginning of
a top-level expression.  To signal that that is not the case one has to
quote the paren.

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 02/23] emacs: Remove excess empty lines
  2020-07-27 18:00   ` Tomi Ollila
@ 2020-07-27 20:25     ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-27 20:25 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> 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-loop p-name)
>>  		 when (string-match "^\"\\(.*\\)\"$" p-name)
>> -		 do (setq p-name (match-string 1 p-name))
>> -
>> +		 do   (setq p-name (match-string 1 p-name))
>>  		 when (string-match "^'\\(.*\\)'$" p-name)
>> -		 do (setq p-name (match-string 1 p-name))
>> -
>> +		 do   (setq p-name (match-string 1 p-name))
>>  		 until (string= start-of-loop p-name)))

> These changes in spaces after `do` I don't understand...

IMO it looks a bit better when aligned with the `when' lines.  Since
these lines alternate with the lines that I modified because of the
stated reason of this commit, I felt that it was appropriate to make
this change as well.

But the alignment is an improvement is subjective and I would be happy
to change this.  I don't feel strongly about it.

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-07-27 16:43       ` Sean Whitton
@ 2020-07-27 20:32         ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-07-27 20:32 UTC (permalink / raw)
  To: Sean Whitton, notmuch

Sean Whitton <spwhitton@spwhitton.name> writes:

> Hello,
>
> On Mon 27 Jul 2020 at 12:02AM +02, Jonas Bernoulli wrote:
>
>> Sean Whitton <spwhitton@spwhitton.name> 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", could you explain?
>>
>> As in "when the caller consumes the returned value".  The alternative
>> would be for the caller to not care about the value returned by the
>> callee and to instead call it for the side-effects only.
>>
>> By using `and' we can signal that care about the return value and by
>> using `when' that we care about the side-effects instead.
>
> Thank you for your reply.  Just to confirm, this is just a convention,
> right?  I hadn't come across it yet.

Yes, just a convention.

Here's one place that talks about this convention:
https://emacs.stackexchange.com/questions/14195/and-vs-when-for-conditionals

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 03/23] emacs: Fix indentation
  2020-07-26 16:57 ` [PATCH 03/23] emacs: Fix indentation Jonas Bernoulli
@ 2020-07-30 20:07   ` Tomi Ollila
  2020-08-01 20:37     ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-07-30 20:07 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

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 one of CHARS is ignored.
>  
>  If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
> @@ -44,49 +44,49 @@ (if (fboundp 'read-char-choice)
>  This is an exact copy of this function from emacs 24 for use on
>  emacs 23, except with the one emacs 24 only function it calls
>  inlined."
> -  (unless (consp chars)
> -    (error "Called `read-char-choice' without valid char choices"))
> -  (let (char done show-help (helpbuf " *Char Help*"))
> -    (let ((cursor-in-echo-area t)
> -          (executing-kbd-macro executing-kbd-macro)
> -	  (esc-flag nil))
> -      (save-window-excursion	      ; in case we call help-form-show
> -	(while (not done)
> -	  (unless (get-text-property 0 'face prompt)
> -	    (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
> -	  (setq char (let ((inhibit-quit inhibit-keyboard-quit))
> -		       (read-key prompt)))
> -	  (and show-help (buffer-live-p (get-buffer helpbuf))
> -	       (kill-buffer helpbuf))
> -	  (cond
> -	   ((not (numberp char)))
> -	   ;; If caller has set help-form, that's enough.
> -	   ;; They don't explicitly have to add help-char to chars.
> -	   ((and help-form
> -		 (eq char help-char)
> -		 (setq show-help t)
> -		 ;; This is an inlined copy of help-form-show as that
> -		 ;; was introduced in emacs 24 too.
> -		 (let ((msg (eval help-form)))
> -		   (if (stringp msg)
> -		       (with-output-to-temp-buffer " *Char Help*"
> -			 (princ msg))))))
> -	   ((memq char chars)
> -	    (setq done t))
> -	   ((and executing-kbd-macro (= char -1))
> -	    ;; read-event returns -1 if we are in a kbd macro and
> -	    ;; there are no more events in the macro.  Attempt to
> -	    ;; get an event interactively.
> -	    (setq executing-kbd-macro nil))
> -	   ((not inhibit-keyboard-quit)
> +    (unless (consp chars)
> +      (error "Called `read-char-choice' without valid char choices"))
> +    (let (char done show-help (helpbuf " *Char Help*"))
> +      (let ((cursor-in-echo-area t)
> +	    (executing-kbd-macro executing-kbd-macro)
> +	    (esc-flag nil))
> +	(save-window-excursion	      ; in case we call help-form-show
> +	  (while (not done)
> +	    (unless (get-text-property 0 'face prompt)
> +	      (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
> +	    (setq char (let ((inhibit-quit inhibit-keyboard-quit))
> +			 (read-key prompt)))
> +	    (and show-help (buffer-live-p (get-buffer helpbuf))
> +		 (kill-buffer helpbuf))
>  	    (cond
> -	     ((and (null esc-flag) (eq char ?\e))
> -	      (setq esc-flag t))
> -	     ((memq char '(?\C-g ?\e))
> -	      (keyboard-quit))))))))
> -    ;; Display the question with the answer.  But without cursor-in-echo-area.
> -    (message "%s%s" prompt (char-to-string char))
> -    char)))
> +	     ((not (numberp char)))
> +	     ;; If caller has set help-form, that's enough.
> +	     ;; They don't explicitly have to add help-char to chars.
> +	     ((and help-form
> +		   (eq char help-char)
> +		   (setq show-help t)
> +		   ;; This is an inlined copy of help-form-show as that
> +		   ;; was introduced in emacs 24 too.
> +		   (let ((msg (eval help-form)))
> +		     (if (stringp msg)
> +			 (with-output-to-temp-buffer " *Char Help*"
> +			   (princ msg))))))
> +	     ((memq char chars)
> +	      (setq done t))
> +	     ((and executing-kbd-macro (= char -1))
> +	      ;; read-event returns -1 if we are in a kbd macro and
> +	      ;; there are no more events in the macro.  Attempt to
> +	      ;; get an event interactively.
> +	      (setq executing-kbd-macro nil))
> +	     ((not inhibit-keyboard-quit)
> +	      (cond
> +	       ((and (null esc-flag) (eq char ?\e))
> +		(setq esc-flag t))
> +	       ((memq char '(?\C-g ?\e))
> +		(keyboard-quit))))))))
> +      ;; Display the question with the answer.  But without cursor-in-echo-area.
> +      (message "%s%s" prompt (char-to-string char))
> +      char)))
>  
>  ;; End of compatibility functions
>  
> diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
> index c3cb619f..ea995379 100644
> --- a/emacs/notmuch-draft.el
> +++ b/emacs/notmuch-draft.el
> @@ -153,17 +153,17 @@ (defun notmuch-draft--query-encryption ()
>  
>  `notmuch-draft-save-plaintext' controls the behaviour."
>    (cl-case notmuch-draft-save-plaintext
> -	((ask)
> -	 (unless (yes-or-no-p
> -		  "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
> +    ((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.
>  Really save and index an unencrypted copy? ")
> -	   (error "Save aborted")))
> -	((nil)
> -	 (error "Refusing to save draft with encryption tags (see `%s')"
> -		'notmuch-draft-save-plaintext))
> -	((t)
> -	 (ignore))))
> +       (error "Save aborted")))
> +    ((nil)
> +     (error "Refusing to save draft with encryption tags (see `%s')"
> +	    'notmuch-draft-save-plaintext))
> +    ((t)
> +     (ignore))))
>  
>  (defun notmuch-draft--make-message-id ()
>    ;; message-make-message-id gives the id inside a "<" ">" pair,
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index e71e55f3..89e03c36 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -147,9 +147,9 @@ (defcustom notmuch-saved-searches
>  
>  Other accepted forms are a cons cell of the form (NAME . QUERY)
>  or a list of the form (NAME QUERY COUNT-QUERY)."
> -;; The saved-search format is also used by the all-tags notmuch-hello
> -;; section. This section generates its own saved-search list in one of
> -;; the latter two forms.
> +  ;; The saved-search format is also used by the all-tags notmuch-hello
> +  ;; section. This section generates its own saved-search list in one of
> +  ;; the latter two forms.
>    :get 'notmuch-hello--saved-searches-to-plist
>    :type '(repeat notmuch-saved-search-plist)
>    :tag "List of Saved Searches"
> @@ -382,10 +382,10 @@ (defun notmuch-hello-nice-number (n)
>        (setq n (/ n 1000)))
>      (setq result (or result '(0)))
>      (apply #'concat
> -     (number-to-string (car result))
> -     (mapcar (lambda (elem)
> -	      (format "%s%03d" notmuch-hello-thousands-separator elem))
> -	     (cdr result)))))
> +	   (number-to-string (car result))
> +	   (mapcar (lambda (elem)
> +		     (format "%s%03d" notmuch-hello-thousands-separator elem))
> +		   (cdr result)))))
>  
>  (defun notmuch-hello-trim (search)
>    "Trim whitespace."
> @@ -540,7 +540,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
>  	  (notmuch-hello-filtered-query count-query
>  					(or (plist-get options :filter-count)
>  					    (plist-get options :filter))))
> -	  "\n")))
> +	 "\n")))
>      (unless (= (call-process-region (point-min) (point-max) notmuch-command
>  				    t t nil "count" "--batch") 0)
>        (notmuch-logged-error
> @@ -690,7 +690,7 @@ (defvar notmuch-hello-mode-map
>  (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
>  
>  (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
> - "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
> +  "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
>  
>  Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
>  or click on a saved search to view matching threads. Edit saved
> @@ -720,9 +720,9 @@ (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
>  Complete list of currently available key bindings:
>  
>  \\{notmuch-hello-mode-map}"
> - (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
> - ;;(setq buffer-read-only t)
> -)
> +  (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
> +  ;;(setq buffer-read-only t)
> +  )
>  
>  (defun notmuch-hello-generate-tag-alist (&optional hide-tags)
>    "Return an alist from tags to queries to display in the all-tags section."
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 615207ed..7994d5ad 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -211,7 +211,7 @@ (defun notmuch-assert-cli-sane ()
>    (unless (notmuch-cli-sane-p)
>      (notmuch-logged-error
>       "notmuch cli seems misconfigured or unconfigured."
> -"Perhaps you haven't run \"notmuch setup\" yet? Try running this
> +     "Perhaps you haven't run \"notmuch setup\" yet? Try running this
>  on the command line, and then retry your notmuch command")))
>  
>  (defun notmuch-cli-version ()
> @@ -321,7 +321,7 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
>  		      (and (functionp binding)
>  			   (notmuch-documentation-first-line binding))))
>  	    tail)))
> -    tail)
> +  tail)
>  
>  (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
>    ;; Remappings are represented as a binding whose first "event" is
> @@ -413,8 +413,8 @@ (defun notmuch-subkeymap-help ()
>    "Show help for a subkeymap."
>    (interactive)
>    (let* ((key (this-command-keys-vector))
> -	(prefix (make-vector (1- (length key)) nil))
> -	(i 0))
> +	 (prefix (make-vector (1- (length key)) nil))
> +	 (i 0))
>      (while (< i (length prefix))
>        (aset prefix i (aref key i))
>        (setq i (1+ i)))
> @@ -527,7 +527,7 @@ (defun notmuch-remove-if-not (predicate list)
>    (let (out)
>      (while list
>        (when (funcall predicate (car list))
> -        (push (car list) out))
> +	(push (car list) out))
>        (setq list (cdr list)))
>      (nreverse out)))
>  
> @@ -835,24 +835,24 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
>  		       command " "))
>  	   (extra
>  	    (concat "command: " command-string "\n"
> -	     (if (integerp exit-status)
> -		 (format "exit status: %s\n" exit-status)
> -	       (format "exit signal: %s\n" exit-status))
> -	     (when err
> -	       (concat "stderr:\n" err))
> -	     (when output
> -	       (concat "stdout:\n" output)))))
> -	(if err
> -	    ;; We have an error message straight from the CLI.
> -	    (notmuch-logged-error
> -	     (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
> -	  ;; We only have combined output from the CLI; don't inundate
> -	  ;; the user with it.  Mimic `process-lines'.
> -	  (notmuch-logged-error (format "%s exited with status %s"
> -					(car command) exit-status)
> -				extra))
> -	;; `notmuch-logged-error' does not return.
> -	))))
> +		    (if (integerp exit-status)
> +			(format "exit status: %s\n" exit-status)
> +		      (format "exit signal: %s\n" exit-status))
> +		    (when err
> +		      (concat "stderr:\n" err))
> +		    (when output
> +		      (concat "stdout:\n" output)))))
> +      (if err
> +	  ;; We have an error message straight from the CLI.
> +	  (notmuch-logged-error
> +	   (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
> +	;; We only have combined output from the CLI; don't inundate
> +	;; the user with it.  Mimic `process-lines'.
> +	(notmuch-logged-error (format "%s exited with status %s"
> +				      (car command) exit-status)
> +			      extra))
> +      ;; `notmuch-logged-error' does not return.
> +      ))))
>  
>  (defun notmuch-call-notmuch--helper (destination args)
>    "Helper for synchronous notmuch invocation commands.
> @@ -925,9 +925,9 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
>  as that will interfere with the handling of stderr and the exit
>  status."
>    (let (err-file err-buffer proc err-proc
> -	;; Find notmuch using Emacs' `exec-path'
> -	(command (or (executable-find notmuch-command)
> -		     (error "Command not found: %s" notmuch-command))))
> +		 ;; Find notmuch using Emacs' `exec-path'
> +		 (command (or (executable-find notmuch-command)
> +			      (error "Command not found: %s" notmuch-command))))
>      (if (fboundp 'make-process)
>  	(progn
>  	  (setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
> @@ -1030,8 +1030,8 @@ (defun notmuch-interactive-region ()
>      (list (point) (point))))
>  
>  (define-obsolete-function-alias
> -    'notmuch-search-interactive-region
> -    'notmuch-interactive-region
> +  'notmuch-search-interactive-region
> +  'notmuch-interactive-region
>    "notmuch 0.29")
>  
>  (provide 'notmuch-lib)
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
> index 66f32fd4..7d001b2d 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -31,7 +31,7 @@ (require 'notmuch-lib)
>  (defvar notmuch-maildir-fcc-count 0)
>  
>  (defcustom notmuch-fcc-dirs "sent"
> - "Determines the Fcc Header which says where to save outgoing mail.
> +  "Determines the Fcc Header which says where to save outgoing mail.
>  
>  Three types of values are permitted:
>  
> @@ -69,13 +69,13 @@ (defcustom notmuch-fcc-dirs "sent"
>  In all cases you will be prompted to create the folder or
>  directory if it does not exist yet when sending a mail."
>  
> - :type '(choice
> -	 (const :tag "No FCC header" nil)
> -	 (string :tag "A single folder")
> -	 (repeat :tag "A folder based on the From header"
> -		 (cons regexp (string :tag "Folder"))))
> - :require 'notmuch-fcc-initialization
> - :group 'notmuch-send)
> +  :type '(choice
> +	  (const :tag "No FCC header" nil)
> +	  (string :tag "A single folder")
> +	  (repeat :tag "A folder based on the From header"
> +		  (cons regexp (string :tag "Folder"))))
> +  :require 'notmuch-fcc-initialization
> +  :group 'notmuch-send)
>  
>  (defcustom notmuch-maildir-use-notmuch-insert 't
>    "Should fcc use notmuch insert instead of simple fcc."
> @@ -267,16 +267,16 @@ (defun notmuch-maildir-fcc-host-fixer (hostname)
>  			    t))
>  
>  (defun notmuch-maildir-fcc-make-uniq-maildir-id ()
> -   (let* ((ftime (float-time))
> -	  (microseconds (mod (* 1000000 ftime) 1000000))
> -	  (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
> -     (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
> -     (format "%d.%d_%d_%d.%s"
> -	     ftime
> -	     (emacs-pid)
> -	     microseconds
> -	     notmuch-maildir-fcc-count
> -	     hostname)))
> +  (let* ((ftime (float-time))
> +	 (microseconds (mod (* 1000000 ftime) 1000000))
> +	 (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
> +    (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
> +    (format "%d.%d_%d_%d.%s"
> +	    ftime
> +	    (emacs-pid)
> +	    microseconds
> +	    notmuch-maildir-fcc-count
> +	    hostname)))
>  
>  (defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
>    (and (file-exists-p (concat dir "/cur/"))
> @@ -328,17 +328,17 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
>      ;; fix it in some way.
>      (let* ((prompt (format "Fcc %s is not a maildir: \
>  \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
> -	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
> -	 (cl-case response
> -	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
> -	   (?c (if (file-writable-p fcc-header)
> -		   (notmuch-maildir-fcc-create-maildir fcc-header)
> -		 (message "No permission to create %s." fcc-header)
> -		 (sit-for 2))
> -	       (notmuch-maildir-fcc-file-fcc fcc-header))
> -	   (?i 't)
> -	   (?e (notmuch-maildir-fcc-file-fcc
> -		(read-from-minibuffer "Fcc header: " fcc-header)))))))
> +	   (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
> +      (cl-case response
> +	(?r (notmuch-maildir-fcc-file-fcc fcc-header))
> +	(?c (if (file-writable-p fcc-header)
> +		(notmuch-maildir-fcc-create-maildir fcc-header)
> +	      (message "No permission to create %s." fcc-header)
> +	      (sit-for 2))
> +	    (notmuch-maildir-fcc-file-fcc fcc-header))
> +	(?i 't)
> +	(?e (notmuch-maildir-fcc-file-fcc
> +	     (read-from-minibuffer "Fcc header: " fcc-header)))))))
>  
>  (defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
>    "Writes the current buffer to maildir destdir. If mark-seen is
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 3bc06b4b..90b02e34 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -58,7 +58,7 @@ (defcustom notmuch-mua-compose-in 'current-window
>  You may want to customize `message-kill-buffer-on-exit'
>  accordingly."
>     (when (< emacs-major-version 24)
> -	   " Due to a known bug in Emacs 23, you should not set
> +     " Due to a known bug in Emacs 23, you should not set
>  this to `new-window' if `message-kill-buffer-on-exit' is
>  disabled: this would result in an incorrect behavior."))
>    :group 'notmuch-send
> @@ -106,13 +106,13 @@ (defcustom notmuch-mua-reply-insert-header-p-function
>  This function specifies which parts of a mime message with
>  multiple parts get a header."
>    :type '(radio (const :tag "No part headers"
> -		               notmuch-show-reply-insert-header-p-never)
> +		       notmuch-show-reply-insert-header-p-never)
>  		(const :tag "All except multipart/* and hidden parts"
> -		               notmuch-show-reply-insert-header-p-trimmed)
> +		       notmuch-show-reply-insert-header-p-trimmed)
>  		(const :tag "Only for included text parts"
> -			       notmuch-show-reply-insert-header-p-minimal)
> +		       notmuch-show-reply-insert-header-p-minimal)
>  		(const :tag "Exactly as in show view"
> -			       notmuch-show-insert-header-p)
> +		       notmuch-show-insert-header-p)
>  		(function :tag "Other"))
>    :group 'notmuch-reply)
>  
> @@ -473,7 +473,7 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>  	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
>  	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
>  	 forward-subject  ;; Comes from the first message and is
> -			  ;; applied later.
> +	 ;; applied later.

Otherwise looks good (I think), but this change above... the indentation
emacs does not work here. perhaps appending this 'applied later' to the end
of previous line (even fits onto 80 columns, unlike the next comment...

>  	 forward-references ;; List of accumulated message-references of forwarded messages
>  	 forward-queries) ;; List of corresponding message-query
>      ;; Generate the template for the outgoing message.
> @@ -529,17 +529,17 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
>  If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
>  the From: address first.  If REPLY-ALL is non-nil, the message
>  will be addressed to all recipients of the source message."
> -;; In current emacs (24.3) select-active-regions is set to t by
> -;; default. The reply insertion code sets the region to the quoted
> -;; message to make it easy to delete (kill-region or C-w). These two
> -;; things combine to put the quoted message in the primary selection.
> -;;
> -;; This is not what the user wanted and is a privacy risk (accidental
> -;; pasting of the quoted message). We can avoid some of the problems
> -;; by let-binding select-active-regions to nil. This fixes if the
> -;; primary selection was previously in a non-emacs window but not if
> -;; it was in an emacs window. To avoid the problem in the latter case
> -;; we deactivate mark.
> +  ;; In current emacs (24.3) select-active-regions is set to t by
> +  ;; default. The reply insertion code sets the region to the quoted
> +  ;; message to make it easy to delete (kill-region or C-w). These two
> +  ;; things combine to put the quoted message in the primary selection.
> +  ;;
> +  ;; This is not what the user wanted and is a privacy risk (accidental
> +  ;; pasting of the quoted message). We can avoid some of the problems
> +  ;; by let-binding select-active-regions to nil. This fixes if the
> +  ;; primary selection was previously in a non-emacs window but not if
> +  ;; it was in an emacs window. To avoid the problem in the latter case
> +  ;; we deactivate mark.
>    (let ((sender
>  	 (when prompt-for-sender
>  	   (notmuch-mua-prompt-for-sender)))
> diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
> index 3a835a00..1db9d7ca 100644
> --- a/emacs/notmuch-query.el
> +++ b/emacs/notmuch-query.el
> @@ -42,9 +42,9 @@ (defun notmuch-query-map-aux  (mapper function seq)
>    "Private function to do the actual mapping and flattening."
>    (apply 'append
>  	 (mapcar
> -	   (lambda (tree)
> -	     (funcall mapper function tree))
> -	   seq)))
> +	  (lambda (tree)
> +	    (funcall mapper function tree))
> +	  seq)))
>  
>  (defun notmuch-query-map-threads (fn threads)
>    "Apply FN to every thread in THREADS. Flatten results to a list.
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 6e23a980..f38866b0 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -272,7 +272,7 @@ (defmacro with-current-notmuch-show-message (&rest body)
>    `(save-excursion
>       (let ((id (notmuch-show-get-message-id)))
>         (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
> -         (with-current-buffer buf
> +	 (with-current-buffer buf
>  	   (let ((coding-system-for-read 'no-conversion))
>  	     (call-process notmuch-command nil t nil "show" "--format=raw" id))
>  	   ,@body)
> @@ -303,7 +303,7 @@ (defun notmuch-show-view-all-mime-parts ()
>  				  ("multipart/alternative" ignore identity)
>  				  ("multipart/mixed" ignore identity)
>  				  ("multipart/related" ignore identity)
> -				 )))
> +				  )))
>       (mm-display-parts (mm-dissect-buffer)))))
>  
>  (defun notmuch-show-save-attachments ()
> @@ -406,43 +406,44 @@ (defun notmuch-clean-address (address)
>  cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
>  parsing fails."
>    (condition-case nil
> -    (let (p-name p-address)
> -      ;; It would be convenient to use `mail-header-parse-address',
> -      ;; but that expects un-decoded mailbox parts, whereas our
> -      ;; mailbox parts are already decoded (and hence may contain
> -      ;; UTF-8). Given that notmuch should handle most of the awkward
> -      ;; cases, some simple string deconstruction should be sufficient
> -      ;; here.
> -      (cond
> -       ;; "User <user@dom.ain>" style.
> -       ((string-match "\\(.*\\) <\\(.*\\)>" address)
> -	(setq p-name (match-string 1 address)
> -	      p-address (match-string 2 address)))
> -       ;; "<user@dom.ain>" style.
> -       ((string-match "<\\(.*\\)>" address)
> -	(setq p-address (match-string 1 address)))
> -       ;; Everything else.
> -       (t
> -	(setq p-address address)))
> -      (when p-name
> -	;; Remove elements of the mailbox part that are not relevant for
> -	;; display, even if they are required during transport:
> -	;;
> -	;; Backslashes.
> -	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
> -	;; Outer single and double quotes, which might be nested.
> -	(cl-loop with start-of-loop
> -		 do   (setq start-of-loop p-name)
> -		 when (string-match "^\"\\(.*\\)\"$" p-name)
> -		 do   (setq p-name (match-string 1 p-name))
> -		 when (string-match "^'\\(.*\\)'$" p-name)
> -		 do   (setq p-name (match-string 1 p-name))
> -		 until (string= start-of-loop p-name)))
> -      ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
> -      ;; 'foo@bar.com'.
> -      (when (string= p-name p-address)
> -	(setq p-name nil))
> -      (cons p-address p-name))
> +      (let (p-name p-address)
> +	;; It would be convenient to use `mail-header-parse-address',
> +	;; but that expects un-decoded mailbox parts, whereas our
> +	;; mailbox parts are already decoded (and hence may contain
> +	;; UTF-8). Given that notmuch should handle most of the awkward
> +	;; cases, some simple string deconstruction should be sufficient
> +	;; here.
> +	(cond
> +	 ;; "User <user@dom.ain>" style.
> +	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
> +	  (setq p-name (match-string 1 address)
> +		p-address (match-string 2 address)))
> +
> +	 ;; "<user@dom.ain>" style.
> +	 ((string-match "<\\(.*\\)>" address)
> +	  (setq p-address (match-string 1 address)))
> +	 ;; Everything else.
> +	 (t
> +	  (setq p-address address)))
> +	(when p-name
> +	  ;; Remove elements of the mailbox part that are not relevant for
> +	  ;; display, even if they are required during transport:
> +	  ;;
> +	  ;; Backslashes.
> +	  (setq p-name (replace-regexp-in-string "\\\\" "" p-name))
> +	  ;; Outer single and double quotes, which might be nested.
> +	  (cl-loop with start-of-loop
> +		   do   (setq start-of-loop p-name)
> +		   when (string-match "^\"\\(.*\\)\"$" p-name)
> +		   do   (setq p-name (match-string 1 p-name))
> +		   when (string-match "^'\\(.*\\)'$" p-name)
> +		   do   (setq p-name (match-string 1 p-name))
> +		   until (string= start-of-loop p-name)))
> +	;; If the address is 'foo@bar.com <foo@bar.com>' then show just
> +	;; 'foo@bar.com'.
> +	(when (string= p-name p-address)
> +	  (setq p-name nil))
> +	(cons p-address p-name))
>      (error (cons address nil))))
>  
>  (defun notmuch-show-clean-address (address)
> @@ -601,9 +602,9 @@ (defun notmuch-show-setup-w3m ()
>    "Instruct w3m how to retrieve content from a \"related\" part of a message."
>    (interactive)
>    (if (boundp 'w3m-cid-retrieve-function-alist)
> -    (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
> -      (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
> -	    w3m-cid-retrieve-function-alist)))
> +      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
> +	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
> +	      w3m-cid-retrieve-function-alist)))
>    (setq mm-html-inhibit-images nil))
>  
>  (defvar w3m-current-buffer) ;; From `w3m.el'.
> @@ -633,8 +634,8 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
>      ;; should be chosen if there are more than one that match?
>      (mapc (lambda (inner-part)
>  	    (let* ((inner-type (plist-get inner-part :content-type))
> -		  (hide (not (or notmuch-show-all-multipart/alternative-parts
> -			   (string= chosen-type inner-type)))))
> +		   (hide (not (or notmuch-show-all-multipart/alternative-parts
> +				  (string= chosen-type inner-type)))))
>  	      (notmuch-show-insert-bodypart msg inner-part depth hide)))
>  	  inner-parts)
>  
> @@ -1002,7 +1003,7 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
>      ;; Store the computed mime-type for later use (e.g. by attachment handlers).
>      (plist-put part :computed-type mime-type)
>      (if show-part
> -        (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
> +	(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
>        (when button
>  	(button-put button :notmuch-lazy-part
>  		    (list msg part mime-type nth depth button))))
> @@ -1515,9 +1516,9 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
>    (setq buffer-read-only t
>  	truncate-lines t)
>    (setq imenu-prev-index-position-function
> -        #'notmuch-show-imenu-prev-index-position-function)
> +	#'notmuch-show-imenu-prev-index-position-function)
>    (setq imenu-extract-index-name-function
> -        #'notmuch-show-imenu-extract-index-name-function))
> +	#'notmuch-show-imenu-extract-index-name-function))
>  
>  (defun notmuch-tree-from-show-current-query ()
>    "Call notmuch tree with the current query."
> @@ -1740,8 +1741,8 @@ (defun notmuch-show-seen-current-message (start end)
>  user decision and we should not override it."
>    (when (and (notmuch-show-message-visible-p)
>  	     (not (notmuch-show-get-prop :seen)))
> -	(notmuch-show-mark-read)
> -	(notmuch-show-set-prop :seen t)))
> +    (notmuch-show-mark-read)
> +    (notmuch-show-set-prop :seen t)))
>  
>  (defvar notmuch-show--seen-has-errored nil)
>  (make-variable-buffer-local 'notmuch-show--seen-has-errored)
> @@ -1860,9 +1861,9 @@ (defun notmuch-show-rewind ()
>    (let ((start-of-message (notmuch-show-message-top))
>  	(start-of-window (window-start)))
>      (cond
> -      ;; Either this message is properly aligned with the start of the
> -      ;; window or the start of this message is not visible on the
> -      ;; screen - scroll.
> +     ;; Either this message is properly aligned with the start of the
> +     ;; window or the start of this message is not visible on the
> +     ;; screen - scroll.
>       ((or (= start-of-message start-of-window)
>  	  (< start-of-message start-of-window))
>        (scroll-down)
> @@ -2506,9 +2507,9 @@ (defmacro notmuch-show--with-currently-shown-message (&rest body)
>  message."
>    `(save-excursion
>       (save-restriction
> -      (let ((extent (notmuch-show-message-extent)))
> -	(narrow-to-region (car extent) (cdr extent))
> -	,@body))))
> +       (let ((extent (notmuch-show-message-extent)))
> +	 (narrow-to-region (car extent) (cdr extent))
> +	 ,@body))))
>  
>  (defun notmuch-show--gather-urls ()
>    "Gather any URLs in the current message."
> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
> index 85c80f54..2fcf5a9e 100644
> --- a/emacs/notmuch-tag.el
> +++ b/emacs/notmuch-tag.el
> @@ -236,7 +236,7 @@ (defun notmuch-tag-format-image-data (tag data)
>  (defun notmuch-tag-star-icon ()
>    "Return SVG data representing a star icon.
>  This can be used with `notmuch-tag-format-image-data'."
> -"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
> +  "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
>  <svg version=\"1.1\" width=\"16\" height=\"16\">
>    <g transform=\"translate(-242.81601,-315.59635)\">
>      <path
> @@ -536,7 +536,7 @@ (defun notmuch-tag-jump (reverse)
>  				name)
>  			    (mapconcat #'identity tag-change " "))))
>  	(push (list key name-string
> -		     `(lambda () (,tag-function ',tag-change)))
> +		    `(lambda () (,tag-function ',tag-change)))
>  	      action-map)))
>      (push (list notmuch-tag-jump-reverse-key
>  		(if reverse
> diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
> index d90f2aa0..6ac0c62d 100644
> --- a/emacs/notmuch-tree.el
> +++ b/emacs/notmuch-tree.el
> @@ -245,7 +245,7 @@ (defun notmuch-tree-to-message-pane (func)
>  which executes function FUNC in the message pane if it is
>  open (if the message pane is closed it does nothing)."
>    `(lambda ()
> -      ,(concat "(In message pane) " (documentation func t))
> +     ,(concat "(In message pane) " (documentation func t))
>       (interactive)
>       (when (window-live-p notmuch-tree-message-window)
>         (with-selected-window notmuch-tree-message-window
> @@ -273,7 +273,7 @@ (defun notmuch-tree-close-message-pane-and (func)
>  which closes the message pane if open and then executes function
>  FUNC."
>    `(lambda ()
> -      ,(concat "(Close message pane and) " (documentation func t))
> +     ,(concat "(Close message pane and) " (documentation func t))
>       (interactive)
>       (let ((notmuch-show-process-crypto
>  	    (notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
> @@ -891,31 +891,31 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
>  message together with all its descendents."
>    (let ((msg (car tree))
>  	(replies (cadr tree)))
> -      (cond
> -       ((and (< 0 depth) (not last))
> -	(push "├" tree-status))
> -       ((and (< 0 depth) last)
> -	(push "╰" tree-status))
> -       ((and (eq 0 depth) first last)
> -	;; Choice between these two variants is a matter of taste.
> -	;; (push "─" tree-status))
> -	(push " " tree-status))
> -       ((and (eq 0 depth) first (not last))
> -	  (push "┬" tree-status))
> -       ((and (eq 0 depth) (not first) last)
> -	(push "╰" tree-status))
> -       ((and (eq 0 depth) (not first) (not last))
> -	(push "├" tree-status)))
> -      (push (concat (if replies "┬" "─") "►") tree-status)
> -      (setq msg (plist-put msg :first (and first (eq 0 depth))))
> -      (setq msg (plist-put msg :tree-status tree-status))
> -      (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
> -      (notmuch-tree-goto-and-insert-msg msg)
> -      (pop tree-status)
> -      (pop tree-status)
> -      (if last
> -	  (push " " tree-status)
> -	(push "│" tree-status))
> +    (cond
> +     ((and (< 0 depth) (not last))
> +      (push "├" tree-status))
> +     ((and (< 0 depth) last)
> +      (push "╰" tree-status))
> +     ((and (eq 0 depth) first last)
> +      ;; Choice between these two variants is a matter of taste.
> +      ;; (push "─" tree-status))
> +      (push " " tree-status))
> +     ((and (eq 0 depth) first (not last))
> +      (push "┬" tree-status))
> +     ((and (eq 0 depth) (not first) last)
> +      (push "╰" tree-status))
> +     ((and (eq 0 depth) (not first) (not last))
> +      (push "├" tree-status)))
> +    (push (concat (if replies "┬" "─") "►") tree-status)
> +    (setq msg (plist-put msg :first (and first (eq 0 depth))))
> +    (setq msg (plist-put msg :tree-status tree-status))
> +    (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
> +    (notmuch-tree-goto-and-insert-msg msg)
> +    (pop tree-status)
> +    (pop tree-status)
> +    (if last
> +	(push " " tree-status)
> +      (push "│" tree-status))
>      (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
>  
>  (defun notmuch-tree-insert-thread (thread depth tree-status)
> @@ -966,34 +966,34 @@ (defun notmuch-tree-process-sentinel (proc msg)
>  	(exit-status (process-exit-status proc))
>  	(never-found-target-thread nil))
>      (when (memq status '(exit signal))
> -        (kill-buffer (process-get proc 'parse-buf))
> -	(if (buffer-live-p buffer)
> -	    (with-current-buffer buffer
> -	      (save-excursion
> -		(let ((inhibit-read-only t)
> -		      (atbob (bobp)))
> -		  (goto-char (point-max))
> -		  (if (eq status 'signal)
> -		      (insert "Incomplete search results (tree view process was killed).\n"))
> -		  (when (eq status 'exit)
> -		    (insert "End of search results.")
> -		    (unless (= exit-status 0)
> -		      (insert (format " (process returned %d)" exit-status)))
> -		    (insert "\n")))))))))
> +      (kill-buffer (process-get proc 'parse-buf))
> +      (if (buffer-live-p buffer)
> +	  (with-current-buffer buffer
> +	    (save-excursion
> +	      (let ((inhibit-read-only t)
> +		    (atbob (bobp)))
> +		(goto-char (point-max))
> +		(if (eq status 'signal)
> +		    (insert "Incomplete search results (tree view process was killed).\n"))
> +		(when (eq status 'exit)
> +		  (insert "End of search results.")
> +		  (unless (= exit-status 0)
> +		    (insert (format " (process returned %d)" exit-status)))
> +		  (insert "\n")))))))))
>  
>  (defun notmuch-tree-process-filter (proc string)
>    "Process and filter the output of \"notmuch show\" for tree view."
>    (let ((results-buf (process-buffer proc))
> -        (parse-buf (process-get proc 'parse-buf))
> -        (inhibit-read-only t)
> -        done)
> +	(parse-buf (process-get proc 'parse-buf))
> +	(inhibit-read-only t)
> +	done)
>      (if (not (buffer-live-p results-buf))
> -        (delete-process proc)
> +	(delete-process proc)
>        (with-current-buffer parse-buf
> -        ;; Insert new data
> -        (save-excursion
> -          (goto-char (point-max))
> -          (insert string))
> +	;; Insert new data
> +	(save-excursion
> +	  (goto-char (point-max))
> +	  (insert string))
>  	(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
>  					 results-buf)))))
>  
> @@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
>    (erase-buffer)
>    (goto-char (point-min))
>    (let* ((search-args (concat basic-query
> -		       (if query-context (concat " and (" query-context ")"))
> -		       ))
> +			      (if query-context (concat " and (" query-context ")"))
> +			      ))
>  	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
>      (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
>  	(setq search-args basic-query))
> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
> index c3b24cb9..00ac45b6 100644
> --- a/emacs/notmuch-wash.el
> +++ b/emacs/notmuch-wash.el
> @@ -373,7 +373,7 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
>    (when (string-match
>  	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
>  	 subject)
> -      (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
> +    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
>  
>  (defun notmuch-wash-subject-to-patch-filename (subject)
>    "Convert a patch mail SUBJECT into a filename.
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 04334c76..2e84cd34 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -117,23 +117,23 @@ (defvar notmuch-query-history nil
>  
>  (defun notmuch-foreach-mime-part (function mm-handle)
>    (cond ((stringp (car mm-handle))
> -         (dolist (part (cdr mm-handle))
> -           (notmuch-foreach-mime-part function part)))
> -        ((bufferp (car mm-handle))
> -         (funcall function mm-handle))
> -        (t (dolist (part mm-handle)
> -             (notmuch-foreach-mime-part function part)))))
> +	 (dolist (part (cdr mm-handle))
> +	   (notmuch-foreach-mime-part function part)))
> +	((bufferp (car mm-handle))
> +	 (funcall function mm-handle))
> +	(t (dolist (part mm-handle)
> +	     (notmuch-foreach-mime-part function part)))))
>  
>  (defun notmuch-count-attachments (mm-handle)
>    (let ((count 0))
>      (notmuch-foreach-mime-part
>       (lambda (p)
>         (let ((disposition (mm-handle-disposition p)))
> -         (and (listp disposition)
> -              (or (equal (car disposition) "attachment")
> -                  (and (equal (car disposition) "inline")
> -                       (assq 'filename disposition)))
> -              (cl-incf count))))
> +	 (and (listp disposition)
> +	      (or (equal (car disposition) "attachment")
> +		  (and (equal (car disposition) "inline")
> +		       (assq 'filename disposition)))
> +	      (cl-incf count))))
>       mm-handle)
>      count))
>  
> @@ -142,13 +142,13 @@ (defun notmuch-save-attachments (mm-handle &optional queryp)
>     (lambda (p)
>       (let ((disposition (mm-handle-disposition p)))
>         (and (listp disposition)
> -            (or (equal (car disposition) "attachment")
> -                (and (equal (car disposition) "inline")
> -                     (assq 'filename disposition)))
> -            (or (not queryp)
> -                (y-or-n-p
> -                 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
> -            (mm-save-part p))))
> +	    (or (equal (car disposition) "attachment")
> +		(and (equal (car disposition) "inline")
> +		     (assq 'filename disposition)))
> +	    (or (not queryp)
> +		(y-or-n-p
> +		 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
> +	    (mm-save-part p))))
>     mm-handle))
>  
>  (require 'hl-line)
> @@ -272,11 +272,11 @@ (defun notmuch-search-first-thread ()
>    (goto-char (point-min)))
>  
>  (defface notmuch-message-summary-face
> - '((((class color) (background light)) (:background "#f0f0f0"))
> -   (((class color) (background dark)) (:background "#303030")))
> - "Face for the single-line message summary in notmuch-show-mode."
> - :group 'notmuch-show
> - :group 'notmuch-faces)
> +  '((((class color) (background light)) (:background "#f0f0f0"))
> +    (((class color) (background dark)) (:background "#303030")))
> +  "Face for the single-line message summary in notmuch-show-mode."
> +  :group 'notmuch-show
> +  :group 'notmuch-faces)
>  
>  (defface notmuch-search-date
>    '((t :inherit default))
> @@ -392,9 +392,9 @@ (define-derived-mode notmuch-search-mode fundamental-mode "notmuch-search"
>    (setq truncate-lines t)
>    (setq buffer-read-only t)
>    (setq imenu-prev-index-position-function
> -        #'notmuch-search-imenu-prev-index-position-function)
> +	#'notmuch-search-imenu-prev-index-position-function)
>    (setq imenu-extract-index-name-function
> -        #'notmuch-search-imenu-extract-index-name-function))
> +	#'notmuch-search-imenu-extract-index-name-function))
>  
>  (defun notmuch-search-get-result (&optional pos)
>    "Return the result object for the thread at POS (or point).
> @@ -689,9 +689,9 @@ (defun notmuch-search-process-sentinel (proc msg)
>  			     (not (string= notmuch-search-target-thread "found")))
>  			(set 'never-found-target-thread t)))))
>  	      (when (and never-found-target-thread
> -		       notmuch-search-target-line)
> -		  (goto-char (point-min))
> -		  (forward-line (1- notmuch-search-target-line)))))))))
> +			 notmuch-search-target-line)
> +		(goto-char (point-min))
> +		(forward-line (1- notmuch-search-target-line)))))))))
>  
>  (define-widget 'notmuch--custom-face-edit 'lazy
>    "Custom face edit with a tag Edit Face"
> @@ -711,7 +711,7 @@ (defcustom notmuch-search-line-faces
>   (the following text would be placed in your ~/.emacs file):
>  
>   (setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
> -                                   (\"deleted\" . (:foreground \"red\"
> +				   (\"deleted\" . (:foreground \"red\"
>  						  :background \"blue\"))))
>  
>  The FACE must be a face name (a symbol or string), a property
> @@ -722,7 +722,7 @@ (defcustom notmuch-search-line-faces
>  background."
>    :type '(alist :key-type (string)
>  		:value-type (radio (face :tag "Face name")
> -				    (notmuch--custom-face-edit)))
> +				   (notmuch--custom-face-edit)))
>    :group 'notmuch-search
>    :group 'notmuch-faces)
>  
> @@ -919,15 +919,15 @@ (defun notmuch-read-query (prompt)
>  PROMPT is the string to prompt with."
>    (let*
>        ((all-tags
> -        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
> -                (process-lines notmuch-command "search" "--output=tags" "*")))
> +	(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
> +		(process-lines notmuch-command "search" "--output=tags" "*")))
>         (completions
> -	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> -		       "subject:" "attachment:")
> -		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> -		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
> -		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
> -			 (mailcap-mime-types)))))
> +	(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
> +		      "subject:" "attachment:")
> +		(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
> +		(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
> +		(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
> +			(mailcap-mime-types)))))
>      (let ((keymap (copy-keymap minibuffer-local-map))
>  	  (current-query (cl-case major-mode
>  			   (notmuch-search-mode (notmuch-search-get-query))
> diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el
> index 8423245f..6eda0ebc 100644
> --- a/test/emacs-address-cleaning.el
> +++ b/test/emacs-address-cleaning.el
> @@ -1,6 +1,6 @@
>  (defun notmuch-test-address-cleaning-1 ()
>    (notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
> -			"dme@dme.org"))
> +			     "dme@dme.org"))
>  
>  (defun notmuch-test-address-cleaning-2 ()
>    (let* ((input '("foo@bar.com"
> -- 
> 2.26.0
>
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 00/23] A create number of cosmetic changes
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (22 preceding siblings ...)
  2020-07-26 16:58 ` [PATCH 23/23] test: Fix indentation Jonas Bernoulli
@ 2020-07-30 20:36 ` Tomi Ollila
  2020-08-01 20:48   ` [PATCH 00/23] A great " Jonas Bernoulli
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
  25 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-07-30 20:36 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

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-jonas@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 +
>  performance-test/Makefile.local            |   2 +-
>  tag-util.c                                 |   2 +-
>  tag-util.h                                 |   2 +-
>  test/Makefile.local                        |   2 +-
>  test/T610-message-property.sh              |   2 +-
>  test/T710-message-id.sh                    |   2 +-
>  test/emacs-address-cleaning.el             |   2 +-
>  test/random-corpus.c                       |   2 +-
>  test/test-lib.el                           |  47 ++-
>  test/test-lib.sh                           |  36 +-
>  util/Makefile.local                        |   2 +-
>  53 files changed, 1189 insertions(+), 1210 deletions(-)
>
> -- 
> 2.26.0
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 03/23] emacs: Fix indentation
  2020-07-30 20:07   ` Tomi Ollila
@ 2020-08-01 20:37     ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-01 20:37 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Sun, Jul 26 2020, Jonas Bernoulli wrote:

>> @@ -473,7 +473,7 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
>>  	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
>>  	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
>>  	 forward-subject  ;; Comes from the first message and is
>> -			  ;; applied later.
>> +	 ;; applied later.
>
> Otherwise looks good (I think), but this change above... the indentation
> emacs does not work here. perhaps appending this 'applied later' to the end
> of previous line (even fits onto 80 columns, unlike the next comment...

I think we should fix that next comment and handle all three nearby
comments consistently, i.e.:

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -476,10 +476,12 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
   (let* ((other-headers
          (and (or prompt-for-sender notmuch-always-prompt-for-sender)
               (list (cons 'From (notmuch-mua-prompt-for-sender)))))
-        forward-subject  ;; Comes from the first message and is
-                         ;; applied later.
-        forward-references ;; List of accumulated message-references of forwarded messages
-        forward-queries) ;; List of corresponding message-query
+        ;; Comes from the first message and is applied later.
+        forward-subject
+        ;; List of accumulated message-references of forwarded messages.
+        forward-references
+        ;; List of corresponding message-query.
+        forward-queries)
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
     (save-excursion

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 00/23] A great number of cosmetic changes
  2020-07-30 20:36 ` [PATCH 00/23] A create number of cosmetic changes Tomi Ollila
@ 2020-08-01 20:48   ` Jonas Bernoulli
  2020-08-03 17:32     ` David Bremner
  0 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-01 20:48 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> Series looks good to me (as far as I can tell). That one comment
> indentation in id:20200726165818.400-4-jonas@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)

Thanks for the review.  Should I send a v2 now or wait a bit to see if
someone else spots any issues?

> 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))).

I don't think the byte-compiler optimizes this away.  Some macros use
`macroexp-progn' instead of `progn' to take care of this.  I am guessing
that `when' doesn't use it because "subr.el" has to be loaded before
"macroexp.el".

I think that's okay.

     Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH 00/23] A great number of cosmetic changes
  2020-08-01 20:48   ` [PATCH 00/23] A great " Jonas Bernoulli
@ 2020-08-03 17:32     ` David Bremner
  0 siblings, 0 replies; 108+ messages in thread
From: David Bremner @ 2020-08-03 17:32 UTC (permalink / raw)
  To: Jonas Bernoulli, Tomi Ollila, notmuch

Jonas Bernoulli <jonas@bernoul.li> writes:

> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> Series looks good to me (as far as I can tell). That one comment
>> indentation in id:20200726165818.400-4-jonas@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)
>
> Thanks for the review.  Should I send a v2 now or wait a bit to see if
> someone else spots any issues?

I think it's probably safe to send v2 now.

d

^ permalink raw reply	[flat|nested] 108+ messages in thread

* [PATCH v2 00/23] A great number of cosmetic changes
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (23 preceding siblings ...)
  2020-07-30 20:36 ` [PATCH 00/23] A create number of cosmetic changes Tomi Ollila
@ 2020-08-06  7:18 ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 01/23] emacs: Shorten long lines Jonas Bernoulli
                     ` (22 more replies)
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
  25 siblings, 23 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

I have addressed the feedback from v1, making a change
to commit (1), leading to a minor conflict in commit (2).
Otherwise this is unchanged.

     Cheers,
     Jonas


Jonas Bernoulli (23):
  emacs: Shorten long lines
  emacs: Remove excess empty lines
1 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
2 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                       | 189 +++++----
 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 +
 performance-test/Makefile.local            |   2 +-
 tag-util.c                                 |   2 +-
 tag-util.h                                 |   2 +-
 test/Makefile.local                        |   2 +-
 test/T610-message-property.sh              |   2 +-
 test/T710-message-id.sh                    |   2 +-
 test/emacs-address-cleaning.el             |   2 +-
 test/random-corpus.c                       |   2 +-
 test/test-lib.el                           |  43 +-
 test/test-lib.sh                           |  36 +-
 util/Makefile.local                        |   2 +-
 53 files changed, 1192 insertions(+), 1211 deletions(-)

-- 
2.28.0

^ permalink raw reply	[flat|nested] 108+ messages in thread

* [PATCH v2 01/23] emacs: Shorten long lines
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 02/23] emacs: Remove excess empty lines Jonas Bernoulli
                     ` (21 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

---
 emacs/coolj.el               |   2 +-
 emacs/notmuch-address.el     |  38 +++++++------
 emacs/notmuch-company.el     |  17 ++++--
 emacs/notmuch-crypto.el      |  16 +++---
 emacs/notmuch-draft.el       |  12 ++--
 emacs/notmuch-hello.el       |  43 ++++++++++-----
 emacs/notmuch-jump.el        |   7 ++-
 emacs/notmuch-lib.el         |  62 +++++++++++++--------
 emacs/notmuch-maildir-fcc.el |  14 ++---
 emacs/notmuch-message.el     |   3 +-
 emacs/notmuch-mua.el         |  78 +++++++++++++++-----------
 emacs/notmuch-show.el        | 103 +++++++++++++++++++++++------------
 emacs/notmuch-tag.el         |  14 +++--
 emacs/notmuch-tree.el        |  55 +++++++++++++------
 emacs/notmuch-wash.el        |  19 +++++--
 emacs/notmuch.el             |  27 ++++++---
 emacs/rstdoc.el              |   3 +-
 17 files changed, 326 insertions(+), 187 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 350d537f..5d311170 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -1,6 +1,6 @@
 ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
 
-;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
 ;; Authors:    Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;;             Alex Schroeder <alex@gnu.org>
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 0d56fba7..2a9c411a 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
       ;; First, run quick synchronous harvest based on what the user
-      ;; entered so far
+      ;; entered so far.
       (notmuch-address-harvest original t))
     (prog1 (notmuch-address-matching original)
-      ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+      ;; Then start the (potentially long-running) full asynchronous
+      ;; harvest if necessary.
       (notmuch-address-harvest-trigger)))
    (t
     (process-lines notmuch-address-command original))))
@@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
 	    (push chosen notmuch-address-history)
 	    (delete-region beg end)
 	    (insert chosen)
-	    (run-hook-with-args 'notmuch-address-post-completion-functions chosen))
+	    (run-hook-with-args 'notmuch-address-post-completion-functions
+				chosen))
 	(message "No matches.")
 	(ding))))
    (t nil)))
@@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
 	      ;; 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 (list :version notmuch-address--save-hash-version
-				  :completion-settings notmuch-address-internal-completion
-				  :last-harvest notmuch-address-last-harvest
-				  :completions notmuch-address-completions)))
+	  (let ((save-plist
+		 (list :version notmuch-address--save-hash-version
+		       :completion-settings notmuch-address-internal-completion
+		       :last-harvest notmuch-address-last-harvest
+		       :completions notmuch-address-completions)))
 	    (print "notmuch-address-hash" (current-buffer))
 	    (print save-plist (current-buffer))))
       (message "\
@@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
   (let ((now (float-time)))
     (when (> (- now notmuch-address-last-harvest) 86400)
       (setq notmuch-address-last-harvest now)
-      (notmuch-address-harvest nil nil
-			       (lambda (proc event)
-				 ;; If harvest fails, we want to try
-				 ;; again when the trigger is next
-				 ;; called
-				 (if (string= event "finished\n")
-				     (progn
-				       (notmuch-address--save-address-hash)
-				       (setq notmuch-address-full-harvest-finished t))
-				   (setq notmuch-address-last-harvest 0)))))))
+      (notmuch-address-harvest
+       nil nil
+       (lambda (proc event)
+	 ;; If harvest fails, we want to try
+	 ;; again when the trigger is next
+	 ;; called
+	 (if (string= event "finished\n")
+	     (progn
+	       (notmuch-address--save-address-hash)
+	       (setq notmuch-address-full-harvest-finished t))
+	   (setq notmuch-address-last-harvest 0)))))))
 
 ;;
 
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index ac998f9b..c1f3594e 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -69,9 +69,11 @@ (defun notmuch-company (command &optional arg &rest _ignore)
     (cl-case command
       (interactive (company-begin-backend 'notmuch-company))
       (prefix (and (derived-mode-p 'message-mode)
-		   (looking-back (concat notmuch-address-completion-headers-regexp ".*")
-				 (line-beginning-position))
-		   (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
+		   (looking-back
+		    (concat notmuch-address-completion-headers-regexp ".*")
+		    (line-beginning-position))
+		   (setq notmuch-company-last-prefix
+			 (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
       (candidates (cond
 		   ((notmuch-address--harvest-ready)
 		    ;; Update harvested addressed from time to time
@@ -80,17 +82,20 @@ (defun notmuch-company (command &optional arg &rest _ignore)
 		   (t
 		    (cons :async
 			  (lambda (callback)
-			    ;; First run quick asynchronous harvest based on what the user entered so far
+			    ;; First run quick asynchronous harvest
+			    ;; based on what the user entered so far
 			    (notmuch-address-harvest
 			     arg nil
 			     (lambda (_proc _event)
 			       (funcall callback (notmuch-address-matching arg))
-			       ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+			       ;; Then start the (potentially long-running)
+			       ;; full asynchronous harvest if necessary
 			       (notmuch-address-harvest-trigger))))))))
       (match (if (string-match notmuch-company-last-prefix arg)
 		 (match-end 0)
 	       0))
-      (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg))
+      (post-completion
+       (run-hook-with-args 'notmuch-address-post-completion-functions arg))
       (no-cache t))))
 
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index c201d0d7..2327ff1f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -161,7 +161,8 @@ (defun notmuch-crypto-sigstatus-good-callback (button)
 	(goto-char (point-max))
 	(insert (format "-- Key %s in message %s:\n"
 			fingerprint id))
-	(call-process notmuch-crypto-gpg-program nil t t "--batch" "--no-tty" "--list-keys" fingerprint))
+	(call-process notmuch-crypto-gpg-program nil t t
+		      "--batch" "--no-tty" "--list-keys" fingerprint))
       (recenter -1))))
 
 (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
@@ -220,12 +221,13 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	  (with-current-buffer buffer
 	    (goto-char (point-max))
 	    (insert (format "--- Retrieving key %s:\n" keyid)))
-	  (let ((p (make-process :name "notmuch GPG key retrieval"
-				 :connection-type 'pipe
-				 :buffer buffer
-				 :stderr buffer
-				 :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
-				 :sentinel #'notmuch-crypto--async-key-sentinel)))
+	  (let ((p (make-process
+		    :name "notmuch GPG key retrieval"
+		    :connection-type 'pipe
+		    :buffer buffer
+		    :stderr buffer
+		    :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
+		    :sentinel #'notmuch-crypto--async-key-sentinel)))
 	    (process-put p :gpg-key-id keyid)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index 27abc7d9..c3cb619f 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -154,12 +154,14 @@ (defun notmuch-draft--query-encryption ()
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
 	((ask)
-	 (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+	 (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.
 Really save and index an unencrypted copy? ")
 	   (error "Save aborted")))
 	((nil)
-	 (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')"))
+	 (error "Refusing to save draft with encryption tags (see `%s')"
+		'notmuch-draft-save-plaintext))
 	((t)
 	 (ignore))))
 
@@ -192,14 +194,16 @@ (defun notmuch-draft-save ()
        (message-remove-header "Message-ID")
        (message-add-header (concat "Message-ID: <" id ">")))
       (t
-       (message "You have customized emacs so Message-ID is not a deletable header, so not changing it")
+       (message "You have customized emacs so Message-ID is not a %s"
+		"deletable header, so not changing it")
        (setq id nil)))
      (cond
       ((member 'Date message-deletable-headers)
        (message-remove-header "Date")
        (message-add-header (concat "Date: " (message-make-date))))
       (t
-       (message "You have customized emacs so Date is not a deletable header, so not changing it")))
+       (message "You have customized emacs so Date is not a deletable %s"
+		"header, so not changing it")))
      (message-add-header "X-Notmuch-Emacs-Draft: True")
      (notmuch-draft-quote-some-mml)
      (notmuch-maildir-setup-message-for-saving)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 0ff5aaff..11c625ea 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -29,7 +29,8 @@ (require 'wid-edit) ; For `widget-forward'.
 (require 'notmuch-lib)
 (require 'notmuch-mua)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 (declare-function notmuch-tree "notmuch-tree"
 		  (&optional query query-context target buffer-name open-target unthreaded))
@@ -91,18 +92,28 @@ (define-widget 'notmuch-saved-search-plist 'list
   :tag "Saved Search"
   :args '((list :inline t
 		:format "%v"
-		(group :format "%v" :inline t (const :format "   Name: " :name) (string :format "%v"))
-		(group :format "%v" :inline t (const :format "  Query: " :query) (string :format "%v")))
+		(group :format "%v" :inline t
+		       (const :format "   Name: " :name)
+		       (string :format "%v"))
+		(group :format "%v" :inline t
+		       (const :format "  Query: " :query)
+		       (string :format "%v")))
 	  (checklist :inline t
 		     :format "%v"
-		     (group :format "%v" :inline t (const :format "Shortcut key: " :key) (key-sequence :format "%v"))
-		     (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))
-		     (group :format "%v" :inline t (const :format "" :sort-order)
+		     (group :format "%v" :inline t
+			    (const :format "Shortcut key: " :key)
+			    (key-sequence :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "Count-Query: " :count-query)
+			    (string :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "" :sort-order)
 			    (choice :tag " Sort Order"
 				    (const :tag "Default" nil)
 				    (const :tag "Oldest-first" oldest-first)
 				    (const :tag "Newest-first" newest-first)))
-		     (group :format "%v" :inline t (const :format "" :search-type)
+		     (group :format "%v" :inline t
+			    (const :format "" :search-type)
 			    (choice :tag " Search Type"
 				    (const :tag "Search mode" nil)
 				    (const :tag "Tree mode" tree)
@@ -474,7 +485,8 @@ (defun notmuch-hello-tags-per-line (widest)
 
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
-		  (proposed-width (max (* available-width notmuch-column-control) widest)))
+		  (proposed-width (max (* available-width notmuch-column-control)
+				       widest)))
 	     (floor available-width proposed-width)))
 
 	  (t
@@ -536,8 +548,9 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
-      (notmuch-logged-error "notmuch count --batch failed"
-			    "Please check that the notmuch CLI is new enough to support `count
+      (notmuch-logged-error
+       "notmuch count --batch failed"
+       "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
 
@@ -553,7 +566,8 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 				search-query (plist-get options :filter)))
 	       (message-count (prog1 (read (current-buffer))
 				(forward-line 1))))
-	  (when (and filtered-query (or (plist-get options :show-empty-searches) (> message-count 0)))
+	  (when (and filtered-query (or (plist-get options :show-empty-searches)
+					(> message-count 0)))
 	    (setq elem-plist (plist-put elem-plist :query filtered-query))
 	    (plist-put elem-plist :count message-count))))
       query-list))))
@@ -740,7 +754,9 @@ (defun notmuch-hello-insert-header ()
       ;; dark background.
       (setq image (cons 'image
 			(append (cdr image)
-				(list :background (face-background 'notmuch-hello-logo-background)))))
+				(list :background
+				      (face-background
+				       'notmuch-hello-logo-background)))))
       (insert-image image))
     (widget-insert "  "))
 
@@ -760,7 +776,8 @@ (defun notmuch-hello-insert-header ()
 			     (notmuch-hello-update))
 		   :help-echo "Refresh"
 		   (notmuch-hello-nice-number
-		    (string-to-number (car (process-lines notmuch-command "count")))))
+		    (string-to-number
+		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
 
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 84fe2b9c..6d8cd97f 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -70,7 +70,8 @@ (defun notmuch-jump-search ()
 
     (if action-map
 	(notmuch-jump action-map "Search: ")
-      (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches."))))
+      (error "To use notmuch-jump, \
+please customize shortcut keys in notmuch-saved-searches."))))
 
 (defvar notmuch-jump--action nil)
 
@@ -200,7 +201,9 @@ (defun notmuch-jump--make-keymap (action-map prompt)
 	      (define-key map keystr
 		`(lambda () (interactive)
 		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump action-submap new-prompt))
+			 ',(apply-partially #'notmuch-jump
+					    action-submap
+					    new-prompt))
 		   (exit-minibuffer)))))))
     map))
 
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0bb08eb2..9339f9d0 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -316,8 +316,10 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		tail)))
       ;; Documentation for command
       (push (cons key-string
-		  (or (and (symbolp binding) (get binding 'notmuch-doc))
-		      (and (functionp binding) (notmuch-documentation-first-line binding))))
+		  (or (and (symbolp binding)
+			   (get binding 'notmuch-doc))
+		      (and (functionp binding)
+			   (notmuch-documentation-first-line binding))))
 	    tail)))
     tail)
 
@@ -327,13 +329,13 @@ (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; binding whose "key" is 'remap, and whose "binding" is itself a
   ;; keymap that maps not from keys to commands, but from old (remapped)
   ;; functions to the commands to use in their stead.
-  (map-keymap
-   (lambda (command binding)
-     (mapc
-      (lambda (actual-key)
-	(setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))
-      (where-is-internal command base-keymap)))
-   remap-keymap)
+  (map-keymap (lambda (command binding)
+		(mapc (lambda (actual-key)
+			(setq tail
+			      (notmuch-describe-key actual-key binding
+						    prefix ua-keys tail)))
+		      (where-is-internal command base-keymap)))
+	      remap-keymap)
   tail)
 
 (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
@@ -356,9 +358,13 @@ (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail
 		      (notmuch-describe-remaps
 		       binding ua-keys base-keymap prefix tail)
 		    (notmuch-describe-keymap
-		     binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))
+		     binding ua-keys base-keymap
+		     (notmuch-prefix-key-description key)
+		     tail))))
 	   (binding
-	    (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
+	    (setq tail
+		  (notmuch-describe-key (vector key)
+					binding prefix ua-keys tail)))))
    keymap)
   tail)
 
@@ -368,11 +374,15 @@ (defun notmuch-substitute-command-keys (doc)
     (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)
       (let ((desc
 	     (save-match-data
-	       (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
+	       (let* ((keymap-name (substring doc
+					      (match-beginning 1)
+					      (match-end 1)))
 		      (keymap (symbol-value (intern keymap-name)))
 		      (ua-keys (where-is-internal 'universal-argument keymap t))
 		      (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
-		      (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))
+		      (desc-list (mapcar (lambda (arg)
+					   (concat (car arg) "\t" (cdr arg)))
+					 desc-alist)))
 		 (mapconcat #'identity desc-list "\n")))))
 	(setq doc (replace-match desc 1 1 doc)))
       (setq beg (match-end 0)))
@@ -391,7 +401,8 @@ (defun notmuch-help ()
 of its command symbol."
   (interactive)
   (let* ((mode major-mode)
-	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
+	 (doc (substitute-command-keys
+	       (notmuch-substitute-command-keys (documentation mode t)))))
     (with-current-buffer (generate-new-buffer "*notmuch-help*")
       (insert doc)
       (goto-char (point-min))
@@ -411,8 +422,10 @@ (defun notmuch-subkeymap-help ()
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-	   (desc-alist (notmuch-describe-keymap subkeymap ua-keys subkeymap prefix-string))
-	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))
+	   (desc-alist (notmuch-describe-keymap
+			subkeymap ua-keys subkeymap prefix-string))
+	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg)))
+			      desc-alist))
 	   (desc (mapconcat #'identity desc-list "\n")))
       (with-help-window (help-buffer)
 	(with-current-buffer standard-output
@@ -547,7 +560,8 @@ (defvar notmuch-multipart/alternative-discouraged
   '(
     ;; Avoid HTML parts.
     "text/html"
-    ;; multipart/related usually contain a text/html part and some associated graphics.
+    ;; multipart/related usually contain a text/html part and some
+    ;; associated graphics.
     "multipart/related"
     ))
 
@@ -602,8 +616,9 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
-			      (let ((coding-system (mm-charset-to-coding-system
-						    (plist-get part :content-charset))))
+			      (let ((coding-system
+				     (mm-charset-to-coding-system
+				      (plist-get part :content-charset))))
 				;; Sadly,
 				;; `mm-charset-to-coding-system' seems
 				;; to return things that are not
@@ -615,7 +630,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				  ;; charset is US-ASCII. RFC6657
 				  ;; complicates this somewhat.
 				  'us-ascii)))))
-		       (apply #'call-process notmuch-command nil '(t nil) nil args)
+		       (apply #'call-process
+			      notmuch-command nil '(t nil) nil args)
 		       (buffer-string))))))
     (when (and cache data)
       (plist-put part plist-elem data))
@@ -670,7 +686,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       (let* ((have-content (plist-member part :content))
 	     (charset (if have-content 'gnus-decoded
 			(plist-get part :content-charset)))
-	     (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))
+	     (handle (mm-make-handle (current-buffer)
+				     `(,content-type (charset . ,charset)))))
 	;; If the user wants the part inlined, insert the content and
 	;; test whether we are able to inline it (which includes both
 	;; capability and suitability tests).
@@ -786,7 +803,8 @@ (defun notmuch-check-async-exit-status (proc msg &optional command err)
 	   ((exit) (process-exit-status proc))
 	   ((signal) msg))))
     (when exit-status
-      (notmuch-check-exit-status exit-status (or command (process-command proc))
+      (notmuch-check-exit-status exit-status
+				 (or command (process-command proc))
 				 nil err))))
 
 (defun notmuch-check-exit-status (exit-status command &optional output err)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index e95de63b..4b10a731 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -135,8 +135,9 @@ (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; really want this header inserted.
 
   (when (or (not (= (elt subdir 0) ?/))
-	    (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
-			      subdir)))
+	    (y-or-n-p
+	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
+Insert header anyway? " subdir)))
     (message-add-header (concat "Fcc: " subdir))))
 
 (defun notmuch-maildir-add-file-style-fcc-header (subdir)
@@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
       ;; typo, or just the user want a new folder, let the user decide
       ;; how to deal with it.
       (error
-       (let ((response (notmuch-read-char-choice
-			"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
-			'(?r ?c ?i ?e))))
+       (let ((response (notmuch-read-char-choice "Insert failed: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
 	   (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
@@ -333,8 +333,8 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
       (notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
     ;; The fcc-header is not a valid maildir see if the user wants to
     ;; fix it in some way.
-    (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or  (e)dit the header? "
-			   fcc-header))
+    (let* ((prompt (format "Fcc %s is not a maildir: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
 	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 0164472f..c2242070 100644
--- a/emacs/notmuch-message.el
+++ b/emacs/notmuch-message.el
@@ -60,7 +60,8 @@ (defconst notmuch-message-queued-tag-changes nil
 be applied to the matching messages.")
 
 (defun notmuch-message-apply-queued-tag-changes ()
-  ;; Apply the tag changes queued in the buffer-local variable notmuch-message-queued-tag-changes.
+  ;; Apply the tag changes queued in the buffer-local variable
+  ;; notmuch-message-queued-tag-changes.
   (dolist (query-and-tags notmuch-message-queued-tag-changes)
     (notmuch-tag (car query-and-tags)
 		 (cdr query-and-tags))))
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 1efc88ea..74dfb384 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -205,10 +205,12 @@ (defun notmuch-mua-add-more-hidden-headers ()
 (defun notmuch-mua-reply-crypto (parts)
   "Add mml sign-encrypt flag if any part of original message is encrypted."
   (cl-loop for part in parts
-	   if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")
-	     do (mml-secure-message-sign-encrypt)
-	   else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
-	     do (notmuch-mua-reply-crypto (plist-get part :content))))
+	   if (notmuch-match-content-type (plist-get part :content-type)
+					  "multipart/encrypted")
+	   do (mml-secure-message-sign-encrypt)
+	   else if (notmuch-match-content-type (plist-get part :content-type)
+					       "multipart/*")
+	   do (notmuch-mua-reply-crypto (plist-get part :content))))
 
 ;; There is a bug in emacs 23's message.el that results in a newline
 ;; not being inserted after the References header, so the next header
@@ -250,8 +252,9 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
 
-	;; We modify message-header-format-alist to get around a bug in message.el.
-	;; See the comment above on notmuch-mua-insert-references.
+	;; We modify message-header-format-alist to get around
+	;; a bug in message.el.  See the comment above on
+	;; notmuch-mua-insert-references.
 	(let ((message-header-format-alist
 	       (cl-loop for pair in message-header-format-alist
 			if (eq (car pair) 'References)
@@ -266,7 +269,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the reply
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
@@ -293,27 +297,29 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
 
-	(insert (with-temp-buffer
-		  (let
-		      ;; Don't attempt to clean up messages, excerpt
-		      ;; citations, etc. in the original message before
-		      ;; quoting.
-		      ((notmuch-show-insert-text/plain-hook nil)
-		       ;; Don't omit long parts.
-		       (notmuch-show-max-text-part-size 0)
-		       ;; Insert headers for parts as appropriate for replying.
-		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
-		       ;; Ensure that any encrypted parts are
-		       ;; decrypted during the generation of the reply
-		       ;; text.
-		       (notmuch-show-process-crypto process-crypto)
-		       ;; Don't indent multipart sub-parts.
-		       (notmuch-show-indent-multipart nil))
-		    ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
-		    (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
-			      ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
-		      (notmuch-show-insert-body original (plist-get original :body) 0)
-		      (buffer-substring-no-properties (point-min) (point-max))))))
+	(insert
+	 (with-temp-buffer
+	   (let
+	       ;; Don't attempt to clean up messages, excerpt
+	       ;; citations, etc. in the original message before
+	       ;; quoting.
+	       ((notmuch-show-insert-text/plain-hook nil)
+		;; Don't omit long parts.
+		(notmuch-show-max-text-part-size 0)
+		;; Insert headers for parts as appropriate for replying.
+		(notmuch-show-insert-header-p-function
+		 notmuch-mua-reply-insert-header-p-function)
+		;; Ensure that any encrypted parts are
+		;; decrypted during the generation of the reply
+		;; text.
+		(notmuch-show-process-crypto process-crypto)
+		;; Don't indent multipart sub-parts.
+		(notmuch-show-indent-multipart nil))
+	     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
+	     (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
+		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
+	       (notmuch-show-insert-body original (plist-get original :body) 0)
+	       (buffer-substring-no-properties (point-min) (point-max))))))
 
 	(set-mark (point))
 	(goto-char start)
@@ -383,10 +389,13 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
-		       (notmuch-user-name) (notmuch-user-primary-email))) other-headers))
+		       (notmuch-user-name)
+		       (notmuch-user-primary-email)))
+	  other-headers))
 
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
-			     (or switch-function (notmuch-mua-get-switch-function)))
+			     (or switch-function
+				 (notmuch-mua-get-switch-function)))
   (let ((headers
 	 (append
 	  ;; The following is copied from `message-mail'
@@ -499,7 +508,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		(with-current-buffer temp-buffer
 		  (erase-buffer)
 		  (let ((coding-system-for-read 'no-conversion))
-		    (call-process notmuch-command nil t nil "show" "--format=raw" id))
+		    (call-process notmuch-command nil t nil
+				  "show" "--format=raw" id))
 		  ;; Because we process the messages in reverse order,
 		  ;; always generate a forwarded subject, then use the
 		  ;; last (i.e. first) one.
@@ -524,7 +534,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the message
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the message.
       (when notmuch-message-forwarded-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (cl-loop for id in forward-queries
@@ -609,7 +620,8 @@ (defun notmuch-mua-send-common (arg &optional exit)
   (run-hooks 'notmuch-mua-send-hook)
   (when (and (notmuch-mua-check-no-misplaced-secure-tag)
 	     (notmuch-mua-check-secure-tag-has-newline))
-    (cl-letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
+    (cl-letf (((symbol-function 'message-do-fcc)
+	       #'notmuch-maildir-message-do-fcc))
       (if exit
 	  (message-send-and-exit arg)
 	(message-send arg)))))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c9170466..26b41603 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -51,7 +51,8 @@ (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))
 (declare-function notmuch-count-attachments "notmuch" (mm-handle))
 (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))
 (declare-function notmuch-tree "notmuch-tree"
-		  (&optional query query-context target buffer-name open-target unthreaded))
+		  (&optional query query-context target buffer-name
+			     open-target unthreaded))
 (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
 (declare-function notmuch-unthreaded
 		  (&optional query query-context target buffer-name open-target))
@@ -95,10 +96,11 @@ (defcustom notmuch-show-hook '(notmuch-show-turn-on-visual-line-mode)
   :group 'notmuch-show
   :group 'notmuch-hooks)
 
-(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
-						 notmuch-wash-tidy-citations
-						 notmuch-wash-elide-blank-lines
-						 notmuch-wash-excerpt-citations)
+(defcustom notmuch-show-insert-text/plain-hook
+  '(notmuch-wash-wrap-long-lines
+    notmuch-wash-tidy-citations
+    notmuch-wash-elide-blank-lines
+    notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
@@ -348,7 +350,9 @@ (defun notmuch-show-with-message-as-text (fn)
     (with-temp-buffer
       (insert all)
       (if indenting
-	  (indent-rigidly (point-min) (point-max) (- (* notmuch-show-indent-messages-width depth))))
+	  (indent-rigidly (point-min)
+			  (point-max)
+			  (- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -395,7 +399,9 @@ (defun notmuch-show-update-tags (tags)
     (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
 	(let ((inhibit-read-only t))
 	  (replace-match (concat "("
-				 (notmuch-tag-format-tags tags (notmuch-show-get-prop :orig-tags))
+				 (notmuch-tag-format-tags
+				  tags
+				  (notmuch-show-get-prop :orig-tags))
 				 ")"))))))
 
 (defun notmuch-clean-address (address)
@@ -475,7 +481,8 @@ (defun notmuch-show-insert-headerline (headers date tags depth)
 	    ") ("
 	    (notmuch-tag-format-tags tags tags)
 	    ")\n")
-    (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
+    (overlay-put (make-overlay start (point))
+		 'face 'notmuch-message-summary-face)))
 
 (defun notmuch-show-insert-header (header header-value)
   "Insert a single header."
@@ -502,7 +509,8 @@ (define-button-type 'notmuch-show-part-button-type
   'face 'message-mml
   :supertype 'notmuch-button-type)
 
-(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
+(defun notmuch-show-insert-part-header (nth content-type declared-type
+					    &optional name comment)
   (let ((button)
 	(base-label (concat (when name (concat name ": "))
 			    declared-type
@@ -526,8 +534,9 @@ (defun notmuch-show-toggle-part-invisibility (&optional button)
     (when button
       (let ((overlay (button-get button 'overlay))
 	    (lazy-part (button-get button :notmuch-lazy-part)))
-	;; We have a part to toggle if there is an overlay or if there is a lazy part.
-	;; If neither is present we cannot toggle the part so we just return nil.
+	;; We have a part to toggle if there is an overlay or if there
+	;; is a lazy part.  If neither is present we cannot toggle the
+	;; part so we just return nil.
 	(when (or overlay lazy-part)
 	  (let* ((show (button-get button :notmuch-part-hidden))
 		 (new-start (button-start button))
@@ -628,7 +637,8 @@ (defun notmuch-show-multipart/*-to-list (part)
 	  (plist-get part :content)))
 
 (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth button)
-  (let ((chosen-type (car (notmuch-multipart/alternative-choose msg (notmuch-show-multipart/*-to-list part))))
+  (let ((chosen-type (car (notmuch-multipart/alternative-choose
+			   msg (notmuch-show-multipart/*-to-list part))))
 	(inner-parts (plist-get part :content))
 	(start (point)))
     ;; This inserts all parts of the chosen type rather than just one,
@@ -764,7 +774,8 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 	      (unwind-protect
 		  (progn
 		    (unless (icalendar-import-buffer file t)
-		      (error "Icalendar import error. See *icalendar-errors* for more information"))
+		      (error "Icalendar import error. %s"
+			     "See *icalendar-errors* for more information"))
 		    (set-buffer (get-file-buffer file))
 		    (setq result (buffer-substring (point-min) (point-max)))
 		    (set-buffer-modified-p nil)
@@ -782,10 +793,13 @@ (if (version< emacs-version "25.3")
     ;;
     ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
     ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched (msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function enriched-decode-display-prop
-      ;; is defined before it will be shadowed by the letf below. Otherwise the version
-      ;; in enriched.el may be loaded a bit later and used instead (for the first time).
+    (defun notmuch-show-insert-part-text/enriched
+	(msg part content-type nth depth button)
+      ;; By requiring enriched below, we ensure that the function
+      ;; enriched-decode-display-prop is defined before it will be
+      ;; shadowed by the letf below. Otherwise the version in
+      ;; enriched.el may be loaded a bit later and used instead (for
+      ;; the first time).
       (require 'enriched)
       (cl-letf (((symbol-function 'enriched-decode-display-prop)
 		 (lambda (start end &optional param) (list start end))))
@@ -943,7 +957,9 @@ (defun notmuch-show-lazy-part (part-args button)
 	(narrow-to-region part-beg part-end)
 	(delete-region part-beg part-end)
 	(apply #'notmuch-show-insert-bodypart-internal part-args)
-	(indent-rigidly part-beg part-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly part-beg
+			part-end
+			(* notmuch-show-indent-messages-width depth)))
       (goto-char part-end)
       (delete-char 1)
       (notmuch-show-record-part-information (cadr part-args)
@@ -1001,12 +1017,14 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (nth (plist-get part :id))
 	 (long (and (notmuch-match-content-type mime-type "text/*")
 		    (> notmuch-show-max-text-part-size 0)
-		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
+		    (> (length (plist-get part :content))
+		       notmuch-show-max-text-part-size)))
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
 	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
+		   (notmuch-show-insert-part-header nth mime-type content-type
+						    (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1104,13 +1122,17 @@ (defun notmuch-show-insert-msg (msg depth)
 
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
-	(indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly content-start
+			content-end
+			(* notmuch-show-indent-messages-width depth)))
 
     (setq message-end (point-max-marker))
 
     ;; Save the extents of this message over the whole text of the
     ;; message.
-    (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
+    (put-text-property message-start message-end
+		       :notmuch-message-extent
+		       (cons message-start message-end))
 
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
@@ -1144,7 +1166,8 @@ (defun notmuch-show-toggle-process-crypto ()
 (defun notmuch-show-toggle-elide-non-matching ()
   "Toggle the display of non-matching messages."
   (interactive)
-  (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))
+  (setq notmuch-show-elide-non-matching-messages
+	(not notmuch-show-elide-non-matching-messages))
   (message (if notmuch-show-elide-non-matching-messages
 	       "Showing matching messages only."
 	     "Showing all messages."))
@@ -1411,8 +1434,9 @@ (defun notmuch-show-apply-state (state)
 
     ;; Open those that were open.
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (member (notmuch-show-get-message-id) open))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
 
     (dolist (win-msg-pair win-msg-alist)
@@ -1645,7 +1669,8 @@ (defun notmuch-show-headers-visible (props visible-p)
 (defun notmuch-show-set-message-properties (props)
   (save-excursion
     (notmuch-show-move-to-message-top)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point) (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-show-get-message-properties ()
   "Return the properties of the current message as a plist.
@@ -1798,8 +1823,9 @@ (defun notmuch-show-command-hook ()
 	   (setq notmuch-show--seen-has-errored 't)
 	   (setq header-line-format
 		 (concat header-line-format
-			 (propertize "  [some mark read tag changes may have failed]"
-				     'face font-lock-warning-face)))))))))
+			 (propertize
+			  "  [some mark read tag changes may have failed]"
+			  'face font-lock-warning-face)))))))))
 
 (defun notmuch-show-filter-thread (query)
   "Filter or LIMIT the current thread based on a new query string.
@@ -1821,7 +1847,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
       (goto-char (point-min))
       (while (not done)
 	(if (notmuch-show-message-visible-p)
-	    (setq message-ids (append message-ids (list (notmuch-show-get-message-id)))))
+	    (setq message-ids
+		  (append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next)))
 	)
       message-ids
@@ -1885,7 +1912,8 @@ (defun notmuch-show-advance-and-archive ()
       (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
-  "Backup through the thread (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
+  "Backup through the thread (reverse scrolling compared to \
+\\[notmuch-show-advance-and-archive]).
 
 Specifically, if the beginning of the previous email is fewer
 than `window-height' lines from the current point, move to it
@@ -2077,11 +2105,14 @@ (defun notmuch-show-pipe-message (entire-thread command)
 	(setq shell-command
 	      (concat notmuch-command " show --format=mbox --exclude=false "
 		      (shell-quote-argument
-		       (mapconcat 'identity (notmuch-show-get-message-ids-for-open-messages) " OR "))
+		       (mapconcat 'identity
+				  (notmuch-show-get-message-ids-for-open-messages)
+				  " OR "))
 		      " | " command))
       (setq shell-command
 	    (concat notmuch-command " show --format=raw "
-		    (shell-quote-argument (notmuch-show-get-message-id)) " | " command)))
+		    (shell-quote-argument (notmuch-show-get-message-id))
+		    " | " command)))
     (let ((cwd default-directory)
 	  (buf (get-buffer-create (concat "*notmuch-pipe*"))))
       (with-current-buffer buf
@@ -2182,8 +2213,9 @@ (defun notmuch-show-open-or-close-all ()
   (interactive)
   (save-excursion
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (not current-prefix-arg))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (not current-prefix-arg))
 	     until (not (notmuch-show-goto-message-next))))
   (force-window-update))
 
@@ -2515,7 +2547,8 @@ (defun notmuch-show-choose-mime-of-part (mime-type)
   (interactive
    (list (completing-read "Mime type to use (default text/plain): "
 			  (mailcap-mime-types) nil nil nil nil "text/plain")))
-  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
+  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part
+					     mime-type))
 
 (defun notmuch-show-imenu-prev-index-position-function ()
   "Move point to previous message in notmuch-show buffer.
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index c54e6ad0..34cd493a 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -44,7 +44,9 @@ (define-widget 'notmuch-tag-key-type 'list
   :args '((list :inline t
 		:format "%v"
 		(key-sequence :tag "Key")
-		(radio :tag "Tag operations" (repeat :tag "Tag list" (string :format "%v" :tag "change"))
+		(radio :tag "Tag operations"
+		       (repeat :tag "Tag list"
+			       (string :format "%v" :tag "change"))
 		       (variable :tag "Tag variable"))
 		(string :tag "Name"))))
 
@@ -316,7 +318,9 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 `notmuch-tag-formats'."
   (let* ((tag-state (cond ((not (member tag tags)) 'deleted)
 			  ((not (member tag orig-tags)) 'added)))
-	 (formatted-tag (gethash (cons tag tag-state) notmuch-tag--format-cache 'missing)))
+	 (formatted-tag (gethash (cons tag tag-state)
+				 notmuch-tag--format-cache
+				 'missing)))
     (when (eq formatted-tag 'missing)
       (let ((base (notmuch-tag--get-formats tag notmuch-tag-formats))
 	    (over (cl-case tag-state
@@ -338,9 +342,9 @@ (defun notmuch-tag-format-tags (tags orig-tags &optional face)
     (notmuch-apply-face
      (mapconcat #'identity
 		;; nil indicated that the tag was deliberately hidden
-		(delq nil (mapcar
-			   (apply-partially #'notmuch-tag-format-tag tags orig-tags)
-			   all-tags))
+		(delq nil (mapcar (apply-partially #'notmuch-tag-format-tag
+						   tags orig-tags)
+				  all-tags))
 		" ")
      face
      t)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index ab90f652..fcfb972d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -34,7 +34,8 @@ (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line))
 (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
 (declare-function notmuch-read-query "notmuch" (prompt))
 (declare-function notmuch-search-find-thread-id "notmuch" (&optional bare))
@@ -284,15 +285,18 @@ (defvar notmuch-tree-mode-map
     (set-keymap-parent map notmuch-common-keymap)
     ;; The following override the global keymap.
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-help] (notmuch-tree-close-message-pane-and #'notmuch-help))
+    (define-key map [remap notmuch-help]
+      (notmuch-tree-close-message-pane-and #'notmuch-help))
     ;; Override because we first close message pane and then close tree buffer.
     (define-key map [remap notmuch-bury-or-kill-this-buffer] 'notmuch-tree-quit)
     ;; Override because we close message pane after the search query is entered.
     (define-key map [remap notmuch-search] 'notmuch-tree-to-search)
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
+    (define-key map [remap notmuch-mua-new-mail]
+      (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-jump-search] (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
+    (define-key map [remap notmuch-jump-search]
+      (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
 
     (define-key map "S" 'notmuch-search-from-tree-current-query)
     (define-key map "U" 'notmuch-unthreaded-from-tree-current-query)
@@ -306,16 +310,24 @@ (defvar notmuch-tree-mode-map
     (define-key map "b" 'notmuch-show-resend-message)
 
     ;; these apply to the message pane
-    (define-key map (kbd "M-TAB") (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "<backtab>")  (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "TAB") (notmuch-tree-to-message-pane #'notmuch-show-next-button))
-    (define-key map "$" (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
+    (define-key map (kbd "M-TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "<backtab>")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-next-button))
+    (define-key map "$"
+      (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
 
     ;; bindings from show (or elsewhere) but we close the message pane first.
-    (define-key map "f" (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
-    (define-key map "r" (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
-    (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
-    (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
+    (define-key map "f"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
+    (define-key map "r"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
+    (define-key map "R"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
+    (define-key map "V"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
 
     ;; The main tree view bindings
     (define-key map (kbd "RET") 'notmuch-tree-show-message)
@@ -354,7 +366,9 @@ (defun notmuch-tree-get-message-properties ()
 (defun notmuch-tree-set-message-properties (props)
   (save-excursion
     (beginning-of-line)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point)
+		       (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-tree-set-prop (prop val &optional props)
   (let ((inhibit-read-only t)
@@ -407,7 +421,8 @@ (defun notmuch-tree-refresh-result ()
     ;; from overwriting the buffer local copy of
     ;; notmuch-tree-previous-subject if this is called while the
     ;; buffer is displaying.
-    (let ((notmuch-tree-previous-subject (notmuch-tree-get-prop :previous-subject)))
+    (let ((notmuch-tree-previous-subject
+	   (notmuch-tree-get-prop :previous-subject)))
       (delete-region (point) (1+ (line-end-position)))
       (notmuch-tree-insert-msg msg))
     (let ((new-end (line-end-position)))
@@ -596,7 +611,8 @@ (defun notmuch-tree-close-message-window ()
   "Close the message-window. Return t if close succeeds."
   (interactive)
   (when (and (window-live-p notmuch-tree-message-window)
-	     (eq (window-buffer notmuch-tree-message-window) notmuch-tree-message-buffer))
+	     (eq (window-buffer notmuch-tree-message-window)
+		 notmuch-tree-message-buffer))
     (delete-window notmuch-tree-message-window)
     (unless (get-buffer-window-list notmuch-tree-message-buffer)
       (kill-buffer notmuch-tree-message-buffer))
@@ -611,7 +627,8 @@ (defun notmuch-tree-archive-message (&optional unarchive)
 `notmuch-archive-tags' will be reversed."
   (interactive "P")
   (when notmuch-archive-tags
-    (notmuch-tree-tag (notmuch-tag-change-list notmuch-archive-tags unarchive))))
+    (notmuch-tree-tag
+     (notmuch-tag-change-list notmuch-archive-tags unarchive))))
 
 (defun notmuch-tree-archive-message-then-next (&optional unarchive)
   "Archive the current message and move to next matching message."
@@ -786,7 +803,8 @@ (defun notmuch-tree-format-field (field format-string msg)
       (let ((face (if match
 		      'notmuch-tree-match-date-face
 		    'notmuch-tree-no-match-date-face)))
-	(propertize (format format-string (plist-get msg :date_relative)) 'face face)))
+	(propertize (format format-string (plist-get msg :date_relative))
+		    'face face)))
 
      ((string-equal field "tree")
       (let ((tree-status (plist-get msg :tree-status))
@@ -880,7 +898,8 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
        ((and (< 0 depth) last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) first last)
-;;	  (push "─" tree-status)) choice between this and next line is matter of taste.
+	;; Choice between these two variants is a matter of taste.
+	;; (push "─" tree-status))
 	(push " " tree-status))
        ((and (eq 0 depth) first (not last))
 	  (push "┬" tree-status))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index fd0314cc..3a9ffdd0 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -25,7 +25,9 @@
 
 (require 'coolj)
 (require 'notmuch-lib)
-(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
+
+(declare-function notmuch-show-insert-bodypart "notmuch-show"
+		  (msg part depth &optional hide))
 (defvar notmuch-show-indent-messages-width)
 
 ;;
@@ -186,9 +188,12 @@ (defun notmuch-wash-button-label (overlay)
   (let* ((type (overlay-get overlay 'type))
 	 (invis-spec (overlay-get overlay 'invisible))
 	 (state (if (invisible-p invis-spec) "hidden" "visible"))
-	 (label-format (symbol-value (intern-soft (concat "notmuch-wash-button-"
-							  type "-" state "-format"))))
-	 (lines-count (count-lines (overlay-start overlay) (overlay-end overlay))))
+	 (label-format (symbol-value
+			(intern-soft
+			 (format "notmuch-wash-button-%s-%s-format"
+				 type state))))
+	 (lines-count (count-lines (overlay-start overlay)
+				   (overlay-end overlay))))
     (format label-format lines-count)))
 
 (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
@@ -238,7 +243,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
     (let* ((cite-start (match-beginning 0))
 	   (cite-end (match-end 0))
 	   (cite-lines (count-lines cite-start cite-end)))
-      (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
+      (overlay-put (make-overlay cite-start cite-end)
+		   'face 'notmuch-wash-cited-text)
       (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
 			     notmuch-wash-citation-lines-suffix
 			     1))
@@ -260,7 +266,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 		  (sig-end-marker (make-marker)))
 	      (set-marker sig-start-marker sig-start)
 	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text)
+	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
+			   'face 'message-cited-text)
 	      (notmuch-wash-region-to-button
 	       msg sig-start-marker sig-end-marker
 	       "signature"))))))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c97997fe..07a58da7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -516,7 +516,9 @@ (defun notmuch-search-show-thread (&optional elide-toggle)
 		      (current-buffer)
 		      notmuch-search-query-string
 		      ;; Name the buffer based on the subject.
-		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
+		      (concat "*"
+			      (truncate-string-to-width subject 30 nil nil t)
+			      "*"))
       (message "End of search results."))))
 
 (defun notmuch-tree-from-search-current-query ()
@@ -800,7 +802,9 @@ (defun notmuch-search-insert-authors (format-string authors)
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-	(setq visible-string (propertize visible-string 'help-echo (concat "..." invisible-string))))
+	(setq visible-string
+	      (propertize visible-string
+			  'help-echo (concat "..." invisible-string))))
 
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
@@ -892,7 +896,8 @@ (defun notmuch-search-buffer-title (query)
 		(longest-length 0))
 	    (cl-loop for tuple in notmuch-saved-searches
 		     if (let ((quoted-query
-			       (regexp-quote (notmuch-saved-search-get tuple :query))))
+			       (regexp-quote
+				(notmuch-saved-search-get tuple :query))))
 			  (and (string-match (concat "^" quoted-query) query)
 			       (> (length (match-string 0 query))
 				  longest-length)))
@@ -905,9 +910,10 @@ (defun notmuch-search-buffer-title (query)
 	   (concat "*notmuch-saved-search-" saved-search-name "*"))
 	  (saved-search
 	   (concat "*notmuch-search-"
-		   (replace-regexp-in-string (concat "^" (regexp-quote saved-search-query))
-					     (concat "[ " saved-search-name " ]")
-					     query)
+		   (replace-regexp-in-string
+		    (concat "^" (regexp-quote saved-search-query))
+		    (concat "[ " saved-search-name " ]")
+		    query)
 		   "*"))
 	  (t
 	   (concat "*notmuch-search-" query "*"))
@@ -926,7 +932,8 @@ (defun notmuch-read-query (prompt)
 		       "subject:" "attachment:")
 		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
 		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
+		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			 (mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
@@ -1078,8 +1085,10 @@ (defun notmuch-search-filter-by-tag (tag)
 Runs a new search matching only messages that match both the
 current search results AND that are tagged with the given tag."
   (interactive
-   (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
-  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
+   (list (notmuch-select-tag-with-completion "Filter by tag: "
+					     notmuch-search-query-string)))
+  (notmuch-search (concat notmuch-search-query-string " and tag:" tag)
+		  notmuch-search-oldest-first))
 
 (defun notmuch-search-by-tag (tag)
   "Display threads matching TAG in a notmuch-search buffer."
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2225aefc..2af91186 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -63,7 +63,8 @@ (defun rstdoc-extract (in-file out-file)
 
 (defun rstdoc--insert-docstring (symbol docstring)
   (insert (format "\n.. |docstring::%s| replace::\n" symbol))
-  (insert (replace-regexp-in-string "^" "    " (rstdoc--rst-quote-string docstring)))
+  (insert (replace-regexp-in-string "^" "    "
+				    (rstdoc--rst-quote-string docstring)))
   (insert "\n"))
 
 (defvar rst--escape-alist
-- 
2.28.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 02/23] emacs: Remove excess empty lines
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 01/23] emacs: Shorten long lines Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 03/23] emacs: Fix indentation Jonas Bernoulli
                     ` (20 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

Most people who write lots of lisp tend to only sparsely use empty
"separator" lines within forms.  In lisp they feel unnecessary and
since most files stick to this convention we get a bit confused
when there are extra empty lines.  It feels like the s-expressions
are falling into pieces.

All of this is especially true between a function's doc-string and
body because the doc-string is colored differently, which visually
already separates it quite sufficiently from the code that follows.
---
 emacs/make-deps.el           |  2 -
 emacs/notmuch-address.el     |  2 -
 emacs/notmuch-crypto.el      |  4 --
 emacs/notmuch-hello.el       | 18 ---------
 emacs/notmuch-jump.el        |  5 ---
 emacs/notmuch-lib.el         | 10 -----
 emacs/notmuch-maildir-fcc.el |  7 ----
 emacs/notmuch-mua.el         | 26 -------------
 emacs/notmuch-parser.el      |  5 ---
 emacs/notmuch-show.el        | 75 ++----------------------------------
 emacs/notmuch-tag.el         |  3 --
 emacs/notmuch-tree.el        |  9 -----
 emacs/notmuch-wash.el        | 18 +--------
 emacs/notmuch.el             |  7 ----
 14 files changed, 5 insertions(+), 186 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index 5b6db698..dcac319c 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -23,7 +23,6 @@
 
 (defun batch-make-deps ()
   "Invoke `make-deps' for each file on the command line."
-
   (setq debug-on-error t)
   (dolist (file command-line-args-left)
     (let ((default-directory command-line-default-directory))
@@ -37,7 +36,6 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-
   (setq dir (or dir default-directory))
   (save-excursion
     (goto-char (point-min))
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2a9c411a..ca4da3f3 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 Address harvesting may take some time so the address collection runs
 asynchronously unless SYNCHRONOUS is t. In case of asynchronous
 execution, CALLBACK is called when harvesting finishes."
-
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
 	 (prefix-query (when addr-prefix
@@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 	;; Kill any existing process
 	(when current-proc
 	  (kill-buffer (process-buffer current-proc))) ; this also kills the process
-
 	(setq current-proc
 	      (apply 'notmuch-start-notmuch proc-name proc-buf
 		     callback				; process sentinel
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 2327ff1f..58947a20 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 		face 'notmuch-crypto-signature-good-key))
 	(setq button-action 'notmuch-crypto-sigstatus-good-callback
 	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
-
      ((string= status "error")
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
 	    button-action 'notmuch-crypto-sigstatus-error-callback
 	    help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
-
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")")
 	    face 'notmuch-crypto-signature-bad))
-
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
@@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
 	    (message "Getting the GPG key %s asynchronously..." keyid)))
-
       (let ((window (display-buffer buffer)))
 	(with-selected-window window
 	  (with-current-buffer buffer
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 11c625ea..e71e55f3 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches
 ;; The saved-search format is also used by the all-tags notmuch-hello
 ;; section. This section generates its own saved-search list in one of
 ;; the latter two forms.
-
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -482,20 +481,17 @@ (defun notmuch-hello-tags-per-line (widest)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 (max notmuch-column-control widest)))))
-
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
 		  (proposed-width (max (* available-width notmuch-column-control)
 				       widest)))
 	     (floor available-width proposed-width)))
-
 	  (t
 	   (max 1
 		(/ (- (window-width) notmuch-hello-indent)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 widest)))))))
-
     (cons tags-per-line (/ (max 1
 				(- (window-width) notmuch-hello-indent
 				   ;; Count is 9 wide (8 digits plus
@@ -545,7 +541,6 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
 	  "\n")))
-
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -553,9 +548,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
        "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
-
     (goto-char (point-min))
-
     (notmuch-remove-if-not
      #'identity
      (mapcar
@@ -621,7 +614,6 @@ (defun notmuch-hello-insert-buttons (searches)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
 	  reordered-list)
-
     ;; If the last line was not full (and hence did not include a
     ;; carriage return), insert one now.
     (unless (eq (% count tags-per-line) 0)
@@ -780,7 +772,6 @@ (defun notmuch-hello-insert-header ()
 		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
-
 (defun notmuch-hello-insert-saved-searches ()
   "Insert the saved-searches section."
   (let ((searches (notmuch-hello-query-counts
@@ -977,7 +968,6 @@ (defun notmuch-hello-insert-footer ()
 (defun notmuch-hello (&optional no-display)
   "Run notmuch and display saved searches, known tags, etc."
   (interactive)
-
   (notmuch-assert-cli-sane)
   ;; This may cause a window configuration change, so if the
   ;; auto-refresh hook is already installed, avoid recursive refresh.
@@ -985,32 +975,25 @@ (defun notmuch-hello (&optional no-display)
     (if no-display
 	(set-buffer "*notmuch-hello*")
       (switch-to-buffer "*notmuch-hello*")))
-
   ;; Install auto-refresh hook
   (when notmuch-hello-auto-refresh
     (add-hook 'window-configuration-change-hook
 	      #'notmuch-hello-window-configuration-change))
-
   (let ((target-line (line-number-at-pos))
 	(target-column (current-column))
 	(inhibit-read-only t))
-
     ;; Delete all editable widget fields.  Editable widget fields are
     ;; tracked in a buffer local variable `widget-field-list' (and
     ;; others).  If we do `erase-buffer' without properly deleting the
     ;; widgets, some widget-related functions are confused later.
     (mapc 'widget-delete widget-field-list)
-
     (erase-buffer)
-
     (unless (eq major-mode 'notmuch-hello-mode)
       (notmuch-hello-mode))
-
     (let ((all (overlay-lists)))
       ;; Delete all the overlays.
       (mapc 'delete-overlay (car all))
       (mapc 'delete-overlay (cdr all)))
-
     (mapc
      (lambda (section)
        (let ((point-before (point)))
@@ -1023,7 +1006,6 @@ (defun notmuch-hello (&optional no-display)
 	   (widget-insert "\n"))))
      notmuch-hello-sections)
     (widget-setup)
-
     ;; Move point back to where it was before refresh. Use line and
     ;; column instead of point directly to be insensitive to additions
     ;; and removals of text within earlier lines.
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 6d8cd97f..adf79650 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -43,7 +43,6 @@ (defun notmuch-jump-search ()
 Typically these shortcuts are a single key long, so this is a
 fast way to jump to a saved search from anywhere in Notmuch."
   (interactive)
-
   ;; Build the action map
   (let (action-map)
     (dolist (saved-search notmuch-saved-searches)
@@ -67,7 +66,6 @@ (defun notmuch-jump-search ()
 			  `(lambda () (notmuch-search ',query ',oldest-first)))))
 		  action-map)))))
     (setq action-map (nreverse action-map))
-
     (if action-map
 	(notmuch-jump action-map "Search: ")
       (error "To use notmuch-jump, \
@@ -90,7 +88,6 @@ (defun notmuch-jump (action-map prompt)
 the buffer, and ACTION is a nullary function to call.  LABEL may
 be null, in which case the action will still be bound, but will
 not appear in the pop-up buffer."
-
   (let* ((items (notmuch-jump--format-actions action-map))
 	 ;; Format the table of bindings and the full prompt
 	 (table
@@ -115,7 +112,6 @@ (defun notmuch-jump (action-map prompt)
 	 (notmuch-jump--action nil))
     ;; Read the action
     (read-from-minibuffer full-prompt nil minibuffer-map)
-
     ;; If we got an action, do it
     (when notmuch-jump--action
       (funcall notmuch-jump--action))))
@@ -126,7 +122,6 @@ (defun notmuch-jump--format-actions (action-map)
 Returns a list of strings, one for each item with a label in
 ACTION-MAP.  These strings can be inserted into a tabular
 buffer."
-
   ;; Compute the maximum key description width
   (let ((key-width 1))
     (pcase-dolist (`(,key ,desc) action-map)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9339f9d0..615207ed 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -418,7 +418,6 @@ (defun notmuch-subkeymap-help ()
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
-
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
@@ -486,7 +485,6 @@ (defun notmuch-escape-boolean-term (term)
 The caller is responsible for prepending the term prefix and a
 colon.  This performs minimal escaping in order to produce
 user-friendly queries."
-
   (save-match-data
     (if (or (equal term "")
 	    ;; To be pessimistic, only pass through terms composed
@@ -731,7 +729,6 @@ (defun notmuch-apply-face (object face &optional below start end)
 attributes, or a list of these.  If START and/or END are omitted,
 they default to the beginning/end of OBJECT.  For convenience
 when applied to strings, this returns OBJECT."
-
   ;; A face property can have three forms: a face name (a string or
   ;; symbol), a property list, or a list of these two forms.  In the
   ;; list case, the faces will be combined, with the earlier faces
@@ -774,7 +771,6 @@ (defun notmuch-logged-error (msg &optional extra)
 signals MSG as an error.  If EXTRA is non-nil, text referring the
 user to the *Notmuch errors* buffer will be appended to the
 signaled error.  This function does not return."
-
   (with-current-buffer (get-buffer-create "*Notmuch errors*")
     (goto-char (point-max))
     (unless (bobp)
@@ -819,7 +815,6 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 giving the output of command.  ERR, if provided, is the error
 output of command.  OUTPUT and ERR will be included in the error
 message."
-
   (cond
    ((eq exit-status 0) t)
    ((eq exit-status 20)
@@ -865,7 +860,6 @@ (defun notmuch-call-notmuch--helper (destination args)
 This wraps `call-process'.  DESTINATION has the same meaning as
 for `call-process'.  ARGS is as described for
 `notmuch-call-notmuch-process'."
-
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
@@ -903,7 +897,6 @@ (defun notmuch-call-notmuch-sexp (&rest args)
 Like `notmuch-call-notmuch-process', if notmuch exits with a
 non-zero status, this will report its output and signal an
 error."
-
   (with-temp-buffer
     (let ((err-file (make-temp-file "nmerr")))
       (unwind-protect
@@ -931,7 +924,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 invoke `set-process-sentinel' directly on the returned process,
 as that will interfere with the handling of stderr and the exit
 status."
-
   (let (err-file err-buffer proc err-proc
 	;; Find notmuch using Emacs' `exec-path'
 	(command (or (executable-find notmuch-command)
@@ -956,7 +948,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 	  (process-put err-proc 'err-file err-file)
 	  (process-put err-proc 'err-buffer err-buffer)
 	  (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel))
-
       ;; On Emacs versions before 25, there is no way to capture
       ;; stdout and stderr separately for asynchronous processes, or
       ;; even to redirect stderr to a file, so we use a trivial shell
@@ -969,7 +960,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 			  "exec 2>\"$1\"; shift; exec \"$0\" \"$@\""
 			  command err-file args)))
       (process-put proc 'err-file err-file))
-
     (process-put proc 'sub-sentinel sentinel)
     (process-put proc 'real-command (cons notmuch-command args))
     (set-process-sentinel proc #'notmuch-start-notmuch-sentinel)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 4b10a731..66f32fd4 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -94,22 +94,18 @@ (defun notmuch-fcc-header-setup ()
 
 Originally intended to be use a hook function, but now called directly
 by notmuch-mua-mail."
-
   (let ((subdir
 	 (cond
 	  ((or (not notmuch-fcc-dirs)
 	       (message-field-value "Fcc"))
 	   ;; Nothing set or an existing header.
 	   nil)
-
 	  ((stringp notmuch-fcc-dirs)
 	   notmuch-fcc-dirs)
-
 	  ((and (listp notmuch-fcc-dirs)
 		(stringp (car notmuch-fcc-dirs)))
 	   ;; Old style - no longer works.
 	   (error "Invalid `notmuch-fcc-dirs' setting (old style)"))
-
 	  ((listp notmuch-fcc-dirs)
 	   (let* ((from (message-field-value "From"))
 		  (match
@@ -121,10 +117,8 @@ (defun notmuch-fcc-header-setup ()
 		 (cdr match)
 	       (message "No Fcc header added.")
 	       nil)))
-
 	  (t
 	   (error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
-
     (when subdir
       (if notmuch-maildir-use-notmuch-insert
 	  (notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
@@ -133,7 +127,6 @@ (defun notmuch-fcc-header-setup ()
 (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; Notmuch insert does not accept absolute paths, so check the user
   ;; really want this header inserted.
-
   (when (or (not (= (elt subdir 0) ?/))
 	    (y-or-n-p
 	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 74dfb384..3bc06b4b 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -228,22 +228,17 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	original)
     (when process-crypto
       (setq args (append args '("--decrypt=true"))))
-
     (if reply-all
 	(setq args (append args '("--reply-to=all")))
       (setq args (append args '("--reply-to=sender"))))
     (setq args (append args (list query-string)))
-
     ;; Get the reply object as SEXP, and parse it into an elisp object.
     (setq reply (apply #'notmuch-call-notmuch-sexp args))
-
     ;; Extract the original message to simplify the following code.
     (setq original (plist-get reply :original))
-
     ;; Extract the headers of both the reply and the original message.
     (let* ((original-headers (plist-get original :headers))
 	   (reply-headers (plist-get reply :reply-headers)))
-
       ;; If sender is non-nil, set the From: header to its value.
       (when sender
 	(plist-put reply-headers :From sender))
@@ -251,7 +246,6 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; Overlay the composition window on that being used to read
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
-
 	;; We modify message-header-format-alist to get around
 	;; a bug in message.el.  See the comment above on
 	;; notmuch-mua-insert-references.
@@ -268,13 +262,11 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-sanitize (plist-get reply-headers :Subject))
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
-
       ;; Insert the message body - but put it in front of the signature
       ;; if one is present, and after any other content
       ;; message*setup-hooks may have added to the message body already.
@@ -286,17 +278,14 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	    (if message-signature-insert-empty-line
 		(forward-line -1))
 	  (goto-char (point-max))))
-
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
 	    (start (point)))
-
 	;; notmuch-mua-cite-function constructs a citation line based
 	;; on the From and Date headers of the original message, which
 	;; are assumed to be in the buffer.
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
-
 	(insert
 	 (with-temp-buffer
 	   (let
@@ -320,22 +309,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
 	       (notmuch-show-insert-body original (plist-get original :body) 0)
 	       (buffer-substring-no-properties (point-min) (point-max))))))
-
 	(set-mark (point))
 	(goto-char start)
 	;; Quote the original message according to the user's configured style.
 	(funcall notmuch-mua-cite-function)))
-
     ;; Crypto processing based crypto content of the original message
     (when process-crypto
       (notmuch-mua-reply-crypto (plist-get original :body))))
-
   ;; Push mark right before signature, if any.
   (message-goto-signature)
   (unless (eobp)
     (end-of-line -1))
   (push-mark)
-
   (message-goto-body)
   (set-buffer-modified-p nil))
 
@@ -381,18 +366,15 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 				   return-action &rest ignored)
   "Invoke the notmuch mail composition window."
   (interactive)
-
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
       (when (not (string= "" user-agent))
 	(push (cons 'User-Agent user-agent) other-headers))))
-
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
 		       (notmuch-user-name)
 		       (notmuch-user-primary-email)))
 	  other-headers))
-
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
 			     (or switch-function
 				 (notmuch-mua-get-switch-function)))
@@ -422,7 +404,6 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (message-hide-headers)
   (set-buffer-modified-p nil)
   (notmuch-mua-maybe-set-window-dedicated)
-
   (message-goto-to))
 
 (defcustom notmuch-identities nil
@@ -495,10 +476,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 			  ;; applied later.
 	 forward-references ;; List of accumulated message-references of forwarded messages
 	 forward-queries) ;; List of corresponding message-query
-
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
-
     (save-excursion
       ;; Insert all of the forwarded messages.
       (mapc (lambda (id)
@@ -524,7 +503,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	    ;; `message-forward-make-body' always puts the message at
 	    ;; the top, so do them in reverse order.
 	    (reverse messages))
-
       ;; Add in the appropriate subject.
       (save-restriction
 	(message-narrow-to-headers)
@@ -533,7 +511,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-remove-header "References")
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the message.
       (when notmuch-message-forwarded-tags
@@ -541,7 +518,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		    (cl-loop for id in forward-queries
 			     collect
 			     (cons id notmuch-message-forwarded-tags))))
-
       ;; `message-forward-make-body' shows the User-agent header.  Hide
       ;; it again.
       (message-hide-headers)
@@ -553,7 +529,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-
 ;; In current emacs (24.3) select-active-regions is set to t by
 ;; default. The reply insertion code sets the region to the quoted
 ;; message to make it easy to delete (kill-region or C-w). These two
@@ -565,7 +540,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 ;; primary selection was previously in a non-emacs window but not if
 ;; it was in an emacs window. To avoid the problem in the latter case
 ;; we deactivate mark.
-
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index dc9fbe2f..06e7487b 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -38,7 +38,6 @@ (defun notmuch-sexp-create-parser ()
 The parser always consumes input from point in the current
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
-
   (vector 'notmuch-sexp-parser
 	  ;; List depth
 	  0
@@ -60,7 +59,6 @@ (defun notmuch-sexp-read (sp)
 list, this moves point just past the terminator and returns 'end.
 Otherwise, this moves point to just past the end of the value and
 returns the value."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\))
@@ -134,7 +132,6 @@ (defun notmuch-sexp-begin-list (sp)
 returns t.  Later calls to `notmuch-sexp-read' will return the
 elements inside the list.  If the input in buffer is not the
 beginning of a list, throw invalid-read-syntax."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\()
@@ -151,7 +148,6 @@ (defun notmuch-sexp-eof (sp)
 
 Moves point to the beginning of any trailing data or to the end
 of the buffer if there is only trailing whitespace."
-
   (skip-chars-forward " \n\r\t")
   (unless (eobp)
     (error "Trailing garbage following expression")))
@@ -173,7 +169,6 @@ (defun notmuch-sexp-parse-partial-list (result-function result-buffer)
 be called whenever the input buffer has been extended with
 additional data.  The caller just needs to ensure it does not
 move point in the input buffer."
-
   ;; Set up the initial state
   (unless (local-variable-p 'notmuch-sexp--parser)
     (set (make-local-variable 'notmuch-sexp--parser)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 26b41603..6e23a980 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -320,7 +320,6 @@ (defun notmuch-show-with-message-as-text (fn)
 
 FN is called with one argument, the message properties. It should
 operation on the contents of the current buffer."
-
   ;; Remake the header to ensure that all information is available.
   (let* ((to (notmuch-show-get-to))
 	 (cc (notmuch-show-get-cc))
@@ -329,7 +328,6 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (date (notmuch-show-get-date))
 	 (tags (notmuch-show-get-tags))
 	 (depth (notmuch-show-get-depth))
-
 	 (header (concat
 		  "Subject: " subject "\n"
 		  "To: " to "\n"
@@ -375,7 +373,6 @@ (defun notmuch-show-fontify-header ()
 		'message-header-subject)
 	       (t
 		'message-header-other))))
-
     (overlay-put (make-overlay (point) (re-search-forward ":"))
 		 'face 'message-header-name)
     (overlay-put (make-overlay (point) (re-search-forward ".*$"))
@@ -421,39 +418,30 @@ (defun notmuch-clean-address (address)
        ((string-match "\\(.*\\) <\\(.*\\)>" address)
 	(setq p-name (match-string 1 address)
 	      p-address (match-string 2 address)))
-
        ;; "<user@dom.ain>" style.
        ((string-match "<\\(.*\\)>" address)
 	(setq p-address (match-string 1 address)))
-
        ;; Everything else.
        (t
 	(setq p-address address)))
-
       (when p-name
 	;; Remove elements of the mailbox part that are not relevant for
 	;; display, even if they are required during transport:
 	;;
 	;; Backslashes.
 	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-
 	;; 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-loop p-name)
 		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 until (string= start-of-loop p-name)))
-
       ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
       ;; 'foo@bar.com'.
       (when (string= p-name p-address)
 	(setq p-name nil))
-
       (cons p-address p-name))
     (error (cons address nil))))
 
@@ -517,7 +505,6 @@ (defun notmuch-show-insert-part-header (nth content-type declared-type
 			    (unless (string-equal declared-type content-type)
 			      (concat " (as " content-type ")"))
 			    comment)))
-
     (setq button
 	  (insert-button
 	   (concat "[ " base-label " ]")
@@ -658,14 +645,12 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
 (defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth button)
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
-
     ;; Render the primary part.  FIXME: Support RFC 2387 Start header.
     (notmuch-show-insert-bodypart msg (car inner-parts) depth)
     ;; Add hidden buttons for the rest
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth t))
 	  (cdr inner-parts))
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -673,18 +658,15 @@ (defun notmuch-show-insert-part-multipart/related (msg part content-type nth dep
 (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -692,21 +674,17 @@ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth dept
 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the encryption status.
   (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -721,7 +699,6 @@ (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth but
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -730,19 +707,15 @@ (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth
   (let* ((message (car (plist-get part :content)))
 	 (body (car (plist-get message :body)))
 	 (start (point)))
-
     ;; Override `notmuch-message-headers' to force `From' to be
     ;; displayed.
     (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
       (notmuch-show-insert-headers (plist-get message :headers)))
-
     ;; Blank line after headers to be compatible with the normal
     ;; message display.
     (insert "\n")
-
     ;; Show the body
     (notmuch-show-insert-bodypart msg body depth)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -826,7 +799,6 @@ (defun notmuch-show-insert-part-text/html (msg part content-type nth depth butto
       ;; It's easier to drive shr ourselves than to work around the
       ;; goofy things `mm-shr' does (like irreversibly taking over
       ;; content ID handling).
-
       ;; FIXME: If we block an image, offer a button to load external
       ;; images.
       (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
@@ -902,7 +874,6 @@ (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth bu
 
 (defun notmuch-show-create-part-overlays (button beg end)
   "Add an overlay to the part between BEG and END."
-
   ;; If there is no button (i.e., the part is text/plain and the first
   ;; part) or if the part has no content then we don't make the part
   ;; toggleable.
@@ -913,7 +884,6 @@ (defun notmuch-show-create-part-overlays (button beg end)
 
 (defun notmuch-show-record-part-information (part beg end)
   "Store PART as a text property from BEG to END."
-
   ;; Record part information.  Since we already inserted subparts,
   ;; don't override existing :notmuch-part properties.
   (notmuch-map-text-property beg end :notmuch-part
@@ -1011,7 +981,6 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 HIDE determines whether to show or hide the part and the button
 as follows: If HIDE is nil, show the part and the button. If HIDE
 is t, hide the part initially and show the button."
-
   (let* ((content-type (downcase (plist-get part :content-type)))
 	 (mime-type (notmuch-show-mime-type part))
 	 (nth (plist-get part :id))
@@ -1030,16 +999,13 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (show-part (not (or (equal hide t)
 			     (and long button))))
 	 (content-beg (point)))
-
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
-
     (if show-part
         (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
-
     ;; Some of the body part handlers leave point somewhere up in the
     ;; part, so we make sure that we're down at the end.
     (goto-char (point-max))
@@ -1056,12 +1022,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 
 (defun notmuch-show-insert-body (msg body depth)
   "Insert the body BODY at depth DEPTH in the current thread."
-
   ;; Register all content IDs for this message.  According to RFC
   ;; 2392, content IDs are *global*, but it's okay if an MUA treats
   ;; them as only global within a message.
   (notmuch-show--register-cids msg (car body))
-
   (mapc (lambda (part) (notmuch-show-insert-bodypart msg part depth)) body))
 
 (defun notmuch-show-make-symbol (type)
@@ -1082,18 +1046,14 @@ (defun notmuch-show-insert-msg (msg depth)
 	 content-start content-end
 	 headers-start headers-end
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
-
     (setq message-start (point-marker))
-
     (notmuch-show-insert-headerline headers
 				    (or (if notmuch-show-relative-dates
 					    (plist-get msg :date_relative)
 					  nil)
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
-
     (setq content-start (point-marker))
-
     ;; Set `headers-start' to point after the 'Subject:' header to be
     ;; compatible with the existing implementation. This just sets it
     ;; to after the first header.
@@ -1108,9 +1068,7 @@ (defun notmuch-show-insert-msg (msg depth)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
-
     (setq notmuch-show-previous-subject bare-subject)
-
     ;; A blank line between the headers and the body.
     (insert "\n")
     (notmuch-show-insert-body msg (plist-get msg :body)
@@ -1119,36 +1077,28 @@ (defun notmuch-show-insert-msg (msg depth)
     (unless (bolp)
       (insert "\n"))
     (setq content-end (point-marker))
-
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
 	(indent-rigidly content-start
 			content-end
 			(* notmuch-show-indent-messages-width depth)))
-
     (setq message-end (point-max-marker))
-
     ;; Save the extents of this message over the whole text of the
     ;; message.
     (put-text-property message-start message-end
 		       :notmuch-message-extent
 		       (cons message-start message-end))
-
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
     (plist-put msg :message-overlay (make-overlay headers-start content-end))
-
     (plist-put msg :depth depth)
-
     ;; Save the properties for this message. Currently this saves the
     ;; entire message (augmented it with other stuff), which seems
     ;; like overkill. We might save a reduced subset (for example, not
     ;; the content).
     (notmuch-show-set-message-properties msg)
-
     ;; Set header visibility.
     (notmuch-show-headers-visible msg notmuch-message-headers-visible)
-
     ;; Message visibility depends on whether it matched the search
     ;; criteria.
     (notmuch-show-message-visible msg (and (plist-get msg :match)
@@ -1296,9 +1246,7 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     (switch-to-buffer (get-buffer-create buffer-name))
     ;; No need to track undo information for this buffer.
     (setq buffer-undo-list t)
-
     (notmuch-show-mode)
-
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
@@ -1307,24 +1255,19 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
 	  notmuch-show-query-context (if (or (string= query-context "")
 					     (string= query-context "*"))
 					 nil query-context)
-
 	  notmuch-show-process-crypto notmuch-crypto-process-mime
 	  ;; If `elide-toggle', invert the default value.
 	  notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
-
     (add-hook 'post-command-hook #'notmuch-show-command-hook nil t)
     (jit-lock-register #'notmuch-show-buttonise-links)
-
     (notmuch-tag-clear-cache)
-
     (let ((inhibit-read-only t))
       (if (notmuch-show--build-buffer)
 	  ;; Messages were inserted into the buffer.
 	  (current-buffer)
-
 	;; No messages were inserted - presumably none matched the
 	;; query.
 	(kill-buffer (current-buffer))
@@ -1367,26 +1310,21 @@ (defun notmuch-show--build-buffer (&optional state)
       (setq queries (cdr queries)))
     (when forest
       (notmuch-show-insert-forest forest)
-
       ;; Store the original tags for each message so that we can
       ;; display changes.
       (notmuch-show-mapc
        (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
-
       ;; Set the header line to the subject of the first message.
       (setq header-line-format
 	    (replace-regexp-in-string "%" "%%"
 				      (notmuch-sanitize
 				       (notmuch-show-strip-re
 					(notmuch-show-get-subject)))))
-
       (run-hooks 'notmuch-show-hook)
-
       (if state
 	  (notmuch-show-apply-state state)
 	;; With no state to apply, just go to the first message.
 	(notmuch-show-goto-first-wanted-message)))
-
     ;; Report back to the caller whether any messages matched.
     forest))
 
@@ -1431,14 +1369,12 @@ (defun notmuch-show-apply-state (state)
  - moving to the correct current message in every displayed window."
   (let ((win-msg-alist (car state))
 	(open (cadr state)))
-
     ;; Open those that were open.
     (goto-char (point-min))
     (cl-loop do (notmuch-show-message-visible
 		 (notmuch-show-get-message-properties)
 		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
-
     (dolist (win-msg-pair win-msg-alist)
       (with-selected-window (car win-msg-pair)
 	;; Go to the previously open message in this window
@@ -1460,7 +1396,6 @@ (defun notmuch-show-refresh-view (&optional reset-state)
     ;; manually.
     (remove-overlays)
     (erase-buffer)
-
     (unless (notmuch-show--build-buffer state)
       ;; No messages were inserted.
       (kill-buffer (current-buffer))
@@ -1881,16 +1816,13 @@ (defun notmuch-show-advance ()
 	   (> visible-end-of-this-message (window-end)))
       ;; The bottom of this message is not visible - scroll.
       (scroll-up nil))
-
      ((not (= end-of-this-message (point-max)))
       ;; This is not the last message - move to the next visible one.
       (notmuch-show-next-open-message))
-
      ((not (= (point) (point-max)))
       ;; This is the last message, but the cursor is not at the end of
       ;; the buffer. Move it there.
       (goto-char (point-max)))
-
      (t
       ;; This is the last message - change the return value
       (setq ret t)))
@@ -2527,7 +2459,6 @@ (defun notmuch-show-pipe-part ()
   (interactive)
   (notmuch-show-apply-to-current-part-handle #'mm-pipe-part))
 
-
 (defun notmuch-show--mm-display-part (handle)
   "Use mm-display-part to display HANDLE in a new buffer.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 34cd493a..85c80f54 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -331,7 +331,6 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 		    (otherwise nil))))
 	(setq formatted-tag (notmuch-tag--do-format tag tag base))
 	(setq formatted-tag (notmuch-tag--do-format tag formatted-tag over))
-
 	(puthash (cons tag tag-state) formatted-tag notmuch-tag--format-cache)))
     formatted-tag))
 
@@ -356,7 +355,6 @@ (defcustom notmuch-before-tag-hook nil
 a list of strings of the form \"+TAG\" or \"-TAG\".
 'query' will be a string containing the search query that determines
 the messages that are about to be tagged."
-
   :type 'hook
   :options '(notmuch-hl-line-mode)
   :group 'notmuch-hooks)
@@ -406,7 +404,6 @@ (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)
 non-nil, is the query string to present in the minibuffer.  It
 defaults to \"Tags\".  INITIAL-INPUT, if non-nil, will be the
 initial input in the minibuffer."
-
   (let* ((all-tag-list (notmuch-tag-completions))
 	 (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))
 	 (remove-tag-list (mapcar (apply-partially 'concat "-") current-tags))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index fcfb972d..d90f2aa0 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -891,7 +891,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-
       (cond
        ((and (< 0 depth) (not last))
 	(push "├" tree-status))
@@ -907,7 +906,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) (not first) (not last))
 	(push "├" tree-status)))
-
       (push (concat (if replies "┬" "─") "►") tree-status)
       (setq msg (plist-put msg :first (and first (eq 0 depth))))
       (setq msg (plist-put msg :tree-status tree-status))
@@ -915,11 +913,9 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
       (notmuch-tree-goto-and-insert-msg msg)
       (pop tree-status)
       (pop tree-status)
-
       (if last
 	  (push " " tree-status)
 	(push "│" tree-status))
-
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -958,7 +954,6 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 Complete list of currently available key bindings:
 
 \\{notmuch-tree-mode-map}"
-
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
   (setq buffer-read-only t
@@ -1022,7 +1017,6 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   ;; (such as reply) do. It is a buffer local variable so setting it
   ;; will not affect genuine show buffers.
   (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
-
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
@@ -1079,13 +1073,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
 						(if unthreaded "unthreaded-" "tree-")
 						query "*")))))
 	(inhibit-read-only t))
-
     (switch-to-buffer buffer))
   ;; Don't track undo information for this buffer
   (set 'buffer-undo-list t)
-
   (notmuch-tree-worker query query-context target open-target unthreaded)
-
   (setq truncate-lines t))
 
 (defun notmuch-unthreaded (&optional query query-context target buffer-name open-target)
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 3a9ffdd0..c3b24cb9 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -203,12 +203,10 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
 \"citation\" or \"signature\". Optional PREFIX is some arbitrary
 text to insert before the button, probably for indentation.  Note
 that PREFIX should not include a newline."
-
   ;; This uses some slightly tricky conversions between strings and
   ;; symbols because of the way the button code works. Note that
   ;; replacing intern-soft with make-symbol will cause this to fail,
   ;; since the newly created symbol has no plist.
-
   (let ((overlay (make-overlay beg end))
 	(button-type (intern-soft (concat "notmuch-wash-button-"
 					  type "-toggle-type"))))
@@ -276,25 +274,20 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 
 (defun notmuch-wash-elide-blank-lines (msg depth)
   "Elide leading, trailing and successive blank lines."
-
   ;; Algorithm derived from `article-strip-multiple-blank-lines' in
   ;; `gnus-art.el'.
-
   ;; Make all blank lines empty.
   (goto-char (point-min))
   (while (re-search-forward "^[[:space:]\t]+$" nil t)
     (replace-match "" nil t))
-
   ;; Replace multiple empty lines with a single empty line.
   (goto-char (point-min))
   (while (re-search-forward "^\n\\(\n+\\)" nil t)
     (delete-region (match-beginning 1) (match-end 1)))
-
   ;; Remove a leading blank line.
   (goto-char (point-min))
   (if (looking-at "\n")
       (delete-region (match-beginning 0) (match-end 0)))
-
   ;; Remove a trailing blank line.
   (goto-char (point-max))
   (if (looking-at "\n")
@@ -313,20 +306,15 @@ (defun notmuch-wash-tidy-citations (msg depth)
   text,
 - Remove citation trailers standing alone after a block of cited
   text."
-
   ;; Remove lines of repeated citation leaders with no other content.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\{2,\\}" nil t)
     (replace-match "\\1"))
-
-  ;; Remove citation leaders standing alone before a block of cited
-  ;; text.
+  ;; Remove citation leaders standing alone before a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(\n\\|^[^>].*\\)\n\\(^>[> ]*\n\\)" nil t)
     (replace-match "\\1\n"))
-
-  ;; Remove citation trailers standing alone after a block of cited
-  ;; text.
+  ;; Remove citation trailers standing alone after a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
     (replace-match "\\2")))
@@ -341,7 +329,6 @@ (defun notmuch-wash-wrap-long-lines (msg depth)
 its value. Otherwise, this function will wrap long lines in the
 message at the window width. When doing so, citation leaders in
 the wrapped text are maintained."
-
   (let* ((coolj-wrap-follows-window-size nil)
 	 (indent (* depth notmuch-show-indent-messages-width))
 	 (limit (if (numberp notmuch-wash-wrap-lines-length)
@@ -405,7 +392,6 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 Given that this function guesses whether a buffer includes a
 patch and then guesses the extent of the patch, there is scope
 for error."
-
   (goto-char (point-min))
   (when (re-search-forward diff-file-header-re nil t)
     (beginning-of-line -1)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 07a58da7..04334c76 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -755,7 +755,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (visible-string formatted-authors)
 	   (invisible-string "")
 	   (padding ""))
-
       ;; Truncate the author string to fit the specification.
       (if (> (length formatted-authors)
 	     (length formatted-sample))
@@ -782,7 +781,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 					  (length visible-string)
 					  (length "..."))
 				       ? ))))
-
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -798,14 +796,12 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; The invisible string may contain both matching and
 	      ;; non-matching authors.
 	      invisible-string (notmuch-search-author-propertize invisible-string)))
-
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
-
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
       (when (not (string= invisible-string ""))
@@ -831,11 +827,9 @@ (defun notmuch-search-insert-field (field format-string result)
     (insert (propertize (format format-string
 				(notmuch-sanitize (plist-get result :subject)))
 			'face 'notmuch-search-subject)))
-
    ((string-equal field "authors")
     (notmuch-search-insert-authors
      format-string (notmuch-sanitize (plist-get result :authors))))
-
    ((string-equal field "tags")
     (let ((tags (plist-get result :tags))
 	  (orig-tags (plist-get result :orig-tags)))
@@ -1118,7 +1112,6 @@ (defun notmuch-cycle-notmuch-buffers ()
 If the current buffer is the only notmuch buffer, bury it. If no
 notmuch buffers exist, run `notmuch'."
   (interactive)
-
   (let (start first)
     ;; If the current buffer is a notmuch buffer, remember it and then
     ;; bury it.
-- 
2.28.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 03/23] emacs: Fix indentation
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 01/23] emacs: Shorten long lines Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 02/23] emacs: Remove excess empty lines Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
                     ` (19 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

---
 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           |  42 +++++++------
 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, 312 insertions(+), 309 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 one of CHARS is ignored.
 
 If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
@@ -44,49 +44,49 @@ (if (fboundp 'read-char-choice)
 This is an exact copy of this function from emacs 24 for use on
 emacs 23, except with the one emacs 24 only function it calls
 inlined."
-  (unless (consp chars)
-    (error "Called `read-char-choice' without valid char choices"))
-  (let (char done show-help (helpbuf " *Char Help*"))
-    (let ((cursor-in-echo-area t)
-          (executing-kbd-macro executing-kbd-macro)
-	  (esc-flag nil))
-      (save-window-excursion	      ; in case we call help-form-show
-	(while (not done)
-	  (unless (get-text-property 0 'face prompt)
-	    (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
-	  (setq char (let ((inhibit-quit inhibit-keyboard-quit))
-		       (read-key prompt)))
-	  (and show-help (buffer-live-p (get-buffer helpbuf))
-	       (kill-buffer helpbuf))
-	  (cond
-	   ((not (numberp char)))
-	   ;; If caller has set help-form, that's enough.
-	   ;; They don't explicitly have to add help-char to chars.
-	   ((and help-form
-		 (eq char help-char)
-		 (setq show-help t)
-		 ;; This is an inlined copy of help-form-show as that
-		 ;; was introduced in emacs 24 too.
-		 (let ((msg (eval help-form)))
-		   (if (stringp msg)
-		       (with-output-to-temp-buffer " *Char Help*"
-			 (princ msg))))))
-	   ((memq char chars)
-	    (setq done t))
-	   ((and executing-kbd-macro (= char -1))
-	    ;; read-event returns -1 if we are in a kbd macro and
-	    ;; there are no more events in the macro.  Attempt to
-	    ;; get an event interactively.
-	    (setq executing-kbd-macro nil))
-	   ((not inhibit-keyboard-quit)
+    (unless (consp chars)
+      (error "Called `read-char-choice' without valid char choices"))
+    (let (char done show-help (helpbuf " *Char Help*"))
+      (let ((cursor-in-echo-area t)
+	    (executing-kbd-macro executing-kbd-macro)
+	    (esc-flag nil))
+	(save-window-excursion	      ; in case we call help-form-show
+	  (while (not done)
+	    (unless (get-text-property 0 'face prompt)
+	      (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
+	    (setq char (let ((inhibit-quit inhibit-keyboard-quit))
+			 (read-key prompt)))
+	    (and show-help (buffer-live-p (get-buffer helpbuf))
+		 (kill-buffer helpbuf))
 	    (cond
-	     ((and (null esc-flag) (eq char ?\e))
-	      (setq esc-flag t))
-	     ((memq char '(?\C-g ?\e))
-	      (keyboard-quit))))))))
-    ;; Display the question with the answer.  But without cursor-in-echo-area.
-    (message "%s%s" prompt (char-to-string char))
-    char)))
+	     ((not (numberp char)))
+	     ;; If caller has set help-form, that's enough.
+	     ;; They don't explicitly have to add help-char to chars.
+	     ((and help-form
+		   (eq char help-char)
+		   (setq show-help t)
+		   ;; This is an inlined copy of help-form-show as that
+		   ;; was introduced in emacs 24 too.
+		   (let ((msg (eval help-form)))
+		     (if (stringp msg)
+			 (with-output-to-temp-buffer " *Char Help*"
+			   (princ msg))))))
+	     ((memq char chars)
+	      (setq done t))
+	     ((and executing-kbd-macro (= char -1))
+	      ;; read-event returns -1 if we are in a kbd macro and
+	      ;; there are no more events in the macro.  Attempt to
+	      ;; get an event interactively.
+	      (setq executing-kbd-macro nil))
+	     ((not inhibit-keyboard-quit)
+	      (cond
+	       ((and (null esc-flag) (eq char ?\e))
+		(setq esc-flag t))
+	       ((memq char '(?\C-g ?\e))
+		(keyboard-quit))))))))
+      ;; Display the question with the answer.  But without cursor-in-echo-area.
+      (message "%s%s" prompt (char-to-string char))
+      char)))
 
 ;; End of compatibility functions
 
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index c3cb619f..ea995379 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -153,17 +153,17 @@ (defun notmuch-draft--query-encryption ()
 
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
-	((ask)
-	 (unless (yes-or-no-p
-		  "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+    ((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.
 Really save and index an unencrypted copy? ")
-	   (error "Save aborted")))
-	((nil)
-	 (error "Refusing to save draft with encryption tags (see `%s')"
-		'notmuch-draft-save-plaintext))
-	((t)
-	 (ignore))))
+       (error "Save aborted")))
+    ((nil)
+     (error "Refusing to save draft with encryption tags (see `%s')"
+	    'notmuch-draft-save-plaintext))
+    ((t)
+     (ignore))))
 
 (defun notmuch-draft--make-message-id ()
   ;; message-make-message-id gives the id inside a "<" ">" pair,
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e71e55f3..89e03c36 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -147,9 +147,9 @@ (defcustom notmuch-saved-searches
 
 Other accepted forms are a cons cell of the form (NAME . QUERY)
 or a list of the form (NAME QUERY COUNT-QUERY)."
-;; The saved-search format is also used by the all-tags notmuch-hello
-;; section. This section generates its own saved-search list in one of
-;; the latter two forms.
+  ;; The saved-search format is also used by the all-tags notmuch-hello
+  ;; section. This section generates its own saved-search list in one of
+  ;; the latter two forms.
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -382,10 +382,10 @@ (defun notmuch-hello-nice-number (n)
       (setq n (/ n 1000)))
     (setq result (or result '(0)))
     (apply #'concat
-     (number-to-string (car result))
-     (mapcar (lambda (elem)
-	      (format "%s%03d" notmuch-hello-thousands-separator elem))
-	     (cdr result)))))
+	   (number-to-string (car result))
+	   (mapcar (lambda (elem)
+		     (format "%s%03d" notmuch-hello-thousands-separator elem))
+		   (cdr result)))))
 
 (defun notmuch-hello-trim (search)
   "Trim whitespace."
@@ -540,7 +540,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 	  (notmuch-hello-filtered-query count-query
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
-	  "\n")))
+	 "\n")))
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -690,7 +690,7 @@ (defvar notmuch-hello-mode-map
 (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
- "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
+  "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
 
 Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
 or click on a saved search to view matching threads. Edit saved
@@ -720,9 +720,9 @@ (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
 Complete list of currently available key bindings:
 
 \\{notmuch-hello-mode-map}"
- (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
- ;;(setq buffer-read-only t)
-)
+  (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
+  ;;(setq buffer-read-only t)
+  )
 
 (defun notmuch-hello-generate-tag-alist (&optional hide-tags)
   "Return an alist from tags to queries to display in the all-tags section."
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 615207ed..7994d5ad 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -211,7 +211,7 @@ (defun notmuch-assert-cli-sane ()
   (unless (notmuch-cli-sane-p)
     (notmuch-logged-error
      "notmuch cli seems misconfigured or unconfigured."
-"Perhaps you haven't run \"notmuch setup\" yet? Try running this
+     "Perhaps you haven't run \"notmuch setup\" yet? Try running this
 on the command line, and then retry your notmuch command")))
 
 (defun notmuch-cli-version ()
@@ -321,7 +321,7 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		      (and (functionp binding)
 			   (notmuch-documentation-first-line binding))))
 	    tail)))
-    tail)
+  tail)
 
 (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; Remappings are represented as a binding whose first "event" is
@@ -413,8 +413,8 @@ (defun notmuch-subkeymap-help ()
   "Show help for a subkeymap."
   (interactive)
   (let* ((key (this-command-keys-vector))
-	(prefix (make-vector (1- (length key)) nil))
-	(i 0))
+	 (prefix (make-vector (1- (length key)) nil))
+	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
@@ -527,7 +527,7 @@ (defun notmuch-remove-if-not (predicate list)
   (let (out)
     (while list
       (when (funcall predicate (car list))
-        (push (car list) out))
+	(push (car list) out))
       (setq list (cdr list)))
     (nreverse out)))
 
@@ -835,24 +835,24 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		       command " "))
 	   (extra
 	    (concat "command: " command-string "\n"
-	     (if (integerp exit-status)
-		 (format "exit status: %s\n" exit-status)
-	       (format "exit signal: %s\n" exit-status))
-	     (when err
-	       (concat "stderr:\n" err))
-	     (when output
-	       (concat "stdout:\n" output)))))
-	(if err
-	    ;; We have an error message straight from the CLI.
-	    (notmuch-logged-error
-	     (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
-	  ;; We only have combined output from the CLI; don't inundate
-	  ;; the user with it.  Mimic `process-lines'.
-	  (notmuch-logged-error (format "%s exited with status %s"
-					(car command) exit-status)
-				extra))
-	;; `notmuch-logged-error' does not return.
-	))))
+		    (if (integerp exit-status)
+			(format "exit status: %s\n" exit-status)
+		      (format "exit signal: %s\n" exit-status))
+		    (when err
+		      (concat "stderr:\n" err))
+		    (when output
+		      (concat "stdout:\n" output)))))
+      (if err
+	  ;; We have an error message straight from the CLI.
+	  (notmuch-logged-error
+	   (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
+	;; We only have combined output from the CLI; don't inundate
+	;; the user with it.  Mimic `process-lines'.
+	(notmuch-logged-error (format "%s exited with status %s"
+				      (car command) exit-status)
+			      extra))
+      ;; `notmuch-logged-error' does not return.
+      ))))
 
 (defun notmuch-call-notmuch--helper (destination args)
   "Helper for synchronous notmuch invocation commands.
@@ -925,9 +925,9 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 as that will interfere with the handling of stderr and the exit
 status."
   (let (err-file err-buffer proc err-proc
-	;; Find notmuch using Emacs' `exec-path'
-	(command (or (executable-find notmuch-command)
-		     (error "Command not found: %s" notmuch-command))))
+		 ;; Find notmuch using Emacs' `exec-path'
+		 (command (or (executable-find notmuch-command)
+			      (error "Command not found: %s" notmuch-command))))
     (if (fboundp 'make-process)
 	(progn
 	  (setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
@@ -1030,8 +1030,8 @@ (defun notmuch-interactive-region ()
     (list (point) (point))))
 
 (define-obsolete-function-alias
-    'notmuch-search-interactive-region
-    'notmuch-interactive-region
+  'notmuch-search-interactive-region
+  'notmuch-interactive-region
   "notmuch 0.29")
 
 (provide 'notmuch-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 66f32fd4..7d001b2d 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -31,7 +31,7 @@ (require 'notmuch-lib)
 (defvar notmuch-maildir-fcc-count 0)
 
 (defcustom notmuch-fcc-dirs "sent"
- "Determines the Fcc Header which says where to save outgoing mail.
+  "Determines the Fcc Header which says where to save outgoing mail.
 
 Three types of values are permitted:
 
@@ -69,13 +69,13 @@ (defcustom notmuch-fcc-dirs "sent"
 In all cases you will be prompted to create the folder or
 directory if it does not exist yet when sending a mail."
 
- :type '(choice
-	 (const :tag "No FCC header" nil)
-	 (string :tag "A single folder")
-	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder"))))
- :require 'notmuch-fcc-initialization
- :group 'notmuch-send)
+  :type '(choice
+	  (const :tag "No FCC header" nil)
+	  (string :tag "A single folder")
+	  (repeat :tag "A folder based on the From header"
+		  (cons regexp (string :tag "Folder"))))
+  :require 'notmuch-fcc-initialization
+  :group 'notmuch-send)
 
 (defcustom notmuch-maildir-use-notmuch-insert 't
   "Should fcc use notmuch insert instead of simple fcc."
@@ -267,16 +267,16 @@ (defun notmuch-maildir-fcc-host-fixer (hostname)
 			    t))
 
 (defun notmuch-maildir-fcc-make-uniq-maildir-id ()
-   (let* ((ftime (float-time))
-	  (microseconds (mod (* 1000000 ftime) 1000000))
-	  (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
-     (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
-     (format "%d.%d_%d_%d.%s"
-	     ftime
-	     (emacs-pid)
-	     microseconds
-	     notmuch-maildir-fcc-count
-	     hostname)))
+  (let* ((ftime (float-time))
+	 (microseconds (mod (* 1000000 ftime) 1000000))
+	 (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
+    (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
+    (format "%d.%d_%d_%d.%s"
+	    ftime
+	    (emacs-pid)
+	    microseconds
+	    notmuch-maildir-fcc-count
+	    hostname)))
 
 (defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
   (and (file-exists-p (concat dir "/cur/"))
@@ -328,17 +328,17 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
     ;; fix it in some way.
     (let* ((prompt (format "Fcc %s is not a maildir: \
 \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
-	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
-	 (cl-case response
-	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?c (if (file-writable-p fcc-header)
-		   (notmuch-maildir-fcc-create-maildir fcc-header)
-		 (message "No permission to create %s." fcc-header)
-		 (sit-for 2))
-	       (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?i 't)
-	   (?e (notmuch-maildir-fcc-file-fcc
-		(read-from-minibuffer "Fcc header: " fcc-header)))))))
+	   (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
+      (cl-case response
+	(?r (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?c (if (file-writable-p fcc-header)
+		(notmuch-maildir-fcc-create-maildir fcc-header)
+	      (message "No permission to create %s." fcc-header)
+	      (sit-for 2))
+	    (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?i 't)
+	(?e (notmuch-maildir-fcc-file-fcc
+	     (read-from-minibuffer "Fcc header: " fcc-header)))))))
 
 (defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
   "Writes the current buffer to maildir destdir. If mark-seen is
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 3bc06b4b..7f80224f 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -58,7 +58,7 @@ (defcustom notmuch-mua-compose-in 'current-window
 You may want to customize `message-kill-buffer-on-exit'
 accordingly."
    (when (< emacs-major-version 24)
-	   " Due to a known bug in Emacs 23, you should not set
+     " Due to a known bug in Emacs 23, you should not set
 this to `new-window' if `message-kill-buffer-on-exit' is
 disabled: this would result in an incorrect behavior."))
   :group 'notmuch-send
@@ -106,13 +106,13 @@ (defcustom notmuch-mua-reply-insert-header-p-function
 This function specifies which parts of a mime message with
 multiple parts get a header."
   :type '(radio (const :tag "No part headers"
-		               notmuch-show-reply-insert-header-p-never)
+		       notmuch-show-reply-insert-header-p-never)
 		(const :tag "All except multipart/* and hidden parts"
-		               notmuch-show-reply-insert-header-p-trimmed)
+		       notmuch-show-reply-insert-header-p-trimmed)
 		(const :tag "Only for included text parts"
-			       notmuch-show-reply-insert-header-p-minimal)
+		       notmuch-show-reply-insert-header-p-minimal)
 		(const :tag "Exactly as in show view"
-			       notmuch-show-insert-header-p)
+		       notmuch-show-insert-header-p)
 		(function :tag "Other"))
   :group 'notmuch-reply)
 
@@ -472,10 +472,12 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
   (let* ((other-headers
 	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
 	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
-	 forward-subject  ;; Comes from the first message and is
-			  ;; applied later.
-	 forward-references ;; List of accumulated message-references of forwarded messages
-	 forward-queries) ;; List of corresponding message-query
+	 ;; Comes from the first message and is applied later.
+	 forward-subject
+	 ;; List of accumulated message-references of forwarded messages.
+	 forward-references
+	 ;; List of corresponding message-query.
+	 forward-queries)
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
     (save-excursion
@@ -529,17 +531,17 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-;; In current emacs (24.3) select-active-regions is set to t by
-;; default. The reply insertion code sets the region to the quoted
-;; message to make it easy to delete (kill-region or C-w). These two
-;; things combine to put the quoted message in the primary selection.
-;;
-;; This is not what the user wanted and is a privacy risk (accidental
-;; pasting of the quoted message). We can avoid some of the problems
-;; by let-binding select-active-regions to nil. This fixes if the
-;; primary selection was previously in a non-emacs window but not if
-;; it was in an emacs window. To avoid the problem in the latter case
-;; we deactivate mark.
+  ;; In current emacs (24.3) select-active-regions is set to t by
+  ;; default. The reply insertion code sets the region to the quoted
+  ;; message to make it easy to delete (kill-region or C-w). These two
+  ;; things combine to put the quoted message in the primary selection.
+  ;;
+  ;; This is not what the user wanted and is a privacy risk (accidental
+  ;; pasting of the quoted message). We can avoid some of the problems
+  ;; by let-binding select-active-regions to nil. This fixes if the
+  ;; primary selection was previously in a non-emacs window but not if
+  ;; it was in an emacs window. To avoid the problem in the latter case
+  ;; we deactivate mark.
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 3a835a00..1db9d7ca 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -42,9 +42,9 @@ (defun notmuch-query-map-aux  (mapper function seq)
   "Private function to do the actual mapping and flattening."
   (apply 'append
 	 (mapcar
-	   (lambda (tree)
-	     (funcall mapper function tree))
-	   seq)))
+	  (lambda (tree)
+	    (funcall mapper function tree))
+	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
   "Apply FN to every thread in THREADS. Flatten results to a list.
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6e23a980..f38866b0 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -272,7 +272,7 @@ (defmacro with-current-notmuch-show-message (&rest body)
   `(save-excursion
      (let ((id (notmuch-show-get-message-id)))
        (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
-         (with-current-buffer buf
+	 (with-current-buffer buf
 	   (let ((coding-system-for-read 'no-conversion))
 	     (call-process notmuch-command nil t nil "show" "--format=raw" id))
 	   ,@body)
@@ -303,7 +303,7 @@ (defun notmuch-show-view-all-mime-parts ()
 				  ("multipart/alternative" ignore identity)
 				  ("multipart/mixed" ignore identity)
 				  ("multipart/related" ignore identity)
-				 )))
+				  )))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -406,43 +406,44 @@ (defun notmuch-clean-address (address)
 cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
 parsing fails."
   (condition-case nil
-    (let (p-name p-address)
-      ;; It would be convenient to use `mail-header-parse-address',
-      ;; but that expects un-decoded mailbox parts, whereas our
-      ;; mailbox parts are already decoded (and hence may contain
-      ;; UTF-8). Given that notmuch should handle most of the awkward
-      ;; cases, some simple string deconstruction should be sufficient
-      ;; here.
-      (cond
-       ;; "User <user@dom.ain>" style.
-       ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	(setq p-name (match-string 1 address)
-	      p-address (match-string 2 address)))
-       ;; "<user@dom.ain>" style.
-       ((string-match "<\\(.*\\)>" address)
-	(setq p-address (match-string 1 address)))
-       ;; Everything else.
-       (t
-	(setq p-address address)))
-      (when p-name
-	;; Remove elements of the mailbox part that are not relevant for
-	;; display, even if they are required during transport:
-	;;
-	;; Backslashes.
-	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-	;; Outer single and double quotes, which might be nested.
-	(cl-loop with start-of-loop
-		 do   (setq start-of-loop p-name)
-		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 until (string= start-of-loop p-name)))
-      ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
-      ;; 'foo@bar.com'.
-      (when (string= p-name p-address)
-	(setq p-name nil))
-      (cons p-address p-name))
+      (let (p-name p-address)
+	;; It would be convenient to use `mail-header-parse-address',
+	;; but that expects un-decoded mailbox parts, whereas our
+	;; mailbox parts are already decoded (and hence may contain
+	;; UTF-8). Given that notmuch should handle most of the awkward
+	;; cases, some simple string deconstruction should be sufficient
+	;; here.
+	(cond
+	 ;; "User <user@dom.ain>" style.
+	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
+	  (setq p-name (match-string 1 address)
+		p-address (match-string 2 address)))
+
+	 ;; "<user@dom.ain>" style.
+	 ((string-match "<\\(.*\\)>" address)
+	  (setq p-address (match-string 1 address)))
+	 ;; Everything else.
+	 (t
+	  (setq p-address address)))
+	(when p-name
+	  ;; Remove elements of the mailbox part that are not relevant for
+	  ;; display, even if they are required during transport:
+	  ;;
+	  ;; Backslashes.
+	  (setq p-name (replace-regexp-in-string "\\\\" "" p-name))
+	  ;; Outer single and double quotes, which might be nested.
+	  (cl-loop with start-of-loop
+		   do   (setq start-of-loop p-name)
+		   when (string-match "^\"\\(.*\\)\"$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   when (string-match "^'\\(.*\\)'$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   until (string= start-of-loop p-name)))
+	;; If the address is 'foo@bar.com <foo@bar.com>' then show just
+	;; 'foo@bar.com'.
+	(when (string= p-name p-address)
+	  (setq p-name nil))
+	(cons p-address p-name))
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
@@ -601,9 +602,9 @@ (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
   (if (boundp 'w3m-cid-retrieve-function-alist)
-    (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-      (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	    w3m-cid-retrieve-function-alist)))
+      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
+	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	      w3m-cid-retrieve-function-alist)))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -633,8 +634,8 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
     ;; should be chosen if there are more than one that match?
     (mapc (lambda (inner-part)
 	    (let* ((inner-type (plist-get inner-part :content-type))
-		  (hide (not (or notmuch-show-all-multipart/alternative-parts
-			   (string= chosen-type inner-type)))))
+		   (hide (not (or notmuch-show-all-multipart/alternative-parts
+				  (string= chosen-type inner-type)))))
 	      (notmuch-show-insert-bodypart msg inner-part depth hide)))
 	  inner-parts)
 
@@ -1002,7 +1003,7 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
     (if show-part
-        (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
+	(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
@@ -1515,9 +1516,9 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
   (setq buffer-read-only t
 	truncate-lines t)
   (setq imenu-prev-index-position-function
-        #'notmuch-show-imenu-prev-index-position-function)
+	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-show-imenu-extract-index-name-function))
+	#'notmuch-show-imenu-extract-index-name-function))
 
 (defun notmuch-tree-from-show-current-query ()
   "Call notmuch tree with the current query."
@@ -1740,8 +1741,8 @@ (defun notmuch-show-seen-current-message (start end)
 user decision and we should not override it."
   (when (and (notmuch-show-message-visible-p)
 	     (not (notmuch-show-get-prop :seen)))
-	(notmuch-show-mark-read)
-	(notmuch-show-set-prop :seen t)))
+    (notmuch-show-mark-read)
+    (notmuch-show-set-prop :seen t)))
 
 (defvar notmuch-show--seen-has-errored nil)
 (make-variable-buffer-local 'notmuch-show--seen-has-errored)
@@ -1860,9 +1861,9 @@ (defun notmuch-show-rewind ()
   (let ((start-of-message (notmuch-show-message-top))
 	(start-of-window (window-start)))
     (cond
-      ;; Either this message is properly aligned with the start of the
-      ;; window or the start of this message is not visible on the
-      ;; screen - scroll.
+     ;; Either this message is properly aligned with the start of the
+     ;; window or the start of this message is not visible on the
+     ;; screen - scroll.
      ((or (= start-of-message start-of-window)
 	  (< start-of-message start-of-window))
       (scroll-down)
@@ -2506,9 +2507,9 @@ (defmacro notmuch-show--with-currently-shown-message (&rest body)
 message."
   `(save-excursion
      (save-restriction
-      (let ((extent (notmuch-show-message-extent)))
-	(narrow-to-region (car extent) (cdr extent))
-	,@body))))
+       (let ((extent (notmuch-show-message-extent)))
+	 (narrow-to-region (car extent) (cdr extent))
+	 ,@body))))
 
 (defun notmuch-show--gather-urls ()
   "Gather any URLs in the current message."
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 85c80f54..2fcf5a9e 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -236,7 +236,7 @@ (defun notmuch-tag-format-image-data (tag data)
 (defun notmuch-tag-star-icon ()
   "Return SVG data representing a star icon.
 This can be used with `notmuch-tag-format-image-data'."
-"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
+  "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
 <svg version=\"1.1\" width=\"16\" height=\"16\">
   <g transform=\"translate(-242.81601,-315.59635)\">
     <path
@@ -536,7 +536,7 @@ (defun notmuch-tag-jump (reverse)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
-		     `(lambda () (,tag-function ',tag-change)))
+		    `(lambda () (,tag-function ',tag-change)))
 	      action-map)))
     (push (list notmuch-tag-jump-reverse-key
 		(if reverse
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index d90f2aa0..6ac0c62d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -245,7 +245,7 @@ (defun notmuch-tree-to-message-pane (func)
 which executes function FUNC in the message pane if it is
 open (if the message pane is closed it does nothing)."
   `(lambda ()
-      ,(concat "(In message pane) " (documentation func t))
+     ,(concat "(In message pane) " (documentation func t))
      (interactive)
      (when (window-live-p notmuch-tree-message-window)
        (with-selected-window notmuch-tree-message-window
@@ -273,7 +273,7 @@ (defun notmuch-tree-close-message-pane-and (func)
 which closes the message pane if open and then executes function
 FUNC."
   `(lambda ()
-      ,(concat "(Close message pane and) " (documentation func t))
+     ,(concat "(Close message pane and) " (documentation func t))
      (interactive)
      (let ((notmuch-show-process-crypto
 	    (notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
@@ -891,31 +891,31 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-      (cond
-       ((and (< 0 depth) (not last))
-	(push "├" tree-status))
-       ((and (< 0 depth) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) first last)
-	;; Choice between these two variants is a matter of taste.
-	;; (push "─" tree-status))
-	(push " " tree-status))
-       ((and (eq 0 depth) first (not last))
-	  (push "┬" tree-status))
-       ((and (eq 0 depth) (not first) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) (not first) (not last))
-	(push "├" tree-status)))
-      (push (concat (if replies "┬" "─") "►") tree-status)
-      (setq msg (plist-put msg :first (and first (eq 0 depth))))
-      (setq msg (plist-put msg :tree-status tree-status))
-      (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
-      (notmuch-tree-goto-and-insert-msg msg)
-      (pop tree-status)
-      (pop tree-status)
-      (if last
-	  (push " " tree-status)
-	(push "│" tree-status))
+    (cond
+     ((and (< 0 depth) (not last))
+      (push "├" tree-status))
+     ((and (< 0 depth) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) first last)
+      ;; Choice between these two variants is a matter of taste.
+      ;; (push "─" tree-status))
+      (push " " tree-status))
+     ((and (eq 0 depth) first (not last))
+      (push "┬" tree-status))
+     ((and (eq 0 depth) (not first) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) (not first) (not last))
+      (push "├" tree-status)))
+    (push (concat (if replies "┬" "─") "►") tree-status)
+    (setq msg (plist-put msg :first (and first (eq 0 depth))))
+    (setq msg (plist-put msg :tree-status tree-status))
+    (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
+    (notmuch-tree-goto-and-insert-msg msg)
+    (pop tree-status)
+    (pop tree-status)
+    (if last
+	(push " " tree-status)
+      (push "│" tree-status))
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -966,34 +966,34 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(exit-status (process-exit-status proc))
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
-        (kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (tree view process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.")
-		    (unless (= exit-status 0)
-		      (insert (format " (process returned %d)" exit-status)))
-		    (insert "\n")))))))))
+      (kill-buffer (process-get proc 'parse-buf))
+      (if (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(if (eq status 'signal)
+		    (insert "Incomplete search results (tree view process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.")
+		  (unless (= exit-status 0)
+		    (insert (format " (process returned %d)" exit-status)))
+		  (insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
   (let ((results-buf (process-buffer proc))
-        (parse-buf (process-get proc 'parse-buf))
-        (inhibit-read-only t)
-        done)
+	(parse-buf (process-get proc 'parse-buf))
+	(inhibit-read-only t)
+	done)
     (if (not (buffer-live-p results-buf))
-        (delete-process proc)
+	(delete-process proc)
       (with-current-buffer parse-buf
-        ;; Insert new data
-        (save-excursion
-          (goto-char (point-max))
-          (insert string))
+	;; Insert new data
+	(save-excursion
+	  (goto-char (point-max))
+	  (insert string))
 	(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
 					 results-buf)))))
 
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-		       (if query-context (concat " and (" query-context ")"))
-		       ))
+			      (if query-context (concat " and (" query-context ")"))
+			      ))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index c3b24cb9..00ac45b6 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -373,7 +373,7 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
   (when (string-match
 	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
 	 subject)
-      (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 04334c76..2e84cd34 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -117,23 +117,23 @@ (defvar notmuch-query-history nil
 
 (defun notmuch-foreach-mime-part (function mm-handle)
   (cond ((stringp (car mm-handle))
-         (dolist (part (cdr mm-handle))
-           (notmuch-foreach-mime-part function part)))
-        ((bufferp (car mm-handle))
-         (funcall function mm-handle))
-        (t (dolist (part mm-handle)
-             (notmuch-foreach-mime-part function part)))))
+	 (dolist (part (cdr mm-handle))
+	   (notmuch-foreach-mime-part function part)))
+	((bufferp (car mm-handle))
+	 (funcall function mm-handle))
+	(t (dolist (part mm-handle)
+	     (notmuch-foreach-mime-part function part)))))
 
 (defun notmuch-count-attachments (mm-handle)
   (let ((count 0))
     (notmuch-foreach-mime-part
      (lambda (p)
        (let ((disposition (mm-handle-disposition p)))
-         (and (listp disposition)
-              (or (equal (car disposition) "attachment")
-                  (and (equal (car disposition) "inline")
-                       (assq 'filename disposition)))
-              (cl-incf count))))
+	 (and (listp disposition)
+	      (or (equal (car disposition) "attachment")
+		  (and (equal (car disposition) "inline")
+		       (assq 'filename disposition)))
+	      (cl-incf count))))
      mm-handle)
     count))
 
@@ -142,13 +142,13 @@ (defun notmuch-save-attachments (mm-handle &optional queryp)
    (lambda (p)
      (let ((disposition (mm-handle-disposition p)))
        (and (listp disposition)
-            (or (equal (car disposition) "attachment")
-                (and (equal (car disposition) "inline")
-                     (assq 'filename disposition)))
-            (or (not queryp)
-                (y-or-n-p
-                 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
-            (mm-save-part p))))
+	    (or (equal (car disposition) "attachment")
+		(and (equal (car disposition) "inline")
+		     (assq 'filename disposition)))
+	    (or (not queryp)
+		(y-or-n-p
+		 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
+	    (mm-save-part p))))
    mm-handle))
 
 (require 'hl-line)
@@ -272,11 +272,11 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
- '((((class color) (background light)) (:background "#f0f0f0"))
-   (((class color) (background dark)) (:background "#303030")))
- "Face for the single-line message summary in notmuch-show-mode."
- :group 'notmuch-show
- :group 'notmuch-faces)
+  '((((class color) (background light)) (:background "#f0f0f0"))
+    (((class color) (background dark)) (:background "#303030")))
+  "Face for the single-line message summary in notmuch-show-mode."
+  :group 'notmuch-show
+  :group 'notmuch-faces)
 
 (defface notmuch-search-date
   '((t :inherit default))
@@ -392,9 +392,9 @@ (define-derived-mode notmuch-search-mode fundamental-mode "notmuch-search"
   (setq truncate-lines t)
   (setq buffer-read-only t)
   (setq imenu-prev-index-position-function
-        #'notmuch-search-imenu-prev-index-position-function)
+	#'notmuch-search-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-search-imenu-extract-index-name-function))
+	#'notmuch-search-imenu-extract-index-name-function))
 
 (defun notmuch-search-get-result (&optional pos)
   "Return the result object for the thread at POS (or point).
@@ -689,9 +689,9 @@ (defun notmuch-search-process-sentinel (proc msg)
 			     (not (string= notmuch-search-target-thread "found")))
 			(set 'never-found-target-thread t)))))
 	      (when (and never-found-target-thread
-		       notmuch-search-target-line)
-		  (goto-char (point-min))
-		  (forward-line (1- notmuch-search-target-line)))))))))
+			 notmuch-search-target-line)
+		(goto-char (point-min))
+		(forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -711,7 +711,7 @@ (defcustom notmuch-search-line-faces
  (the following text would be placed in your ~/.emacs file):
 
  (setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
-                                   (\"deleted\" . (:foreground \"red\"
+				   (\"deleted\" . (:foreground \"red\"
 						  :background \"blue\"))))
 
 The FACE must be a face name (a symbol or string), a property
@@ -722,7 +722,7 @@ (defcustom notmuch-search-line-faces
 background."
   :type '(alist :key-type (string)
 		:value-type (radio (face :tag "Face name")
-				    (notmuch--custom-face-edit)))
+				   (notmuch--custom-face-edit)))
   :group 'notmuch-search
   :group 'notmuch-faces)
 
@@ -919,15 +919,15 @@ (defun notmuch-read-query (prompt)
 PROMPT is the string to prompt with."
   (let*
       ((all-tags
-        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
-                (process-lines notmuch-command "search" "--output=tags" "*")))
+	(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+		(process-lines notmuch-command "search" "--output=tags" "*")))
        (completions
-	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
-		       "subject:" "attachment:")
-		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
-		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
-			 (mailcap-mime-types)))))
+	(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
+		      "subject:" "attachment:")
+		(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+		(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
+		(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			(mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el
index 8423245f..6eda0ebc 100644
--- a/test/emacs-address-cleaning.el
+++ b/test/emacs-address-cleaning.el
@@ -1,6 +1,6 @@
 (defun notmuch-test-address-cleaning-1 ()
   (notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
-			"dme@dme.org"))
+			     "dme@dme.org"))
 
 (defun notmuch-test-address-cleaning-2 ()
   (let* ((input '("foo@bar.com"
-- 
2.28.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 04/23] emacs: Closing parenthesis go on the same line
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (2 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 03/23] emacs: Fix indentation Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
                     ` (18 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-lib.el  |  6 ++----
 emacs/notmuch-show.el | 19 ++++++++-----------
 emacs/notmuch-tree.el |  4 ++--
 emacs/notmuch.el      |  6 ++----
 4 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 7994d5ad..f8958a91 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -555,13 +555,11 @@ (defun notmuch-match-content-type (t1 t2)
       (string= (downcase t1) (downcase t2)))))
 
 (defvar notmuch-multipart/alternative-discouraged
-  '(
-    ;; Avoid HTML parts.
+  '(;; Avoid HTML parts.
     "text/html"
     ;; multipart/related usually contain a text/html part and some
     ;; associated graphics.
-    "multipart/related"
-    ))
+    "multipart/related"))
 
 (defun notmuch-multipart/alternative-determine-discouraged (msg)
   "Return the discouraged alternatives for the specified message."
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f38866b0..8592936f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -297,13 +297,12 @@ (defun notmuch-show-view-all-mime-parts ()
    ;;
    ;; Any MIME part not explicitly mentioned here will be handled by an
    ;; external viewer as configured in the various mailcap files.
-   (let ((mm-inline-media-tests '(
-				  ("text/.*" ignore identity)
-				  ("application/pgp-signature" ignore identity)
-				  ("multipart/alternative" ignore identity)
-				  ("multipart/mixed" ignore identity)
-				  ("multipart/related" ignore identity)
-				  )))
+   (let ((mm-inline-media-tests
+	  '(("text/.*" ignore identity)
+	    ("application/pgp-signature" ignore identity)
+	    ("multipart/alternative" ignore identity)
+	    ("multipart/mixed" ignore identity)
+	    ("multipart/related" ignore identity))))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -1785,10 +1784,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
 	(if (notmuch-show-message-visible-p)
 	    (setq message-ids
 		  (append message-ids (list (notmuch-show-get-message-id)))))
-	(setq done (not (notmuch-show-goto-message-next)))
-	)
-      message-ids
-      )))
+	(setq done (not (notmuch-show-goto-message-next))))
+      message-ids)))
 
 ;; Commands typically bound to keys.
 
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6ac0c62d..b1bb40b1 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context (concat " and (" query-context ")"))
-			      ))
+			      (if query-context
+				  (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 2e84cd34..d6e0a9d5 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -910,8 +910,7 @@ (defun notmuch-search-buffer-title (query)
 		    query)
 		   "*"))
 	  (t
-	   (concat "*notmuch-search-" query "*"))
-	  )))
+	   (concat "*notmuch-search-" query "*")))))
 
 (defun notmuch-read-query (prompt)
   "Read a notmuch-query from the minibuffer with completion.
@@ -1003,8 +1002,7 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
       (if proc
-	  (error "notmuch search process already running for query `%s'" query)
-	)
+	  (error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 05/23] emacs: Only set one variable per setq form
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (3 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
                     ` (17 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

It's a bit weird to avoid having to write the "(setq ... )" more than
once, just because we can.  In a language that uses '=' for the same
purpose we also happily use that once per assignment.

While there are no benefit to using just one 'setq' there are some
drawbacks.  It is not always clear on first what is a key and what a
value and as a result it is easy to make a mistake.  Also it becomes
harder to comment out just one assignment.
---
 emacs/notmuch-address.el |  6 +++---
 emacs/notmuch-crypto.el  | 23 ++++++++++++-----------
 emacs/notmuch-lib.el     |  8 ++++----
 emacs/notmuch-show.el    | 26 ++++++++++++++------------
 emacs/notmuch-tree.el    |  4 ++--
 emacs/notmuch.el         | 35 ++++++++++++++++++-----------------
 6 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 09dda247..4db7096c 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -381,9 +381,9 @@ (defun notmuch-address--load-address-hash ()
 		      notmuch-address-internal-completion)
 	       (equal (plist-get load-plist :version)
 		      notmuch-address--save-hash-version))
-      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest)
-	    notmuch-address-completions (plist-get load-plist :completions)
-	    notmuch-address-full-harvest-finished t)
+      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest))
+      (setq notmuch-address-completions (plist-get load-plist :completions))
+      (setq notmuch-address-full-harvest-finished t)
       ;; Return t to say load was successful.
       t)))
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 58947a20..420b008f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -117,20 +117,21 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 	    (userid (plist-get sigstatus :userid)))
 	;; If userid is present it has full or greater validity.
 	(if userid
-	    (setq label (concat "Good signature by: " userid)
-		  face 'notmuch-crypto-signature-good)
-	  (setq label (concat "Good signature by key: " fingerprint)
-		face 'notmuch-crypto-signature-good-key))
-	(setq button-action 'notmuch-crypto-sigstatus-good-callback
-	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
+	    (progn
+	      (setq label (concat "Good signature by: " userid))
+	      (setq face 'notmuch-crypto-signature-good))
+	  (setq label (concat "Good signature by key: " fingerprint))
+	  (setq face 'notmuch-crypto-signature-good-key))
+	(setq button-action 'notmuch-crypto-sigstatus-good-callback)
+	(setq help-msg (concat "Click to list key ID 0x" fingerprint "."))))
      ((string= status "error")
-      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
-	    button-action 'notmuch-crypto-sigstatus-error-callback
-	    help-msg (concat "Click to retrieve key ID " keyid
+      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
+      (setq button-action 'notmuch-crypto-sigstatus-error-callback)
+      (setq help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
      ((string= status "bad")
-      (setq label (concat "Bad signature (claimed key ID " keyid ")")
-	    face 'notmuch-crypto-signature-bad))
+      (setq label (concat "Bad signature (claimed key ID " keyid ")"))
+      (setq face 'notmuch-crypto-signature-bad))
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index f8958a91..886da99f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -861,8 +861,8 @@ (defun notmuch-call-notmuch--helper (destination args)
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
-	(:stdin-string (setq stdin-string (cadr args)
-			     args (cddr args)))
+	(:stdin-string (setq stdin-string (cadr args))
+		       (setq args (cddr args)))
 	(otherwise
 	 (error "Unknown keyword argument: %s" (car args)))))
     (if (null stdin-string)
@@ -939,8 +939,8 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 		      :buffer buffer
 		      :command (cons command args)
 		      :connection-type 'pipe
-		      :stderr err-buffer)
-		err-proc (get-buffer-process err-buffer))
+		      :stderr err-buffer))
+	  (setq err-proc (get-buffer-process err-buffer))
 	  (process-put proc 'err-buffer err-buffer)
 
 	  (process-put err-proc 'err-file err-file)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 8592936f..a0a6c09d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -415,8 +415,8 @@ (defun notmuch-clean-address (address)
 	(cond
 	 ;; "User <user@dom.ain>" style.
 	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	  (setq p-name (match-string 1 address)
-		p-address (match-string 2 address)))
+	  (setq p-name (match-string 1 address))
+	  (setq p-address (match-string 2 address)))
 
 	 ;; "<user@dom.ain>" style.
 	 ((string-match "<\\(.*\\)>" address)
@@ -1250,14 +1250,16 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
-    (setq notmuch-show-thread-id thread-id
-	  notmuch-show-parent-buffer parent-buffer
-	  notmuch-show-query-context (if (or (string= query-context "")
-					     (string= query-context "*"))
-					 nil query-context)
-	  notmuch-show-process-crypto notmuch-crypto-process-mime
-	  ;; If `elide-toggle', invert the default value.
-	  notmuch-show-elide-non-matching-messages
+    (setq notmuch-show-thread-id thread-id)
+    (setq notmuch-show-parent-buffer parent-buffer)
+    (setq notmuch-show-query-context
+	  (if (or (string= query-context "")
+		  (string= query-context "*"))
+	      nil
+	    query-context))
+    (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
+    ;; If `elide-toggle', invert the default value.
+    (setq notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
@@ -1512,8 +1514,8 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
 
 \\{notmuch-show-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
-  (setq buffer-read-only t
-	truncate-lines t)
+  (setq buffer-read-only t)
+  (setq truncate-lines t)
   (setq imenu-prev-index-position-function
 	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b1bb40b1..827acebf 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -956,8 +956,8 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 \\{notmuch-tree-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
-  (setq buffer-read-only t
-	truncate-lines t))
+  (setq buffer-read-only t)
+  (setq truncate-lines t))
 
 (defun notmuch-tree-process-sentinel (proc msg)
   "Add a message to let user know when \"notmuch tree\" exits."
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index d6e0a9d5..6ce2b1f9 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -443,8 +443,8 @@ (defun notmuch-search-foreach-result (beg end fn)
     (while (and pos (or (< pos end) first))
       (when (notmuch-search-get-result pos)
 	(funcall fn pos))
-      (setq pos (notmuch-search-result-end pos)
-	    first nil))))
+      (setq pos (notmuch-search-result-end pos))
+      (setq first nil))))
 ;; Unindent the function argument of notmuch-search-foreach-result so
 ;; the indentation of callers doesn't get out of hand.
 (put 'notmuch-search-foreach-result 'lisp-indent-function 2)
@@ -589,8 +589,8 @@ (defun notmuch-search-tag (tag-changes &optional beg end only-matched)
 If ONLY-MATCHED is non-nil, only tag matched messages."
   (interactive (notmuch-search-interactive-tag-changes))
   (unless (and beg end)
-    (setq beg (car (notmuch-interactive-region))
-	  end (cadr (notmuch-interactive-region))))
+    (setq beg (car (notmuch-interactive-region)))
+    (setq end (cadr (notmuch-interactive-region))))
   (let ((search-string (notmuch-search-find-stable-query-region
 			beg end only-matched)))
     (notmuch-tag search-string tag-changes)
@@ -762,8 +762,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 				   (length "... "))))
 	    ;; Truncate the visible string according to the width of
 	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length)
-		  invisible-string (substring formatted-authors visible-length))
+	    (setq visible-string (substring formatted-authors 0 visible-length))
+	    (setq invisible-string (substring formatted-authors visible-length))
 	    ;; If possible, truncate the visible string at a natural
 	    ;; break (comma or pipe), as incremental search doesn't
 	    ;; match across the visible/invisible border.
@@ -771,8 +771,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; Second clause is destructive on `visible-string', so
 	      ;; order is important.
 	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string)
-		    visible-string (concat (match-string 1 visible-string)
+					     invisible-string))
+	      (setq visible-string (concat (match-string 1 visible-string)
 					   (match-string 2 visible-string))))
 	    ;; `visible-string' may be shorter than the space allowed
 	    ;; by `format-string'. If so we must insert some padding
@@ -785,17 +785,18 @@ (defun notmuch-search-insert-authors (format-string authors)
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
 	  ;; non-matching authors.
-	  (setq visible-string (notmuch-search-author-propertize visible-string)
-		;; The invisible string must contain only non-matching
-		;; authors, as the visible-string contains both.
-		invisible-string (propertize invisible-string
-					     'face 'notmuch-search-non-matching-authors))
+	  (progn
+	    (setq visible-string (notmuch-search-author-propertize visible-string))
+	    ;; The invisible string must contain only non-matching
+	    ;; authors, as the visible-string contains both.
+	    (setq invisible-string (propertize invisible-string
+					       'face 'notmuch-search-non-matching-authors)))
 	;; The visible string contains only matching authors.
 	(setq visible-string (propertize visible-string
-					 'face 'notmuch-search-matching-authors)
-	      ;; The invisible string may contain both matching and
-	      ;; non-matching authors.
-	      invisible-string (notmuch-search-author-propertize invisible-string)))
+					 'face 'notmuch-search-matching-authors))
+	;; The invisible string may contain both matching and
+	;; non-matching authors.
+	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 06/23] emacs: Use cl-incf where appropriate
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (4 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06 11:37     ` David Bremner
  2020-08-06  7:18   ` [PATCH v2 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
                     ` (16 subsequent siblings)
  22 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

It's shorter.  That's it pretty much.
---
 emacs/notmuch-hello.el | 2 +-
 emacs/notmuch-lib.el   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 89e03c36..1c084bf7 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -609,7 +609,7 @@ (defun notmuch-hello-insert-buttons (searches)
 			       name)
 		(setq column-indent
 		      (1+ (max 0 (- column-width (length name)))))))
-	    (setq count (1+ count))
+	    (cl-incf count)
 	    (when (eq (% count tags-per-line) 0)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 886da99f..5d0c373a 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -417,7 +417,7 @@ (defun notmuch-subkeymap-help ()
 	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
-      (setq i (1+ i)))
+      (cl-incf i))
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 07/23] emacs: Use 'and' instead of 'when' when the return value matters
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (5 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
                     ` (15 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

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       |  2 +-
 emacs/notmuch-lib.el         | 37 +++++++++---------
 emacs/notmuch-maildir-fcc.el |  4 +-
 emacs/notmuch-mua.el         | 13 +++----
 emacs/notmuch-show.el        | 45 +++++++++++-----------
 emacs/notmuch-tree.el        |  4 +-
 emacs/notmuch-wash.el        |  8 ++--
 emacs/notmuch.el             | 28 ++++++++------
 11 files changed, 114 insertions(+), 113 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 961db606..39a8de2b 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -107,12 +107,12 @@ (defun coolj-set-breakpoint (prefix)
 If the line should not be broken, return nil; point remains on the
 line."
   (move-to-column fill-column)
-  (if (and (re-search-forward "[^ ]" (line-end-position) 1)
-	   (> (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)))))
+  (and (re-search-forward "[^ ]" (line-end-position) 1)
+       (> (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)))))
 
 (defun coolj-find-break-backward (prefix)
   "Move point backward to the first available breakpoint and return t.
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 4db7096c..2dd08661 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -252,20 +252,20 @@ (defun notmuch-address-expand-name ()
 (defun notmuch-address-locate-command (command)
   "Return non-nil if `command' is an executable either on
 `exec-path' or an absolute pathname."
-  (when (stringp command)
-    (if (and (file-name-absolute-p command)
-	     (file-executable-p command))
-	command
-      (setq command (file-name-nondirectory command))
-      (catch 'found-command
-	(let (bin)
-	  (dolist (dir exec-path)
-	    (setq bin (expand-file-name command dir))
-	    (when (or (and (file-executable-p bin)
-			   (not (file-directory-p bin)))
-		      (and (file-executable-p (setq bin (concat bin ".exe")))
-			   (not (file-directory-p bin))))
-	      (throw 'found-command bin))))))))
+  (and (stringp command)
+       (if (and (file-name-absolute-p command)
+		(file-executable-p command))
+	   command
+	 (setq command (file-name-nondirectory command))
+	 (catch 'found-command
+	   (let (bin)
+	     (dolist (dir exec-path)
+	       (setq bin (expand-file-name command dir))
+	       (when (or (and (file-executable-p bin)
+			      (not (file-directory-p bin)))
+			 (and (file-executable-p (setq bin (concat bin ".exe")))
+			      (not (file-directory-p bin))))
+		 (throw 'found-command bin))))))))
 
 (defun notmuch-address-harvest-addr (result)
   (let ((name-addr (plist-get result :name-addr)))
@@ -304,18 +304,20 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 execution, CALLBACK is called when harvesting finishes."
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
-	 (prefix-query (when addr-prefix
-			 (format "%s:%s*" (if sent "to" "from") addr-prefix)))
+	 (prefix-query (and addr-prefix
+			    (format "%s:%s*"
+				    (if sent "to" "from")
+				    addr-prefix)))
 	 (from-or-to-me-query
 	  (mapconcat (lambda (x)
 		       (concat (if sent "from:" "to:") x))
 		     (notmuch-user-emails) " or "))
 	 (query (if (or prefix-query config-query)
 		    (concat (format "(%s)" from-or-to-me-query)
-			    (when prefix-query
-			      (format " and (%s)" prefix-query))
-			    (when config-query
-			      (format " and (%s)" config-query)))
+			    (and prefix-query
+				 (format " and (%s)" prefix-query))
+			    (and config-query
+				 (format " and (%s)" config-query)))
 		  from-or-to-me-query))
 	 (args `("address" "--format=sexp" "--format-version=4"
 		 ,(if sent "--output=recipients" "--output=sender")
@@ -354,21 +356,21 @@ (defun notmuch-address--get-address-hash ()
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
-  (when notmuch-address-save-filename
-    (condition-case nil
-	(with-temp-buffer
-	  (insert-file-contents notmuch-address-save-filename)
-	  (let ((name (read (current-buffer)))
-		(plist (read (current-buffer))))
-	    ;; We do two simple sanity checks on the loaded file. We just
-	    ;; check a version is specified, not that it is the current
-	    ;; version, as we are allowed to over-write and a save-file with
-	    ;; an older version.
-	    (when (and (string= name "notmuch-address-hash")
-		       (plist-get plist :version))
-	      plist)))
-      ;; The error case catches any of the reads failing.
-      (error nil))))
+  (and notmuch-address-save-filename
+       (condition-case nil
+	   (with-temp-buffer
+	     (insert-file-contents notmuch-address-save-filename)
+	     (let ((name (read (current-buffer)))
+		   (plist (read (current-buffer))))
+	       ;; We do two simple sanity checks on the loaded file.
+	       ;; We just check a version is specified, not that
+	       ;; it is the current version, as we are allowed to
+	       ;; over-write and a save-file with an older version.
+	       (and (string= name "notmuch-address-hash")
+		    (plist-get plist :version)
+		    plist)))
+	 ;; The error case catches any of the reads failing.
+	 (error nil))))
 
 (defun notmuch-address--load-address-hash ()
   "Read the saved address hash and set the corresponding variables."
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 420b008f..e6bf8339 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -253,7 +253,7 @@ (defun notmuch-crypto-insert-encstatus-button (encstatus)
 	       "Decryption error")
 	      (t
 	       (concat "Unknown encryption status"
-		       (if status (concat ": " status))))))
+		       (and status (concat ": " status))))))
 	   " ]")
    :type 'notmuch-crypto-status-button-type
    'face 'notmuch-crypto-decryption
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index ea995379..759e6c9e 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -263,7 +263,7 @@ (defun notmuch-draft-resume (id)
       ;; If the resumed message was a draft then set the draft
       ;; message-id so that we can delete the current saved draft if the
       ;; message is resaved or sent.
-      (setq notmuch-draft-id (when draft id)))))
+      (setq notmuch-draft-id (and draft id)))))
 
 
 (add-hook 'message-send-hook 'notmuch-draft--mark-deleted)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 5d0c373a..9b02cd66 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -608,7 +608,7 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 		       (set-buffer-multibyte nil))
 		     (let ((args `("show" "--format=raw"
 				   ,(format "--part=%s" (plist-get part :id))
-				   ,@(when process-crypto '("--decrypt=true"))
+				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
@@ -781,8 +781,8 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s" (concat msg (when extra
-			    " (see *Notmuch errors* for more details)"))))
+  (error "%s"
+	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
@@ -836,10 +836,8 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		    (if (integerp exit-status)
 			(format "exit status: %s\n" exit-status)
 		      (format "exit signal: %s\n" exit-status))
-		    (when err
-		      (concat "stderr:\n" err))
-		    (when output
-		      (concat "stdout:\n" output)))))
+		    (and err    (concat "stderr:\n" err))
+		    (and output (concat "stdout:\n" output)))))
       (if err
 	  ;; We have an error message straight from the CLI.
 	  (notmuch-logged-error
@@ -968,8 +966,8 @@ (defun notmuch-start-notmuch-sentinel (proc event)
   (let* ((err-file (process-get proc 'err-file))
 	 (err-buffer (or (process-get proc 'err-buffer)
 			 (find-file-noselect err-file)))
-	 (err (when (not (zerop (buffer-size err-buffer)))
-		(with-current-buffer err-buffer (buffer-string))))
+	 (err (and (not (zerop (buffer-size err-buffer)))
+		   (with-current-buffer err-buffer (buffer-string))))
 	 (sub-sentinel (process-get proc 'sub-sentinel))
 	 (real-command (process-get proc 'real-command)))
     (condition-case err
@@ -987,16 +985,17 @@ (defun notmuch-start-notmuch-sentinel (proc event)
 	  ;; If that didn't signal an error, then any error output was
 	  ;; really warning output.  Show warnings, if any.
 	  (let ((warnings
-		 (when err
-		   (with-current-buffer err-buffer
-		     (goto-char (point-min))
-		     (end-of-line)
-		     ;; Show first line; stuff remaining lines in the
-		     ;; errors buffer.
-		     (let ((l1 (buffer-substring (point-min) (point))))
-		       (skip-chars-forward "\n")
-		       (cons l1 (unless (eobp)
-				  (buffer-substring (point) (point-max)))))))))
+		 (and err
+		      (with-current-buffer err-buffer
+			(goto-char (point-min))
+			(end-of-line)
+			;; Show first line; stuff remaining lines in the
+			;; errors buffer.
+			(let ((l1 (buffer-substring (point-min) (point))))
+			  (skip-chars-forward "\n")
+			  (cons l1 (and (not (eobp))
+					(buffer-substring (point)
+							  (point-max)))))))))
 	    (when warnings
 	      (notmuch-logged-error (car warnings) (cdr warnings)))))
       (error
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 7d001b2d..1027e1a7 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -215,7 +215,7 @@ (defun notmuch-maildir-notmuch-insert-current-buffer (folder &optional create ta
 database in folder FOLDER. If CREATE is non-nil it will supply
 the --create-folder flag to create the folder if necessary. TAGS
 should be a list of tag changes to apply to the inserted message."
-  (let* ((args (append (when create (list "--create-folder"))
+  (let* ((args (append (and create (list "--create-folder"))
 		       (list (concat "--folder=" folder))
 		       tags)))
     (apply 'notmuch-call-notmuch-process
@@ -315,7 +315,7 @@ (defun notmuch-maildir-fcc-move-tmp-to-new (destdir msg-id)
 (defun notmuch-maildir-fcc-move-tmp-to-cur (destdir msg-id &optional mark-seen)
   (add-name-to-file
    (concat destdir "/tmp/" msg-id)
-   (concat destdir "/cur/" msg-id ":2," (when mark-seen "S"))))
+   (concat destdir "/cur/" msg-id ":2," (and mark-seen "S"))))
 
 (defun notmuch-maildir-fcc-file-fcc (fcc-header)
   "Write the message to the file specified by FCC-HEADER.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 7f80224f..f6d8ffc5 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -460,8 +460,8 @@ (defun notmuch-mua-new-mail (&optional prompt-for-sender)
 the From: address first."
   (interactive "P")
   (let ((other-headers
-	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	   (list (cons 'From (notmuch-mua-prompt-for-sender))))))
+	 (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	      (list (cons 'From (notmuch-mua-prompt-for-sender))))))
     (notmuch-mua-mail nil nil other-headers nil (notmuch-mua-get-switch-function))))
 
 (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
@@ -470,8 +470,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 If PROMPT-FOR-SENDER is non-nil, the user will be prompteed for
 the From: address."
   (let* ((other-headers
-	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
+	  (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	       (list (cons 'From (notmuch-mua-prompt-for-sender)))))
 	 ;; Comes from the first message and is applied later.
 	 forward-subject
 	 ;; List of accumulated message-references of forwarded messages.
@@ -542,9 +542,8 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
   ;; primary selection was previously in a non-emacs window but not if
   ;; it was in an emacs window. To avoid the problem in the latter case
   ;; we deactivate mark.
-  (let ((sender
-	 (when prompt-for-sender
-	   (notmuch-mua-prompt-for-sender)))
+  (let ((sender (and prompt-for-sender
+		     (notmuch-mua-prompt-for-sender)))
 	(select-active-regions nil))
     (notmuch-mua-reply query-string sender reply-all)
     (deactivate-mark)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a0a6c09d..211be091 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -500,10 +500,10 @@ (define-button-type 'notmuch-show-part-button-type
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
   (let ((button)
-	(base-label (concat (when name (concat name ": "))
+	(base-label (concat (and name (concat name ": "))
 			    declared-type
-			    (unless (string-equal declared-type content-type)
-			      (concat " (as " content-type ")"))
+			    (and (not (string-equal declared-type content-type))
+				 (concat " (as " content-type ")"))
 			    comment)))
     (setq button
 	  (insert-button
@@ -781,18 +781,15 @@ (if (version< emacs-version "25.3")
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
   ;; we return that.
-  (if (plist-get part :filename)
-      (let ((extension (file-name-extension (plist-get part :filename)))
-	    mime-type)
-	(if extension
-	    (progn
-	      (mailcap-parse-mimetypes)
-	      (setq mime-type (mailcap-extension-to-mime extension))
-	      (if (and mime-type
-		       (not (string-equal mime-type "application/octet-stream")))
-		  mime-type
-		nil))
-	  nil))))
+  (and (plist-get part :filename)
+       (let ((extension (file-name-extension (plist-get part :filename))))
+	 (and extension
+	      (progn
+		(mailcap-parse-mimetypes)
+		(let ((mime-type (mailcap-extension-to-mime extension)))
+		  (and mime-type
+		       (not (string-equal mime-type "application/octet-stream"))
+		       mime-type)))))))
 
 (defun notmuch-show-insert-part-text/html (msg part content-type nth depth button)
   (if (eq mm-text-html-renderer 'shr)
@@ -991,9 +988,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
-	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type
-						    (plist-get part :filename))))
+	 (button (and (funcall notmuch-show-insert-header-p-function part hide)
+		      (notmuch-show-insert-part-header
+		       nth mime-type content-type
+		       (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1048,9 +1046,8 @@ (defun notmuch-show-insert-msg (msg depth)
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
     (setq message-start (point-marker))
     (notmuch-show-insert-headerline headers
-				    (or (if notmuch-show-relative-dates
-					    (plist-get msg :date_relative)
-					  nil)
+				    (or (and notmuch-show-relative-dates
+					     (plist-get msg :date_relative))
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
     (setq content-start (point-marker))
@@ -1297,8 +1294,8 @@ (defun notmuch-show--build-buffer (&optional state)
 
 If no messages match the query return NIL."
   (let* ((cli-args (cons "--exclude=false"
-			 (when notmuch-show-elide-non-matching-messages
-			   (list "--entire-thread=false"))))
+			 (and notmuch-show-elide-non-matching-messages
+			      (list "--entire-thread=false"))))
 	 (queries (notmuch-show--build-queries
 		   notmuch-show-thread-id notmuch-show-query-context))
 	 (forest nil)
@@ -2406,7 +2403,7 @@ (defun notmuch-show-current-part-handle (&optional mime-type)
 	 (buf (notmuch-show-generate-part-buffer msg part))
 	 (computed-type (or mime-type (plist-get part :computed-type)))
 	 (filename (plist-get part :filename))
-	 (disposition (if filename `(attachment (filename . ,filename)))))
+	 (disposition (and filename `(attachment (filename . ,filename)))))
     (mm-make-handle buf (list computed-type) nil nil disposition)))
 
 (defun notmuch-show-apply-to-current-part-handle (fn &optional mime-type)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 827acebf..37a5d1c8 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context
-				  (concat " and (" query-context ")"))))
+			      (and query-context
+				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 00ac45b6..31fda61f 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -370,10 +370,10 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
 
 Return the patch sequence number N from the last \"[PATCH N/M]\"
 style prefix in SUBJECT, or nil if such a prefix can't be found."
-  (when (string-match
-	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
-	 subject)
-    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+  (and (string-match
+	"^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
+	subject)
+       (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6ce2b1f9..41207643 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -264,7 +264,8 @@ (defun notmuch-search-last-thread ()
   (goto-char (point-max))
   (forward-line -2)
   (let ((beg (notmuch-search-result-beginning)))
-    (when beg (goto-char beg))))
+    (when beg
+      (goto-char beg))))
 
 (defun notmuch-search-first-thread ()
   "Select the first thread in the search results."
@@ -406,11 +407,12 @@ (defun notmuch-search-result-beginning (&optional pos)
   "Return the point at the beginning of the thread at POS (or point).
 
 If there is no thread at POS (or point), returns nil."
-  (when (notmuch-search-get-result pos)
-    ;; We pass 1+point because previous-single-property-change starts
-    ;; searching one before the position we give it.
-    (previous-single-property-change (1+ (or pos (point)))
-				     'notmuch-search-result nil (point-min))))
+  (and (notmuch-search-get-result pos)
+       ;; We pass 1+point because previous-single-property-change starts
+       ;; searching one before the position we give it.
+       (previous-single-property-change (1+ (or pos (point)))
+					'notmuch-search-result nil
+					(point-min))))
 
 (defun notmuch-search-result-end (&optional pos)
   "Return the point at the end of the thread at POS (or point).
@@ -418,9 +420,10 @@ (defun notmuch-search-result-end (&optional pos)
 The returned point will be just after the newline character that
 ends the result line.  If there is no thread at POS (or point),
 returns nil."
-  (when (notmuch-search-get-result pos)
-    (next-single-property-change (or pos (point)) 'notmuch-search-result
-				 nil (point-max))))
+  (and (notmuch-search-get-result pos)
+       (next-single-property-change (or pos (point))
+				    'notmuch-search-result nil
+				    (point-max))))
 
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
@@ -461,7 +464,8 @@ (defun notmuch-search-find-thread-id (&optional bare)
 
 If BARE is set then do not prefix with \"thread:\"."
   (let ((thread (plist-get (notmuch-search-get-result) :thread)))
-    (when thread (concat (unless bare "thread:") thread))))
+    (when thread
+      (concat (and (not bare) "thread:") thread))))
 
 (defun notmuch-search-find-stable-query ()
   "Return the stable queries for the current thread.
@@ -482,8 +486,8 @@ (defun notmuch-search-find-stable-query-region (beg end &optional only-matched)
 	(push (car queries) query-list))
       (when (and all (cadr queries))
 	(push (cadr queries) query-list)))
-    (when query-list
-      (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
+    (and query-list
+	 (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
 
 (defun notmuch-search-find-authors ()
   "Return the authors for the current thread."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 08/23] emacs: Use 'unless' instead of 'when' and 'not'
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (6 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
                     ` (14 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

Also use 'unless' in a few cases where previously 'if' was used with
'not' but without an ELSE part.
---
 emacs/notmuch-hello.el  | 6 +++---
 emacs/notmuch-mua.el    | 4 ++--
 emacs/notmuch-parser.el | 2 +-
 emacs/notmuch-show.el   | 3 +--
 emacs/notmuch-tag.el    | 4 ++--
 emacs/notmuch-tree.el   | 8 ++++----
 emacs/notmuch.el        | 4 ++--
 test/test-lib.el        | 6 +++---
 8 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 1c084bf7..25e28a52 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -638,7 +638,7 @@ (defun notmuch-hello-window-configuration-change ()
     (dolist (window (window-list))
       (let ((last-buf (window-parameter window 'notmuch-hello-last-buffer))
 	    (cur-buf (window-buffer window)))
-	(when (not (eq last-buf cur-buf))
+	(unless (eq last-buf cur-buf)
 	  ;; This window changed or is new.  Update recorded buffer
 	  ;; for next time.
 	  (set-window-parameter window 'notmuch-hello-last-buffer cur-buf)
@@ -652,7 +652,7 @@ (defun notmuch-hello-window-configuration-change ()
       ;; 24, we can't do it right here because something in this
       ;; hook's call stack overrides hello's point placement.
       (run-at-time nil nil #'notmuch-hello t))
-    (when (null hello-buf)
+    (unless hello-buf
       ;; Clean up hook
       (remove-hook 'window-configuration-change-hook
 		   #'notmuch-hello-window-configuration-change))))
@@ -908,7 +908,7 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
 				(notmuch-hello-update))
 		     "hide"))
     (widget-insert "\n")
-    (when (not is-hidden)
+    (unless is-hidden
       (let ((searches (apply 'notmuch-hello-query-counts query-list options)))
 	(when (or (not (plist-get options :hide-if-empty))
 		  searches)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index f6d8ffc5..dc1f518c 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -198,7 +198,7 @@ (defun notmuch-mua-user-agent-emacs ()
 (defun notmuch-mua-add-more-hidden-headers ()
   "Add some headers to the list that are hidden by default."
   (mapc (lambda (header)
-	  (when (not (member header message-hidden-headers))
+	  (unless (member header message-hidden-headers)
 	    (push header message-hidden-headers)))
 	notmuch-mua-hidden-headers))
 
@@ -368,7 +368,7 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (interactive)
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
-      (when (not (string= "" user-agent))
+      (unless (string= "" user-agent)
 	(push (cons 'User-Agent user-agent) other-headers))))
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index 06e7487b..fbcfc2ef 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -78,7 +78,7 @@ (defun notmuch-sexp-read (sp)
 	 ;; parse, extend the partial parse to figure out when we
 	 ;; have a complete list.
 	 (catch 'return
-	   (when (null (notmuch-sexp--partial-state sp))
+	   (unless (notmuch-sexp--partial-state sp)
 	     (let ((start (point)))
 	       (condition-case nil
 		   (throw 'return (read (current-buffer)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 211be091..6102ca2e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1060,8 +1060,7 @@ (defun notmuch-show-insert-msg (msg depth)
       ;; If the subject of this message is the same as that of the
       ;; previous message, don't display it when this message is
       ;; collapsed.
-      (when (not (string= notmuch-show-previous-subject
-			  bare-subject))
+      (unless (string= notmuch-show-previous-subject bare-subject)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 2fcf5a9e..1067f185 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -382,8 +382,8 @@ (defun notmuch-tag-completions (&rest search-terms)
   "Return a list of tags for messages matching SEARCH-TERMS.
 
 Returns all tags if no search terms are given."
-  (if (null search-terms)
-      (setq search-terms (list "*")))
+  (unless search-terms
+    (setq search-terms (list "*")))
   (split-string
    (with-output-to-string
      (with-current-buffer standard-output
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 37a5d1c8..a5ae0edb 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1063,10 +1063,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
   OPEN-TARGET: If TRUE open the target message in the message pane.
   UNTHREADED: If TRUE only show matching messages in an unthreaded view."
   (interactive)
-  (if (null query)
-      (setq query (notmuch-read-query (concat "Notmuch "
-					      (if unthreaded "unthreaded " "tree ")
-					      "view search: "))))
+  (unless query
+    (setq query (notmuch-read-query (concat "Notmuch "
+					    (if unthreaded "unthreaded " "tree ")
+					    "view search: "))))
   (let ((buffer (get-buffer-create (generate-new-buffer-name
 				    (or buffer-name
 					(concat "*notmuch-"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 41207643..93e92b39 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -803,13 +803,13 @@ (defun notmuch-search-insert-authors (format-string authors)
 	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(let ((start (point))
 	      overlay)
 	  (insert invisible-string)
diff --git a/test/test-lib.el b/test/test-lib.el
index aae9e833..a1233390 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -81,7 +81,7 @@ (defun visible-buffer-substring (start end)
   (let (str)
     (while (< start end)
       (let ((next-pos (next-char-property-change start end)))
-	(when (not (invisible-p start))
+	(unless (invisible-p start)
 	  (setq str (concat str (buffer-substring-no-properties
 				 start next-pos))))
 	(setq start next-pos)))
@@ -97,8 +97,8 @@ (defun test-process-running (pid)
 (defun orphan-watchdog-check (pid)
   "Periodically check that the process with id PID is still
 running, quit if it terminated."
-  (if (not (test-process-running pid))
-      (kill-emacs)))
+  (unless (test-process-running pid)
+    (kill-emacs)))
 
 (defun orphan-watchdog (pid)
   "Initiate orphan watchdog check."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (7 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
                     ` (13 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

---
 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 +-
 emacs/notmuch-show.el    |  93 ++++++++++++++++++------------------
 emacs/notmuch-tree.el    |  30 ++++++------
 emacs/notmuch-wash.el    |  68 +++++++++++++-------------
 emacs/notmuch.el         | 100 +++++++++++++++++++--------------------
 test/test-lib.el         |   4 +-
 12 files changed, 206 insertions(+), 203 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2dd08661..85531489 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -171,10 +171,10 @@ (defun notmuch-address-toggle-internal-completion ()
   (if (local-variable-p 'notmuch-address-command)
       (kill-local-variable 'notmuch-address-command)
     (notmuch-setq-local notmuch-address-command 'internal))
-  (if (boundp 'company-idle-delay)
-      (if (local-variable-p 'company-idle-delay)
-	  (kill-local-variable 'company-idle-delay)
-	(notmuch-setq-local company-idle-delay nil))))
+  (when (boundp 'company-idle-delay)
+    (if (local-variable-p 'company-idle-delay)
+	(kill-local-variable 'company-idle-delay)
+      (notmuch-setq-local company-idle-delay nil))))
 
 (defun notmuch-address-matching (substring)
   "Returns a list of completion candidates matching SUBSTRING.
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 388ef70f..3340918f 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -68,9 +68,9 @@ (if (fboundp 'read-char-choice)
 		   ;; This is an inlined copy of help-form-show as that
 		   ;; was introduced in emacs 24 too.
 		   (let ((msg (eval help-form)))
-		     (if (stringp msg)
-			 (with-output-to-temp-buffer " *Char Help*"
-			   (princ msg))))))
+		     (when (stringp msg)
+		       (with-output-to-temp-buffer " *Char Help*"
+			 (princ msg))))))
 	     ((memq char chars)
 	      (setq done t))
 	     ((and executing-kbd-macro (= char -1))
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 25e28a52..3127de86 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -589,8 +589,8 @@ (defun notmuch-hello-insert-buttons (searches)
     (mapc (lambda (elem)
 	    ;; (not elem) indicates an empty slot in the matrix.
 	    (when elem
-	      (if (> column-indent 0)
-		  (widget-insert (make-string column-indent ? )))
+	      (when (> column-indent 0)
+		(widget-insert (make-string column-indent ? )))
 	      (let* ((name (plist-get elem :name))
 		     (query (plist-get elem :query))
 		     (oldest-first (cl-case (plist-get elem :sort-order)
@@ -890,8 +890,8 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
    the same values as :filter. If :filter and :filter-count are specified, this
    will be used instead of :filter, not in conjunction with it."
   (widget-insert title ": ")
-  (if (and notmuch-hello-first-run (plist-get options :initially-hidden))
-      (add-to-list 'notmuch-hello-hidden-sections title))
+  (when (and notmuch-hello-first-run (plist-get options :initially-hidden))
+    (add-to-list 'notmuch-hello-hidden-sections title))
   (let ((is-hidden (member title notmuch-hello-hidden-sections))
 	(start (point)))
     (if is-hidden
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index adf79650..e302fe00 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -169,37 +169,37 @@ (defun notmuch-jump--make-keymap (action-map prompt)
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map notmuch-jump-minibuffer-map)
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (= (length key) 1)
-	  (define-key map key
-	    `(lambda () (interactive)
-	       (setq notmuch-jump--action ',fn)
-	       (exit-minibuffer)))))
+      (when (= (length key) 1)
+	(define-key map key
+	  `(lambda () (interactive)
+	     (setq notmuch-jump--action ',fn)
+	     (exit-minibuffer)))))
     ;; By doing this in two passes (and checking if we already have a
     ;; binding) we avoid problems if the user specifies a binding which
     ;; is a prefix of another binding.
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (> (length key) 1)
-	  (let* ((key (elt key 0))
-		 (keystr (string key))
-		 (new-prompt (concat prompt (format-kbd-macro keystr) " "))
-		 (action-submap nil))
-	    (unless (lookup-key map keystr)
-	      (pcase-dolist (`(,k ,n ,f) action-map)
-		(when (= key (elt k 0))
-		  (push (list (substring k 1) n f) action-submap)))
-	      ;; We deal with backspace specially
-	      (push (list (kbd "DEL")
-			  "Backup"
-			  (apply-partially #'notmuch-jump action-map prompt))
-		    action-submap)
-	      (setq action-submap (nreverse action-submap))
-	      (define-key map keystr
-		`(lambda () (interactive)
-		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump
-					    action-submap
-					    new-prompt))
-		   (exit-minibuffer)))))))
+      (when (> (length key) 1)
+	(let* ((key (elt key 0))
+	       (keystr (string key))
+	       (new-prompt (concat prompt (format-kbd-macro keystr) " "))
+	       (action-submap nil))
+	  (unless (lookup-key map keystr)
+	    (pcase-dolist (`(,k ,n ,f) action-map)
+	      (when (= key (elt k 0))
+		(push (list (substring k 1) n f) action-submap)))
+	    ;; We deal with backspace specially
+	    (push (list (kbd "DEL")
+			"Backup"
+			(apply-partially #'notmuch-jump action-map prompt))
+		  action-submap)
+	    (setq action-submap (nreverse action-submap))
+	    (define-key map keystr
+	      `(lambda () (interactive)
+		 (setq notmuch-jump--action
+		       ',(apply-partially #'notmuch-jump
+					  action-submap
+					  new-prompt))
+		 (exit-minibuffer)))))))
     map))
 
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9b02cd66..6110e45d 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -664,11 +664,11 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
 ;; is loaded.
-(if (>= emacs-major-version 24)
-    (defadvice mm-shr (before load-gnus-arts activate)
-      (require 'gnus-art nil t)
-      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
-      (ad-activate 'mm-shr)))
+(when (>= emacs-major-version 24)
+  (defadvice mm-shr (before load-gnus-arts activate)
+    (require 'gnus-art nil t)
+    (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
+    (ad-activate 'mm-shr)))
 
 (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
   "Use the mm-decode/mm-view functions to display a part in the
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index dc1f518c..2910a63e 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -275,8 +275,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(narrow-to-region (point) (point-max))
 	(goto-char (point-max))
 	(if (re-search-backward message-signature-separator nil t)
-	    (if message-signature-insert-empty-line
-		(forward-line -1))
+	    (when message-signature-insert-empty-line
+	      (forward-line -1))
 	  (goto-char (point-max))))
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
@@ -388,7 +388,8 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 	  ;; https://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
 	  ;; We need to convert any string input, eg from rmail-start-mail.
 	  (dolist (h other-headers other-headers)
-	    (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))
+	    (when (stringp (car h))
+	      (setcar h (intern (capitalize (car h))))))))
 	(args (list yank-action send-actions))
 	;; Cause `message-setup-1' to do things relevant for mail,
 	;; such as observe `message-default-mail-headers'.
@@ -428,14 +429,15 @@ (defvar notmuch-mua-sender-history nil)
 ;; without some explicit initialization fill freeze the operation.
 ;; Hence, we advice `ido-completing-read' to ensure required initialization
 ;; is done.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 4))
-    (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
-      (ido-init-completion-maps)
-      (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
-      (add-hook 'choose-completion-string-functions
-		'ido-choose-completion-string)
-      (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
-      (ad-activate 'ido-completing-read)))
+(when (and (= emacs-major-version 23)
+	   (< emacs-minor-version 4))
+  (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
+    (ido-init-completion-maps)
+    (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+    (add-hook 'choose-completion-string-functions
+	      'ido-choose-completion-string)
+    (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
+    (ad-activate 'ido-completing-read)))
 
 (defun notmuch-mua-prompt-for-sender ()
   "Prompt for a sender from the user's configured identities."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 1db9d7ca..a8e5d11f 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -30,8 +30,8 @@ (defun notmuch-query-get-threads (search-terms)
 list where the first element is a message, and the second element
 is a possibly empty forest of replies."
   (let ((args '("show" "--format=sexp" "--format-version=4")))
-    (if notmuch-show-process-crypto
-	(setq args (append args '("--decrypt=true"))))
+    (when notmuch-show-process-crypto
+      (setq args (append args '("--decrypt=true"))))
     (setq args (append args search-terms))
     (apply #'notmuch-call-notmuch-sexp args)))
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6102ca2e..f9418a94 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -346,10 +346,10 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (indenting notmuch-show-indent-content))
     (with-temp-buffer
       (insert all)
-      (if indenting
-	  (indent-rigidly (point-min)
-			  (point-max)
-			  (- (* notmuch-show-indent-messages-width depth))))
+      (when indenting
+	(indent-rigidly (point-min)
+			(point-max)
+			(- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -392,13 +392,13 @@ (defun notmuch-show-update-tags (tags)
   "Update the displayed tags of the current message."
   (save-excursion
     (goto-char (notmuch-show-message-top))
-    (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
-	(let ((inhibit-read-only t))
-	  (replace-match (concat "("
-				 (notmuch-tag-format-tags
-				  tags
-				  (notmuch-show-get-prop :orig-tags))
-				 ")"))))))
+    (when (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
+      (let ((inhibit-read-only t))
+	(replace-match (concat "("
+			       (notmuch-tag-format-tags
+				tags
+				(notmuch-show-get-prop :orig-tags))
+			       ")"))))))
 
 (defun notmuch-clean-address (address)
   "Try to clean a single email ADDRESS for display. Return a cons
@@ -482,9 +482,9 @@ (defun notmuch-show-insert-headers (headers)
     (mapc (lambda (header)
 	    (let* ((header-symbol (intern (concat ":" header)))
 		   (header-value (plist-get headers header-symbol)))
-	      (if (and header-value
-		       (not (string-equal "" header-value)))
-		  (notmuch-show-insert-header header header-value))))
+	      (when (and header-value
+			 (not (string-equal "" header-value)))
+		(notmuch-show-insert-header header header-value))))
 	  notmuch-message-headers)
     (save-excursion
       (save-restriction
@@ -600,10 +600,10 @@ (defun notmuch-show--get-cid-content (cid)
 (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
-  (if (boundp 'w3m-cid-retrieve-function-alist)
-      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	      w3m-cid-retrieve-function-alist)))
+  (when (and (boundp 'w3m-cid-retrieve-function-alist)
+	     (not (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)))
+    (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	  w3m-cid-retrieve-function-alist))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -761,22 +761,22 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 (defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth button)
   (notmuch-show-insert-part-text/calendar msg part content-type nth depth button))
 
-(if (version< emacs-version "25.3")
-    ;; https://bugs.gnu.org/28350
-    ;;
-    ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
-    ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched
-	(msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function
-      ;; enriched-decode-display-prop is defined before it will be
-      ;; shadowed by the letf below. Otherwise the version in
-      ;; enriched.el may be loaded a bit later and used instead (for
-      ;; the first time).
-      (require 'enriched)
-      (cl-letf (((symbol-function 'enriched-decode-display-prop)
-		 (lambda (start end &optional param) (list start end))))
-	(notmuch-show-insert-part-*/* msg part content-type nth depth button))))
+(when (version< emacs-version "25.3")
+  ;; https://bugs.gnu.org/28350
+  ;;
+  ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
+  ;; (see notmuch-show-handlers-for)
+  (defun notmuch-show-insert-part-text/enriched
+      (msg part content-type nth depth button)
+    ;; By requiring enriched below, we ensure that the function
+    ;; enriched-decode-display-prop is defined before it will be
+    ;; shadowed by the letf below. Otherwise the version in
+    ;; enriched.el may be loaded a bit later and used instead (for
+    ;; the first time).
+    (require 'enriched)
+    (cl-letf (((symbol-function 'enriched-decode-display-prop)
+	       (lambda (start end &optional param) (list start end))))
+      (notmuch-show-insert-part-*/* msg part content-type nth depth button))))
 
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
@@ -843,8 +843,8 @@ (defun notmuch-show-handlers-for (content-type)
   "Return a list of content handlers for a part of type CONTENT-TYPE."
   (let (result)
     (mapc (lambda (func)
-	    (if (functionp func)
-		(push func result)))
+	    (when (functionp func)
+	      (push func result)))
 	  ;; Reverse order of prefrence.
 	  (list (intern (concat "notmuch-show-insert-part-*/*"))
 		(intern (concat
@@ -1074,10 +1074,10 @@ (defun notmuch-show-insert-msg (msg depth)
       (insert "\n"))
     (setq content-end (point-marker))
     ;; Indent according to the depth in the thread.
-    (if notmuch-show-indent-content
-	(indent-rigidly content-start
-			content-end
-			(* notmuch-show-indent-messages-width depth)))
+    (when notmuch-show-indent-content
+      (indent-rigidly content-start
+		      content-end
+		      (* notmuch-show-indent-messages-width depth)))
     (setq message-end (point-max-marker))
     ;; Save the extents of this message over the whole text of the
     ;; message.
@@ -1282,7 +1282,8 @@ (defun notmuch-show--build-queries (thread context)
 fallback if the prior matches no messages."
   (let (queries)
     (push (list thread) queries)
-    (if context (push (list thread "and (" context ")") queries))
+    (when context
+      (push (list thread "and (" context ")") queries))
     queries))
 
 (defun notmuch-show--build-buffer (&optional state)
@@ -1779,9 +1780,9 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
     (let (message-ids done)
       (goto-char (point-min))
       (while (not done)
-	(if (notmuch-show-message-visible-p)
-	    (setq message-ids
-		  (append message-ids (list (notmuch-show-get-message-id)))))
+	(when (notmuch-show-message-visible-p)
+	  (setq message-ids
+		(append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next))))
       message-ids)))
 
@@ -1836,8 +1837,8 @@ (defun notmuch-show-advance-and-archive ()
 thread from the search from which this thread was originally
 shown."
   (interactive)
-  (if (notmuch-show-advance)
-      (notmuch-show-archive-thread-then-next)))
+  (when (notmuch-show-advance)
+    (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
   "Backup through the thread (reverse scrolling compared to \
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index a5ae0edb..6a619ec2 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -967,19 +967,19 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
       (kill-buffer (process-get proc 'parse-buf))
-      (if (buffer-live-p buffer)
-	  (with-current-buffer buffer
-	    (save-excursion
-	      (let ((inhibit-read-only t)
-		    (atbob (bobp)))
-		(goto-char (point-max))
-		(if (eq status 'signal)
-		    (insert "Incomplete search results (tree view process was killed).\n"))
-		(when (eq status 'exit)
-		  (insert "End of search results.")
-		  (unless (= exit-status 0)
-		    (insert (format " (process returned %d)" exit-status)))
-		  (insert "\n")))))))))
+      (when (buffer-live-p buffer)
+	(with-current-buffer buffer
+	  (save-excursion
+	    (let ((inhibit-read-only t)
+		  (atbob (bobp)))
+	      (goto-char (point-max))
+	      (when (eq status 'signal)
+		(insert "Incomplete search results (tree view process was killed).\n"))
+	      (when (eq status 'exit)
+		(insert "End of search results.")
+		(unless (= exit-status 0)
+		  (insert (format " (process returned %d)" exit-status)))
+		(insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
@@ -1023,8 +1023,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
 			      (and query-context
 				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
-    (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
-	(setq search-args basic-query))
+    (when (equal (car (process-lines notmuch-command "count" search-args)) "0")
+      (setq search-args basic-query))
     (notmuch-tag-clear-cache)
     (let ((proc (notmuch-start-notmuch
 		 "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 31fda61f..ce4b9637 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -216,8 +216,8 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
     (goto-char (1+ end))
     (save-excursion
       (goto-char beg)
-      (if prefix
-	  (insert-before-markers prefix))
+      (when prefix
+	(insert-before-markers prefix))
       (let ((button-beg (point)))
 	(insert-before-markers (notmuch-wash-button-label overlay) "\n")
 	(let ((button (make-button button-beg (1- (point))
@@ -229,13 +229,13 @@ (defun notmuch-wash-excerpt-citations (msg depth)
   "Excerpt citations and up to one signature."
   (goto-char (point-min))
   (beginning-of-line)
-  (if (and (< (point) (point-max))
-	   (re-search-forward notmuch-wash-original-regexp nil t))
-      (let* ((msg-start (match-beginning 0))
-	     (msg-end (point-max))
-	     (msg-lines (count-lines msg-start msg-end)))
-	(notmuch-wash-region-to-button
-	 msg msg-start msg-end "original")))
+  (when (and (< (point) (point-max))
+	     (re-search-forward notmuch-wash-original-regexp nil t))
+    (let* ((msg-start (match-beginning 0))
+	   (msg-end (point-max))
+	   (msg-lines (count-lines msg-start msg-end)))
+      (notmuch-wash-region-to-button
+       msg msg-start msg-end "original")))
   (while (and (< (point) (point-max))
 	      (re-search-forward notmuch-wash-citation-regexp nil t))
     (let* ((cite-start (match-beginning 0))
@@ -254,21 +254,21 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 	  (notmuch-wash-region-to-button
 	   msg hidden-start (point-marker)
 	   "citation")))))
-  (if (and (not (eobp))
-	   (re-search-forward notmuch-wash-signature-regexp nil t))
-      (let* ((sig-start (match-beginning 0))
-	     (sig-end (match-end 0))
-	     (sig-lines (count-lines sig-start (point-max))))
-	(if (<= sig-lines notmuch-wash-signature-lines-max)
-	    (let ((sig-start-marker (make-marker))
-		  (sig-end-marker (make-marker)))
-	      (set-marker sig-start-marker sig-start)
-	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
-			   'face 'message-cited-text)
-	      (notmuch-wash-region-to-button
-	       msg sig-start-marker sig-end-marker
-	       "signature"))))))
+  (when (and (not (eobp))
+	     (re-search-forward notmuch-wash-signature-regexp nil t))
+    (let* ((sig-start (match-beginning 0))
+	   (sig-end (match-end 0))
+	   (sig-lines (count-lines sig-start (point-max))))
+      (when (<= sig-lines notmuch-wash-signature-lines-max)
+	(let ((sig-start-marker (make-marker))
+	      (sig-end-marker (make-marker)))
+	  (set-marker sig-start-marker sig-start)
+	  (set-marker sig-end-marker (point-max))
+	  (overlay-put (make-overlay sig-start-marker sig-end-marker)
+		       'face 'message-cited-text)
+	  (notmuch-wash-region-to-button
+	   msg sig-start-marker sig-end-marker
+	   "signature"))))))
 
 ;;
 
@@ -286,12 +286,12 @@ (defun notmuch-wash-elide-blank-lines (msg depth)
     (delete-region (match-beginning 1) (match-end 1)))
   ;; Remove a leading blank line.
   (goto-char (point-min))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0)))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0)))
   ;; Remove a trailing blank line.
   (goto-char (point-max))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0))))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0))))
 
 ;;
 
@@ -399,12 +399,12 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 	  (patch-end (point-max))
 	  part)
       (goto-char patch-start)
-      (if (or
-	   ;; Patch ends with signature.
-	   (re-search-forward notmuch-wash-signature-regexp nil t)
-	   ;; Patch ends with bugtraq comment.
-	   (re-search-forward "^\\*\\*\\* " nil t))
-	  (setq patch-end (match-beginning 0)))
+      (when (or
+	     ;; Patch ends with signature.
+	     (re-search-forward notmuch-wash-signature-regexp nil t)
+	     ;; Patch ends with bugtraq comment.
+	     (re-search-forward "^\\*\\*\\* " nil t))
+	(setq patch-end (match-beginning 0)))
       (save-restriction
 	(narrow-to-region patch-start patch-end)
 	(setq part (plist-put part :content-type "inline patch"))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 93e92b39..4fc338e2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -674,28 +674,28 @@ (defun notmuch-search-process-sentinel (proc msg)
     (when (memq status '(exit signal))
       (catch 'return
 	(kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (search process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.\n")
-		    ;; For version mismatch, there's no point in
-		    ;; showing the search buffer
-		    (when (or (= exit-status 20) (= exit-status 21))
-		      (kill-buffer)
-		      (throw 'return nil))
-		    (if (and atbob
+	(when (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(when (eq status 'signal)
+		  (insert "Incomplete search results (search process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.\n")
+		  ;; For version mismatch, there's no point in
+		  ;; showing the search buffer
+		  (when (or (= exit-status 20) (= exit-status 21))
+		    (kill-buffer)
+		    (throw 'return nil))
+		  (when (and atbob
 			     (not (string= notmuch-search-target-thread "found")))
-			(set 'never-found-target-thread t)))))
-	      (when (and never-found-target-thread
-			 notmuch-search-target-line)
-		(goto-char (point-min))
-		(forward-line (1- notmuch-search-target-line)))))))))
+		    (set 'never-found-target-thread t)))))
+	    (when (and never-found-target-thread
+		       notmuch-search-target-line)
+	      (goto-char (point-min))
+	      (forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -760,31 +760,31 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (invisible-string "")
 	   (padding ""))
       ;; Truncate the author string to fit the specification.
-      (if (> (length formatted-authors)
-	     (length formatted-sample))
-	  (let ((visible-length (- (length formatted-sample)
-				   (length "... "))))
-	    ;; Truncate the visible string according to the width of
-	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length))
-	    (setq invisible-string (substring formatted-authors visible-length))
-	    ;; If possible, truncate the visible string at a natural
-	    ;; break (comma or pipe), as incremental search doesn't
-	    ;; match across the visible/invisible border.
-	    (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
-	      ;; Second clause is destructive on `visible-string', so
-	      ;; order is important.
-	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string))
-	      (setq visible-string (concat (match-string 1 visible-string)
-					   (match-string 2 visible-string))))
-	    ;; `visible-string' may be shorter than the space allowed
-	    ;; by `format-string'. If so we must insert some padding
-	    ;; after `invisible-string'.
-	    (setq padding (make-string (- (length formatted-sample)
-					  (length visible-string)
-					  (length "..."))
-				       ? ))))
+      (when (> (length formatted-authors)
+	       (length formatted-sample))
+	(let ((visible-length (- (length formatted-sample)
+				 (length "... "))))
+	  ;; Truncate the visible string according to the width of
+	  ;; the display string.
+	  (setq visible-string (substring formatted-authors 0 visible-length))
+	  (setq invisible-string (substring formatted-authors visible-length))
+	  ;; If possible, truncate the visible string at a natural
+	  ;; break (comma or pipe), as incremental search doesn't
+	  ;; match across the visible/invisible border.
+	  (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
+	    ;; Second clause is destructive on `visible-string', so
+	    ;; order is important.
+	    (setq invisible-string (concat (match-string 3 visible-string)
+					   invisible-string))
+	    (setq visible-string (concat (match-string 1 visible-string)
+					 (match-string 2 visible-string))))
+	  ;; `visible-string' may be shorter than the space allowed
+	  ;; by `format-string'. If so we must insert some padding
+	  ;; after `invisible-string'.
+	  (setq padding (make-string (- (length formatted-sample)
+					(length visible-string)
+					(length "..."))
+				     ? ))))
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -1006,8 +1006,8 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (notmuch-tag-clear-cache)
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
-      (if proc
-	  (error "notmuch search process already running for query `%s'" query))
+      (when proc
+	(error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
@@ -1156,7 +1156,7 @@ (setq mail-user-agent 'notmuch-user-agent)
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-(if init-file-user ; don't load init file if the -q option was used.
-    (load notmuch-init-file t t nil t))
+(when init-file-user ; don't load init file if the -q option was used.
+  (load notmuch-init-file t t nil t))
 
 ;;; notmuch.el ends here
diff --git a/test/test-lib.el b/test/test-lib.el
index a1233390..6a39bbe2 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -36,7 +36,7 @@ (setq read-file-name-function (lambda (&rest _) (read)))
 
 ;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents
 ;; noninteractive (kill-emacs) from emacsclient.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 3))
+(when (and (= emacs-major-version 23) (< emacs-minor-version 3))
   (defadvice kill-emacs (before disable-yes-or-no-p activate)
     "Disable yes-or-no-p before executing kill-emacs"
     (defun yes-or-no-p (prompt) t)))
@@ -46,7 +46,7 @@ (if (and (= emacs-major-version 23) (< emacs-minor-version 3))
 ;; seems to be present in Emacs 23.1.
 ;; Running `list-processes' after `accept-process-output' seems to work
 ;; around this problem.
-(if (and (= emacs-major-version 23) (= emacs-minor-version 1))
+(when (and (= emacs-major-version 23) (= emacs-minor-version 1))
   (defadvice accept-process-output (after run-list-processes activate)
     "run list-processes after executing accept-process-output"
     (list-processes)))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 10/23] emacs: Use one or three lines for 'if' forms
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (8 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 11/23] emacs: Extend face to window edge again Jonas Bernoulli
                     ` (12 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

Putting the COND and THEN parts on the same line but ELSE on a
separate line makes it harder to determine if there actually is
an ELSE part.
---
 emacs/notmuch-lib.el  | 6 ++++--
 emacs/notmuch-tag.el  | 3 ++-
 emacs/notmuch-tree.el | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 6110e45d..fc76fd67 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -611,7 +611,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
-			    (if binaryp 'no-conversion
+			    (if binaryp
+				'no-conversion
 			      (let ((coding-system
 				     (mm-charset-to-coding-system
 				      (plist-get part :content-charset))))
@@ -680,7 +681,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       ;; `gnus-decoded' charset.  Otherwise, we'll fetch the binary
       ;; part content and let mm-* decode it.
       (let* ((have-content (plist-member part :content))
-	     (charset (if have-content 'gnus-decoded
+	     (charset (if have-content
+			  'gnus-decoded
 			(plist-get part :content-charset)))
 	     (handle (mm-make-handle (current-buffer)
 				     `(,content-type (charset . ,charset)))))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1067f185..e71de041 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -532,7 +532,8 @@ (defun notmuch-tag-jump (reverse)
 		       (and (symbolp name)
 			    (symbol-name name))))
 	     (name-string (if name
-			      (if reverse (concat "Reverse " name)
+			      (if reverse
+				  (concat "Reverse " name)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6a619ec2..b498db07 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1009,7 +1009,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (setq notmuch-tree-basic-query basic-query)
   (setq notmuch-tree-query-context (if (or (string= query-context "")
 					   (string= query-context "*"))
-				       nil query-context))
+				       nil
+				     query-context))
   (setq notmuch-tree-target-msg target)
   (setq notmuch-tree-open-target open-target)
   ;; Set the default value for `notmuch-show-process-crypto' in this
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 11/23] emacs: Extend face to window edge again
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (9 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:18   ` [PATCH v2 12/23] emacs: Fix some function declarations Jonas Bernoulli
                     ` (11 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

Since Emacs 27 each face has to be explicitly configured to "extend
to the edge of the window".  Without doing that the face used for
the newline character only has an effect that spans "one character"
(i.e. it looks like there is a single trailing space character).

We don't want that so extend the face in Emacs 27, so that it looks
the same as it did in older Emacs releases.  We have to do this
conditionally, otherwise older Emacsen would choke on it.
---
 emacs/notmuch.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 4fc338e2..5562ad10 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -273,8 +273,12 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
-  '((((class color) (background light)) (:background "#f0f0f0"))
-    (((class color) (background dark)) (:background "#303030")))
+  `((((class color) (background light))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#f0f0f0"))
+    (((class color) (background dark))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#303030")))
   "Face for the single-line message summary in notmuch-show-mode."
   :group 'notmuch-show
   :group 'notmuch-faces)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 12/23] emacs: Fix some function declarations
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (10 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 11/23] emacs: Extend face to window edge again Jonas Bernoulli
@ 2020-08-06  7:18   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
                     ` (10 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:18 UTC (permalink / raw)
  To: notmuch

---
 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)
 
-(declare-function notmuch-search-tag "notmuch" tag-changes)
-(declare-function notmuch-show-tag "notmuch-show" tag-changes)
-(declare-function notmuch-tree-tag "notmuch-tree" tag-changes)
+(declare-function notmuch-search-tag "notmuch"
+		  (tag-changes &optional beg end only-matched))
+(declare-function notmuch-show-tag "notmuch-show" (tag-changes))
+(declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
 
 (autoload 'notmuch-jump "notmuch-jump")
 
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 13/23] emacs: No longer define notmuch-hello-mode-map as a function
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (11 preceding siblings ...)
  2020-08-06  7:18   ` [PATCH v2 12/23] emacs: Fix some function declarations Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
                     ` (9 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

It was defined as such for a decade; ever since
a56010ac8b89a2489eee5c78469f05cee85ec858 but there
wasn't a reason to do that then nor is there now.
---
 emacs/notmuch-hello.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 3127de86..c127bba9 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -687,7 +687,6 @@ (defvar notmuch-hello-mode-map
     (define-key map (kbd "<C-tab>") 'widget-backward)
     map)
   "Keymap for \"notmuch hello\" buffers.")
-(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
   "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 14/23] emacs: notmuch-poll: Let the user know we are polling
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (12 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
                     ` (8 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

It is done synchronously and it can take a while,
so we should let the user know what is going on.
---
 emacs/notmuch-lib.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index fc76fd67..069a19e9 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -259,11 +259,13 @@ (defun notmuch-poll ()
 Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
 depending on the value of `notmuch-poll-script'."
   (interactive)
+  (message "Polling mail...")
   (if (stringp notmuch-poll-script)
       (unless (string= notmuch-poll-script "")
 	(unless (equal (call-process notmuch-poll-script nil nil) 0)
 	  (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
-    (notmuch-call-notmuch-process "new")))
+    (notmuch-call-notmuch-process "new"))
+  (message "Polling mail...done"))
 
 (defun notmuch-bury-or-kill-this-buffer ()
   "Undisplay the current buffer.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 15/23] emacs: Use makefile-gmake-mode in Makefile*s
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (13 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 16/23] emacs: Improve doc-strings Jonas Bernoulli
                     ` (7 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

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 are Makefiles (of any flavor).
---
 Makefile.global                  | 1 +
 Makefile.local                   | 2 +-
 bindings/Makefile.local          | 2 +-
 compat/Makefile.local            | 2 +-
 completion/Makefile.local        | 2 +-
 doc/Makefile.local               | 2 +-
 emacs/Makefile.local             | 2 +-
 lib/Makefile.local               | 2 +-
 parse-time-string/Makefile.local | 2 ++
 performance-test/Makefile.local  | 2 +-
 test/Makefile.local              | 2 +-
 util/Makefile.local              | 2 +-
 12 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Makefile.global b/Makefile.global
index 98b6962e..c8812f9d 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -1,3 +1,4 @@
+# -*- makefile-gmake -*-
 # Here's the (hopefully simple) versioning scheme.
 #
 # Releases of notmuch have a two-digit version (0.1, 0.2, etc.). We
diff --git a/Makefile.local b/Makefile.local
index 22577617..77bc9850 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 .PHONY: all
 all: notmuch notmuch-shared build-man build-info ruby-bindings python-cffi-bindings
diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 19ddd6ea..bc960bbc 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := bindings
 
diff --git a/compat/Makefile.local b/compat/Makefile.local
index bcb9f0ec..2ee1b399 100644
--- a/compat/Makefile.local
+++ b/compat/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := compat
 extra_cflags += -I$(srcdir)/$(dir)
diff --git a/completion/Makefile.local b/completion/Makefile.local
index 8e86c9d2..54df463c 100644
--- a/completion/Makefile.local
+++ b/completion/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := completion
 
diff --git a/doc/Makefile.local b/doc/Makefile.local
index 30411341..60bd7184 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := doc
 
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 141f5868..d1b320c3 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := emacs
 emacs_sources := \
diff --git a/lib/Makefile.local b/lib/Makefile.local
index 5dc057c0..a6400126 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := lib
 
diff --git a/parse-time-string/Makefile.local b/parse-time-string/Makefile.local
index 53534f3e..ee8030cc 100644
--- a/parse-time-string/Makefile.local
+++ b/parse-time-string/Makefile.local
@@ -1,3 +1,5 @@
+# -*- makefile-gmake -*-
+
 dir := parse-time-string
 extra_cflags += -I$(srcdir)/$(dir)
 
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index 9dc260e3..b9f580c7 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := performance-test
 
diff --git a/test/Makefile.local b/test/Makefile.local
index 47244e8f..40574739 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := test
 
diff --git a/util/Makefile.local b/util/Makefile.local
index f5d72f79..7ef029a5 100644
--- a/util/Makefile.local
+++ b/util/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := util
 extra_cflags += -I$(srcdir)/$(dir)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 16/23] emacs: Improve doc-strings
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (14 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
                     ` (6 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

- 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 shouldn't be done.

- Symbols are quoted like `so'.

- There is no clear rule on how to (not) quote non-atomic
  s-expressions, but quoting like '(this) is definitely weird.

- It is a good idea to remember that \" becomes " and to take
  that in mind when adjusting the automatic filling by hand.

- Use the imperative form.

- Arguments are written in all uppercase.
---
 emacs/notmuch-address.el | 42 +++++++++++++++++++++-------------------
 emacs/notmuch-query.el   | 19 +++++++++---------
 emacs/notmuch-show.el    |  4 ++--
 emacs/notmuch-tree.el    |  5 +++--
 emacs/notmuch.el         |  9 ++++-----
 emacs/rstdoc.el          |  6 +++---
 6 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 85531489..cd0ffb67 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -36,9 +36,9 @@ (defvar notmuch-address-completions (make-hash-table :test 'equal)
 This variable is set by calling `notmuch-address-harvest'.")
 
 (defvar notmuch-address-full-harvest-finished nil
-  "t indicates that full completion address harvesting has been
-finished. Use notmuch-address--harvest-ready to access as that
-will load a saved hash if necessary (and available).")
+  "t indicates that full completion address harvesting has been finished.
+Use notmuch-address--harvest-ready to access as that will load a
+saved hash if necessary (and available).")
 
 (defun notmuch-address--harvest-ready ()
   "Return t if there is a full address hash available.
@@ -54,9 +54,9 @@ (defcustom notmuch-address-command 'internal
 which must take a single argument (searched string) and output a
 list of completion candidates, one per line.
 
-Alternatively, it can be the symbol 'internal, in which case
+Alternatively, it can be the symbol `internal', in which case
 internal completion is used; the variable
-`notmuch-address-internal-completion` can be used to customize
+`notmuch-address-internal-completion' can be used to customize
 this case.
 
 Finally, if this variable is nil then address completion is
@@ -72,12 +72,12 @@ (defcustom notmuch-address-command 'internal
 (defcustom notmuch-address-internal-completion '(sent nil)
   "Determines how internal address completion generates candidates.
 
-This should be a list of the form '(DIRECTION FILTER), where
+This should be a list of the form (DIRECTION FILTER), where
 DIRECTION is either sent or received and specifies whether the
 candidates are searched in messages sent by the user or received
 by the user (note received by is much faster), and FILTER is
-either nil or a filter-string, such as \"date:1y..\" to append
-to the query."
+either nil or a filter-string, such as \"date:1y..\" to append to
+the query."
   :type '(list :tag "Use internal address completion"
 	       (radio
 		:tag "Base completion on messages you have"
@@ -101,8 +101,8 @@ (defcustom notmuch-address-save-filename nil
   "Filename to save the cached completion addresses.
 
 All the addresses notmuch uses for address completion will be
-cached in this file. This has obvious privacy implications so you
-should make sure it is not somewhere publicly readable."
+cached in this file.  This has obvious privacy implications so
+you should make sure it is not somewhere publicly readable."
   :type '(choice (const :tag "Off" nil)
 		 (file :tag "Filename"))
   :group 'notmuch-send
@@ -110,12 +110,14 @@ (defcustom notmuch-address-save-filename nil
   :group 'notmuch-external)
 
 (defcustom notmuch-address-selection-function 'notmuch-address-selection-function
-  "The function to select address from given list. The function is
-called with PROMPT, COLLECTION, and INITIAL-INPUT as arguments
-(subset of what `completing-read' can be called with).
-While executed the value of `completion-ignore-case' is t.
-See documentation of function `notmuch-address-selection-function'
-to know how address selection is made by default."
+  "The function to select address from given list.
+
+The function is called with PROMPT, COLLECTION, and INITIAL-INPUT
+as arguments (subset of what `completing-read' can be called
+with).  While executed the value of `completion-ignore-case'
+is t.  See documentation of function
+`notmuch-address-selection-function' to know how address
+selection is made by default."
   :type 'function
   :group 'notmuch-send
   :group 'notmuch-address
@@ -188,9 +190,9 @@ (defun notmuch-address-matching (substring)
     candidates))
 
 (defun notmuch-address-options (original)
-  "Returns a list of completion candidates. Uses either
-elisp-based implementation or older implementation requiring
-external commands."
+  "Return a list of completion candidates.
+Use either elisp-based implementation or older implementation
+requiring external commands."
   (cond
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
@@ -352,7 +354,7 @@ (defvar notmuch-address--save-hash-version 1
   "Version format of the save hash.")
 
 (defun notmuch-address--get-address-hash ()
-  "Returns the saved address hash as a plist.
+  "Return the saved address hash as a plist.
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index a8e5d11f..3cfccbc3 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -47,22 +47,21 @@ (defun notmuch-query-map-aux  (mapper function seq)
 	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
-  "Apply FN to every thread in THREADS. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every thread in THREADS.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-forest fn threads))
 
 (defun notmuch-query-map-forest (fn forest)
-  "Apply function to every message in a forest. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information.
-"
+  "Apply function FN to every message in FOREST.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-tree fn forest))
 
 (defun notmuch-query-map-tree (fn tree)
-  "Apply function FN to every message in TREE. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every message in TREE.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (cons (funcall fn (car tree)) (notmuch-query-map-forest fn (cadr tree))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f9418a94..015edb0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -446,8 +446,8 @@ (defun notmuch-clean-address (address)
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
-  "Try to clean a single email ADDRESS for display.  Return
-unchanged ADDRESS if parsing fails."
+  "Try to clean a single email ADDRESS for display.
+Return unchanged ADDRESS if parsing fails."
   (let* ((clean-address (notmuch-clean-address address))
 	 (p-address (car clean-address))
 	 (p-name (cdr clean-address)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b498db07..364da240 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -587,7 +587,7 @@ (defun notmuch-tree-scroll-message-window ()
 	(scroll-up)))))
 
 (defun notmuch-tree-scroll-message-window-back ()
-  "Scroll the message window back(if it exists)."
+  "Scroll the message window back (if it exists)."
   (interactive)
   (when (window-live-p notmuch-tree-message-window)
     (with-selected-window notmuch-tree-message-window
@@ -596,7 +596,8 @@ (defun notmuch-tree-scroll-message-window-back ()
 	(scroll-down)))))
 
 (defun notmuch-tree-scroll-or-next ()
-  "Scroll the message window. If it at end go to next message."
+  "Scroll the message window.
+If it at end go to next message."
   (interactive)
   (when (notmuch-tree-scroll-message-window)
     (notmuch-tree-next-matching-message)))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5562ad10..75fe6900 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -432,11 +432,10 @@ (defun notmuch-search-result-end (&optional pos)
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
 
-FN should take one argument.  It will be applied to the
-character position of the beginning of each result that overlaps
-the region between points BEG and END.  As a special case, if (=
-BEG END), FN will be applied to the result containing point
-BEG."
+FN should take one argument.  It will be applied to the character
+position of the beginning of each result that overlaps the region
+between points BEG and END.  As a special case, if (= BEG END),
+FN will be applied to the result containing point BEG."
   (let ((pos (notmuch-search-result-beginning beg))
 	;; End must be a marker in case fn changes the
 	;; text.
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2af91186..92a337c8 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -36,11 +36,11 @@
 (provide 'rstdoc)
 
 (defun rstdoc-batch-extract ()
-  "Extract docstrings to and from the files on the command line"
+  "Extract docstrings to and from the files on the command line."
   (apply #'rstdoc-extract command-line-args-left))
 
 (defun rstdoc-extract (in-file out-file)
-  "Write docstrings from IN-FILE to OUT-FILE"
+  "Write docstrings from IN-FILE to OUT-FILE."
   (load-file in-file)
   (let* ((definitions (cdr (assoc (expand-file-name in-file) load-history)))
 	 (doc-hash (make-hash-table :test 'eq)))
@@ -72,7 +72,7 @@ (defvar rst--escape-alist
      ("\\([^\\]\\)'" . "\\1`")
      ("^[[:space:]\t]*$" . "|br|")
      ("^[[:space:]\t]" . "|indent| "))
-    "list of (regex . replacement) pairs")
+  "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
   (with-temp-buffer
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 17/23] emacs: Autoload notmuch-jump-search only once
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (15 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 16/23] emacs: Improve doc-strings Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
                     ` (5 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

This function is being autoloaded using an autoload cookie, so it
shouldn't additionally be autoloaded using an `autoload' form.

When building libraries we don't actually load the autoloads file and
dropping the `autoload' form results in an error, which reveals a so
far unspecified dependency: `notmuch-tree' needs `notmuch-jump'.

Before this commit compiling (or even just loading) `notmuch-tree'
resulted in `notmuch-jump' being loaded because the former requires
`notmuch-lib', which autoloaded `notmuch-jump-search'.

The bug was that this dependency was not explicitly specified, which
we fix by adding the respective `require' form.
---
 emacs/notmuch-lib.el  | 3 ---
 emacs/notmuch-tree.el | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 069a19e9..549161f3 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -35,9 +35,6 @@ (unless (require 'notmuch-version nil t)
   (defconst notmuch-emacs-version "unknown"
     "Placeholder variable when notmuch-version.el[c] is not available."))
 
-(autoload 'notmuch-jump-search "notmuch-jump"
-  "Jump to a saved search by shortcut key." t)
-
 (defgroup notmuch nil
   "Notmuch mail reader for Emacs."
   :group 'mail)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 364da240..b538cef9 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -33,6 +33,7 @@ (require 'notmuch-query)
 (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
+(require 'notmuch-jump)
 
 (declare-function notmuch-search "notmuch"
 		  (&optional query oldest-first target-thread target-line))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 18/23] emacs: Autoload notmuch-jump using an autoload cookie
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (16 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 19/23] emacs: Various cosmetic changes Jonas Bernoulli
                     ` (4 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

Doing that is better than using an `autoload' form because the latter
may result in dependencies getting hidden and indeed it turns out we
have to declare `notmuch-jump' in "notmuch-tag.el".
---
 emacs/notmuch-jump.el | 1 +
 emacs/notmuch-tag.el  | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index e302fe00..1e2d0497 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -73,6 +73,7 @@ (defun notmuch-jump-search ()
 
 (defvar notmuch-jump--action nil)
 
+;;;###autoload
 (defun notmuch-jump (action-map prompt)
   "Interactively prompt for one of the keys in ACTION-MAP.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1cef17e1..ccc1321f 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -36,8 +36,7 @@ (declare-function notmuch-search-tag "notmuch"
 		  (tag-changes &optional beg end only-matched))
 (declare-function notmuch-show-tag "notmuch-show" (tag-changes))
 (declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
-
-(autoload 'notmuch-jump "notmuch-jump")
+(declare-function notmuch-jump "notmuch-jump" (action-map prompt))
 
 (define-widget 'notmuch-tag-key-type 'list
   "A single key tagging binding."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 19/23] emacs: Various cosmetic changes
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (17 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
                     ` (3 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

---
 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 insertions(+), 44 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index dcac319c..91f4ef3d 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -36,7 +36,8 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-  (setq dir (or dir default-directory))
+  (unless dir
+    (setq dir default-directory))
   (save-excursion
     (goto-char (point-min))
     (condition-case nil
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 549161f3..a057140f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -53,9 +53,8 @@ (defgroup notmuch-show nil
 
 (defgroup notmuch-send nil
   "Sending messages from Notmuch."
-  :group 'notmuch)
-
-(custom-add-to-group 'notmuch-send 'message 'custom-group)
+  :group 'notmuch
+  :group 'message)
 
 (defgroup notmuch-tag nil
   "Tags and tagging in Notmuch."
@@ -782,8 +781,7 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s"
-	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
+  (error "%s%s" msg (if extra " (see *Notmuch errors* for more details)" "")))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index fbcfc2ef..3aa5bd8f 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -39,12 +39,9 @@ (defun notmuch-sexp-create-parser ()
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
   (vector 'notmuch-sexp-parser
-	  ;; List depth
-	  0
-	  ;; Partial parse position marker
-	  nil
-	  ;; Partial parse state
-	  nil))
+	  0     ; List depth
+	  nil   ; Partial parse position marker
+	  nil)) ; Partial parse state
 
 (defmacro notmuch-sexp--depth (sp)         `(aref ,sp 1))
 (defmacro notmuch-sexp--partial-pos (sp)   `(aref ,sp 2))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 015edb0c..5640346f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -499,21 +499,17 @@ (define-button-type 'notmuch-show-part-button-type
 
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
-  (let ((button)
-	(base-label (concat (and name (concat name ": "))
+  (let ((base-label (concat (and name (concat name ": "))
 			    declared-type
 			    (and (not (string-equal declared-type content-type))
 				 (concat " (as " content-type ")"))
 			    comment)))
-    (setq button
-	  (insert-button
-	   (concat "[ " base-label " ]")
-	   :base-label base-label
-	   :type 'notmuch-show-part-button-type
-	   :notmuch-part-hidden nil))
-    (insert "\n")
-    ;; return button
-    button))
+    (prog1 (insert-button
+	    (concat "[ " base-label " ]")
+	    :base-label base-label
+	    :type 'notmuch-show-part-button-type
+	    :notmuch-part-hidden nil)
+      (insert "\n"))))
 
 (defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 92a337c8..41390bbe 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -24,7 +24,6 @@
 ;;
 
 ;;; Commentary:
-;;
 
 ;; Rstdoc provides a facility to extract all of the docstrings defined in
 ;; an elisp source file. Usage:
@@ -68,10 +67,10 @@ (defun rstdoc--insert-docstring (symbol docstring)
   (insert "\n"))
 
 (defvar rst--escape-alist
-  '( ("\\\\='" . "\\\\'")
-     ("\\([^\\]\\)'" . "\\1`")
-     ("^[[:space:]\t]*$" . "|br|")
-     ("^[[:space:]\t]" . "|indent| "))
+  '(("\\\\='" . "\\\\'")
+    ("\\([^\\]\\)'" . "\\1`")
+    ("^[[:space:]\t]*$" . "|br|")
+    ("^[[:space:]\t]" . "|indent| "))
   "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
diff --git a/test/test-lib.el b/test/test-lib.el
index 6a39bbe2..e9e7c379 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -154,22 +154,21 @@ (defun notmuch-test-report-unexpected (output expected)
 
 (defun notmuch-test-expect-equal (output expected)
   "Compare OUTPUT with EXPECTED. Report any discrepencies."
-  (if (equal output expected)
-      t
-    (cond
-     ((and (listp output)
-	   (listp expected))
-      ;; Reporting the difference between two lists is done by
-      ;; reporting differing elements of OUTPUT and EXPECTED
-      ;; pairwise. This is expected to make analysis of failures
-      ;; simpler.
-      (apply #'concat (cl-loop for o in output
-			       for e in expected
-			       if (not (equal o e))
-			       collect (notmuch-test-report-unexpected o e))))
-
-     (t
-      (notmuch-test-report-unexpected output expected)))))
+  (cond
+   ((equal output expected)
+    t)
+   ((and (listp output)
+	 (listp expected))
+    ;; Reporting the difference between two lists is done by
+    ;; reporting differing elements of OUTPUT and EXPECTED
+    ;; pairwise. This is expected to make analysis of failures
+    ;; simpler.
+    (apply #'concat (cl-loop for o in output
+			     for e in expected
+			     if (not (equal o e))
+			     collect (notmuch-test-report-unexpected o e))))
+   (t
+    (notmuch-test-report-unexpected output expected))))
 
 (defun notmuch-post-command ()
   (run-hooks 'post-command-hook))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 20/23] emacs: Increase consistency of library headers
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (18 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 19/23] emacs: Various cosmetic changes Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 21/23] Fix typos Jonas Bernoulli
                     ` (2 subsequent siblings)
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

---
 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       |  2 +-
 emacs/notmuch-show.el        |  2 +-
 emacs/notmuch-tree.el        |  2 +-
 emacs/notmuch.el             |  2 +-
 9 files changed, 60 insertions(+), 42 deletions(-)

diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index c1f3594e..88b1c533 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -1,29 +1,35 @@
 ;;; notmuch-company.el --- Mail address completion for notmuch via company-mode  -*- lexical-binding: t -*-
 
-;; Authors: Trevor Jim <tjim@mac.com>
-;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
+;; Copyright © Trevor Jim
+;; Copyright © Michal Sojka
 ;;
-;; Keywords: mail, completion
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation, either version 3 of the License, or
 ;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Trevor Jim <tjim@mac.com>
+;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
+;;
+;; Keywords: mail, completion
 
 ;;; Commentary:
 
-;; To enable this, install company mode (https://company-mode.github.io/)
+;; Mail address completion for notmuch via company-mode.  To enable
+;; this, install company mode from <https://company-mode.github.io/>.
 ;;
 ;; NB company-minimum-prefix-length defaults to 3 so you don't get
-;; completion unless you type 3 characters
+;; completion unless you type 3 characters.
 
 ;;; Code:
 
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 3340918f..43b60ae3 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -3,6 +3,21 @@
 ;; The functions in this file are copied from more modern versions of
 ;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017
 ;; Free Software Foundation, Inc.
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; emacs master has a bugfix for folding long headers when sending
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index e6bf8339..6df1dd64 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -1,4 +1,4 @@
-;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata.
+;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata
 ;;
 ;; Copyright © Jameson Rollins
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index a057140f..dbdc99c1 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -19,8 +19,6 @@
 ;;
 ;; Authors: Carl Worth <cworth@cworth.org>
 
-;; This is an part of an emacs-based interface to the notmuch mail system.
-
 ;;; Code:
 
 (require 'cl-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 1027e1a7..aa07b26a 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -1,24 +1,23 @@
-;;; notmuch-maildir-fcc.el ---
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published
-;; by the Free Software Foundation; either version 2, or (at your
-;; option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;; notmuch-maildir-fcc.el --- inserting using a fcc handler
+
+;; Copyright © Jesse Rosenthal
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; To use this as the fcc handler for message-mode,
-;; customize the notmuch-fcc-dirs variable
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Jesse Rosenthal <jrosenthal@jhu.edu>
 
 ;;; Code:
 
diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el
index d9b3d449..6dd9f775 100644
--- a/emacs/notmuch-print.el
+++ b/emacs/notmuch-print.el
@@ -1,4 +1,4 @@
-;;; notmuch-print.el --- printing messages from notmuch.
+;;; notmuch-print.el --- printing messages from notmuch
 ;;
 ;; Copyright © David Edmondson
 ;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5640346f..de822357 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1,4 +1,4 @@
-;;; notmuch-show.el --- displaying notmuch forests.
+;;; notmuch-show.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b538cef9..fbba4bb3 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1,4 +1,4 @@
-;;; notmuch-tree.el --- displaying notmuch forests.
+;;; notmuch-tree.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 75fe6900..e3b7289b 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -62,7 +62,7 @@
 ;;
 ;; TL;DR: notmuch-emacs from MELPA and notmuch from distro packages is
 ;; NOT SUPPORTED.
-;;
+
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
-- 
2.28.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 21/23] Fix typos
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (19 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 23/23] test: Fix indentation Jonas Bernoulli
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

---
 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 ++--
 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 +-
 emacs/notmuch-crypto.el                    |  2 +-
 emacs/notmuch-lib.el                       |  2 +-
 emacs/notmuch-mua.el                       |  2 +-
 lib/notmuch.h                              |  4 ++--
 tag-util.c                                 |  2 +-
 tag-util.h                                 |  2 +-
 test/T610-message-property.sh              |  2 +-
 test/T710-message-id.sh                    |  2 +-
 test/random-corpus.c                       |  2 +-
 test/test-lib.el                           |  2 +-
 19 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/NEWS b/NEWS
index 0d8b930f..9f0db031 100644
--- a/NEWS
+++ b/NEWS
@@ -116,7 +116,7 @@ information about cryptographic protections for the Subject header.
 Emacs
 -----
 
-Optionally check for missing attachements in outgoing messages (see
+Optionally check for missing attachments in outgoing messages (see
 function `notmuch-mua-attachment-check`).
 
 Bind `B` to browse URLs in current message.
diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py
index 613317e0..f281edc1 100644
--- a/bindings/python-cffi/notmuch2/__init__.py
+++ b/bindings/python-cffi/notmuch2/__init__.py
@@ -10,7 +10,7 @@ should consider their signatures implementation details.
 Errors
 ======
 
-All errors occuring due to errors from the underlying notmuch database
+All errors occurring due to errors from the underlying notmuch database
 are subclasses of the :exc:`NotmuchError`.  Due to memory management
 it is possible to try and use an object after it has been freed.  In
 this case a :exc:`ObjectDestroyedError` will be raised.
diff --git a/bindings/python-cffi/notmuch2/_base.py b/bindings/python-cffi/notmuch2/_base.py
index 31258149..1cf03c88 100644
--- a/bindings/python-cffi/notmuch2/_base.py
+++ b/bindings/python-cffi/notmuch2/_base.py
@@ -29,7 +29,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     However during some peculiar situations, e.g. interpreter
     shutdown, it is possible for the :meth:`__del__` method to have
     been called, whele there are still references to an object.  This
-    could result in child objects asking their memeory to be freed
+    could result in child objects asking their memory to be freed
     after the parent has already freed the memory, making things
     rather unhappy as double frees are not taken lightly in C.  To
     handle this case all objects need to follow the same protocol to
@@ -73,7 +73,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     def _destroy(self):
         """Destroy the object, freeing all memory.
 
-        This method needs to destory the object on the
+        This method needs to destroy the object on the
         libnotmuch-level.  It must ensure it's not been destroyed by
         it's parent object yet before doing so.  It also must be
         idempotent.
@@ -134,7 +134,7 @@ class BinString(str):
 
     Most data in libnotmuch should be valid ASCII or valid UTF-8.
     However since it is a C library these are represented as
-    bytestrings intead which means on an API level we can not
+    bytestrings instead which means on an API level we can not
     guarantee that decoding this to UTF-8 will both succeed and be
     lossless.  This string type converts bytes to unicode in a lossy
     way, but also makes the raw bytes available.
diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py
index 7db5a7f8..5ab0f20a 100644
--- a/bindings/python-cffi/notmuch2/_database.py
+++ b/bindings/python-cffi/notmuch2/_database.py
@@ -422,7 +422,7 @@ class Database(base.NotmuchObject):
            of it as ``dup = db.remove_message(name); if dup: ...``.
         :rtype: bool
 
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ReadOnlyDatabaseError: The database is opened in
            READ_ONLY mode.
         :raises UpgradeRequiredError: The database must be upgraded
@@ -458,7 +458,7 @@ class Database(base.NotmuchObject):
         :raises LookupError: If no message was found.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         msg_pp = capi.ffi.new('notmuch_message_t **')
@@ -489,7 +489,7 @@ class Database(base.NotmuchObject):
            a subclass of :exc:`KeyError`.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
@@ -695,7 +695,7 @@ class AtomicContext:
         """Force ending the atomic section.
 
         This can only be called once __exit__ has been called.  It
-        will attept to close the atomic section (again).  This is
+        will attempt to close the atomic section (again).  This is
         useful if the original exit raised an exception and the atomic
         section is still open.  But things are pretty ugly by now.
 
diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py
index 02de50ad..2f232076 100644
--- a/bindings/python-cffi/notmuch2/_message.py
+++ b/bindings/python-cffi/notmuch2/_message.py
@@ -147,7 +147,7 @@ class Message(base.NotmuchObject):
         """Return an iterator of all files for this message.
 
         If multiple files contained the same message ID they will all
-        be returned here.  The files are returned as intances of
+        be returned here.  The files are returned as instances of
         :class:`pathlib.Path`.
 
         :returns: Iterator yielding :class:`pathlib.Path` instances.
@@ -431,7 +431,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
     means the former will yield duplicate keys while the latter won't.
     It also means ``len(list(iter(this_map)))`` could be different
     than ``len(this_map.keys())``.  ``len(this_map)`` will correspond
-    with the lenght of the default iterator.
+    with the length of the default iterator.
 
     Be aware that libnotmuch exposes all of this as iterators, so
     quite a few operations have O(n) performance instead of the usual
diff --git a/bindings/python-cffi/notmuch2/_tags.py b/bindings/python-cffi/notmuch2/_tags.py
index 3b14c981..ee5d2a34 100644
--- a/bindings/python-cffi/notmuch2/_tags.py
+++ b/bindings/python-cffi/notmuch2/_tags.py
@@ -161,7 +161,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
     """
 
     # Since we subclass ImmutableTagSet we inherit a __hash__.  But we
-    # are mutable, setting it to None will make the Python machinary
+    # are mutable, setting it to None will make the Python machinery
     # recognise us as unhashable.
     __hash__ = None
 
@@ -179,7 +179,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the added tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -204,7 +204,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -286,7 +286,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 class TagsIter(base.NotmuchObject, collections.abc.Iterator):
     """Iterator over tags.
 
-    This is only an interator, not a container so calling
+    This is only an iterator, not a container so calling
     :meth:`__iter__` does not return a new, replenished iterator but
     only itself.
 
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index de7db8e7..6835fd30 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -31,7 +31,7 @@ def notmuch(maildir):
     fixture.
     """
     def run(*args):
-        """Run a notmuch comand.
+        """Run a notmuch command.
 
         This function runs with a timeout error as many notmuch
         commands may block if multiple processes are trying to open
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 88ca836e..8fb507fa 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -65,7 +65,7 @@ class Database(object):
     .. note::
 
         Any function in this class can and will throw an
-        :exc:`NotInitializedError` if the database was not intitialized
+        :exc:`NotInitializedError` if the database was not initialized
         properly.
     """
     _std_db_path = None
@@ -273,9 +273,9 @@ class Database(object):
         return Database._get_version(self._db)
 
     def get_revision (self):
-        """Returns the committed database revison and UUID
+        """Returns the committed database revision and UUID
 
-        :returns: (revison, uuid) The database revision as a positive integer
+        :returns: (revision, uuid) The database revision as a positive integer
         and the UUID of the database.
         """
         self._assert_db_is_initialized()
@@ -574,7 +574,7 @@ class Database(object):
                   in the meantime. In this case, you should close and
                   reopen the database and retry.
             :exc:`NotInitializedError` if
-                    the database was not intitialized.
+                    the database was not initialized.
         """
         self._assert_db_is_initialized()
         msg_p = NotmuchMessageP()
@@ -600,7 +600,7 @@ class Database(object):
                  case, you should close and reopen the database and
                  retry.
         :raises: :exc:`NotInitializedError` if the database was not
-                 intitialized.
+                 initialized.
 
         *Added in notmuch 0.9*"""
         self._assert_db_is_initialized()
@@ -616,7 +616,7 @@ class Database(object):
         """Returns :class:`Tags` with a list of all tags found in the database
 
         :returns: :class:`Tags`
-        :execption: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
+        :exception: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
                     on error
         """
         self._assert_db_is_initialized()
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index bdc18790..ffb86df1 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -95,7 +95,7 @@ class Query(object):
             :exc:`NullPointerError` if the query creation failed
                 (e.g. too little memory).
             :exc:`NotInitializedError` if the underlying db was not
-                intitialized.
+                initialized.
         """
         db._assert_db_is_initialized()
         # create reference to parent db to keep it alive
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 6df1dd64..276c9859 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -128,7 +128,7 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
       (setq button-action 'notmuch-crypto-sigstatus-error-callback)
       (setq help-msg (concat "Click to retrieve key ID " keyid
-			     " from keyserver.")))
+			     " from key server.")))
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")"))
       (setq face 'notmuch-crypto-signature-bad))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index dbdc99c1..91c94781 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -656,7 +656,7 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; Workaround: The call to `mm-display-part' below triggers a bug in
 ;; Emacs 24 if it attempts to use the shr renderer to display an HTML
 ;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and
-;; Fedora 17, though unreproducable in other configurations).
+;; Fedora 17, though unreproducible in other configurations).
 ;; `mm-shr' references the variable `gnus-inhibit-images' without
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 2910a63e..f321e0c6 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -337,7 +337,7 @@ (define-key notmuch-message-mode-map (kbd "C-x C-s") #'notmuch-draft-save)
 
 (defun notmuch-mua-pop-to-buffer (name switch-function)
   "Pop to buffer NAME, and warn if it already exists and is
-modified. This function is notmuch addaptation of
+modified. This function is notmuch adaptation of
 `message-pop-to-buffer'."
   (let ((buffer (get-buffer name)))
     (if (and buffer
diff --git a/lib/notmuch.h b/lib/notmuch.h
index f9e9cc41..041cc143 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -1642,7 +1642,7 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag);
  *
  * @retval #NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in
  *	read-only mode so message cannot be modified.
- * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an execption was thrown
+ * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an exception was thrown
  *      accessing the database.
  */
 notmuch_status_t
@@ -1874,7 +1874,7 @@ notmuch_message_add_property (notmuch_message_t *message, const char *key, const
 /**
  * Remove a (key,value) pair from a message.
  *
- * It is not an error to remove a non-existant (key,value) pair
+ * It is not an error to remove a non-existent (key,value) pair
  *
  * @returns
  * - NOTMUCH_STATUS_ILLEGAL_ARGUMENT: *key* may not contain an '=' character.
diff --git a/tag-util.c b/tag-util.c
index 1837b1ae..accf299e 100644
--- a/tag-util.c
+++ b/tag-util.c
@@ -323,7 +323,7 @@ tag_op_list_apply (notmuch_message_t *message,
     if (flags & TAG_FLAG_MAILDIR_SYNC) {
 	status = notmuch_message_tags_to_maildir_flags (message);
 	if (status) {
-	    message_error (message, status, "synching tags to maildir");
+	    message_error (message, status, "syncing tags to maildir");
 	    return status;
 	}
     }
diff --git a/tag-util.h b/tag-util.h
index bbe54d99..411e8cae 100644
--- a/tag-util.h
+++ b/tag-util.h
@@ -123,7 +123,7 @@ tag_op_list_append (tag_op_list_t *list,
 /*
  * Apply a list of tag operations, in order, to a given message.
  *
- * Flags can be bitwise ORed; see enum above for possibilies.
+ * Flags can be bitwise ORed; see enum above for possibilities.
  */
 
 notmuch_status_t
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index b8774230..d0e52f4a 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -65,7 +65,7 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
 
-   /* remove non-existant value for key */
+   /* remove non-existent value for key */
    EXPECT0(notmuch_message_remove_property (message, "testkey2", "this value has spaces and = sign"));
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
diff --git a/test/T710-message-id.sh b/test/T710-message-id.sh
index e73d6ba9..5129d84c 100755
--- a/test/T710-message-id.sh
+++ b/test/T710-message-id.sh
@@ -29,7 +29,7 @@ GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
-test_begin_subtest "<> delimeters are required"
+test_begin_subtest "<> delimiters are required"
 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
 <1530507300.raoomurnbf.astroid@strange.none
diff --git a/test/random-corpus.c b/test/random-corpus.c
index 8ed7ff76..ff413252 100644
--- a/test/random-corpus.c
+++ b/test/random-corpus.c
@@ -50,7 +50,7 @@ typedef struct {
 
 /*
  *  Choose about half ascii as test characters, as ascii
- *  punctation and whitespace is the main cause of problems for
+ *  punctuation and whitespace is the main cause of problems for
  *  the (old) restore parser.
  *
  *  We then favour code points with 2 byte encodings. Note that
diff --git a/test/test-lib.el b/test/test-lib.el
index e9e7c379..2def7ffe 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -153,7 +153,7 @@ (defun notmuch-test-report-unexpected (output expected)
 	  "Output:\t" (prin1-to-string output) "\n"))
 
 (defun notmuch-test-expect-equal (output expected)
-  "Compare OUTPUT with EXPECTED. Report any discrepencies."
+  "Compare OUTPUT with EXPECTED. Report any discrepancies."
   (cond
    ((equal output expected)
     t)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 22/23] .dir-locals.el: Set variables for correct "shell" mode
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (20 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 21/23] Fix typos Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  2020-08-06  7:19   ` [PATCH v2 23/23] test: Fix indentation Jonas Bernoulli
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

The major mode used for shell scripts is named 'sh-mode'.
'shell-mode' on the other hand implements an interactive
shell in emacs-lisp.
---
 .dir-locals.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index fc75ae61..b3ddffe8 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -15,7 +15,7 @@ ((c-mode
  (emacs-lisp-mode
   (indent-tabs-mode . t)
   (tab-width . 8))
- (shell-mode
+ (sh-mode
   (indent-tabs-mode . t)
   (tab-width . 8)
   (sh-basic-offset . 4)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v2 23/23] test: Fix indentation
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
                     ` (21 preceding siblings ...)
  2020-08-06  7:19   ` [PATCH v2 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
@ 2020-08-06  7:19   ` Jonas Bernoulli
  22 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06  7:19 UTC (permalink / raw)
  To: notmuch

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 31c858d1..167fa621 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -136,16 +136,16 @@ add_gpgsm_home ()
     at_exit_function _gnupg_exit
     mkdir -p -m 0700 "$GNUPGHOME"
     openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
-        < "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
-        gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
+	< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
+	gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
+	      --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
     fpr=$(gpgsm --batch --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
     echo "$fpr S relax" >> "$GNUPGHOME/trustlist.txt"
     gpgsm --quiet --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/ca.crt
     echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$GNUPGHOME/trustlist.txt"
     printf '%s::1\n' include-certs disable-crl-checks | gpgconf --output /dev/null --change-options gpgsm
     gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
+	      --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
     test_debug "cat $GNUPGHOME/import.log"
 }
 
@@ -394,8 +394,8 @@ emacs_fcc_message ()
     local nmn_args subject body
     nmn_args=''
     while [[ "$1" =~ ^-- ]]; do
-        nmn_args="$nmn_args $1"
-        shift
+	nmn_args="$nmn_args $1"
+	shift
     done
     subject="$1"
     body="$2"
@@ -405,7 +405,7 @@ emacs_fcc_message ()
 
     test_emacs \
 	"(let ((message-send-mail-function (lambda () t))
-               (mail-host-address \"example.com\"))
+	       (mail-host-address \"example.com\"))
 	   (notmuch-mua-mail)
 	   (message-goto-to)
 	   (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\")
@@ -524,9 +524,9 @@ test_expect_equal_json () {
     # override Python's stdio encoding defaults.
     script='import json, sys; json.dump(json.load(sys.stdin), sys.stdout, sort_keys=True, indent=4)'
     output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$1")
+	|| echo "$1")
     expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$2")
+	|| echo "$2")
     shift 2
     test_expect_equal "$output" "$expected" "$@"
 }
@@ -540,15 +540,15 @@ test_valid_json () {
 # Sort the top-level list of JSON data from stdin.
 test_sort_json () {
     PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c \
-        "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
+	"import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
 }
 
 # test for json objects:
 # read the source of test/json_check_nodes.py (or the output when
 # invoking it without arguments) for an explanation of the syntax.
 test_json_nodes () {
-        local output
-        exec 1>&6 2>&7		# Restore stdout and stderr
+	local output
+	exec 1>&6 2>&7		# Restore stdout and stderr
 	if [ -z "$inside_subtest" ]; then
 		error "bug in the test script: test_json_eval without test_begin_subtest"
 	fi
@@ -662,7 +662,7 @@ notmuch_json_show_sanitize ()
 	-e 's|"filename": "signature.asc",||g' \
 	-e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \
 	-e 's|"timestamp": 97.......|"timestamp": 42|g' \
-        -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
+	-e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
 }
 
 notmuch_emacs_error_sanitize ()
@@ -673,7 +673,7 @@ notmuch_emacs_error_sanitize ()
     for file in "$@"; do
 	echo "=== $file ==="
 	cat "$file"
-    done | sed  \
+    done | sed \
 	-e 's/^\[.*\]$/[XXX]/' \
 	-e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|"
 }
@@ -929,8 +929,8 @@ test_expect_code () {
 # but is a prefix that can be used in the test script, like:
 #
 #	test_expect_success 'complain and die' '
-#           do something &&
-#           do something else &&
+#	    do something &&
+#	    do something else &&
 #	    test_must_fail git checkout ../outerspace
 #	'
 #
@@ -1020,8 +1020,8 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
 
 # Here's what we are using here:
 #
-# --quick              Use minimal customization. This implies --no-init-file,
-#		       --no-site-file and (emacs 24) --no-site-lisp
+# --quick		Use minimal customization. This implies --no-init-file,
+#			--no-site-file and (emacs 24) --no-site-lisp
 #
 # --directory		Ensure that the local elisp sources are found
 #
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* Re: [PATCH v2 06/23] emacs: Use cl-incf where appropriate
  2020-08-06  7:18   ` [PATCH v2 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
@ 2020-08-06 11:37     ` David Bremner
  2020-08-06 13:37       ` Jonas Bernoulli
  0 siblings, 1 reply; 108+ messages in thread
From: David Bremner @ 2020-08-06 11:37 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

Jonas Bernoulli <jonas@bernoul.li> writes:

> It's shorter.  That's it pretty much.
> ---
>  emacs/notmuch-hello.el | 2 +-
>  emacs/notmuch-lib.el   | 2 +-

"cl-incf is a Lisp macro in ‘aquamacs-tools.el’."

What the actual heck?

Anyway, that aside, what version of emacs is this available from?

d\r

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v2 06/23] emacs: Use cl-incf where appropriate
  2020-08-06 11:37     ` David Bremner
@ 2020-08-06 13:37       ` Jonas Bernoulli
  2020-08-07 17:03         ` Tomi Ollila
  0 siblings, 1 reply; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-06 13:37 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner <david@tethera.net> writes:
> "cl-incf is a Lisp macro in ‘aquamacs-tools.el’."
>
> What the actual heck?

Indeed.  Did you follow the link to the definition to figure out what's
going on?

Ah... I found this: https://github.com/dholm/tabbar/commit/6d5a6935879.
IMO it's wrong to do that, but that is of no concern here.

> Anyway, that aside, what version of emacs is this available from?

Emacs 24.3.  A forward compatibility implementation for older versions
is available at https://elpa.gnu.org/packages/cl-lib.html.

I didn't find any information about what minimal Emacs version Notmuch
expects but https://notmuchmail.org/emacstips/#index1h2 implies that it
is 24.1.

IMO it would be reasonable to expect at least 24.3, 24.5 or even 25.1.
See https://www.gnu.org/software/emacs/history.html for release dates.

Or you might want to just drop this commit.  Or we could update the FAQ
to mention that one has to install cl-lib from GNU ELPA if one uses such
an ancient Emacs release.

     Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v2 06/23] emacs: Use cl-incf where appropriate
  2020-08-06 13:37       ` Jonas Bernoulli
@ 2020-08-07 17:03         ` Tomi Ollila
  2020-08-07 17:22           ` David Bremner
  0 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-08-07 17:03 UTC (permalink / raw)
  To: Jonas Bernoulli, David Bremner, notmuch

On Thu, Aug 06 2020, Jonas Bernoulli wrote:

> David Bremner <david@tethera.net> writes:
>> "cl-incf is a Lisp macro in ‘aquamacs-tools.el’."
>>
>> What the actual heck?
>
> Indeed.  Did you follow the link to the definition to figure out what's
> going on?
>
> Ah... I found this: https://github.com/dholm/tabbar/commit/6d5a6935879.
> IMO it's wrong to do that, but that is of no concern here.
>
>> Anyway, that aside, what version of emacs is this available from?
>
> Emacs 24.3.  A forward compatibility implementation for older versions
> is available at https://elpa.gnu.org/packages/cl-lib.html.
>
> I didn't find any information about what minimal Emacs version Notmuch
> expects but https://notmuchmail.org/emacstips/#index1h2 implies that it
> is 24.1.
>
> IMO it would be reasonable to expect at least 24.3, 24.5 or even 25.1.
> See https://www.gnu.org/software/emacs/history.html for release dates.

NEWS for notmuch 0.29 says that:

"
The minimum supported major version of Emacs is now 24.

Support for GNU Emacs older than 25.1 is deprecated with this release,
and may be removed in a future release.
"

So we have 3 options:

1) apply this patch and now drop support for emacs 24

2) apply this patch and somehow infor emacs 24 users to install cl-lib from
ELPA

3) hold this particular patch until notmuch 0.31 is released and drop
support for emacs 24 then (would that mean quite a few following patches
not to apply anymore ;/


Anyway, the patch series V2 looked good to me (on terminal)

Tomi


>
> Or you might want to just drop this commit.  Or we could update the FAQ
> to mention that one has to install cl-lib from GNU ELPA if one uses such
> an ancient Emacs release.
>
>      Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v2 06/23] emacs: Use cl-incf where appropriate
  2020-08-07 17:03         ` Tomi Ollila
@ 2020-08-07 17:22           ` David Bremner
  0 siblings, 0 replies; 108+ messages in thread
From: David Bremner @ 2020-08-07 17:22 UTC (permalink / raw)
  To: Tomi Ollila, Jonas Bernoulli, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> NEWS for notmuch 0.29 says that:
>
> "
> The minimum supported major version of Emacs is now 24.
>
> Support for GNU Emacs older than 25.1 is deprecated with this release,
> and may be removed in a future release.
> "
>
> So we have 3 options:
>
> 1) apply this patch and now drop support for emacs 24
>
> 2) apply this patch and somehow infor emacs 24 users to install cl-lib from
> ELPA

I'm fine with either of these options. I'd hope we can specify what
versions we need in emacs/notmuch-pkg.el.templ

d

^ permalink raw reply	[flat|nested] 108+ messages in thread

* [PATCH v3 00/34] A great number of cosmetic changes
  2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
                   ` (24 preceding siblings ...)
  2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
@ 2020-08-08 11:49 ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 01/34] emacs: Shorten long lines Jonas Bernoulli
                     ` (35 more replies)
  25 siblings, 36 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> Tomi Ollila <tomi.ollila@iki.fi> writes:

>> So we have 3 options:
>>
>> 1) apply this patch and now drop support for emacs 24
>>
>> 2) apply this patch and somehow infor emacs 24 users to install cl-lib from
>> ELPA
>
> I'm fine with either of these options. I'd hope we can specify what
> versions we need in emacs/notmuch-pkg.el.templ

I went with option 1: drop support for emacs 24.  Instead of just
adding a NEWS entry and bump a number, I also removed some old cruft
that was only necessary for emacs 24 (and in some cases emacs 23!).

That resulted in a few new commits of course, marked with * below.
And since I had to add some commit anyway, I also added three other
minor commits, marked with ^ below.

     Cheers,
     Jonas

Jonas Bernoulli (34):
  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 '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
^ .gitignore: Sort using sort-lines
^ emacs: Provide 'rstdoc' feature at end of file
^ emacs: Add end-of-file line to libraries that lack it
* NEWS: Add stub for 0.31
* NEWS: At least Emacs 25.1 is required now
* emacs: Use cl-incf where appropriate
* emacs: Remove notmuch-setq-local
* emacs: Remove notmuch-read-char-choice
* emacs: Drop old advices that were only need for Emacs 23
* emacs: Do not abuse advice to monkey patch while testing
* emacs: Use new advice mechanism do advice mm-shr
* try-emacs-mua: Trim `require' advice for Emacs 25

 .dir-locals.el                             |   2 +-
 .gitignore                                 |  28 +-
 Makefile.global                            |   1 +
 Makefile.local                             |   2 +-
 NEWS                                       |  10 +-
 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 +-
 devel/try-emacs-mua                        |  26 +-
 doc/Makefile.local                         |   2 +-
 emacs/Makefile.local                       |   2 +-
 emacs/coolj.el                             |  24 +-
 emacs/make-deps.el                         |   7 +-
 emacs/notmuch-address.el                   | 188 ++++-----
 emacs/notmuch-company.el                   |  56 +--
 emacs/notmuch-compat.el                    |  88 +----
 emacs/notmuch-crypto.el                    |  49 ++-
 emacs/notmuch-draft.el                     |  24 +-
 emacs/notmuch-hello.el                     | 102 +++--
 emacs/notmuch-jump.el                      |  61 ++-
 emacs/notmuch-lib.el                       | 202 +++++-----
 emacs/notmuch-maildir-fcc.el               | 122 +++---
 emacs/notmuch-message.el                   |   3 +-
 emacs/notmuch-mua.el                       | 185 ++++-----
 emacs/notmuch-parser.el                    |  16 +-
 emacs/notmuch-pkg.el.tmpl                  |   3 +-
 emacs/notmuch-print.el                     |   2 +-
 emacs/notmuch-query.el                     |  29 +-
 emacs/notmuch-show.el                      | 439 ++++++++++-----------
 emacs/notmuch-tag.el                       |  43 +-
 emacs/notmuch-tree.el                      | 189 ++++-----
 emacs/notmuch-version.el.tmpl              |   3 +-
 emacs/notmuch-wash.el                      | 109 +++--
 emacs/notmuch.el                           | 278 ++++++-------
 emacs/rstdoc.el                            |  22 +-
 lib/Makefile.local                         |   2 +-
 lib/notmuch.h                              |   4 +-
 parse-time-string/Makefile.local           |   2 +
 performance-test/Makefile.local            |   2 +-
 tag-util.c                                 |   2 +-
 tag-util.h                                 |   2 +-
 test/Makefile.local                        |   2 +-
 test/T310-emacs.sh                         |  14 +-
 test/T610-message-property.sh              |   2 +-
 test/T710-message-id.sh                    |   2 +-
 test/emacs-address-cleaning.el             |   2 +-
 test/random-corpus.c                       |   2 +-
 test/test-lib.el                           |  64 +--
 test/test-lib.sh                           |  36 +-
 util/Makefile.local                        |   2 +-
 58 files changed, 1188 insertions(+), 1319 deletions(-)

-- 
2.28.0

^ permalink raw reply	[flat|nested] 108+ messages in thread

* [PATCH v3 01/34] emacs: Shorten long lines
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 02/34] emacs: Remove excess empty lines Jonas Bernoulli
                     ` (34 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 emacs/coolj.el               |   2 +-
 emacs/notmuch-address.el     |  38 +++++++------
 emacs/notmuch-company.el     |  17 ++++--
 emacs/notmuch-crypto.el      |  16 +++---
 emacs/notmuch-draft.el       |  12 ++--
 emacs/notmuch-hello.el       |  43 ++++++++++-----
 emacs/notmuch-jump.el        |   7 ++-
 emacs/notmuch-lib.el         |  62 +++++++++++++--------
 emacs/notmuch-maildir-fcc.el |  14 ++---
 emacs/notmuch-message.el     |   3 +-
 emacs/notmuch-mua.el         |  78 +++++++++++++++-----------
 emacs/notmuch-show.el        | 103 +++++++++++++++++++++++------------
 emacs/notmuch-tag.el         |  14 +++--
 emacs/notmuch-tree.el        |  55 +++++++++++++------
 emacs/notmuch-wash.el        |  19 +++++--
 emacs/notmuch.el             |  27 ++++++---
 emacs/rstdoc.el              |   3 +-
 17 files changed, 326 insertions(+), 187 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 350d537f..5d311170 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -1,6 +1,6 @@
 ;;; coolj.el --- automatically wrap long lines  -*- coding:utf-8 -*-
 
-;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc.
 
 ;; Authors:    Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
 ;;             Alex Schroeder <alex@gnu.org>
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 0d56fba7..2a9c411a 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -195,10 +195,11 @@ (defun notmuch-address-options (original)
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
       ;; First, run quick synchronous harvest based on what the user
-      ;; entered so far
+      ;; entered so far.
       (notmuch-address-harvest original t))
     (prog1 (notmuch-address-matching original)
-      ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+      ;; Then start the (potentially long-running) full asynchronous
+      ;; harvest if necessary.
       (notmuch-address-harvest-trigger)))
    (t
     (process-lines notmuch-address-command original))))
@@ -241,7 +242,8 @@ (defun notmuch-address-expand-name ()
 	    (push chosen notmuch-address-history)
 	    (delete-region beg end)
 	    (insert chosen)
-	    (run-hook-with-args 'notmuch-address-post-completion-functions chosen))
+	    (run-hook-with-args 'notmuch-address-post-completion-functions
+				chosen))
 	(message "No matches.")
 	(ding))))
    (t nil)))
@@ -393,10 +395,11 @@ (defun notmuch-address--save-address-hash ()
 	      ;; 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 (list :version notmuch-address--save-hash-version
-				  :completion-settings notmuch-address-internal-completion
-				  :last-harvest notmuch-address-last-harvest
-				  :completions notmuch-address-completions)))
+	  (let ((save-plist
+		 (list :version notmuch-address--save-hash-version
+		       :completion-settings notmuch-address-internal-completion
+		       :last-harvest notmuch-address-last-harvest
+		       :completions notmuch-address-completions)))
 	    (print "notmuch-address-hash" (current-buffer))
 	    (print save-plist (current-buffer))))
       (message "\
@@ -408,16 +411,17 @@ (defun notmuch-address-harvest-trigger ()
   (let ((now (float-time)))
     (when (> (- now notmuch-address-last-harvest) 86400)
       (setq notmuch-address-last-harvest now)
-      (notmuch-address-harvest nil nil
-			       (lambda (proc event)
-				 ;; If harvest fails, we want to try
-				 ;; again when the trigger is next
-				 ;; called
-				 (if (string= event "finished\n")
-				     (progn
-				       (notmuch-address--save-address-hash)
-				       (setq notmuch-address-full-harvest-finished t))
-				   (setq notmuch-address-last-harvest 0)))))))
+      (notmuch-address-harvest
+       nil nil
+       (lambda (proc event)
+	 ;; If harvest fails, we want to try
+	 ;; again when the trigger is next
+	 ;; called
+	 (if (string= event "finished\n")
+	     (progn
+	       (notmuch-address--save-address-hash)
+	       (setq notmuch-address-full-harvest-finished t))
+	   (setq notmuch-address-last-harvest 0)))))))
 
 ;;
 
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index ac998f9b..c1f3594e 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -69,9 +69,11 @@ (defun notmuch-company (command &optional arg &rest _ignore)
     (cl-case command
       (interactive (company-begin-backend 'notmuch-company))
       (prefix (and (derived-mode-p 'message-mode)
-		   (looking-back (concat notmuch-address-completion-headers-regexp ".*")
-				 (line-beginning-position))
-		   (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
+		   (looking-back
+		    (concat notmuch-address-completion-headers-regexp ".*")
+		    (line-beginning-position))
+		   (setq notmuch-company-last-prefix
+			 (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol)))))
       (candidates (cond
 		   ((notmuch-address--harvest-ready)
 		    ;; Update harvested addressed from time to time
@@ -80,17 +82,20 @@ (defun notmuch-company (command &optional arg &rest _ignore)
 		   (t
 		    (cons :async
 			  (lambda (callback)
-			    ;; First run quick asynchronous harvest based on what the user entered so far
+			    ;; First run quick asynchronous harvest
+			    ;; based on what the user entered so far
 			    (notmuch-address-harvest
 			     arg nil
 			     (lambda (_proc _event)
 			       (funcall callback (notmuch-address-matching arg))
-			       ;; Then start the (potentially long-running) full asynchronous harvest if necessary
+			       ;; Then start the (potentially long-running)
+			       ;; full asynchronous harvest if necessary
 			       (notmuch-address-harvest-trigger))))))))
       (match (if (string-match notmuch-company-last-prefix arg)
 		 (match-end 0)
 	       0))
-      (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg))
+      (post-completion
+       (run-hook-with-args 'notmuch-address-post-completion-functions arg))
       (no-cache t))))
 
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index c201d0d7..2327ff1f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -161,7 +161,8 @@ (defun notmuch-crypto-sigstatus-good-callback (button)
 	(goto-char (point-max))
 	(insert (format "-- Key %s in message %s:\n"
 			fingerprint id))
-	(call-process notmuch-crypto-gpg-program nil t t "--batch" "--no-tty" "--list-keys" fingerprint))
+	(call-process notmuch-crypto-gpg-program nil t t
+		      "--batch" "--no-tty" "--list-keys" fingerprint))
       (recenter -1))))
 
 (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
@@ -220,12 +221,13 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	  (with-current-buffer buffer
 	    (goto-char (point-max))
 	    (insert (format "--- Retrieving key %s:\n" keyid)))
-	  (let ((p (make-process :name "notmuch GPG key retrieval"
-				 :connection-type 'pipe
-				 :buffer buffer
-				 :stderr buffer
-				 :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
-				 :sentinel #'notmuch-crypto--async-key-sentinel)))
+	  (let ((p (make-process
+		    :name "notmuch GPG key retrieval"
+		    :connection-type 'pipe
+		    :buffer buffer
+		    :stderr buffer
+		    :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
+		    :sentinel #'notmuch-crypto--async-key-sentinel)))
 	    (process-put p :gpg-key-id keyid)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index 27abc7d9..c3cb619f 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -154,12 +154,14 @@ (defun notmuch-draft--query-encryption ()
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
 	((ask)
-	 (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+	 (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.
 Really save and index an unencrypted copy? ")
 	   (error "Save aborted")))
 	((nil)
-	 (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')"))
+	 (error "Refusing to save draft with encryption tags (see `%s')"
+		'notmuch-draft-save-plaintext))
 	((t)
 	 (ignore))))
 
@@ -192,14 +194,16 @@ (defun notmuch-draft-save ()
        (message-remove-header "Message-ID")
        (message-add-header (concat "Message-ID: <" id ">")))
       (t
-       (message "You have customized emacs so Message-ID is not a deletable header, so not changing it")
+       (message "You have customized emacs so Message-ID is not a %s"
+		"deletable header, so not changing it")
        (setq id nil)))
      (cond
       ((member 'Date message-deletable-headers)
        (message-remove-header "Date")
        (message-add-header (concat "Date: " (message-make-date))))
       (t
-       (message "You have customized emacs so Date is not a deletable header, so not changing it")))
+       (message "You have customized emacs so Date is not a deletable %s"
+		"header, so not changing it")))
      (message-add-header "X-Notmuch-Emacs-Draft: True")
      (notmuch-draft-quote-some-mml)
      (notmuch-maildir-setup-message-for-saving)
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 0ff5aaff..11c625ea 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -29,7 +29,8 @@ (require 'wid-edit) ; For `widget-forward'.
 (require 'notmuch-lib)
 (require 'notmuch-mua)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 (declare-function notmuch-tree "notmuch-tree"
 		  (&optional query query-context target buffer-name open-target unthreaded))
@@ -91,18 +92,28 @@ (define-widget 'notmuch-saved-search-plist 'list
   :tag "Saved Search"
   :args '((list :inline t
 		:format "%v"
-		(group :format "%v" :inline t (const :format "   Name: " :name) (string :format "%v"))
-		(group :format "%v" :inline t (const :format "  Query: " :query) (string :format "%v")))
+		(group :format "%v" :inline t
+		       (const :format "   Name: " :name)
+		       (string :format "%v"))
+		(group :format "%v" :inline t
+		       (const :format "  Query: " :query)
+		       (string :format "%v")))
 	  (checklist :inline t
 		     :format "%v"
-		     (group :format "%v" :inline t (const :format "Shortcut key: " :key) (key-sequence :format "%v"))
-		     (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v"))
-		     (group :format "%v" :inline t (const :format "" :sort-order)
+		     (group :format "%v" :inline t
+			    (const :format "Shortcut key: " :key)
+			    (key-sequence :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "Count-Query: " :count-query)
+			    (string :format "%v"))
+		     (group :format "%v" :inline t
+			    (const :format "" :sort-order)
 			    (choice :tag " Sort Order"
 				    (const :tag "Default" nil)
 				    (const :tag "Oldest-first" oldest-first)
 				    (const :tag "Newest-first" newest-first)))
-		     (group :format "%v" :inline t (const :format "" :search-type)
+		     (group :format "%v" :inline t
+			    (const :format "" :search-type)
 			    (choice :tag " Search Type"
 				    (const :tag "Search mode" nil)
 				    (const :tag "Tree mode" tree)
@@ -474,7 +485,8 @@ (defun notmuch-hello-tags-per-line (widest)
 
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
-		  (proposed-width (max (* available-width notmuch-column-control) widest)))
+		  (proposed-width (max (* available-width notmuch-column-control)
+				       widest)))
 	     (floor available-width proposed-width)))
 
 	  (t
@@ -536,8 +548,9 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
-      (notmuch-logged-error "notmuch count --batch failed"
-			    "Please check that the notmuch CLI is new enough to support `count
+      (notmuch-logged-error
+       "notmuch count --batch failed"
+       "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
 
@@ -553,7 +566,8 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 				search-query (plist-get options :filter)))
 	       (message-count (prog1 (read (current-buffer))
 				(forward-line 1))))
-	  (when (and filtered-query (or (plist-get options :show-empty-searches) (> message-count 0)))
+	  (when (and filtered-query (or (plist-get options :show-empty-searches)
+					(> message-count 0)))
 	    (setq elem-plist (plist-put elem-plist :query filtered-query))
 	    (plist-put elem-plist :count message-count))))
       query-list))))
@@ -740,7 +754,9 @@ (defun notmuch-hello-insert-header ()
       ;; dark background.
       (setq image (cons 'image
 			(append (cdr image)
-				(list :background (face-background 'notmuch-hello-logo-background)))))
+				(list :background
+				      (face-background
+				       'notmuch-hello-logo-background)))))
       (insert-image image))
     (widget-insert "  "))
 
@@ -760,7 +776,8 @@ (defun notmuch-hello-insert-header ()
 			     (notmuch-hello-update))
 		   :help-echo "Refresh"
 		   (notmuch-hello-nice-number
-		    (string-to-number (car (process-lines notmuch-command "count")))))
+		    (string-to-number
+		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
 
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 84fe2b9c..6d8cd97f 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -70,7 +70,8 @@ (defun notmuch-jump-search ()
 
     (if action-map
 	(notmuch-jump action-map "Search: ")
-      (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches."))))
+      (error "To use notmuch-jump, \
+please customize shortcut keys in notmuch-saved-searches."))))
 
 (defvar notmuch-jump--action nil)
 
@@ -200,7 +201,9 @@ (defun notmuch-jump--make-keymap (action-map prompt)
 	      (define-key map keystr
 		`(lambda () (interactive)
 		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump action-submap new-prompt))
+			 ',(apply-partially #'notmuch-jump
+					    action-submap
+					    new-prompt))
 		   (exit-minibuffer)))))))
     map))
 
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 0bb08eb2..9339f9d0 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -316,8 +316,10 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		tail)))
       ;; Documentation for command
       (push (cons key-string
-		  (or (and (symbolp binding) (get binding 'notmuch-doc))
-		      (and (functionp binding) (notmuch-documentation-first-line binding))))
+		  (or (and (symbolp binding)
+			   (get binding 'notmuch-doc))
+		      (and (functionp binding)
+			   (notmuch-documentation-first-line binding))))
 	    tail)))
     tail)
 
@@ -327,13 +329,13 @@ (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; binding whose "key" is 'remap, and whose "binding" is itself a
   ;; keymap that maps not from keys to commands, but from old (remapped)
   ;; functions to the commands to use in their stead.
-  (map-keymap
-   (lambda (command binding)
-     (mapc
-      (lambda (actual-key)
-	(setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail)))
-      (where-is-internal command base-keymap)))
-   remap-keymap)
+  (map-keymap (lambda (command binding)
+		(mapc (lambda (actual-key)
+			(setq tail
+			      (notmuch-describe-key actual-key binding
+						    prefix ua-keys tail)))
+		      (where-is-internal command base-keymap)))
+	      remap-keymap)
   tail)
 
 (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail)
@@ -356,9 +358,13 @@ (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail
 		      (notmuch-describe-remaps
 		       binding ua-keys base-keymap prefix tail)
 		    (notmuch-describe-keymap
-		     binding ua-keys base-keymap (notmuch-prefix-key-description key) tail))))
+		     binding ua-keys base-keymap
+		     (notmuch-prefix-key-description key)
+		     tail))))
 	   (binding
-	    (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail)))))
+	    (setq tail
+		  (notmuch-describe-key (vector key)
+					binding prefix ua-keys tail)))))
    keymap)
   tail)
 
@@ -368,11 +374,15 @@ (defun notmuch-substitute-command-keys (doc)
     (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg)
       (let ((desc
 	     (save-match-data
-	       (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1)))
+	       (let* ((keymap-name (substring doc
+					      (match-beginning 1)
+					      (match-end 1)))
 		      (keymap (symbol-value (intern keymap-name)))
 		      (ua-keys (where-is-internal 'universal-argument keymap t))
 		      (desc-alist (notmuch-describe-keymap keymap ua-keys keymap))
-		      (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)))
+		      (desc-list (mapcar (lambda (arg)
+					   (concat (car arg) "\t" (cdr arg)))
+					 desc-alist)))
 		 (mapconcat #'identity desc-list "\n")))))
 	(setq doc (replace-match desc 1 1 doc)))
       (setq beg (match-end 0)))
@@ -391,7 +401,8 @@ (defun notmuch-help ()
 of its command symbol."
   (interactive)
   (let* ((mode major-mode)
-	 (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t)))))
+	 (doc (substitute-command-keys
+	       (notmuch-substitute-command-keys (documentation mode t)))))
     (with-current-buffer (generate-new-buffer "*notmuch-help*")
       (insert doc)
       (goto-char (point-min))
@@ -411,8 +422,10 @@ (defun notmuch-subkeymap-help ()
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-	   (desc-alist (notmuch-describe-keymap subkeymap ua-keys subkeymap prefix-string))
-	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))
+	   (desc-alist (notmuch-describe-keymap
+			subkeymap ua-keys subkeymap prefix-string))
+	   (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg)))
+			      desc-alist))
 	   (desc (mapconcat #'identity desc-list "\n")))
       (with-help-window (help-buffer)
 	(with-current-buffer standard-output
@@ -547,7 +560,8 @@ (defvar notmuch-multipart/alternative-discouraged
   '(
     ;; Avoid HTML parts.
     "text/html"
-    ;; multipart/related usually contain a text/html part and some associated graphics.
+    ;; multipart/related usually contain a text/html part and some
+    ;; associated graphics.
     "multipart/related"
     ))
 
@@ -602,8 +616,9 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
-			      (let ((coding-system (mm-charset-to-coding-system
-						    (plist-get part :content-charset))))
+			      (let ((coding-system
+				     (mm-charset-to-coding-system
+				      (plist-get part :content-charset))))
 				;; Sadly,
 				;; `mm-charset-to-coding-system' seems
 				;; to return things that are not
@@ -615,7 +630,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				  ;; charset is US-ASCII. RFC6657
 				  ;; complicates this somewhat.
 				  'us-ascii)))))
-		       (apply #'call-process notmuch-command nil '(t nil) nil args)
+		       (apply #'call-process
+			      notmuch-command nil '(t nil) nil args)
 		       (buffer-string))))))
     (when (and cache data)
       (plist-put part plist-elem data))
@@ -670,7 +686,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       (let* ((have-content (plist-member part :content))
 	     (charset (if have-content 'gnus-decoded
 			(plist-get part :content-charset)))
-	     (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))
+	     (handle (mm-make-handle (current-buffer)
+				     `(,content-type (charset . ,charset)))))
 	;; If the user wants the part inlined, insert the content and
 	;; test whether we are able to inline it (which includes both
 	;; capability and suitability tests).
@@ -786,7 +803,8 @@ (defun notmuch-check-async-exit-status (proc msg &optional command err)
 	   ((exit) (process-exit-status proc))
 	   ((signal) msg))))
     (when exit-status
-      (notmuch-check-exit-status exit-status (or command (process-command proc))
+      (notmuch-check-exit-status exit-status
+				 (or command (process-command proc))
 				 nil err))))
 
 (defun notmuch-check-exit-status (exit-status command &optional output err)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index e95de63b..4b10a731 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -135,8 +135,9 @@ (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; really want this header inserted.
 
   (when (or (not (= (elt subdir 0) ?/))
-	    (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
-			      subdir)))
+	    (y-or-n-p
+	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
+Insert header anyway? " subdir)))
     (message-add-header (concat "Fcc: " subdir))))
 
 (defun notmuch-maildir-add-file-style-fcc-header (subdir)
@@ -249,9 +250,8 @@ (defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
       ;; typo, or just the user want a new folder, let the user decide
       ;; how to deal with it.
       (error
-       (let ((response (notmuch-read-char-choice
-			"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
-			'(?r ?c ?i ?e))))
+       (let ((response (notmuch-read-char-choice "Insert failed: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
 	   (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
@@ -333,8 +333,8 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
       (notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
     ;; The fcc-header is not a valid maildir see if the user wants to
     ;; fix it in some way.
-    (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or  (e)dit the header? "
-			   fcc-header))
+    (let* ((prompt (format "Fcc %s is not a maildir: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
 	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el
index 0164472f..c2242070 100644
--- a/emacs/notmuch-message.el
+++ b/emacs/notmuch-message.el
@@ -60,7 +60,8 @@ (defconst notmuch-message-queued-tag-changes nil
 be applied to the matching messages.")
 
 (defun notmuch-message-apply-queued-tag-changes ()
-  ;; Apply the tag changes queued in the buffer-local variable notmuch-message-queued-tag-changes.
+  ;; Apply the tag changes queued in the buffer-local variable
+  ;; notmuch-message-queued-tag-changes.
   (dolist (query-and-tags notmuch-message-queued-tag-changes)
     (notmuch-tag (car query-and-tags)
 		 (cdr query-and-tags))))
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 1efc88ea..74dfb384 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -205,10 +205,12 @@ (defun notmuch-mua-add-more-hidden-headers ()
 (defun notmuch-mua-reply-crypto (parts)
   "Add mml sign-encrypt flag if any part of original message is encrypted."
   (cl-loop for part in parts
-	   if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")
-	     do (mml-secure-message-sign-encrypt)
-	   else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
-	     do (notmuch-mua-reply-crypto (plist-get part :content))))
+	   if (notmuch-match-content-type (plist-get part :content-type)
+					  "multipart/encrypted")
+	   do (mml-secure-message-sign-encrypt)
+	   else if (notmuch-match-content-type (plist-get part :content-type)
+					       "multipart/*")
+	   do (notmuch-mua-reply-crypto (plist-get part :content))))
 
 ;; There is a bug in emacs 23's message.el that results in a newline
 ;; not being inserted after the References header, so the next header
@@ -250,8 +252,9 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
 
-	;; We modify message-header-format-alist to get around a bug in message.el.
-	;; See the comment above on notmuch-mua-insert-references.
+	;; We modify message-header-format-alist to get around
+	;; a bug in message.el.  See the comment above on
+	;; notmuch-mua-insert-references.
 	(let ((message-header-format-alist
 	       (cl-loop for pair in message-header-format-alist
 			if (eq (car pair) 'References)
@@ -266,7 +269,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the reply
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
@@ -293,27 +297,29 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
 
-	(insert (with-temp-buffer
-		  (let
-		      ;; Don't attempt to clean up messages, excerpt
-		      ;; citations, etc. in the original message before
-		      ;; quoting.
-		      ((notmuch-show-insert-text/plain-hook nil)
-		       ;; Don't omit long parts.
-		       (notmuch-show-max-text-part-size 0)
-		       ;; Insert headers for parts as appropriate for replying.
-		       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
-		       ;; Ensure that any encrypted parts are
-		       ;; decrypted during the generation of the reply
-		       ;; text.
-		       (notmuch-show-process-crypto process-crypto)
-		       ;; Don't indent multipart sub-parts.
-		       (notmuch-show-indent-multipart nil))
-		    ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
-		    (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
-			      ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
-		      (notmuch-show-insert-body original (plist-get original :body) 0)
-		      (buffer-substring-no-properties (point-min) (point-max))))))
+	(insert
+	 (with-temp-buffer
+	   (let
+	       ;; Don't attempt to clean up messages, excerpt
+	       ;; citations, etc. in the original message before
+	       ;; quoting.
+	       ((notmuch-show-insert-text/plain-hook nil)
+		;; Don't omit long parts.
+		(notmuch-show-max-text-part-size 0)
+		;; Insert headers for parts as appropriate for replying.
+		(notmuch-show-insert-header-p-function
+		 notmuch-mua-reply-insert-header-p-function)
+		;; Ensure that any encrypted parts are
+		;; decrypted during the generation of the reply
+		;; text.
+		(notmuch-show-process-crypto process-crypto)
+		;; Don't indent multipart sub-parts.
+		(notmuch-show-indent-multipart nil))
+	     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
+	     (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
+		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
+	       (notmuch-show-insert-body original (plist-get original :body) 0)
+	       (buffer-substring-no-properties (point-min) (point-max))))))
 
 	(set-mark (point))
 	(goto-char start)
@@ -383,10 +389,13 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
-		       (notmuch-user-name) (notmuch-user-primary-email))) other-headers))
+		       (notmuch-user-name)
+		       (notmuch-user-primary-email)))
+	  other-headers))
 
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
-			     (or switch-function (notmuch-mua-get-switch-function)))
+			     (or switch-function
+				 (notmuch-mua-get-switch-function)))
   (let ((headers
 	 (append
 	  ;; The following is copied from `message-mail'
@@ -499,7 +508,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		(with-current-buffer temp-buffer
 		  (erase-buffer)
 		  (let ((coding-system-for-read 'no-conversion))
-		    (call-process notmuch-command nil t nil "show" "--format=raw" id))
+		    (call-process notmuch-command nil t nil
+				  "show" "--format=raw" id))
 		  ;; Because we process the messages in reverse order,
 		  ;; always generate a forwarded subject, then use the
 		  ;; last (i.e. first) one.
@@ -524,7 +534,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
 
-      ;; Create a buffer-local queue for tag changes triggered when sending the message
+      ;; Create a buffer-local queue for tag changes triggered when
+      ;; sending the message.
       (when notmuch-message-forwarded-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (cl-loop for id in forward-queries
@@ -609,7 +620,8 @@ (defun notmuch-mua-send-common (arg &optional exit)
   (run-hooks 'notmuch-mua-send-hook)
   (when (and (notmuch-mua-check-no-misplaced-secure-tag)
 	     (notmuch-mua-check-secure-tag-has-newline))
-    (cl-letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
+    (cl-letf (((symbol-function 'message-do-fcc)
+	       #'notmuch-maildir-message-do-fcc))
       (if exit
 	  (message-send-and-exit arg)
 	(message-send arg)))))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c9170466..26b41603 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -51,7 +51,8 @@ (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))
 (declare-function notmuch-count-attachments "notmuch" (mm-handle))
 (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))
 (declare-function notmuch-tree "notmuch-tree"
-		  (&optional query query-context target buffer-name open-target unthreaded))
+		  (&optional query query-context target buffer-name
+			     open-target unthreaded))
 (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
 (declare-function notmuch-unthreaded
 		  (&optional query query-context target buffer-name open-target))
@@ -95,10 +96,11 @@ (defcustom notmuch-show-hook '(notmuch-show-turn-on-visual-line-mode)
   :group 'notmuch-show
   :group 'notmuch-hooks)
 
-(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines
-						 notmuch-wash-tidy-citations
-						 notmuch-wash-elide-blank-lines
-						 notmuch-wash-excerpt-citations)
+(defcustom notmuch-show-insert-text/plain-hook
+  '(notmuch-wash-wrap-long-lines
+    notmuch-wash-tidy-citations
+    notmuch-wash-elide-blank-lines
+    notmuch-wash-excerpt-citations)
   "Functions used to improve the display of text/plain parts."
   :type 'hook
   :options '(notmuch-wash-convert-inline-patch-to-part
@@ -348,7 +350,9 @@ (defun notmuch-show-with-message-as-text (fn)
     (with-temp-buffer
       (insert all)
       (if indenting
-	  (indent-rigidly (point-min) (point-max) (- (* notmuch-show-indent-messages-width depth))))
+	  (indent-rigidly (point-min)
+			  (point-max)
+			  (- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -395,7 +399,9 @@ (defun notmuch-show-update-tags (tags)
     (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
 	(let ((inhibit-read-only t))
 	  (replace-match (concat "("
-				 (notmuch-tag-format-tags tags (notmuch-show-get-prop :orig-tags))
+				 (notmuch-tag-format-tags
+				  tags
+				  (notmuch-show-get-prop :orig-tags))
 				 ")"))))))
 
 (defun notmuch-clean-address (address)
@@ -475,7 +481,8 @@ (defun notmuch-show-insert-headerline (headers date tags depth)
 	    ") ("
 	    (notmuch-tag-format-tags tags tags)
 	    ")\n")
-    (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
+    (overlay-put (make-overlay start (point))
+		 'face 'notmuch-message-summary-face)))
 
 (defun notmuch-show-insert-header (header header-value)
   "Insert a single header."
@@ -502,7 +509,8 @@ (define-button-type 'notmuch-show-part-button-type
   'face 'message-mml
   :supertype 'notmuch-button-type)
 
-(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)
+(defun notmuch-show-insert-part-header (nth content-type declared-type
+					    &optional name comment)
   (let ((button)
 	(base-label (concat (when name (concat name ": "))
 			    declared-type
@@ -526,8 +534,9 @@ (defun notmuch-show-toggle-part-invisibility (&optional button)
     (when button
       (let ((overlay (button-get button 'overlay))
 	    (lazy-part (button-get button :notmuch-lazy-part)))
-	;; We have a part to toggle if there is an overlay or if there is a lazy part.
-	;; If neither is present we cannot toggle the part so we just return nil.
+	;; We have a part to toggle if there is an overlay or if there
+	;; is a lazy part.  If neither is present we cannot toggle the
+	;; part so we just return nil.
 	(when (or overlay lazy-part)
 	  (let* ((show (button-get button :notmuch-part-hidden))
 		 (new-start (button-start button))
@@ -628,7 +637,8 @@ (defun notmuch-show-multipart/*-to-list (part)
 	  (plist-get part :content)))
 
 (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth button)
-  (let ((chosen-type (car (notmuch-multipart/alternative-choose msg (notmuch-show-multipart/*-to-list part))))
+  (let ((chosen-type (car (notmuch-multipart/alternative-choose
+			   msg (notmuch-show-multipart/*-to-list part))))
 	(inner-parts (plist-get part :content))
 	(start (point)))
     ;; This inserts all parts of the chosen type rather than just one,
@@ -764,7 +774,8 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 	      (unwind-protect
 		  (progn
 		    (unless (icalendar-import-buffer file t)
-		      (error "Icalendar import error. See *icalendar-errors* for more information"))
+		      (error "Icalendar import error. %s"
+			     "See *icalendar-errors* for more information"))
 		    (set-buffer (get-file-buffer file))
 		    (setq result (buffer-substring (point-min) (point-max)))
 		    (set-buffer-modified-p nil)
@@ -782,10 +793,13 @@ (if (version< emacs-version "25.3")
     ;;
     ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
     ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched (msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function enriched-decode-display-prop
-      ;; is defined before it will be shadowed by the letf below. Otherwise the version
-      ;; in enriched.el may be loaded a bit later and used instead (for the first time).
+    (defun notmuch-show-insert-part-text/enriched
+	(msg part content-type nth depth button)
+      ;; By requiring enriched below, we ensure that the function
+      ;; enriched-decode-display-prop is defined before it will be
+      ;; shadowed by the letf below. Otherwise the version in
+      ;; enriched.el may be loaded a bit later and used instead (for
+      ;; the first time).
       (require 'enriched)
       (cl-letf (((symbol-function 'enriched-decode-display-prop)
 		 (lambda (start end &optional param) (list start end))))
@@ -943,7 +957,9 @@ (defun notmuch-show-lazy-part (part-args button)
 	(narrow-to-region part-beg part-end)
 	(delete-region part-beg part-end)
 	(apply #'notmuch-show-insert-bodypart-internal part-args)
-	(indent-rigidly part-beg part-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly part-beg
+			part-end
+			(* notmuch-show-indent-messages-width depth)))
       (goto-char part-end)
       (delete-char 1)
       (notmuch-show-record-part-information (cadr part-args)
@@ -1001,12 +1017,14 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (nth (plist-get part :id))
 	 (long (and (notmuch-match-content-type mime-type "text/*")
 		    (> notmuch-show-max-text-part-size 0)
-		    (> (length (plist-get part :content)) notmuch-show-max-text-part-size)))
+		    (> (length (plist-get part :content))
+		       notmuch-show-max-text-part-size)))
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
 	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type (plist-get part :filename))))
+		   (notmuch-show-insert-part-header nth mime-type content-type
+						    (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1104,13 +1122,17 @@ (defun notmuch-show-insert-msg (msg depth)
 
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
-	(indent-rigidly content-start content-end (* notmuch-show-indent-messages-width depth)))
+	(indent-rigidly content-start
+			content-end
+			(* notmuch-show-indent-messages-width depth)))
 
     (setq message-end (point-max-marker))
 
     ;; Save the extents of this message over the whole text of the
     ;; message.
-    (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
+    (put-text-property message-start message-end
+		       :notmuch-message-extent
+		       (cons message-start message-end))
 
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
@@ -1144,7 +1166,8 @@ (defun notmuch-show-toggle-process-crypto ()
 (defun notmuch-show-toggle-elide-non-matching ()
   "Toggle the display of non-matching messages."
   (interactive)
-  (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))
+  (setq notmuch-show-elide-non-matching-messages
+	(not notmuch-show-elide-non-matching-messages))
   (message (if notmuch-show-elide-non-matching-messages
 	       "Showing matching messages only."
 	     "Showing all messages."))
@@ -1411,8 +1434,9 @@ (defun notmuch-show-apply-state (state)
 
     ;; Open those that were open.
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (member (notmuch-show-get-message-id) open))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
 
     (dolist (win-msg-pair win-msg-alist)
@@ -1645,7 +1669,8 @@ (defun notmuch-show-headers-visible (props visible-p)
 (defun notmuch-show-set-message-properties (props)
   (save-excursion
     (notmuch-show-move-to-message-top)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point) (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-show-get-message-properties ()
   "Return the properties of the current message as a plist.
@@ -1798,8 +1823,9 @@ (defun notmuch-show-command-hook ()
 	   (setq notmuch-show--seen-has-errored 't)
 	   (setq header-line-format
 		 (concat header-line-format
-			 (propertize "  [some mark read tag changes may have failed]"
-				     'face font-lock-warning-face)))))))))
+			 (propertize
+			  "  [some mark read tag changes may have failed]"
+			  'face font-lock-warning-face)))))))))
 
 (defun notmuch-show-filter-thread (query)
   "Filter or LIMIT the current thread based on a new query string.
@@ -1821,7 +1847,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
       (goto-char (point-min))
       (while (not done)
 	(if (notmuch-show-message-visible-p)
-	    (setq message-ids (append message-ids (list (notmuch-show-get-message-id)))))
+	    (setq message-ids
+		  (append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next)))
 	)
       message-ids
@@ -1885,7 +1912,8 @@ (defun notmuch-show-advance-and-archive ()
       (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
-  "Backup through the thread (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
+  "Backup through the thread (reverse scrolling compared to \
+\\[notmuch-show-advance-and-archive]).
 
 Specifically, if the beginning of the previous email is fewer
 than `window-height' lines from the current point, move to it
@@ -2077,11 +2105,14 @@ (defun notmuch-show-pipe-message (entire-thread command)
 	(setq shell-command
 	      (concat notmuch-command " show --format=mbox --exclude=false "
 		      (shell-quote-argument
-		       (mapconcat 'identity (notmuch-show-get-message-ids-for-open-messages) " OR "))
+		       (mapconcat 'identity
+				  (notmuch-show-get-message-ids-for-open-messages)
+				  " OR "))
 		      " | " command))
       (setq shell-command
 	    (concat notmuch-command " show --format=raw "
-		    (shell-quote-argument (notmuch-show-get-message-id)) " | " command)))
+		    (shell-quote-argument (notmuch-show-get-message-id))
+		    " | " command)))
     (let ((cwd default-directory)
 	  (buf (get-buffer-create (concat "*notmuch-pipe*"))))
       (with-current-buffer buf
@@ -2182,8 +2213,9 @@ (defun notmuch-show-open-or-close-all ()
   (interactive)
   (save-excursion
     (goto-char (point-min))
-    (cl-loop do (notmuch-show-message-visible (notmuch-show-get-message-properties)
-					      (not current-prefix-arg))
+    (cl-loop do (notmuch-show-message-visible
+		 (notmuch-show-get-message-properties)
+		 (not current-prefix-arg))
 	     until (not (notmuch-show-goto-message-next))))
   (force-window-update))
 
@@ -2515,7 +2547,8 @@ (defun notmuch-show-choose-mime-of-part (mime-type)
   (interactive
    (list (completing-read "Mime type to use (default text/plain): "
 			  (mailcap-mime-types) nil nil nil nil "text/plain")))
-  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part mime-type))
+  (notmuch-show-apply-to-current-part-handle #'notmuch-show--mm-display-part
+					     mime-type))
 
 (defun notmuch-show-imenu-prev-index-position-function ()
   "Move point to previous message in notmuch-show buffer.
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index c54e6ad0..34cd493a 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -44,7 +44,9 @@ (define-widget 'notmuch-tag-key-type 'list
   :args '((list :inline t
 		:format "%v"
 		(key-sequence :tag "Key")
-		(radio :tag "Tag operations" (repeat :tag "Tag list" (string :format "%v" :tag "change"))
+		(radio :tag "Tag operations"
+		       (repeat :tag "Tag list"
+			       (string :format "%v" :tag "change"))
 		       (variable :tag "Tag variable"))
 		(string :tag "Name"))))
 
@@ -316,7 +318,9 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 `notmuch-tag-formats'."
   (let* ((tag-state (cond ((not (member tag tags)) 'deleted)
 			  ((not (member tag orig-tags)) 'added)))
-	 (formatted-tag (gethash (cons tag tag-state) notmuch-tag--format-cache 'missing)))
+	 (formatted-tag (gethash (cons tag tag-state)
+				 notmuch-tag--format-cache
+				 'missing)))
     (when (eq formatted-tag 'missing)
       (let ((base (notmuch-tag--get-formats tag notmuch-tag-formats))
 	    (over (cl-case tag-state
@@ -338,9 +342,9 @@ (defun notmuch-tag-format-tags (tags orig-tags &optional face)
     (notmuch-apply-face
      (mapconcat #'identity
 		;; nil indicated that the tag was deliberately hidden
-		(delq nil (mapcar
-			   (apply-partially #'notmuch-tag-format-tag tags orig-tags)
-			   all-tags))
+		(delq nil (mapcar (apply-partially #'notmuch-tag-format-tag
+						   tags orig-tags)
+				  all-tags))
 		" ")
      face
      t)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index ab90f652..fcfb972d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -34,7 +34,8 @@ (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
 
-(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line))
+(declare-function notmuch-search "notmuch"
+		  (&optional query oldest-first target-thread target-line))
 (declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
 (declare-function notmuch-read-query "notmuch" (prompt))
 (declare-function notmuch-search-find-thread-id "notmuch" (&optional bare))
@@ -284,15 +285,18 @@ (defvar notmuch-tree-mode-map
     (set-keymap-parent map notmuch-common-keymap)
     ;; The following override the global keymap.
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-help] (notmuch-tree-close-message-pane-and #'notmuch-help))
+    (define-key map [remap notmuch-help]
+      (notmuch-tree-close-message-pane-and #'notmuch-help))
     ;; Override because we first close message pane and then close tree buffer.
     (define-key map [remap notmuch-bury-or-kill-this-buffer] 'notmuch-tree-quit)
     ;; Override because we close message pane after the search query is entered.
     (define-key map [remap notmuch-search] 'notmuch-tree-to-search)
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
+    (define-key map [remap notmuch-mua-new-mail]
+      (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail))
     ;; Override because we want to close message pane first.
-    (define-key map [remap notmuch-jump-search] (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
+    (define-key map [remap notmuch-jump-search]
+      (notmuch-tree-close-message-pane-and #'notmuch-jump-search))
 
     (define-key map "S" 'notmuch-search-from-tree-current-query)
     (define-key map "U" 'notmuch-unthreaded-from-tree-current-query)
@@ -306,16 +310,24 @@ (defvar notmuch-tree-mode-map
     (define-key map "b" 'notmuch-show-resend-message)
 
     ;; these apply to the message pane
-    (define-key map (kbd "M-TAB") (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "<backtab>")  (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
-    (define-key map (kbd "TAB") (notmuch-tree-to-message-pane #'notmuch-show-next-button))
-    (define-key map "$" (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
+    (define-key map (kbd "M-TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "<backtab>")
+      (notmuch-tree-to-message-pane #'notmuch-show-previous-button))
+    (define-key map (kbd "TAB")
+      (notmuch-tree-to-message-pane #'notmuch-show-next-button))
+    (define-key map "$"
+      (notmuch-tree-to-message-pane #'notmuch-show-toggle-process-crypto))
 
     ;; bindings from show (or elsewhere) but we close the message pane first.
-    (define-key map "f" (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
-    (define-key map "r" (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
-    (define-key map "R" (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
-    (define-key map "V" (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
+    (define-key map "f"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-forward-message))
+    (define-key map "r"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply-sender))
+    (define-key map "R"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-reply))
+    (define-key map "V"
+      (notmuch-tree-close-message-pane-and #'notmuch-show-view-raw-message))
 
     ;; The main tree view bindings
     (define-key map (kbd "RET") 'notmuch-tree-show-message)
@@ -354,7 +366,9 @@ (defun notmuch-tree-get-message-properties ()
 (defun notmuch-tree-set-message-properties (props)
   (save-excursion
     (beginning-of-line)
-    (put-text-property (point) (+ (point) 1) :notmuch-message-properties props)))
+    (put-text-property (point)
+		       (+ (point) 1)
+		       :notmuch-message-properties props)))
 
 (defun notmuch-tree-set-prop (prop val &optional props)
   (let ((inhibit-read-only t)
@@ -407,7 +421,8 @@ (defun notmuch-tree-refresh-result ()
     ;; from overwriting the buffer local copy of
     ;; notmuch-tree-previous-subject if this is called while the
     ;; buffer is displaying.
-    (let ((notmuch-tree-previous-subject (notmuch-tree-get-prop :previous-subject)))
+    (let ((notmuch-tree-previous-subject
+	   (notmuch-tree-get-prop :previous-subject)))
       (delete-region (point) (1+ (line-end-position)))
       (notmuch-tree-insert-msg msg))
     (let ((new-end (line-end-position)))
@@ -596,7 +611,8 @@ (defun notmuch-tree-close-message-window ()
   "Close the message-window. Return t if close succeeds."
   (interactive)
   (when (and (window-live-p notmuch-tree-message-window)
-	     (eq (window-buffer notmuch-tree-message-window) notmuch-tree-message-buffer))
+	     (eq (window-buffer notmuch-tree-message-window)
+		 notmuch-tree-message-buffer))
     (delete-window notmuch-tree-message-window)
     (unless (get-buffer-window-list notmuch-tree-message-buffer)
       (kill-buffer notmuch-tree-message-buffer))
@@ -611,7 +627,8 @@ (defun notmuch-tree-archive-message (&optional unarchive)
 `notmuch-archive-tags' will be reversed."
   (interactive "P")
   (when notmuch-archive-tags
-    (notmuch-tree-tag (notmuch-tag-change-list notmuch-archive-tags unarchive))))
+    (notmuch-tree-tag
+     (notmuch-tag-change-list notmuch-archive-tags unarchive))))
 
 (defun notmuch-tree-archive-message-then-next (&optional unarchive)
   "Archive the current message and move to next matching message."
@@ -786,7 +803,8 @@ (defun notmuch-tree-format-field (field format-string msg)
       (let ((face (if match
 		      'notmuch-tree-match-date-face
 		    'notmuch-tree-no-match-date-face)))
-	(propertize (format format-string (plist-get msg :date_relative)) 'face face)))
+	(propertize (format format-string (plist-get msg :date_relative))
+		    'face face)))
 
      ((string-equal field "tree")
       (let ((tree-status (plist-get msg :tree-status))
@@ -880,7 +898,8 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
        ((and (< 0 depth) last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) first last)
-;;	  (push "─" tree-status)) choice between this and next line is matter of taste.
+	;; Choice between these two variants is a matter of taste.
+	;; (push "─" tree-status))
 	(push " " tree-status))
        ((and (eq 0 depth) first (not last))
 	  (push "┬" tree-status))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index fd0314cc..3a9ffdd0 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -25,7 +25,9 @@
 
 (require 'coolj)
 (require 'notmuch-lib)
-(declare-function notmuch-show-insert-bodypart "notmuch-show" (msg part depth &optional hide))
+
+(declare-function notmuch-show-insert-bodypart "notmuch-show"
+		  (msg part depth &optional hide))
 (defvar notmuch-show-indent-messages-width)
 
 ;;
@@ -186,9 +188,12 @@ (defun notmuch-wash-button-label (overlay)
   (let* ((type (overlay-get overlay 'type))
 	 (invis-spec (overlay-get overlay 'invisible))
 	 (state (if (invisible-p invis-spec) "hidden" "visible"))
-	 (label-format (symbol-value (intern-soft (concat "notmuch-wash-button-"
-							  type "-" state "-format"))))
-	 (lines-count (count-lines (overlay-start overlay) (overlay-end overlay))))
+	 (label-format (symbol-value
+			(intern-soft
+			 (format "notmuch-wash-button-%s-%s-format"
+				 type state))))
+	 (lines-count (count-lines (overlay-start overlay)
+				   (overlay-end overlay))))
     (format label-format lines-count)))
 
 (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
@@ -238,7 +243,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
     (let* ((cite-start (match-beginning 0))
 	   (cite-end (match-end 0))
 	   (cite-lines (count-lines cite-start cite-end)))
-      (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
+      (overlay-put (make-overlay cite-start cite-end)
+		   'face 'notmuch-wash-cited-text)
       (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
 			     notmuch-wash-citation-lines-suffix
 			     1))
@@ -260,7 +266,8 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 		  (sig-end-marker (make-marker)))
 	      (set-marker sig-start-marker sig-start)
 	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text)
+	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
+			   'face 'message-cited-text)
 	      (notmuch-wash-region-to-button
 	       msg sig-start-marker sig-end-marker
 	       "signature"))))))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index c97997fe..07a58da7 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -516,7 +516,9 @@ (defun notmuch-search-show-thread (&optional elide-toggle)
 		      (current-buffer)
 		      notmuch-search-query-string
 		      ;; Name the buffer based on the subject.
-		      (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
+		      (concat "*"
+			      (truncate-string-to-width subject 30 nil nil t)
+			      "*"))
       (message "End of search results."))))
 
 (defun notmuch-tree-from-search-current-query ()
@@ -800,7 +802,9 @@ (defun notmuch-search-insert-authors (format-string authors)
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-	(setq visible-string (propertize visible-string 'help-echo (concat "..." invisible-string))))
+	(setq visible-string
+	      (propertize visible-string
+			  'help-echo (concat "..." invisible-string))))
 
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
@@ -892,7 +896,8 @@ (defun notmuch-search-buffer-title (query)
 		(longest-length 0))
 	    (cl-loop for tuple in notmuch-saved-searches
 		     if (let ((quoted-query
-			       (regexp-quote (notmuch-saved-search-get tuple :query))))
+			       (regexp-quote
+				(notmuch-saved-search-get tuple :query))))
 			  (and (string-match (concat "^" quoted-query) query)
 			       (> (length (match-string 0 query))
 				  longest-length)))
@@ -905,9 +910,10 @@ (defun notmuch-search-buffer-title (query)
 	   (concat "*notmuch-saved-search-" saved-search-name "*"))
 	  (saved-search
 	   (concat "*notmuch-search-"
-		   (replace-regexp-in-string (concat "^" (regexp-quote saved-search-query))
-					     (concat "[ " saved-search-name " ]")
-					     query)
+		   (replace-regexp-in-string
+		    (concat "^" (regexp-quote saved-search-query))
+		    (concat "[ " saved-search-name " ]")
+		    query)
 		   "*"))
 	  (t
 	   (concat "*notmuch-search-" query "*"))
@@ -926,7 +932,8 @@ (defun notmuch-read-query (prompt)
 		       "subject:" "attachment:")
 		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
 		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
+		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			 (mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
@@ -1078,8 +1085,10 @@ (defun notmuch-search-filter-by-tag (tag)
 Runs a new search matching only messages that match both the
 current search results AND that are tagged with the given tag."
   (interactive
-   (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
-  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
+   (list (notmuch-select-tag-with-completion "Filter by tag: "
+					     notmuch-search-query-string)))
+  (notmuch-search (concat notmuch-search-query-string " and tag:" tag)
+		  notmuch-search-oldest-first))
 
 (defun notmuch-search-by-tag (tag)
   "Display threads matching TAG in a notmuch-search buffer."
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2225aefc..2af91186 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -63,7 +63,8 @@ (defun rstdoc-extract (in-file out-file)
 
 (defun rstdoc--insert-docstring (symbol docstring)
   (insert (format "\n.. |docstring::%s| replace::\n" symbol))
-  (insert (replace-regexp-in-string "^" "    " (rstdoc--rst-quote-string docstring)))
+  (insert (replace-regexp-in-string "^" "    "
+				    (rstdoc--rst-quote-string docstring)))
   (insert "\n"))
 
 (defvar rst--escape-alist
-- 
2.28.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 02/34] emacs: Remove excess empty lines
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 01/34] emacs: Shorten long lines Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 03/34] emacs: Fix indentation Jonas Bernoulli
                     ` (33 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Most people who write lots of lisp tend to only sparsely use empty
"separator" lines within forms.  In lisp they feel unnecessary and
since most files stick to this convention we get a bit confused
when there are extra empty lines.  It feels like the s-expressions
are falling into pieces.

All of this is especially true between a function's doc-string and
body because the doc-string is colored differently, which visually
already separates it quite sufficiently from the code that follows.
---
 emacs/make-deps.el           |  2 -
 emacs/notmuch-address.el     |  2 -
 emacs/notmuch-crypto.el      |  4 --
 emacs/notmuch-hello.el       | 18 ---------
 emacs/notmuch-jump.el        |  5 ---
 emacs/notmuch-lib.el         | 10 -----
 emacs/notmuch-maildir-fcc.el |  7 ----
 emacs/notmuch-mua.el         | 26 -------------
 emacs/notmuch-parser.el      |  5 ---
 emacs/notmuch-show.el        | 75 ++----------------------------------
 emacs/notmuch-tag.el         |  3 --
 emacs/notmuch-tree.el        |  9 -----
 emacs/notmuch-wash.el        | 18 +--------
 emacs/notmuch.el             |  7 ----
 14 files changed, 5 insertions(+), 186 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index 5b6db698..dcac319c 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -23,7 +23,6 @@
 
 (defun batch-make-deps ()
   "Invoke `make-deps' for each file on the command line."
-
   (setq debug-on-error t)
   (dolist (file command-line-args-left)
     (let ((default-directory command-line-default-directory))
@@ -37,7 +36,6 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-
   (setq dir (or dir default-directory))
   (save-excursion
     (goto-char (point-min))
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2a9c411a..ca4da3f3 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -302,7 +302,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 Address harvesting may take some time so the address collection runs
 asynchronously unless SYNCHRONOUS is t. In case of asynchronous
 execution, CALLBACK is called when harvesting finishes."
-
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
 	 (prefix-query (when addr-prefix
@@ -335,7 +334,6 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 	;; Kill any existing process
 	(when current-proc
 	  (kill-buffer (process-buffer current-proc))) ; this also kills the process
-
 	(setq current-proc
 	      (apply 'notmuch-start-notmuch proc-name proc-buf
 		     callback				; process sentinel
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 2327ff1f..58947a20 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -123,17 +123,14 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 		face 'notmuch-crypto-signature-good-key))
 	(setq button-action 'notmuch-crypto-sigstatus-good-callback
 	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
-
      ((string= status "error")
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
 	    button-action 'notmuch-crypto-sigstatus-error-callback
 	    help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
-
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")")
 	    face 'notmuch-crypto-signature-bad))
-
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
@@ -232,7 +229,6 @@ (defun notmuch-crypto-sigstatus-error-callback (button)
 	    (process-put p :notmuch-show-buffer (current-buffer))
 	    (process-put p :notmuch-show-point (point))
 	    (message "Getting the GPG key %s asynchronously..." keyid)))
-
       (let ((window (display-buffer buffer)))
 	(with-selected-window window
 	  (with-current-buffer buffer
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 11c625ea..e71e55f3 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -150,7 +150,6 @@ (defcustom notmuch-saved-searches
 ;; The saved-search format is also used by the all-tags notmuch-hello
 ;; section. This section generates its own saved-search list in one of
 ;; the latter two forms.
-
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -482,20 +481,17 @@ (defun notmuch-hello-tags-per-line (widest)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 (max notmuch-column-control widest)))))
-
 	  ((floatp notmuch-column-control)
 	   (let* ((available-width (- (window-width) notmuch-hello-indent))
 		  (proposed-width (max (* available-width notmuch-column-control)
 				       widest)))
 	     (floor available-width proposed-width)))
-
 	  (t
 	   (max 1
 		(/ (- (window-width) notmuch-hello-indent)
 		   ;; Count is 9 wide (8 digits plus space), 1 for the space
 		   ;; after the name.
 		   (+ 9 1 widest)))))))
-
     (cons tags-per-line (/ (max 1
 				(- (window-width) notmuch-hello-indent
 				   ;; Count is 9 wide (8 digits plus
@@ -545,7 +541,6 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
 	  "\n")))
-
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -553,9 +548,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
        "Please check that the notmuch CLI is new enough to support `count
 --batch'. In general we recommend running matching versions of
 the CLI and emacs interface."))
-
     (goto-char (point-min))
-
     (notmuch-remove-if-not
      #'identity
      (mapcar
@@ -621,7 +614,6 @@ (defun notmuch-hello-insert-buttons (searches)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
 	  reordered-list)
-
     ;; If the last line was not full (and hence did not include a
     ;; carriage return), insert one now.
     (unless (eq (% count tags-per-line) 0)
@@ -780,7 +772,6 @@ (defun notmuch-hello-insert-header ()
 		     (car (process-lines notmuch-command "count")))))
     (widget-insert " messages.\n")))
 
-
 (defun notmuch-hello-insert-saved-searches ()
   "Insert the saved-searches section."
   (let ((searches (notmuch-hello-query-counts
@@ -977,7 +968,6 @@ (defun notmuch-hello-insert-footer ()
 (defun notmuch-hello (&optional no-display)
   "Run notmuch and display saved searches, known tags, etc."
   (interactive)
-
   (notmuch-assert-cli-sane)
   ;; This may cause a window configuration change, so if the
   ;; auto-refresh hook is already installed, avoid recursive refresh.
@@ -985,32 +975,25 @@ (defun notmuch-hello (&optional no-display)
     (if no-display
 	(set-buffer "*notmuch-hello*")
       (switch-to-buffer "*notmuch-hello*")))
-
   ;; Install auto-refresh hook
   (when notmuch-hello-auto-refresh
     (add-hook 'window-configuration-change-hook
 	      #'notmuch-hello-window-configuration-change))
-
   (let ((target-line (line-number-at-pos))
 	(target-column (current-column))
 	(inhibit-read-only t))
-
     ;; Delete all editable widget fields.  Editable widget fields are
     ;; tracked in a buffer local variable `widget-field-list' (and
     ;; others).  If we do `erase-buffer' without properly deleting the
     ;; widgets, some widget-related functions are confused later.
     (mapc 'widget-delete widget-field-list)
-
     (erase-buffer)
-
     (unless (eq major-mode 'notmuch-hello-mode)
       (notmuch-hello-mode))
-
     (let ((all (overlay-lists)))
       ;; Delete all the overlays.
       (mapc 'delete-overlay (car all))
       (mapc 'delete-overlay (cdr all)))
-
     (mapc
      (lambda (section)
        (let ((point-before (point)))
@@ -1023,7 +1006,6 @@ (defun notmuch-hello (&optional no-display)
 	   (widget-insert "\n"))))
      notmuch-hello-sections)
     (widget-setup)
-
     ;; Move point back to where it was before refresh. Use line and
     ;; column instead of point directly to be insensitive to additions
     ;; and removals of text within earlier lines.
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index 6d8cd97f..adf79650 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -43,7 +43,6 @@ (defun notmuch-jump-search ()
 Typically these shortcuts are a single key long, so this is a
 fast way to jump to a saved search from anywhere in Notmuch."
   (interactive)
-
   ;; Build the action map
   (let (action-map)
     (dolist (saved-search notmuch-saved-searches)
@@ -67,7 +66,6 @@ (defun notmuch-jump-search ()
 			  `(lambda () (notmuch-search ',query ',oldest-first)))))
 		  action-map)))))
     (setq action-map (nreverse action-map))
-
     (if action-map
 	(notmuch-jump action-map "Search: ")
       (error "To use notmuch-jump, \
@@ -90,7 +88,6 @@ (defun notmuch-jump (action-map prompt)
 the buffer, and ACTION is a nullary function to call.  LABEL may
 be null, in which case the action will still be bound, but will
 not appear in the pop-up buffer."
-
   (let* ((items (notmuch-jump--format-actions action-map))
 	 ;; Format the table of bindings and the full prompt
 	 (table
@@ -115,7 +112,6 @@ (defun notmuch-jump (action-map prompt)
 	 (notmuch-jump--action nil))
     ;; Read the action
     (read-from-minibuffer full-prompt nil minibuffer-map)
-
     ;; If we got an action, do it
     (when notmuch-jump--action
       (funcall notmuch-jump--action))))
@@ -126,7 +122,6 @@ (defun notmuch-jump--format-actions (action-map)
 Returns a list of strings, one for each item with a label in
 ACTION-MAP.  These strings can be inserted into a tabular
 buffer."
-
   ;; Compute the maximum key description width
   (let ((key-width 1))
     (pcase-dolist (`(,key ,desc) action-map)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 9339f9d0..615207ed 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -418,7 +418,6 @@ (defun notmuch-subkeymap-help ()
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
-
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
@@ -486,7 +485,6 @@ (defun notmuch-escape-boolean-term (term)
 The caller is responsible for prepending the term prefix and a
 colon.  This performs minimal escaping in order to produce
 user-friendly queries."
-
   (save-match-data
     (if (or (equal term "")
 	    ;; To be pessimistic, only pass through terms composed
@@ -731,7 +729,6 @@ (defun notmuch-apply-face (object face &optional below start end)
 attributes, or a list of these.  If START and/or END are omitted,
 they default to the beginning/end of OBJECT.  For convenience
 when applied to strings, this returns OBJECT."
-
   ;; A face property can have three forms: a face name (a string or
   ;; symbol), a property list, or a list of these two forms.  In the
   ;; list case, the faces will be combined, with the earlier faces
@@ -774,7 +771,6 @@ (defun notmuch-logged-error (msg &optional extra)
 signals MSG as an error.  If EXTRA is non-nil, text referring the
 user to the *Notmuch errors* buffer will be appended to the
 signaled error.  This function does not return."
-
   (with-current-buffer (get-buffer-create "*Notmuch errors*")
     (goto-char (point-max))
     (unless (bobp)
@@ -819,7 +815,6 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 giving the output of command.  ERR, if provided, is the error
 output of command.  OUTPUT and ERR will be included in the error
 message."
-
   (cond
    ((eq exit-status 0) t)
    ((eq exit-status 20)
@@ -865,7 +860,6 @@ (defun notmuch-call-notmuch--helper (destination args)
 This wraps `call-process'.  DESTINATION has the same meaning as
 for `call-process'.  ARGS is as described for
 `notmuch-call-notmuch-process'."
-
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
@@ -903,7 +897,6 @@ (defun notmuch-call-notmuch-sexp (&rest args)
 Like `notmuch-call-notmuch-process', if notmuch exits with a
 non-zero status, this will report its output and signal an
 error."
-
   (with-temp-buffer
     (let ((err-file (make-temp-file "nmerr")))
       (unwind-protect
@@ -931,7 +924,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 invoke `set-process-sentinel' directly on the returned process,
 as that will interfere with the handling of stderr and the exit
 status."
-
   (let (err-file err-buffer proc err-proc
 	;; Find notmuch using Emacs' `exec-path'
 	(command (or (executable-find notmuch-command)
@@ -956,7 +948,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 	  (process-put err-proc 'err-file err-file)
 	  (process-put err-proc 'err-buffer err-buffer)
 	  (set-process-sentinel err-proc #'notmuch-start-notmuch-error-sentinel))
-
       ;; On Emacs versions before 25, there is no way to capture
       ;; stdout and stderr separately for asynchronous processes, or
       ;; even to redirect stderr to a file, so we use a trivial shell
@@ -969,7 +960,6 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 			  "exec 2>\"$1\"; shift; exec \"$0\" \"$@\""
 			  command err-file args)))
       (process-put proc 'err-file err-file))
-
     (process-put proc 'sub-sentinel sentinel)
     (process-put proc 'real-command (cons notmuch-command args))
     (set-process-sentinel proc #'notmuch-start-notmuch-sentinel)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 4b10a731..66f32fd4 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -94,22 +94,18 @@ (defun notmuch-fcc-header-setup ()
 
 Originally intended to be use a hook function, but now called directly
 by notmuch-mua-mail."
-
   (let ((subdir
 	 (cond
 	  ((or (not notmuch-fcc-dirs)
 	       (message-field-value "Fcc"))
 	   ;; Nothing set or an existing header.
 	   nil)
-
 	  ((stringp notmuch-fcc-dirs)
 	   notmuch-fcc-dirs)
-
 	  ((and (listp notmuch-fcc-dirs)
 		(stringp (car notmuch-fcc-dirs)))
 	   ;; Old style - no longer works.
 	   (error "Invalid `notmuch-fcc-dirs' setting (old style)"))
-
 	  ((listp notmuch-fcc-dirs)
 	   (let* ((from (message-field-value "From"))
 		  (match
@@ -121,10 +117,8 @@ (defun notmuch-fcc-header-setup ()
 		 (cdr match)
 	       (message "No Fcc header added.")
 	       nil)))
-
 	  (t
 	   (error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
-
     (when subdir
       (if notmuch-maildir-use-notmuch-insert
 	  (notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
@@ -133,7 +127,6 @@ (defun notmuch-fcc-header-setup ()
 (defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
   ;; Notmuch insert does not accept absolute paths, so check the user
   ;; really want this header inserted.
-
   (when (or (not (= (elt subdir 0) ?/))
 	    (y-or-n-p
 	     (format "Fcc header %s is an absolute path and notmuch insert is requested.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 74dfb384..3bc06b4b 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -228,22 +228,17 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	original)
     (when process-crypto
       (setq args (append args '("--decrypt=true"))))
-
     (if reply-all
 	(setq args (append args '("--reply-to=all")))
       (setq args (append args '("--reply-to=sender"))))
     (setq args (append args (list query-string)))
-
     ;; Get the reply object as SEXP, and parse it into an elisp object.
     (setq reply (apply #'notmuch-call-notmuch-sexp args))
-
     ;; Extract the original message to simplify the following code.
     (setq original (plist-get reply :original))
-
     ;; Extract the headers of both the reply and the original message.
     (let* ((original-headers (plist-get original :headers))
 	   (reply-headers (plist-get reply :reply-headers)))
-
       ;; If sender is non-nil, set the From: header to its value.
       (when sender
 	(plist-put reply-headers :From sender))
@@ -251,7 +246,6 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	  ;; Overlay the composition window on that being used to read
 	  ;; the original message.
 	  ((same-window-regexps '("\\*mail .*")))
-
 	;; We modify message-header-format-alist to get around
 	;; a bug in message.el.  See the comment above on
 	;; notmuch-mua-insert-references.
@@ -268,13 +262,11 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 			    (notmuch-sanitize (plist-get reply-headers :Subject))
 			    (notmuch-headers-plist-to-alist reply-headers)
 			    nil (notmuch-mua-get-switch-function))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the reply.
       (when notmuch-message-replied-tags
 	(setq-local notmuch-message-queued-tag-changes
 		    (list (cons query-string notmuch-message-replied-tags))))
-
       ;; Insert the message body - but put it in front of the signature
       ;; if one is present, and after any other content
       ;; message*setup-hooks may have added to the message body already.
@@ -286,17 +278,14 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	    (if message-signature-insert-empty-line
 		(forward-line -1))
 	  (goto-char (point-max))))
-
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
 	    (start (point)))
-
 	;; notmuch-mua-cite-function constructs a citation line based
 	;; on the From and Date headers of the original message, which
 	;; are assumed to be in the buffer.
 	(insert "From: " from "\n")
 	(insert "Date: " date "\n\n")
-
 	(insert
 	 (with-temp-buffer
 	   (let
@@ -320,22 +309,18 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 		       ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
 	       (notmuch-show-insert-body original (plist-get original :body) 0)
 	       (buffer-substring-no-properties (point-min) (point-max))))))
-
 	(set-mark (point))
 	(goto-char start)
 	;; Quote the original message according to the user's configured style.
 	(funcall notmuch-mua-cite-function)))
-
     ;; Crypto processing based crypto content of the original message
     (when process-crypto
       (notmuch-mua-reply-crypto (plist-get original :body))))
-
   ;; Push mark right before signature, if any.
   (message-goto-signature)
   (unless (eobp)
     (end-of-line -1))
   (push-mark)
-
   (message-goto-body)
   (set-buffer-modified-p nil))
 
@@ -381,18 +366,15 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 				   return-action &rest ignored)
   "Invoke the notmuch mail composition window."
   (interactive)
-
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
       (when (not (string= "" user-agent))
 	(push (cons 'User-Agent user-agent) other-headers))))
-
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
 		       (notmuch-user-name)
 		       (notmuch-user-primary-email)))
 	  other-headers))
-
   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
 			     (or switch-function
 				 (notmuch-mua-get-switch-function)))
@@ -422,7 +404,6 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (message-hide-headers)
   (set-buffer-modified-p nil)
   (notmuch-mua-maybe-set-window-dedicated)
-
   (message-goto-to))
 
 (defcustom notmuch-identities nil
@@ -495,10 +476,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 			  ;; applied later.
 	 forward-references ;; List of accumulated message-references of forwarded messages
 	 forward-queries) ;; List of corresponding message-query
-
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
-
     (save-excursion
       ;; Insert all of the forwarded messages.
       (mapc (lambda (id)
@@ -524,7 +503,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	    ;; `message-forward-make-body' always puts the message at
 	    ;; the top, so do them in reverse order.
 	    (reverse messages))
-
       ;; Add in the appropriate subject.
       (save-restriction
 	(message-narrow-to-headers)
@@ -533,7 +511,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 	(message-remove-header "References")
 	(message-add-header (concat "References: "
 				    (mapconcat 'identity forward-references " "))))
-
       ;; Create a buffer-local queue for tag changes triggered when
       ;; sending the message.
       (when notmuch-message-forwarded-tags
@@ -541,7 +518,6 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 		    (cl-loop for id in forward-queries
 			     collect
 			     (cons id notmuch-message-forwarded-tags))))
-
       ;; `message-forward-make-body' shows the User-agent header.  Hide
       ;; it again.
       (message-hide-headers)
@@ -553,7 +529,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-
 ;; In current emacs (24.3) select-active-regions is set to t by
 ;; default. The reply insertion code sets the region to the quoted
 ;; message to make it easy to delete (kill-region or C-w). These two
@@ -565,7 +540,6 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 ;; primary selection was previously in a non-emacs window but not if
 ;; it was in an emacs window. To avoid the problem in the latter case
 ;; we deactivate mark.
-
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index dc9fbe2f..06e7487b 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -38,7 +38,6 @@ (defun notmuch-sexp-create-parser ()
 The parser always consumes input from point in the current
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
-
   (vector 'notmuch-sexp-parser
 	  ;; List depth
 	  0
@@ -60,7 +59,6 @@ (defun notmuch-sexp-read (sp)
 list, this moves point just past the terminator and returns 'end.
 Otherwise, this moves point to just past the end of the value and
 returns the value."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\))
@@ -134,7 +132,6 @@ (defun notmuch-sexp-begin-list (sp)
 returns t.  Later calls to `notmuch-sexp-read' will return the
 elements inside the list.  If the input in buffer is not the
 beginning of a list, throw invalid-read-syntax."
-
   (skip-chars-forward " \n\r\t")
   (cond ((eobp) 'retry)
 	((= (char-after) ?\()
@@ -151,7 +148,6 @@ (defun notmuch-sexp-eof (sp)
 
 Moves point to the beginning of any trailing data or to the end
 of the buffer if there is only trailing whitespace."
-
   (skip-chars-forward " \n\r\t")
   (unless (eobp)
     (error "Trailing garbage following expression")))
@@ -173,7 +169,6 @@ (defun notmuch-sexp-parse-partial-list (result-function result-buffer)
 be called whenever the input buffer has been extended with
 additional data.  The caller just needs to ensure it does not
 move point in the input buffer."
-
   ;; Set up the initial state
   (unless (local-variable-p 'notmuch-sexp--parser)
     (set (make-local-variable 'notmuch-sexp--parser)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 26b41603..6e23a980 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -320,7 +320,6 @@ (defun notmuch-show-with-message-as-text (fn)
 
 FN is called with one argument, the message properties. It should
 operation on the contents of the current buffer."
-
   ;; Remake the header to ensure that all information is available.
   (let* ((to (notmuch-show-get-to))
 	 (cc (notmuch-show-get-cc))
@@ -329,7 +328,6 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (date (notmuch-show-get-date))
 	 (tags (notmuch-show-get-tags))
 	 (depth (notmuch-show-get-depth))
-
 	 (header (concat
 		  "Subject: " subject "\n"
 		  "To: " to "\n"
@@ -375,7 +373,6 @@ (defun notmuch-show-fontify-header ()
 		'message-header-subject)
 	       (t
 		'message-header-other))))
-
     (overlay-put (make-overlay (point) (re-search-forward ":"))
 		 'face 'message-header-name)
     (overlay-put (make-overlay (point) (re-search-forward ".*$"))
@@ -421,39 +418,30 @@ (defun notmuch-clean-address (address)
        ((string-match "\\(.*\\) <\\(.*\\)>" address)
 	(setq p-name (match-string 1 address)
 	      p-address (match-string 2 address)))
-
        ;; "<user@dom.ain>" style.
        ((string-match "<\\(.*\\)>" address)
 	(setq p-address (match-string 1 address)))
-
        ;; Everything else.
        (t
 	(setq p-address address)))
-
       (when p-name
 	;; Remove elements of the mailbox part that are not relevant for
 	;; display, even if they are required during transport:
 	;;
 	;; Backslashes.
 	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-
 	;; 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-loop p-name)
 		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do (setq p-name (match-string 1 p-name))
-
+		 do   (setq p-name (match-string 1 p-name))
 		 until (string= start-of-loop p-name)))
-
       ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
       ;; 'foo@bar.com'.
       (when (string= p-name p-address)
 	(setq p-name nil))
-
       (cons p-address p-name))
     (error (cons address nil))))
 
@@ -517,7 +505,6 @@ (defun notmuch-show-insert-part-header (nth content-type declared-type
 			    (unless (string-equal declared-type content-type)
 			      (concat " (as " content-type ")"))
 			    comment)))
-
     (setq button
 	  (insert-button
 	   (concat "[ " base-label " ]")
@@ -658,14 +645,12 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
 (defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth button)
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
-
     ;; Render the primary part.  FIXME: Support RFC 2387 Start header.
     (notmuch-show-insert-bodypart msg (car inner-parts) depth)
     ;; Add hidden buttons for the rest
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth t))
 	  (cdr inner-parts))
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -673,18 +658,15 @@ (defun notmuch-show-insert-part-multipart/related (msg part content-type nth dep
 (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -692,21 +674,17 @@ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth dept
 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
   (when button
     (button-put button 'face 'notmuch-crypto-part-header))
-
   ;; Insert a button detailing the encryption status.
   (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
-
   ;; Insert a button detailing the signature status.
   (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
 					  (notmuch-show-get-header :From msg))
-
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
     ;; Show all of the parts.
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -721,7 +699,6 @@ (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth but
     (mapc (lambda (inner-part)
 	    (notmuch-show-insert-bodypart msg inner-part depth))
 	  inner-parts)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -730,19 +707,15 @@ (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth
   (let* ((message (car (plist-get part :content)))
 	 (body (car (plist-get message :body)))
 	 (start (point)))
-
     ;; Override `notmuch-message-headers' to force `From' to be
     ;; displayed.
     (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
       (notmuch-show-insert-headers (plist-get message :headers)))
-
     ;; Blank line after headers to be compatible with the normal
     ;; message display.
     (insert "\n")
-
     ;; Show the body
     (notmuch-show-insert-bodypart msg body depth)
-
     (when notmuch-show-indent-multipart
       (indent-rigidly start (point) 1)))
   t)
@@ -826,7 +799,6 @@ (defun notmuch-show-insert-part-text/html (msg part content-type nth depth butto
       ;; It's easier to drive shr ourselves than to work around the
       ;; goofy things `mm-shr' does (like irreversibly taking over
       ;; content ID handling).
-
       ;; FIXME: If we block an image, offer a button to load external
       ;; images.
       (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
@@ -902,7 +874,6 @@ (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth bu
 
 (defun notmuch-show-create-part-overlays (button beg end)
   "Add an overlay to the part between BEG and END."
-
   ;; If there is no button (i.e., the part is text/plain and the first
   ;; part) or if the part has no content then we don't make the part
   ;; toggleable.
@@ -913,7 +884,6 @@ (defun notmuch-show-create-part-overlays (button beg end)
 
 (defun notmuch-show-record-part-information (part beg end)
   "Store PART as a text property from BEG to END."
-
   ;; Record part information.  Since we already inserted subparts,
   ;; don't override existing :notmuch-part properties.
   (notmuch-map-text-property beg end :notmuch-part
@@ -1011,7 +981,6 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 HIDE determines whether to show or hide the part and the button
 as follows: If HIDE is nil, show the part and the button. If HIDE
 is t, hide the part initially and show the button."
-
   (let* ((content-type (downcase (plist-get part :content-type)))
 	 (mime-type (notmuch-show-mime-type part))
 	 (nth (plist-get part :id))
@@ -1030,16 +999,13 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (show-part (not (or (equal hide t)
 			     (and long button))))
 	 (content-beg (point)))
-
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
-
     (if show-part
         (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
-
     ;; Some of the body part handlers leave point somewhere up in the
     ;; part, so we make sure that we're down at the end.
     (goto-char (point-max))
@@ -1056,12 +1022,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 
 (defun notmuch-show-insert-body (msg body depth)
   "Insert the body BODY at depth DEPTH in the current thread."
-
   ;; Register all content IDs for this message.  According to RFC
   ;; 2392, content IDs are *global*, but it's okay if an MUA treats
   ;; them as only global within a message.
   (notmuch-show--register-cids msg (car body))
-
   (mapc (lambda (part) (notmuch-show-insert-bodypart msg part depth)) body))
 
 (defun notmuch-show-make-symbol (type)
@@ -1082,18 +1046,14 @@ (defun notmuch-show-insert-msg (msg depth)
 	 content-start content-end
 	 headers-start headers-end
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
-
     (setq message-start (point-marker))
-
     (notmuch-show-insert-headerline headers
 				    (or (if notmuch-show-relative-dates
 					    (plist-get msg :date_relative)
 					  nil)
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
-
     (setq content-start (point-marker))
-
     ;; Set `headers-start' to point after the 'Subject:' header to be
     ;; compatible with the existing implementation. This just sets it
     ;; to after the first header.
@@ -1108,9 +1068,7 @@ (defun notmuch-show-insert-msg (msg depth)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
-
     (setq notmuch-show-previous-subject bare-subject)
-
     ;; A blank line between the headers and the body.
     (insert "\n")
     (notmuch-show-insert-body msg (plist-get msg :body)
@@ -1119,36 +1077,28 @@ (defun notmuch-show-insert-msg (msg depth)
     (unless (bolp)
       (insert "\n"))
     (setq content-end (point-marker))
-
     ;; Indent according to the depth in the thread.
     (if notmuch-show-indent-content
 	(indent-rigidly content-start
 			content-end
 			(* notmuch-show-indent-messages-width depth)))
-
     (setq message-end (point-max-marker))
-
     ;; Save the extents of this message over the whole text of the
     ;; message.
     (put-text-property message-start message-end
 		       :notmuch-message-extent
 		       (cons message-start message-end))
-
     ;; Create overlays used to control visibility
     (plist-put msg :headers-overlay (make-overlay headers-start headers-end))
     (plist-put msg :message-overlay (make-overlay headers-start content-end))
-
     (plist-put msg :depth depth)
-
     ;; Save the properties for this message. Currently this saves the
     ;; entire message (augmented it with other stuff), which seems
     ;; like overkill. We might save a reduced subset (for example, not
     ;; the content).
     (notmuch-show-set-message-properties msg)
-
     ;; Set header visibility.
     (notmuch-show-headers-visible msg notmuch-message-headers-visible)
-
     ;; Message visibility depends on whether it matched the search
     ;; criteria.
     (notmuch-show-message-visible msg (and (plist-get msg :match)
@@ -1296,9 +1246,7 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     (switch-to-buffer (get-buffer-create buffer-name))
     ;; No need to track undo information for this buffer.
     (setq buffer-undo-list t)
-
     (notmuch-show-mode)
-
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
@@ -1307,24 +1255,19 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
 	  notmuch-show-query-context (if (or (string= query-context "")
 					     (string= query-context "*"))
 					 nil query-context)
-
 	  notmuch-show-process-crypto notmuch-crypto-process-mime
 	  ;; If `elide-toggle', invert the default value.
 	  notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
-
     (add-hook 'post-command-hook #'notmuch-show-command-hook nil t)
     (jit-lock-register #'notmuch-show-buttonise-links)
-
     (notmuch-tag-clear-cache)
-
     (let ((inhibit-read-only t))
       (if (notmuch-show--build-buffer)
 	  ;; Messages were inserted into the buffer.
 	  (current-buffer)
-
 	;; No messages were inserted - presumably none matched the
 	;; query.
 	(kill-buffer (current-buffer))
@@ -1367,26 +1310,21 @@ (defun notmuch-show--build-buffer (&optional state)
       (setq queries (cdr queries)))
     (when forest
       (notmuch-show-insert-forest forest)
-
       ;; Store the original tags for each message so that we can
       ;; display changes.
       (notmuch-show-mapc
        (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
-
       ;; Set the header line to the subject of the first message.
       (setq header-line-format
 	    (replace-regexp-in-string "%" "%%"
 				      (notmuch-sanitize
 				       (notmuch-show-strip-re
 					(notmuch-show-get-subject)))))
-
       (run-hooks 'notmuch-show-hook)
-
       (if state
 	  (notmuch-show-apply-state state)
 	;; With no state to apply, just go to the first message.
 	(notmuch-show-goto-first-wanted-message)))
-
     ;; Report back to the caller whether any messages matched.
     forest))
 
@@ -1431,14 +1369,12 @@ (defun notmuch-show-apply-state (state)
  - moving to the correct current message in every displayed window."
   (let ((win-msg-alist (car state))
 	(open (cadr state)))
-
     ;; Open those that were open.
     (goto-char (point-min))
     (cl-loop do (notmuch-show-message-visible
 		 (notmuch-show-get-message-properties)
 		 (member (notmuch-show-get-message-id) open))
 	     until (not (notmuch-show-goto-message-next)))
-
     (dolist (win-msg-pair win-msg-alist)
       (with-selected-window (car win-msg-pair)
 	;; Go to the previously open message in this window
@@ -1460,7 +1396,6 @@ (defun notmuch-show-refresh-view (&optional reset-state)
     ;; manually.
     (remove-overlays)
     (erase-buffer)
-
     (unless (notmuch-show--build-buffer state)
       ;; No messages were inserted.
       (kill-buffer (current-buffer))
@@ -1881,16 +1816,13 @@ (defun notmuch-show-advance ()
 	   (> visible-end-of-this-message (window-end)))
       ;; The bottom of this message is not visible - scroll.
       (scroll-up nil))
-
      ((not (= end-of-this-message (point-max)))
       ;; This is not the last message - move to the next visible one.
       (notmuch-show-next-open-message))
-
      ((not (= (point) (point-max)))
       ;; This is the last message, but the cursor is not at the end of
       ;; the buffer. Move it there.
       (goto-char (point-max)))
-
      (t
       ;; This is the last message - change the return value
       (setq ret t)))
@@ -2527,7 +2459,6 @@ (defun notmuch-show-pipe-part ()
   (interactive)
   (notmuch-show-apply-to-current-part-handle #'mm-pipe-part))
 
-
 (defun notmuch-show--mm-display-part (handle)
   "Use mm-display-part to display HANDLE in a new buffer.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 34cd493a..85c80f54 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -331,7 +331,6 @@ (defun notmuch-tag-format-tag (tags orig-tags tag)
 		    (otherwise nil))))
 	(setq formatted-tag (notmuch-tag--do-format tag tag base))
 	(setq formatted-tag (notmuch-tag--do-format tag formatted-tag over))
-
 	(puthash (cons tag tag-state) formatted-tag notmuch-tag--format-cache)))
     formatted-tag))
 
@@ -356,7 +355,6 @@ (defcustom notmuch-before-tag-hook nil
 a list of strings of the form \"+TAG\" or \"-TAG\".
 'query' will be a string containing the search query that determines
 the messages that are about to be tagged."
-
   :type 'hook
   :options '(notmuch-hl-line-mode)
   :group 'notmuch-hooks)
@@ -406,7 +404,6 @@ (defun notmuch-read-tag-changes (current-tags &optional prompt initial-input)
 non-nil, is the query string to present in the minibuffer.  It
 defaults to \"Tags\".  INITIAL-INPUT, if non-nil, will be the
 initial input in the minibuffer."
-
   (let* ((all-tag-list (notmuch-tag-completions))
 	 (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))
 	 (remove-tag-list (mapcar (apply-partially 'concat "-") current-tags))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index fcfb972d..d90f2aa0 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -891,7 +891,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-
       (cond
        ((and (< 0 depth) (not last))
 	(push "├" tree-status))
@@ -907,7 +906,6 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 	(push "╰" tree-status))
        ((and (eq 0 depth) (not first) (not last))
 	(push "├" tree-status)))
-
       (push (concat (if replies "┬" "─") "►") tree-status)
       (setq msg (plist-put msg :first (and first (eq 0 depth))))
       (setq msg (plist-put msg :tree-status tree-status))
@@ -915,11 +913,9 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
       (notmuch-tree-goto-and-insert-msg msg)
       (pop tree-status)
       (pop tree-status)
-
       (if last
 	  (push " " tree-status)
 	(push "│" tree-status))
-
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -958,7 +954,6 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 Complete list of currently available key bindings:
 
 \\{notmuch-tree-mode-map}"
-
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
   (setq buffer-read-only t
@@ -1022,7 +1017,6 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   ;; (such as reply) do. It is a buffer local variable so setting it
   ;; will not affect genuine show buffers.
   (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
-
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
@@ -1079,13 +1073,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
 						(if unthreaded "unthreaded-" "tree-")
 						query "*")))))
 	(inhibit-read-only t))
-
     (switch-to-buffer buffer))
   ;; Don't track undo information for this buffer
   (set 'buffer-undo-list t)
-
   (notmuch-tree-worker query query-context target open-target unthreaded)
-
   (setq truncate-lines t))
 
 (defun notmuch-unthreaded (&optional query query-context target buffer-name open-target)
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 3a9ffdd0..c3b24cb9 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -203,12 +203,10 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
 \"citation\" or \"signature\". Optional PREFIX is some arbitrary
 text to insert before the button, probably for indentation.  Note
 that PREFIX should not include a newline."
-
   ;; This uses some slightly tricky conversions between strings and
   ;; symbols because of the way the button code works. Note that
   ;; replacing intern-soft with make-symbol will cause this to fail,
   ;; since the newly created symbol has no plist.
-
   (let ((overlay (make-overlay beg end))
 	(button-type (intern-soft (concat "notmuch-wash-button-"
 					  type "-toggle-type"))))
@@ -276,25 +274,20 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 
 (defun notmuch-wash-elide-blank-lines (msg depth)
   "Elide leading, trailing and successive blank lines."
-
   ;; Algorithm derived from `article-strip-multiple-blank-lines' in
   ;; `gnus-art.el'.
-
   ;; Make all blank lines empty.
   (goto-char (point-min))
   (while (re-search-forward "^[[:space:]\t]+$" nil t)
     (replace-match "" nil t))
-
   ;; Replace multiple empty lines with a single empty line.
   (goto-char (point-min))
   (while (re-search-forward "^\n\\(\n+\\)" nil t)
     (delete-region (match-beginning 1) (match-end 1)))
-
   ;; Remove a leading blank line.
   (goto-char (point-min))
   (if (looking-at "\n")
       (delete-region (match-beginning 0) (match-end 0)))
-
   ;; Remove a trailing blank line.
   (goto-char (point-max))
   (if (looking-at "\n")
@@ -313,20 +306,15 @@ (defun notmuch-wash-tidy-citations (msg depth)
   text,
 - Remove citation trailers standing alone after a block of cited
   text."
-
   ;; Remove lines of repeated citation leaders with no other content.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\{2,\\}" nil t)
     (replace-match "\\1"))
-
-  ;; Remove citation leaders standing alone before a block of cited
-  ;; text.
+  ;; Remove citation leaders standing alone before a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(\n\\|^[^>].*\\)\n\\(^>[> ]*\n\\)" nil t)
     (replace-match "\\1\n"))
-
-  ;; Remove citation trailers standing alone after a block of cited
-  ;; text.
+  ;; Remove citation trailers standing alone after a block of cited text.
   (goto-char (point-min))
   (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
     (replace-match "\\2")))
@@ -341,7 +329,6 @@ (defun notmuch-wash-wrap-long-lines (msg depth)
 its value. Otherwise, this function will wrap long lines in the
 message at the window width. When doing so, citation leaders in
 the wrapped text are maintained."
-
   (let* ((coolj-wrap-follows-window-size nil)
 	 (indent (* depth notmuch-show-indent-messages-width))
 	 (limit (if (numberp notmuch-wash-wrap-lines-length)
@@ -405,7 +392,6 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 Given that this function guesses whether a buffer includes a
 patch and then guesses the extent of the patch, there is scope
 for error."
-
   (goto-char (point-min))
   (when (re-search-forward diff-file-header-re nil t)
     (beginning-of-line -1)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 07a58da7..04334c76 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -755,7 +755,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (visible-string formatted-authors)
 	   (invisible-string "")
 	   (padding ""))
-
       ;; Truncate the author string to fit the specification.
       (if (> (length formatted-authors)
 	     (length formatted-sample))
@@ -782,7 +781,6 @@ (defun notmuch-search-insert-authors (format-string authors)
 					  (length visible-string)
 					  (length "..."))
 				       ? ))))
-
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -798,14 +796,12 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; The invisible string may contain both matching and
 	      ;; non-matching authors.
 	      invisible-string (notmuch-search-author-propertize invisible-string)))
-
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
-
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
       (when (not (string= invisible-string ""))
@@ -831,11 +827,9 @@ (defun notmuch-search-insert-field (field format-string result)
     (insert (propertize (format format-string
 				(notmuch-sanitize (plist-get result :subject)))
 			'face 'notmuch-search-subject)))
-
    ((string-equal field "authors")
     (notmuch-search-insert-authors
      format-string (notmuch-sanitize (plist-get result :authors))))
-
    ((string-equal field "tags")
     (let ((tags (plist-get result :tags))
 	  (orig-tags (plist-get result :orig-tags)))
@@ -1118,7 +1112,6 @@ (defun notmuch-cycle-notmuch-buffers ()
 If the current buffer is the only notmuch buffer, bury it. If no
 notmuch buffers exist, run `notmuch'."
   (interactive)
-
   (let (start first)
     ;; If the current buffer is a notmuch buffer, remember it and then
     ;; bury it.
-- 
2.28.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 03/34] emacs: Fix indentation
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 01/34] emacs: Shorten long lines Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 02/34] emacs: Remove excess empty lines Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 04/34] emacs: Closing parenthesis go on the same line Jonas Bernoulli
                     ` (32 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 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           |  42 +++++++------
 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, 312 insertions(+), 309 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 one of CHARS is ignored.
 
 If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
@@ -44,49 +44,49 @@ (if (fboundp 'read-char-choice)
 This is an exact copy of this function from emacs 24 for use on
 emacs 23, except with the one emacs 24 only function it calls
 inlined."
-  (unless (consp chars)
-    (error "Called `read-char-choice' without valid char choices"))
-  (let (char done show-help (helpbuf " *Char Help*"))
-    (let ((cursor-in-echo-area t)
-          (executing-kbd-macro executing-kbd-macro)
-	  (esc-flag nil))
-      (save-window-excursion	      ; in case we call help-form-show
-	(while (not done)
-	  (unless (get-text-property 0 'face prompt)
-	    (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
-	  (setq char (let ((inhibit-quit inhibit-keyboard-quit))
-		       (read-key prompt)))
-	  (and show-help (buffer-live-p (get-buffer helpbuf))
-	       (kill-buffer helpbuf))
-	  (cond
-	   ((not (numberp char)))
-	   ;; If caller has set help-form, that's enough.
-	   ;; They don't explicitly have to add help-char to chars.
-	   ((and help-form
-		 (eq char help-char)
-		 (setq show-help t)
-		 ;; This is an inlined copy of help-form-show as that
-		 ;; was introduced in emacs 24 too.
-		 (let ((msg (eval help-form)))
-		   (if (stringp msg)
-		       (with-output-to-temp-buffer " *Char Help*"
-			 (princ msg))))))
-	   ((memq char chars)
-	    (setq done t))
-	   ((and executing-kbd-macro (= char -1))
-	    ;; read-event returns -1 if we are in a kbd macro and
-	    ;; there are no more events in the macro.  Attempt to
-	    ;; get an event interactively.
-	    (setq executing-kbd-macro nil))
-	   ((not inhibit-keyboard-quit)
+    (unless (consp chars)
+      (error "Called `read-char-choice' without valid char choices"))
+    (let (char done show-help (helpbuf " *Char Help*"))
+      (let ((cursor-in-echo-area t)
+	    (executing-kbd-macro executing-kbd-macro)
+	    (esc-flag nil))
+	(save-window-excursion	      ; in case we call help-form-show
+	  (while (not done)
+	    (unless (get-text-property 0 'face prompt)
+	      (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
+	    (setq char (let ((inhibit-quit inhibit-keyboard-quit))
+			 (read-key prompt)))
+	    (and show-help (buffer-live-p (get-buffer helpbuf))
+		 (kill-buffer helpbuf))
 	    (cond
-	     ((and (null esc-flag) (eq char ?\e))
-	      (setq esc-flag t))
-	     ((memq char '(?\C-g ?\e))
-	      (keyboard-quit))))))))
-    ;; Display the question with the answer.  But without cursor-in-echo-area.
-    (message "%s%s" prompt (char-to-string char))
-    char)))
+	     ((not (numberp char)))
+	     ;; If caller has set help-form, that's enough.
+	     ;; They don't explicitly have to add help-char to chars.
+	     ((and help-form
+		   (eq char help-char)
+		   (setq show-help t)
+		   ;; This is an inlined copy of help-form-show as that
+		   ;; was introduced in emacs 24 too.
+		   (let ((msg (eval help-form)))
+		     (if (stringp msg)
+			 (with-output-to-temp-buffer " *Char Help*"
+			   (princ msg))))))
+	     ((memq char chars)
+	      (setq done t))
+	     ((and executing-kbd-macro (= char -1))
+	      ;; read-event returns -1 if we are in a kbd macro and
+	      ;; there are no more events in the macro.  Attempt to
+	      ;; get an event interactively.
+	      (setq executing-kbd-macro nil))
+	     ((not inhibit-keyboard-quit)
+	      (cond
+	       ((and (null esc-flag) (eq char ?\e))
+		(setq esc-flag t))
+	       ((memq char '(?\C-g ?\e))
+		(keyboard-quit))))))))
+      ;; Display the question with the answer.  But without cursor-in-echo-area.
+      (message "%s%s" prompt (char-to-string char))
+      char)))
 
 ;; End of compatibility functions
 
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index c3cb619f..ea995379 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -153,17 +153,17 @@ (defun notmuch-draft--query-encryption ()
 
 `notmuch-draft-save-plaintext' controls the behaviour."
   (cl-case notmuch-draft-save-plaintext
-	((ask)
-	 (unless (yes-or-no-p
-		  "(Customize `notmuch-draft-save-plaintext' to avoid this warning)
+    ((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.
 Really save and index an unencrypted copy? ")
-	   (error "Save aborted")))
-	((nil)
-	 (error "Refusing to save draft with encryption tags (see `%s')"
-		'notmuch-draft-save-plaintext))
-	((t)
-	 (ignore))))
+       (error "Save aborted")))
+    ((nil)
+     (error "Refusing to save draft with encryption tags (see `%s')"
+	    'notmuch-draft-save-plaintext))
+    ((t)
+     (ignore))))
 
 (defun notmuch-draft--make-message-id ()
   ;; message-make-message-id gives the id inside a "<" ">" pair,
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e71e55f3..89e03c36 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -147,9 +147,9 @@ (defcustom notmuch-saved-searches
 
 Other accepted forms are a cons cell of the form (NAME . QUERY)
 or a list of the form (NAME QUERY COUNT-QUERY)."
-;; The saved-search format is also used by the all-tags notmuch-hello
-;; section. This section generates its own saved-search list in one of
-;; the latter two forms.
+  ;; The saved-search format is also used by the all-tags notmuch-hello
+  ;; section. This section generates its own saved-search list in one of
+  ;; the latter two forms.
   :get 'notmuch-hello--saved-searches-to-plist
   :type '(repeat notmuch-saved-search-plist)
   :tag "List of Saved Searches"
@@ -382,10 +382,10 @@ (defun notmuch-hello-nice-number (n)
       (setq n (/ n 1000)))
     (setq result (or result '(0)))
     (apply #'concat
-     (number-to-string (car result))
-     (mapcar (lambda (elem)
-	      (format "%s%03d" notmuch-hello-thousands-separator elem))
-	     (cdr result)))))
+	   (number-to-string (car result))
+	   (mapcar (lambda (elem)
+		     (format "%s%03d" notmuch-hello-thousands-separator elem))
+		   (cdr result)))))
 
 (defun notmuch-hello-trim (search)
   "Trim whitespace."
@@ -540,7 +540,7 @@ (defun notmuch-hello-query-counts (query-list &rest options)
 	  (notmuch-hello-filtered-query count-query
 					(or (plist-get options :filter-count)
 					    (plist-get options :filter))))
-	  "\n")))
+	 "\n")))
     (unless (= (call-process-region (point-min) (point-max) notmuch-command
 				    t t nil "count" "--batch") 0)
       (notmuch-logged-error
@@ -690,7 +690,7 @@ (defvar notmuch-hello-mode-map
 (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
- "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
+  "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
 
 Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
 or click on a saved search to view matching threads. Edit saved
@@ -720,9 +720,9 @@ (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
 Complete list of currently available key bindings:
 
 \\{notmuch-hello-mode-map}"
- (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
- ;;(setq buffer-read-only t)
-)
+  (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
+  ;;(setq buffer-read-only t)
+  )
 
 (defun notmuch-hello-generate-tag-alist (&optional hide-tags)
   "Return an alist from tags to queries to display in the all-tags section."
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 615207ed..7994d5ad 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -211,7 +211,7 @@ (defun notmuch-assert-cli-sane ()
   (unless (notmuch-cli-sane-p)
     (notmuch-logged-error
      "notmuch cli seems misconfigured or unconfigured."
-"Perhaps you haven't run \"notmuch setup\" yet? Try running this
+     "Perhaps you haven't run \"notmuch setup\" yet? Try running this
 on the command line, and then retry your notmuch command")))
 
 (defun notmuch-cli-version ()
@@ -321,7 +321,7 @@ (defun notmuch-describe-key (actual-key binding prefix ua-keys tail)
 		      (and (functionp binding)
 			   (notmuch-documentation-first-line binding))))
 	    tail)))
-    tail)
+  tail)
 
 (defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
   ;; Remappings are represented as a binding whose first "event" is
@@ -413,8 +413,8 @@ (defun notmuch-subkeymap-help ()
   "Show help for a subkeymap."
   (interactive)
   (let* ((key (this-command-keys-vector))
-	(prefix (make-vector (1- (length key)) nil))
-	(i 0))
+	 (prefix (make-vector (1- (length key)) nil))
+	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
       (setq i (1+ i)))
@@ -527,7 +527,7 @@ (defun notmuch-remove-if-not (predicate list)
   (let (out)
     (while list
       (when (funcall predicate (car list))
-        (push (car list) out))
+	(push (car list) out))
       (setq list (cdr list)))
     (nreverse out)))
 
@@ -835,24 +835,24 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		       command " "))
 	   (extra
 	    (concat "command: " command-string "\n"
-	     (if (integerp exit-status)
-		 (format "exit status: %s\n" exit-status)
-	       (format "exit signal: %s\n" exit-status))
-	     (when err
-	       (concat "stderr:\n" err))
-	     (when output
-	       (concat "stdout:\n" output)))))
-	(if err
-	    ;; We have an error message straight from the CLI.
-	    (notmuch-logged-error
-	     (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
-	  ;; We only have combined output from the CLI; don't inundate
-	  ;; the user with it.  Mimic `process-lines'.
-	  (notmuch-logged-error (format "%s exited with status %s"
-					(car command) exit-status)
-				extra))
-	;; `notmuch-logged-error' does not return.
-	))))
+		    (if (integerp exit-status)
+			(format "exit status: %s\n" exit-status)
+		      (format "exit signal: %s\n" exit-status))
+		    (when err
+		      (concat "stderr:\n" err))
+		    (when output
+		      (concat "stdout:\n" output)))))
+      (if err
+	  ;; We have an error message straight from the CLI.
+	  (notmuch-logged-error
+	   (replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
+	;; We only have combined output from the CLI; don't inundate
+	;; the user with it.  Mimic `process-lines'.
+	(notmuch-logged-error (format "%s exited with status %s"
+				      (car command) exit-status)
+			      extra))
+      ;; `notmuch-logged-error' does not return.
+      ))))
 
 (defun notmuch-call-notmuch--helper (destination args)
   "Helper for synchronous notmuch invocation commands.
@@ -925,9 +925,9 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 as that will interfere with the handling of stderr and the exit
 status."
   (let (err-file err-buffer proc err-proc
-	;; Find notmuch using Emacs' `exec-path'
-	(command (or (executable-find notmuch-command)
-		     (error "Command not found: %s" notmuch-command))))
+		 ;; Find notmuch using Emacs' `exec-path'
+		 (command (or (executable-find notmuch-command)
+			      (error "Command not found: %s" notmuch-command))))
     (if (fboundp 'make-process)
 	(progn
 	  (setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
@@ -1030,8 +1030,8 @@ (defun notmuch-interactive-region ()
     (list (point) (point))))
 
 (define-obsolete-function-alias
-    'notmuch-search-interactive-region
-    'notmuch-interactive-region
+  'notmuch-search-interactive-region
+  'notmuch-interactive-region
   "notmuch 0.29")
 
 (provide 'notmuch-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 66f32fd4..7d001b2d 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -31,7 +31,7 @@ (require 'notmuch-lib)
 (defvar notmuch-maildir-fcc-count 0)
 
 (defcustom notmuch-fcc-dirs "sent"
- "Determines the Fcc Header which says where to save outgoing mail.
+  "Determines the Fcc Header which says where to save outgoing mail.
 
 Three types of values are permitted:
 
@@ -69,13 +69,13 @@ (defcustom notmuch-fcc-dirs "sent"
 In all cases you will be prompted to create the folder or
 directory if it does not exist yet when sending a mail."
 
- :type '(choice
-	 (const :tag "No FCC header" nil)
-	 (string :tag "A single folder")
-	 (repeat :tag "A folder based on the From header"
-		 (cons regexp (string :tag "Folder"))))
- :require 'notmuch-fcc-initialization
- :group 'notmuch-send)
+  :type '(choice
+	  (const :tag "No FCC header" nil)
+	  (string :tag "A single folder")
+	  (repeat :tag "A folder based on the From header"
+		  (cons regexp (string :tag "Folder"))))
+  :require 'notmuch-fcc-initialization
+  :group 'notmuch-send)
 
 (defcustom notmuch-maildir-use-notmuch-insert 't
   "Should fcc use notmuch insert instead of simple fcc."
@@ -267,16 +267,16 @@ (defun notmuch-maildir-fcc-host-fixer (hostname)
 			    t))
 
 (defun notmuch-maildir-fcc-make-uniq-maildir-id ()
-   (let* ((ftime (float-time))
-	  (microseconds (mod (* 1000000 ftime) 1000000))
-	  (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
-     (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
-     (format "%d.%d_%d_%d.%s"
-	     ftime
-	     (emacs-pid)
-	     microseconds
-	     notmuch-maildir-fcc-count
-	     hostname)))
+  (let* ((ftime (float-time))
+	 (microseconds (mod (* 1000000 ftime) 1000000))
+	 (hostname (notmuch-maildir-fcc-host-fixer (system-name))))
+    (setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
+    (format "%d.%d_%d_%d.%s"
+	    ftime
+	    (emacs-pid)
+	    microseconds
+	    notmuch-maildir-fcc-count
+	    hostname)))
 
 (defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
   (and (file-exists-p (concat dir "/cur/"))
@@ -328,17 +328,17 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
     ;; fix it in some way.
     (let* ((prompt (format "Fcc %s is not a maildir: \
 \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
-	    (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
-	 (cl-case response
-	   (?r (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?c (if (file-writable-p fcc-header)
-		   (notmuch-maildir-fcc-create-maildir fcc-header)
-		 (message "No permission to create %s." fcc-header)
-		 (sit-for 2))
-	       (notmuch-maildir-fcc-file-fcc fcc-header))
-	   (?i 't)
-	   (?e (notmuch-maildir-fcc-file-fcc
-		(read-from-minibuffer "Fcc header: " fcc-header)))))))
+	   (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
+      (cl-case response
+	(?r (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?c (if (file-writable-p fcc-header)
+		(notmuch-maildir-fcc-create-maildir fcc-header)
+	      (message "No permission to create %s." fcc-header)
+	      (sit-for 2))
+	    (notmuch-maildir-fcc-file-fcc fcc-header))
+	(?i 't)
+	(?e (notmuch-maildir-fcc-file-fcc
+	     (read-from-minibuffer "Fcc header: " fcc-header)))))))
 
 (defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
   "Writes the current buffer to maildir destdir. If mark-seen is
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 3bc06b4b..7f80224f 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -58,7 +58,7 @@ (defcustom notmuch-mua-compose-in 'current-window
 You may want to customize `message-kill-buffer-on-exit'
 accordingly."
    (when (< emacs-major-version 24)
-	   " Due to a known bug in Emacs 23, you should not set
+     " Due to a known bug in Emacs 23, you should not set
 this to `new-window' if `message-kill-buffer-on-exit' is
 disabled: this would result in an incorrect behavior."))
   :group 'notmuch-send
@@ -106,13 +106,13 @@ (defcustom notmuch-mua-reply-insert-header-p-function
 This function specifies which parts of a mime message with
 multiple parts get a header."
   :type '(radio (const :tag "No part headers"
-		               notmuch-show-reply-insert-header-p-never)
+		       notmuch-show-reply-insert-header-p-never)
 		(const :tag "All except multipart/* and hidden parts"
-		               notmuch-show-reply-insert-header-p-trimmed)
+		       notmuch-show-reply-insert-header-p-trimmed)
 		(const :tag "Only for included text parts"
-			       notmuch-show-reply-insert-header-p-minimal)
+		       notmuch-show-reply-insert-header-p-minimal)
 		(const :tag "Exactly as in show view"
-			       notmuch-show-insert-header-p)
+		       notmuch-show-insert-header-p)
 		(function :tag "Other"))
   :group 'notmuch-reply)
 
@@ -472,10 +472,12 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
   (let* ((other-headers
 	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
 	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
-	 forward-subject  ;; Comes from the first message and is
-			  ;; applied later.
-	 forward-references ;; List of accumulated message-references of forwarded messages
-	 forward-queries) ;; List of corresponding message-query
+	 ;; Comes from the first message and is applied later.
+	 forward-subject
+	 ;; List of accumulated message-references of forwarded messages.
+	 forward-references
+	 ;; List of corresponding message-query.
+	 forward-queries)
     ;; Generate the template for the outgoing message.
     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
     (save-excursion
@@ -529,17 +531,17 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
 the From: address first.  If REPLY-ALL is non-nil, the message
 will be addressed to all recipients of the source message."
-;; In current emacs (24.3) select-active-regions is set to t by
-;; default. The reply insertion code sets the region to the quoted
-;; message to make it easy to delete (kill-region or C-w). These two
-;; things combine to put the quoted message in the primary selection.
-;;
-;; This is not what the user wanted and is a privacy risk (accidental
-;; pasting of the quoted message). We can avoid some of the problems
-;; by let-binding select-active-regions to nil. This fixes if the
-;; primary selection was previously in a non-emacs window but not if
-;; it was in an emacs window. To avoid the problem in the latter case
-;; we deactivate mark.
+  ;; In current emacs (24.3) select-active-regions is set to t by
+  ;; default. The reply insertion code sets the region to the quoted
+  ;; message to make it easy to delete (kill-region or C-w). These two
+  ;; things combine to put the quoted message in the primary selection.
+  ;;
+  ;; This is not what the user wanted and is a privacy risk (accidental
+  ;; pasting of the quoted message). We can avoid some of the problems
+  ;; by let-binding select-active-regions to nil. This fixes if the
+  ;; primary selection was previously in a non-emacs window but not if
+  ;; it was in an emacs window. To avoid the problem in the latter case
+  ;; we deactivate mark.
   (let ((sender
 	 (when prompt-for-sender
 	   (notmuch-mua-prompt-for-sender)))
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 3a835a00..1db9d7ca 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -42,9 +42,9 @@ (defun notmuch-query-map-aux  (mapper function seq)
   "Private function to do the actual mapping and flattening."
   (apply 'append
 	 (mapcar
-	   (lambda (tree)
-	     (funcall mapper function tree))
-	   seq)))
+	  (lambda (tree)
+	    (funcall mapper function tree))
+	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
   "Apply FN to every thread in THREADS. Flatten results to a list.
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6e23a980..f38866b0 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -272,7 +272,7 @@ (defmacro with-current-notmuch-show-message (&rest body)
   `(save-excursion
      (let ((id (notmuch-show-get-message-id)))
        (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
-         (with-current-buffer buf
+	 (with-current-buffer buf
 	   (let ((coding-system-for-read 'no-conversion))
 	     (call-process notmuch-command nil t nil "show" "--format=raw" id))
 	   ,@body)
@@ -303,7 +303,7 @@ (defun notmuch-show-view-all-mime-parts ()
 				  ("multipart/alternative" ignore identity)
 				  ("multipart/mixed" ignore identity)
 				  ("multipart/related" ignore identity)
-				 )))
+				  )))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -406,43 +406,44 @@ (defun notmuch-clean-address (address)
 cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
 parsing fails."
   (condition-case nil
-    (let (p-name p-address)
-      ;; It would be convenient to use `mail-header-parse-address',
-      ;; but that expects un-decoded mailbox parts, whereas our
-      ;; mailbox parts are already decoded (and hence may contain
-      ;; UTF-8). Given that notmuch should handle most of the awkward
-      ;; cases, some simple string deconstruction should be sufficient
-      ;; here.
-      (cond
-       ;; "User <user@dom.ain>" style.
-       ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	(setq p-name (match-string 1 address)
-	      p-address (match-string 2 address)))
-       ;; "<user@dom.ain>" style.
-       ((string-match "<\\(.*\\)>" address)
-	(setq p-address (match-string 1 address)))
-       ;; Everything else.
-       (t
-	(setq p-address address)))
-      (when p-name
-	;; Remove elements of the mailbox part that are not relevant for
-	;; display, even if they are required during transport:
-	;;
-	;; Backslashes.
-	(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
-	;; Outer single and double quotes, which might be nested.
-	(cl-loop with start-of-loop
-		 do   (setq start-of-loop p-name)
-		 when (string-match "^\"\\(.*\\)\"$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 when (string-match "^'\\(.*\\)'$" p-name)
-		 do   (setq p-name (match-string 1 p-name))
-		 until (string= start-of-loop p-name)))
-      ;; If the address is 'foo@bar.com <foo@bar.com>' then show just
-      ;; 'foo@bar.com'.
-      (when (string= p-name p-address)
-	(setq p-name nil))
-      (cons p-address p-name))
+      (let (p-name p-address)
+	;; It would be convenient to use `mail-header-parse-address',
+	;; but that expects un-decoded mailbox parts, whereas our
+	;; mailbox parts are already decoded (and hence may contain
+	;; UTF-8). Given that notmuch should handle most of the awkward
+	;; cases, some simple string deconstruction should be sufficient
+	;; here.
+	(cond
+	 ;; "User <user@dom.ain>" style.
+	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
+	  (setq p-name (match-string 1 address)
+		p-address (match-string 2 address)))
+
+	 ;; "<user@dom.ain>" style.
+	 ((string-match "<\\(.*\\)>" address)
+	  (setq p-address (match-string 1 address)))
+	 ;; Everything else.
+	 (t
+	  (setq p-address address)))
+	(when p-name
+	  ;; Remove elements of the mailbox part that are not relevant for
+	  ;; display, even if they are required during transport:
+	  ;;
+	  ;; Backslashes.
+	  (setq p-name (replace-regexp-in-string "\\\\" "" p-name))
+	  ;; Outer single and double quotes, which might be nested.
+	  (cl-loop with start-of-loop
+		   do   (setq start-of-loop p-name)
+		   when (string-match "^\"\\(.*\\)\"$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   when (string-match "^'\\(.*\\)'$" p-name)
+		   do   (setq p-name (match-string 1 p-name))
+		   until (string= start-of-loop p-name)))
+	;; If the address is 'foo@bar.com <foo@bar.com>' then show just
+	;; 'foo@bar.com'.
+	(when (string= p-name p-address)
+	  (setq p-name nil))
+	(cons p-address p-name))
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
@@ -601,9 +602,9 @@ (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
   (if (boundp 'w3m-cid-retrieve-function-alist)
-    (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-      (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	    w3m-cid-retrieve-function-alist)))
+      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
+	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	      w3m-cid-retrieve-function-alist)))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -633,8 +634,8 @@ (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth
     ;; should be chosen if there are more than one that match?
     (mapc (lambda (inner-part)
 	    (let* ((inner-type (plist-get inner-part :content-type))
-		  (hide (not (or notmuch-show-all-multipart/alternative-parts
-			   (string= chosen-type inner-type)))))
+		   (hide (not (or notmuch-show-all-multipart/alternative-parts
+				  (string= chosen-type inner-type)))))
 	      (notmuch-show-insert-bodypart msg inner-part depth hide)))
 	  inner-parts)
 
@@ -1002,7 +1003,7 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
     ;; Store the computed mime-type for later use (e.g. by attachment handlers).
     (plist-put part :computed-type mime-type)
     (if show-part
-        (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
+	(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
       (when button
 	(button-put button :notmuch-lazy-part
 		    (list msg part mime-type nth depth button))))
@@ -1515,9 +1516,9 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
   (setq buffer-read-only t
 	truncate-lines t)
   (setq imenu-prev-index-position-function
-        #'notmuch-show-imenu-prev-index-position-function)
+	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-show-imenu-extract-index-name-function))
+	#'notmuch-show-imenu-extract-index-name-function))
 
 (defun notmuch-tree-from-show-current-query ()
   "Call notmuch tree with the current query."
@@ -1740,8 +1741,8 @@ (defun notmuch-show-seen-current-message (start end)
 user decision and we should not override it."
   (when (and (notmuch-show-message-visible-p)
 	     (not (notmuch-show-get-prop :seen)))
-	(notmuch-show-mark-read)
-	(notmuch-show-set-prop :seen t)))
+    (notmuch-show-mark-read)
+    (notmuch-show-set-prop :seen t)))
 
 (defvar notmuch-show--seen-has-errored nil)
 (make-variable-buffer-local 'notmuch-show--seen-has-errored)
@@ -1860,9 +1861,9 @@ (defun notmuch-show-rewind ()
   (let ((start-of-message (notmuch-show-message-top))
 	(start-of-window (window-start)))
     (cond
-      ;; Either this message is properly aligned with the start of the
-      ;; window or the start of this message is not visible on the
-      ;; screen - scroll.
+     ;; Either this message is properly aligned with the start of the
+     ;; window or the start of this message is not visible on the
+     ;; screen - scroll.
      ((or (= start-of-message start-of-window)
 	  (< start-of-message start-of-window))
       (scroll-down)
@@ -2506,9 +2507,9 @@ (defmacro notmuch-show--with-currently-shown-message (&rest body)
 message."
   `(save-excursion
      (save-restriction
-      (let ((extent (notmuch-show-message-extent)))
-	(narrow-to-region (car extent) (cdr extent))
-	,@body))))
+       (let ((extent (notmuch-show-message-extent)))
+	 (narrow-to-region (car extent) (cdr extent))
+	 ,@body))))
 
 (defun notmuch-show--gather-urls ()
   "Gather any URLs in the current message."
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 85c80f54..2fcf5a9e 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -236,7 +236,7 @@ (defun notmuch-tag-format-image-data (tag data)
 (defun notmuch-tag-star-icon ()
   "Return SVG data representing a star icon.
 This can be used with `notmuch-tag-format-image-data'."
-"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
+  "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
 <svg version=\"1.1\" width=\"16\" height=\"16\">
   <g transform=\"translate(-242.81601,-315.59635)\">
     <path
@@ -536,7 +536,7 @@ (defun notmuch-tag-jump (reverse)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
-		     `(lambda () (,tag-function ',tag-change)))
+		    `(lambda () (,tag-function ',tag-change)))
 	      action-map)))
     (push (list notmuch-tag-jump-reverse-key
 		(if reverse
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index d90f2aa0..6ac0c62d 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -245,7 +245,7 @@ (defun notmuch-tree-to-message-pane (func)
 which executes function FUNC in the message pane if it is
 open (if the message pane is closed it does nothing)."
   `(lambda ()
-      ,(concat "(In message pane) " (documentation func t))
+     ,(concat "(In message pane) " (documentation func t))
      (interactive)
      (when (window-live-p notmuch-tree-message-window)
        (with-selected-window notmuch-tree-message-window
@@ -273,7 +273,7 @@ (defun notmuch-tree-close-message-pane-and (func)
 which closes the message pane if open and then executes function
 FUNC."
   `(lambda ()
-      ,(concat "(Close message pane and) " (documentation func t))
+     ,(concat "(Close message pane and) " (documentation func t))
      (interactive)
      (let ((notmuch-show-process-crypto
 	    (notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
@@ -891,31 +891,31 @@ (defun notmuch-tree-insert-tree (tree depth tree-status first last)
 message together with all its descendents."
   (let ((msg (car tree))
 	(replies (cadr tree)))
-      (cond
-       ((and (< 0 depth) (not last))
-	(push "├" tree-status))
-       ((and (< 0 depth) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) first last)
-	;; Choice between these two variants is a matter of taste.
-	;; (push "─" tree-status))
-	(push " " tree-status))
-       ((and (eq 0 depth) first (not last))
-	  (push "┬" tree-status))
-       ((and (eq 0 depth) (not first) last)
-	(push "╰" tree-status))
-       ((and (eq 0 depth) (not first) (not last))
-	(push "├" tree-status)))
-      (push (concat (if replies "┬" "─") "►") tree-status)
-      (setq msg (plist-put msg :first (and first (eq 0 depth))))
-      (setq msg (plist-put msg :tree-status tree-status))
-      (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
-      (notmuch-tree-goto-and-insert-msg msg)
-      (pop tree-status)
-      (pop tree-status)
-      (if last
-	  (push " " tree-status)
-	(push "│" tree-status))
+    (cond
+     ((and (< 0 depth) (not last))
+      (push "├" tree-status))
+     ((and (< 0 depth) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) first last)
+      ;; Choice between these two variants is a matter of taste.
+      ;; (push "─" tree-status))
+      (push " " tree-status))
+     ((and (eq 0 depth) first (not last))
+      (push "┬" tree-status))
+     ((and (eq 0 depth) (not first) last)
+      (push "╰" tree-status))
+     ((and (eq 0 depth) (not first) (not last))
+      (push "├" tree-status)))
+    (push (concat (if replies "┬" "─") "►") tree-status)
+    (setq msg (plist-put msg :first (and first (eq 0 depth))))
+    (setq msg (plist-put msg :tree-status tree-status))
+    (setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
+    (notmuch-tree-goto-and-insert-msg msg)
+    (pop tree-status)
+    (pop tree-status)
+    (if last
+	(push " " tree-status)
+      (push "│" tree-status))
     (notmuch-tree-insert-thread replies (1+ depth) tree-status)))
 
 (defun notmuch-tree-insert-thread (thread depth tree-status)
@@ -966,34 +966,34 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(exit-status (process-exit-status proc))
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
-        (kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (tree view process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.")
-		    (unless (= exit-status 0)
-		      (insert (format " (process returned %d)" exit-status)))
-		    (insert "\n")))))))))
+      (kill-buffer (process-get proc 'parse-buf))
+      (if (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(if (eq status 'signal)
+		    (insert "Incomplete search results (tree view process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.")
+		  (unless (= exit-status 0)
+		    (insert (format " (process returned %d)" exit-status)))
+		  (insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
   (let ((results-buf (process-buffer proc))
-        (parse-buf (process-get proc 'parse-buf))
-        (inhibit-read-only t)
-        done)
+	(parse-buf (process-get proc 'parse-buf))
+	(inhibit-read-only t)
+	done)
     (if (not (buffer-live-p results-buf))
-        (delete-process proc)
+	(delete-process proc)
       (with-current-buffer parse-buf
-        ;; Insert new data
-        (save-excursion
-          (goto-char (point-max))
-          (insert string))
+	;; Insert new data
+	(save-excursion
+	  (goto-char (point-max))
+	  (insert string))
 	(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
 					 results-buf)))))
 
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-		       (if query-context (concat " and (" query-context ")"))
-		       ))
+			      (if query-context (concat " and (" query-context ")"))
+			      ))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index c3b24cb9..00ac45b6 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -373,7 +373,7 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
   (when (string-match
 	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
 	 subject)
-      (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 04334c76..2e84cd34 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -117,23 +117,23 @@ (defvar notmuch-query-history nil
 
 (defun notmuch-foreach-mime-part (function mm-handle)
   (cond ((stringp (car mm-handle))
-         (dolist (part (cdr mm-handle))
-           (notmuch-foreach-mime-part function part)))
-        ((bufferp (car mm-handle))
-         (funcall function mm-handle))
-        (t (dolist (part mm-handle)
-             (notmuch-foreach-mime-part function part)))))
+	 (dolist (part (cdr mm-handle))
+	   (notmuch-foreach-mime-part function part)))
+	((bufferp (car mm-handle))
+	 (funcall function mm-handle))
+	(t (dolist (part mm-handle)
+	     (notmuch-foreach-mime-part function part)))))
 
 (defun notmuch-count-attachments (mm-handle)
   (let ((count 0))
     (notmuch-foreach-mime-part
      (lambda (p)
        (let ((disposition (mm-handle-disposition p)))
-         (and (listp disposition)
-              (or (equal (car disposition) "attachment")
-                  (and (equal (car disposition) "inline")
-                       (assq 'filename disposition)))
-              (cl-incf count))))
+	 (and (listp disposition)
+	      (or (equal (car disposition) "attachment")
+		  (and (equal (car disposition) "inline")
+		       (assq 'filename disposition)))
+	      (cl-incf count))))
      mm-handle)
     count))
 
@@ -142,13 +142,13 @@ (defun notmuch-save-attachments (mm-handle &optional queryp)
    (lambda (p)
      (let ((disposition (mm-handle-disposition p)))
        (and (listp disposition)
-            (or (equal (car disposition) "attachment")
-                (and (equal (car disposition) "inline")
-                     (assq 'filename disposition)))
-            (or (not queryp)
-                (y-or-n-p
-                 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
-            (mm-save-part p))))
+	    (or (equal (car disposition) "attachment")
+		(and (equal (car disposition) "inline")
+		     (assq 'filename disposition)))
+	    (or (not queryp)
+		(y-or-n-p
+		 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))
+	    (mm-save-part p))))
    mm-handle))
 
 (require 'hl-line)
@@ -272,11 +272,11 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
- '((((class color) (background light)) (:background "#f0f0f0"))
-   (((class color) (background dark)) (:background "#303030")))
- "Face for the single-line message summary in notmuch-show-mode."
- :group 'notmuch-show
- :group 'notmuch-faces)
+  '((((class color) (background light)) (:background "#f0f0f0"))
+    (((class color) (background dark)) (:background "#303030")))
+  "Face for the single-line message summary in notmuch-show-mode."
+  :group 'notmuch-show
+  :group 'notmuch-faces)
 
 (defface notmuch-search-date
   '((t :inherit default))
@@ -392,9 +392,9 @@ (define-derived-mode notmuch-search-mode fundamental-mode "notmuch-search"
   (setq truncate-lines t)
   (setq buffer-read-only t)
   (setq imenu-prev-index-position-function
-        #'notmuch-search-imenu-prev-index-position-function)
+	#'notmuch-search-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
-        #'notmuch-search-imenu-extract-index-name-function))
+	#'notmuch-search-imenu-extract-index-name-function))
 
 (defun notmuch-search-get-result (&optional pos)
   "Return the result object for the thread at POS (or point).
@@ -689,9 +689,9 @@ (defun notmuch-search-process-sentinel (proc msg)
 			     (not (string= notmuch-search-target-thread "found")))
 			(set 'never-found-target-thread t)))))
 	      (when (and never-found-target-thread
-		       notmuch-search-target-line)
-		  (goto-char (point-min))
-		  (forward-line (1- notmuch-search-target-line)))))))))
+			 notmuch-search-target-line)
+		(goto-char (point-min))
+		(forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -711,7 +711,7 @@ (defcustom notmuch-search-line-faces
  (the following text would be placed in your ~/.emacs file):
 
  (setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
-                                   (\"deleted\" . (:foreground \"red\"
+				   (\"deleted\" . (:foreground \"red\"
 						  :background \"blue\"))))
 
 The FACE must be a face name (a symbol or string), a property
@@ -722,7 +722,7 @@ (defcustom notmuch-search-line-faces
 background."
   :type '(alist :key-type (string)
 		:value-type (radio (face :tag "Face name")
-				    (notmuch--custom-face-edit)))
+				   (notmuch--custom-face-edit)))
   :group 'notmuch-search
   :group 'notmuch-faces)
 
@@ -919,15 +919,15 @@ (defun notmuch-read-query (prompt)
 PROMPT is the string to prompt with."
   (let*
       ((all-tags
-        (mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
-                (process-lines notmuch-command "search" "--output=tags" "*")))
+	(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
+		(process-lines notmuch-command "search" "--output=tags" "*")))
        (completions
-	 (append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
-		       "subject:" "attachment:")
-		 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
-		 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-		 (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
-			 (mailcap-mime-types)))))
+	(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
+		      "subject:" "attachment:")
+		(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
+		(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
+		(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+			(mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
 	  (current-query (cl-case major-mode
 			   (notmuch-search-mode (notmuch-search-get-query))
diff --git a/test/emacs-address-cleaning.el b/test/emacs-address-cleaning.el
index 8423245f..6eda0ebc 100644
--- a/test/emacs-address-cleaning.el
+++ b/test/emacs-address-cleaning.el
@@ -1,6 +1,6 @@
 (defun notmuch-test-address-cleaning-1 ()
   (notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
-			"dme@dme.org"))
+			     "dme@dme.org"))
 
 (defun notmuch-test-address-cleaning-2 ()
   (let* ((input '("foo@bar.com"
-- 
2.28.0
\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 04/34] emacs: Closing parenthesis go on the same line
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (2 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 03/34] emacs: Fix indentation Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 05/34] emacs: Only set one variable per setq form Jonas Bernoulli
                     ` (31 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-lib.el  |  6 ++----
 emacs/notmuch-show.el | 19 ++++++++-----------
 emacs/notmuch-tree.el |  4 ++--
 emacs/notmuch.el      |  6 ++----
 4 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 7994d5ad..f8958a91 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -555,13 +555,11 @@ (defun notmuch-match-content-type (t1 t2)
       (string= (downcase t1) (downcase t2)))))
 
 (defvar notmuch-multipart/alternative-discouraged
-  '(
-    ;; Avoid HTML parts.
+  '(;; Avoid HTML parts.
     "text/html"
     ;; multipart/related usually contain a text/html part and some
     ;; associated graphics.
-    "multipart/related"
-    ))
+    "multipart/related"))
 
 (defun notmuch-multipart/alternative-determine-discouraged (msg)
   "Return the discouraged alternatives for the specified message."
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f38866b0..8592936f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -297,13 +297,12 @@ (defun notmuch-show-view-all-mime-parts ()
    ;;
    ;; Any MIME part not explicitly mentioned here will be handled by an
    ;; external viewer as configured in the various mailcap files.
-   (let ((mm-inline-media-tests '(
-				  ("text/.*" ignore identity)
-				  ("application/pgp-signature" ignore identity)
-				  ("multipart/alternative" ignore identity)
-				  ("multipart/mixed" ignore identity)
-				  ("multipart/related" ignore identity)
-				  )))
+   (let ((mm-inline-media-tests
+	  '(("text/.*" ignore identity)
+	    ("application/pgp-signature" ignore identity)
+	    ("multipart/alternative" ignore identity)
+	    ("multipart/mixed" ignore identity)
+	    ("multipart/related" ignore identity))))
      (mm-display-parts (mm-dissect-buffer)))))
 
 (defun notmuch-show-save-attachments ()
@@ -1785,10 +1784,8 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
 	(if (notmuch-show-message-visible-p)
 	    (setq message-ids
 		  (append message-ids (list (notmuch-show-get-message-id)))))
-	(setq done (not (notmuch-show-goto-message-next)))
-	)
-      message-ids
-      )))
+	(setq done (not (notmuch-show-goto-message-next))))
+      message-ids)))
 
 ;; Commands typically bound to keys.
 
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6ac0c62d..b1bb40b1 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context (concat " and (" query-context ")"))
-			      ))
+			      (if query-context
+				  (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 2e84cd34..d6e0a9d5 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -910,8 +910,7 @@ (defun notmuch-search-buffer-title (query)
 		    query)
 		   "*"))
 	  (t
-	   (concat "*notmuch-search-" query "*"))
-	  )))
+	   (concat "*notmuch-search-" query "*")))))
 
 (defun notmuch-read-query (prompt)
   "Read a notmuch-query from the minibuffer with completion.
@@ -1003,8 +1002,7 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
       (if proc
-	  (error "notmuch search process already running for query `%s'" query)
-	)
+	  (error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 05/34] emacs: Only set one variable per setq form
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (3 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 04/34] emacs: Closing parenthesis go on the same line Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 06/34] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
                     ` (30 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

It's a bit weird to avoid having to write the "(setq ... )" more than
once, just because we can.  In a language that uses '=' for the same
purpose we also happily use that once per assignment.

While there are no benefit to using just one 'setq' there are some
drawbacks.  It is not always clear on first what is a key and what a
value and as a result it is easy to make a mistake.  Also it becomes
harder to comment out just one assignment.
---
 emacs/notmuch-address.el |  6 +++---
 emacs/notmuch-crypto.el  | 23 ++++++++++++-----------
 emacs/notmuch-lib.el     |  8 ++++----
 emacs/notmuch-show.el    | 26 ++++++++++++++------------
 emacs/notmuch-tree.el    |  4 ++--
 emacs/notmuch.el         | 35 ++++++++++++++++++-----------------
 6 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 09dda247..4db7096c 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -381,9 +381,9 @@ (defun notmuch-address--load-address-hash ()
 		      notmuch-address-internal-completion)
 	       (equal (plist-get load-plist :version)
 		      notmuch-address--save-hash-version))
-      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest)
-	    notmuch-address-completions (plist-get load-plist :completions)
-	    notmuch-address-full-harvest-finished t)
+      (setq notmuch-address-last-harvest (plist-get load-plist :last-harvest))
+      (setq notmuch-address-completions (plist-get load-plist :completions))
+      (setq notmuch-address-full-harvest-finished t)
       ;; Return t to say load was successful.
       t)))
 
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 58947a20..420b008f 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -117,20 +117,21 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
 	    (userid (plist-get sigstatus :userid)))
 	;; If userid is present it has full or greater validity.
 	(if userid
-	    (setq label (concat "Good signature by: " userid)
-		  face 'notmuch-crypto-signature-good)
-	  (setq label (concat "Good signature by key: " fingerprint)
-		face 'notmuch-crypto-signature-good-key))
-	(setq button-action 'notmuch-crypto-sigstatus-good-callback
-	      help-msg (concat "Click to list key ID 0x" fingerprint "."))))
+	    (progn
+	      (setq label (concat "Good signature by: " userid))
+	      (setq face 'notmuch-crypto-signature-good))
+	  (setq label (concat "Good signature by key: " fingerprint))
+	  (setq face 'notmuch-crypto-signature-good-key))
+	(setq button-action 'notmuch-crypto-sigstatus-good-callback)
+	(setq help-msg (concat "Click to list key ID 0x" fingerprint "."))))
      ((string= status "error")
-      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm")
-	    button-action 'notmuch-crypto-sigstatus-error-callback
-	    help-msg (concat "Click to retrieve key ID " keyid
+      (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
+      (setq button-action 'notmuch-crypto-sigstatus-error-callback)
+      (setq help-msg (concat "Click to retrieve key ID " keyid
 			     " from keyserver.")))
      ((string= status "bad")
-      (setq label (concat "Bad signature (claimed key ID " keyid ")")
-	    face 'notmuch-crypto-signature-bad))
+      (setq label (concat "Bad signature (claimed key ID " keyid ")"))
+      (setq face 'notmuch-crypto-signature-bad))
      (status
       (setq label (concat "Unknown signature status: " status)))
      (t
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index f8958a91..886da99f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -861,8 +861,8 @@ (defun notmuch-call-notmuch--helper (destination args)
   (let (stdin-string)
     (while (keywordp (car args))
       (cl-case (car args)
-	(:stdin-string (setq stdin-string (cadr args)
-			     args (cddr args)))
+	(:stdin-string (setq stdin-string (cadr args))
+		       (setq args (cddr args)))
 	(otherwise
 	 (error "Unknown keyword argument: %s" (car args)))))
     (if (null stdin-string)
@@ -939,8 +939,8 @@ (defun notmuch-start-notmuch (name buffer sentinel &rest args)
 		      :buffer buffer
 		      :command (cons command args)
 		      :connection-type 'pipe
-		      :stderr err-buffer)
-		err-proc (get-buffer-process err-buffer))
+		      :stderr err-buffer))
+	  (setq err-proc (get-buffer-process err-buffer))
 	  (process-put proc 'err-buffer err-buffer)
 
 	  (process-put err-proc 'err-file err-file)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 8592936f..a0a6c09d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -415,8 +415,8 @@ (defun notmuch-clean-address (address)
 	(cond
 	 ;; "User <user@dom.ain>" style.
 	 ((string-match "\\(.*\\) <\\(.*\\)>" address)
-	  (setq p-name (match-string 1 address)
-		p-address (match-string 2 address)))
+	  (setq p-name (match-string 1 address))
+	  (setq p-address (match-string 2 address)))
 
 	 ;; "<user@dom.ain>" style.
 	 ((string-match "<\\(.*\\)>" address)
@@ -1250,14 +1250,16 @@ (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-contex
     ;; Set various buffer local variables to their appropriate initial
     ;; state. Do this after enabling `notmuch-show-mode' so that they
     ;; aren't wiped out.
-    (setq notmuch-show-thread-id thread-id
-	  notmuch-show-parent-buffer parent-buffer
-	  notmuch-show-query-context (if (or (string= query-context "")
-					     (string= query-context "*"))
-					 nil query-context)
-	  notmuch-show-process-crypto notmuch-crypto-process-mime
-	  ;; If `elide-toggle', invert the default value.
-	  notmuch-show-elide-non-matching-messages
+    (setq notmuch-show-thread-id thread-id)
+    (setq notmuch-show-parent-buffer parent-buffer)
+    (setq notmuch-show-query-context
+	  (if (or (string= query-context "")
+		  (string= query-context "*"))
+	      nil
+	    query-context))
+    (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
+    ;; If `elide-toggle', invert the default value.
+    (setq notmuch-show-elide-non-matching-messages
 	  (if elide-toggle
 	      (not notmuch-show-only-matching-messages)
 	    notmuch-show-only-matching-messages))
@@ -1512,8 +1514,8 @@ (define-derived-mode notmuch-show-mode fundamental-mode "notmuch-show"
 
 \\{notmuch-show-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
-  (setq buffer-read-only t
-	truncate-lines t)
+  (setq buffer-read-only t)
+  (setq truncate-lines t)
   (setq imenu-prev-index-position-function
 	#'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b1bb40b1..827acebf 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -956,8 +956,8 @@ (define-derived-mode notmuch-tree-mode fundamental-mode "notmuch-tree"
 \\{notmuch-tree-mode-map}"
   (setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
   (hl-line-mode 1)
-  (setq buffer-read-only t
-	truncate-lines t))
+  (setq buffer-read-only t)
+  (setq truncate-lines t))
 
 (defun notmuch-tree-process-sentinel (proc msg)
   "Add a message to let user know when \"notmuch tree\" exits."
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index d6e0a9d5..6ce2b1f9 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -443,8 +443,8 @@ (defun notmuch-search-foreach-result (beg end fn)
     (while (and pos (or (< pos end) first))
       (when (notmuch-search-get-result pos)
 	(funcall fn pos))
-      (setq pos (notmuch-search-result-end pos)
-	    first nil))))
+      (setq pos (notmuch-search-result-end pos))
+      (setq first nil))))
 ;; Unindent the function argument of notmuch-search-foreach-result so
 ;; the indentation of callers doesn't get out of hand.
 (put 'notmuch-search-foreach-result 'lisp-indent-function 2)
@@ -589,8 +589,8 @@ (defun notmuch-search-tag (tag-changes &optional beg end only-matched)
 If ONLY-MATCHED is non-nil, only tag matched messages."
   (interactive (notmuch-search-interactive-tag-changes))
   (unless (and beg end)
-    (setq beg (car (notmuch-interactive-region))
-	  end (cadr (notmuch-interactive-region))))
+    (setq beg (car (notmuch-interactive-region)))
+    (setq end (cadr (notmuch-interactive-region))))
   (let ((search-string (notmuch-search-find-stable-query-region
 			beg end only-matched)))
     (notmuch-tag search-string tag-changes)
@@ -762,8 +762,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 				   (length "... "))))
 	    ;; Truncate the visible string according to the width of
 	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length)
-		  invisible-string (substring formatted-authors visible-length))
+	    (setq visible-string (substring formatted-authors 0 visible-length))
+	    (setq invisible-string (substring formatted-authors visible-length))
 	    ;; If possible, truncate the visible string at a natural
 	    ;; break (comma or pipe), as incremental search doesn't
 	    ;; match across the visible/invisible border.
@@ -771,8 +771,8 @@ (defun notmuch-search-insert-authors (format-string authors)
 	      ;; Second clause is destructive on `visible-string', so
 	      ;; order is important.
 	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string)
-		    visible-string (concat (match-string 1 visible-string)
+					     invisible-string))
+	      (setq visible-string (concat (match-string 1 visible-string)
 					   (match-string 2 visible-string))))
 	    ;; `visible-string' may be shorter than the space allowed
 	    ;; by `format-string'. If so we must insert some padding
@@ -785,17 +785,18 @@ (defun notmuch-search-insert-authors (format-string authors)
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
 	  ;; non-matching authors.
-	  (setq visible-string (notmuch-search-author-propertize visible-string)
-		;; The invisible string must contain only non-matching
-		;; authors, as the visible-string contains both.
-		invisible-string (propertize invisible-string
-					     'face 'notmuch-search-non-matching-authors))
+	  (progn
+	    (setq visible-string (notmuch-search-author-propertize visible-string))
+	    ;; The invisible string must contain only non-matching
+	    ;; authors, as the visible-string contains both.
+	    (setq invisible-string (propertize invisible-string
+					       'face 'notmuch-search-non-matching-authors)))
 	;; The visible string contains only matching authors.
 	(setq visible-string (propertize visible-string
-					 'face 'notmuch-search-matching-authors)
-	      ;; The invisible string may contain both matching and
-	      ;; non-matching authors.
-	      invisible-string (notmuch-search-author-propertize invisible-string)))
+					 'face 'notmuch-search-matching-authors))
+	;; The invisible string may contain both matching and
+	;; non-matching authors.
+	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 06/34] emacs: Use 'and' instead of 'when' when the return value matters
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (4 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 05/34] emacs: Only set one variable per setq form Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 07/34] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
                     ` (29 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

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       |  2 +-
 emacs/notmuch-lib.el         | 37 +++++++++---------
 emacs/notmuch-maildir-fcc.el |  4 +-
 emacs/notmuch-mua.el         | 13 +++----
 emacs/notmuch-show.el        | 45 +++++++++++-----------
 emacs/notmuch-tree.el        |  4 +-
 emacs/notmuch-wash.el        |  8 ++--
 emacs/notmuch.el             | 28 ++++++++------
 11 files changed, 114 insertions(+), 113 deletions(-)

diff --git a/emacs/coolj.el b/emacs/coolj.el
index 961db606..39a8de2b 100644
--- a/emacs/coolj.el
+++ b/emacs/coolj.el
@@ -107,12 +107,12 @@ (defun coolj-set-breakpoint (prefix)
 If the line should not be broken, return nil; point remains on the
 line."
   (move-to-column fill-column)
-  (if (and (re-search-forward "[^ ]" (line-end-position) 1)
-	   (> (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)))))
+  (and (re-search-forward "[^ ]" (line-end-position) 1)
+       (> (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)))))
 
 (defun coolj-find-break-backward (prefix)
   "Move point backward to the first available breakpoint and return t.
diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 4db7096c..2dd08661 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -252,20 +252,20 @@ (defun notmuch-address-expand-name ()
 (defun notmuch-address-locate-command (command)
   "Return non-nil if `command' is an executable either on
 `exec-path' or an absolute pathname."
-  (when (stringp command)
-    (if (and (file-name-absolute-p command)
-	     (file-executable-p command))
-	command
-      (setq command (file-name-nondirectory command))
-      (catch 'found-command
-	(let (bin)
-	  (dolist (dir exec-path)
-	    (setq bin (expand-file-name command dir))
-	    (when (or (and (file-executable-p bin)
-			   (not (file-directory-p bin)))
-		      (and (file-executable-p (setq bin (concat bin ".exe")))
-			   (not (file-directory-p bin))))
-	      (throw 'found-command bin))))))))
+  (and (stringp command)
+       (if (and (file-name-absolute-p command)
+		(file-executable-p command))
+	   command
+	 (setq command (file-name-nondirectory command))
+	 (catch 'found-command
+	   (let (bin)
+	     (dolist (dir exec-path)
+	       (setq bin (expand-file-name command dir))
+	       (when (or (and (file-executable-p bin)
+			      (not (file-directory-p bin)))
+			 (and (file-executable-p (setq bin (concat bin ".exe")))
+			      (not (file-directory-p bin))))
+		 (throw 'found-command bin))))))))
 
 (defun notmuch-address-harvest-addr (result)
   (let ((name-addr (plist-get result :name-addr)))
@@ -304,18 +304,20 @@ (defun notmuch-address-harvest (&optional addr-prefix synchronous callback)
 execution, CALLBACK is called when harvesting finishes."
   (let* ((sent (eq (car notmuch-address-internal-completion) 'sent))
 	 (config-query (cadr notmuch-address-internal-completion))
-	 (prefix-query (when addr-prefix
-			 (format "%s:%s*" (if sent "to" "from") addr-prefix)))
+	 (prefix-query (and addr-prefix
+			    (format "%s:%s*"
+				    (if sent "to" "from")
+				    addr-prefix)))
 	 (from-or-to-me-query
 	  (mapconcat (lambda (x)
 		       (concat (if sent "from:" "to:") x))
 		     (notmuch-user-emails) " or "))
 	 (query (if (or prefix-query config-query)
 		    (concat (format "(%s)" from-or-to-me-query)
-			    (when prefix-query
-			      (format " and (%s)" prefix-query))
-			    (when config-query
-			      (format " and (%s)" config-query)))
+			    (and prefix-query
+				 (format " and (%s)" prefix-query))
+			    (and config-query
+				 (format " and (%s)" config-query)))
 		  from-or-to-me-query))
 	 (args `("address" "--format=sexp" "--format-version=4"
 		 ,(if sent "--output=recipients" "--output=sender")
@@ -354,21 +356,21 @@ (defun notmuch-address--get-address-hash ()
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
-  (when notmuch-address-save-filename
-    (condition-case nil
-	(with-temp-buffer
-	  (insert-file-contents notmuch-address-save-filename)
-	  (let ((name (read (current-buffer)))
-		(plist (read (current-buffer))))
-	    ;; We do two simple sanity checks on the loaded file. We just
-	    ;; check a version is specified, not that it is the current
-	    ;; version, as we are allowed to over-write and a save-file with
-	    ;; an older version.
-	    (when (and (string= name "notmuch-address-hash")
-		       (plist-get plist :version))
-	      plist)))
-      ;; The error case catches any of the reads failing.
-      (error nil))))
+  (and notmuch-address-save-filename
+       (condition-case nil
+	   (with-temp-buffer
+	     (insert-file-contents notmuch-address-save-filename)
+	     (let ((name (read (current-buffer)))
+		   (plist (read (current-buffer))))
+	       ;; We do two simple sanity checks on the loaded file.
+	       ;; We just check a version is specified, not that
+	       ;; it is the current version, as we are allowed to
+	       ;; over-write and a save-file with an older version.
+	       (and (string= name "notmuch-address-hash")
+		    (plist-get plist :version)
+		    plist)))
+	 ;; The error case catches any of the reads failing.
+	 (error nil))))
 
 (defun notmuch-address--load-address-hash ()
   "Read the saved address hash and set the corresponding variables."
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 420b008f..e6bf8339 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -253,7 +253,7 @@ (defun notmuch-crypto-insert-encstatus-button (encstatus)
 	       "Decryption error")
 	      (t
 	       (concat "Unknown encryption status"
-		       (if status (concat ": " status))))))
+		       (and status (concat ": " status))))))
 	   " ]")
    :type 'notmuch-crypto-status-button-type
    'face 'notmuch-crypto-decryption
diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index ea995379..759e6c9e 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -263,7 +263,7 @@ (defun notmuch-draft-resume (id)
       ;; If the resumed message was a draft then set the draft
       ;; message-id so that we can delete the current saved draft if the
       ;; message is resaved or sent.
-      (setq notmuch-draft-id (when draft id)))))
+      (setq notmuch-draft-id (and draft id)))))
 
 
 (add-hook 'message-send-hook 'notmuch-draft--mark-deleted)
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 886da99f..98056eb6 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -608,7 +608,7 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 		       (set-buffer-multibyte nil))
 		     (let ((args `("show" "--format=raw"
 				   ,(format "--part=%s" (plist-get part :id))
-				   ,@(when process-crypto '("--decrypt=true"))
+				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
 			    (if binaryp 'no-conversion
@@ -781,8 +781,8 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s" (concat msg (when extra
-			    " (see *Notmuch errors* for more details)"))))
+  (error "%s"
+	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
@@ -836,10 +836,8 @@ (defun notmuch-check-exit-status (exit-status command &optional output err)
 		    (if (integerp exit-status)
 			(format "exit status: %s\n" exit-status)
 		      (format "exit signal: %s\n" exit-status))
-		    (when err
-		      (concat "stderr:\n" err))
-		    (when output
-		      (concat "stdout:\n" output)))))
+		    (and err    (concat "stderr:\n" err))
+		    (and output (concat "stdout:\n" output)))))
       (if err
 	  ;; We have an error message straight from the CLI.
 	  (notmuch-logged-error
@@ -968,8 +966,8 @@ (defun notmuch-start-notmuch-sentinel (proc event)
   (let* ((err-file (process-get proc 'err-file))
 	 (err-buffer (or (process-get proc 'err-buffer)
 			 (find-file-noselect err-file)))
-	 (err (when (not (zerop (buffer-size err-buffer)))
-		(with-current-buffer err-buffer (buffer-string))))
+	 (err (and (not (zerop (buffer-size err-buffer)))
+		   (with-current-buffer err-buffer (buffer-string))))
 	 (sub-sentinel (process-get proc 'sub-sentinel))
 	 (real-command (process-get proc 'real-command)))
     (condition-case err
@@ -987,16 +985,17 @@ (defun notmuch-start-notmuch-sentinel (proc event)
 	  ;; If that didn't signal an error, then any error output was
 	  ;; really warning output.  Show warnings, if any.
 	  (let ((warnings
-		 (when err
-		   (with-current-buffer err-buffer
-		     (goto-char (point-min))
-		     (end-of-line)
-		     ;; Show first line; stuff remaining lines in the
-		     ;; errors buffer.
-		     (let ((l1 (buffer-substring (point-min) (point))))
-		       (skip-chars-forward "\n")
-		       (cons l1 (unless (eobp)
-				  (buffer-substring (point) (point-max)))))))))
+		 (and err
+		      (with-current-buffer err-buffer
+			(goto-char (point-min))
+			(end-of-line)
+			;; Show first line; stuff remaining lines in the
+			;; errors buffer.
+			(let ((l1 (buffer-substring (point-min) (point))))
+			  (skip-chars-forward "\n")
+			  (cons l1 (and (not (eobp))
+					(buffer-substring (point)
+							  (point-max)))))))))
 	    (when warnings
 	      (notmuch-logged-error (car warnings) (cdr warnings)))))
       (error
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 7d001b2d..1027e1a7 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -215,7 +215,7 @@ (defun notmuch-maildir-notmuch-insert-current-buffer (folder &optional create ta
 database in folder FOLDER. If CREATE is non-nil it will supply
 the --create-folder flag to create the folder if necessary. TAGS
 should be a list of tag changes to apply to the inserted message."
-  (let* ((args (append (when create (list "--create-folder"))
+  (let* ((args (append (and create (list "--create-folder"))
 		       (list (concat "--folder=" folder))
 		       tags)))
     (apply 'notmuch-call-notmuch-process
@@ -315,7 +315,7 @@ (defun notmuch-maildir-fcc-move-tmp-to-new (destdir msg-id)
 (defun notmuch-maildir-fcc-move-tmp-to-cur (destdir msg-id &optional mark-seen)
   (add-name-to-file
    (concat destdir "/tmp/" msg-id)
-   (concat destdir "/cur/" msg-id ":2," (when mark-seen "S"))))
+   (concat destdir "/cur/" msg-id ":2," (and mark-seen "S"))))
 
 (defun notmuch-maildir-fcc-file-fcc (fcc-header)
   "Write the message to the file specified by FCC-HEADER.
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 7f80224f..f6d8ffc5 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -460,8 +460,8 @@ (defun notmuch-mua-new-mail (&optional prompt-for-sender)
 the From: address first."
   (interactive "P")
   (let ((other-headers
-	 (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	   (list (cons 'From (notmuch-mua-prompt-for-sender))))))
+	 (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	      (list (cons 'From (notmuch-mua-prompt-for-sender))))))
     (notmuch-mua-mail nil nil other-headers nil (notmuch-mua-get-switch-function))))
 
 (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
@@ -470,8 +470,8 @@ (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
 If PROMPT-FOR-SENDER is non-nil, the user will be prompteed for
 the From: address."
   (let* ((other-headers
-	  (when (or prompt-for-sender notmuch-always-prompt-for-sender)
-	    (list (cons 'From (notmuch-mua-prompt-for-sender)))))
+	  (and (or prompt-for-sender notmuch-always-prompt-for-sender)
+	       (list (cons 'From (notmuch-mua-prompt-for-sender)))))
 	 ;; Comes from the first message and is applied later.
 	 forward-subject
 	 ;; List of accumulated message-references of forwarded messages.
@@ -542,9 +542,8 @@ (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all
   ;; primary selection was previously in a non-emacs window but not if
   ;; it was in an emacs window. To avoid the problem in the latter case
   ;; we deactivate mark.
-  (let ((sender
-	 (when prompt-for-sender
-	   (notmuch-mua-prompt-for-sender)))
+  (let ((sender (and prompt-for-sender
+		     (notmuch-mua-prompt-for-sender)))
 	(select-active-regions nil))
     (notmuch-mua-reply query-string sender reply-all)
     (deactivate-mark)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a0a6c09d..211be091 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -500,10 +500,10 @@ (define-button-type 'notmuch-show-part-button-type
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
   (let ((button)
-	(base-label (concat (when name (concat name ": "))
+	(base-label (concat (and name (concat name ": "))
 			    declared-type
-			    (unless (string-equal declared-type content-type)
-			      (concat " (as " content-type ")"))
+			    (and (not (string-equal declared-type content-type))
+				 (concat " (as " content-type ")"))
 			    comment)))
     (setq button
 	  (insert-button
@@ -781,18 +781,15 @@ (if (version< emacs-version "25.3")
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
   ;; we return that.
-  (if (plist-get part :filename)
-      (let ((extension (file-name-extension (plist-get part :filename)))
-	    mime-type)
-	(if extension
-	    (progn
-	      (mailcap-parse-mimetypes)
-	      (setq mime-type (mailcap-extension-to-mime extension))
-	      (if (and mime-type
-		       (not (string-equal mime-type "application/octet-stream")))
-		  mime-type
-		nil))
-	  nil))))
+  (and (plist-get part :filename)
+       (let ((extension (file-name-extension (plist-get part :filename))))
+	 (and extension
+	      (progn
+		(mailcap-parse-mimetypes)
+		(let ((mime-type (mailcap-extension-to-mime extension)))
+		  (and mime-type
+		       (not (string-equal mime-type "application/octet-stream"))
+		       mime-type)))))))
 
 (defun notmuch-show-insert-part-text/html (msg part content-type nth depth button)
   (if (eq mm-text-html-renderer 'shr)
@@ -991,9 +988,10 @@ (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
 	 (beg (point))
 	 ;; This default header-p function omits the part button for
 	 ;; the first (or only) part if this is text/plain.
-	 (button (when (funcall notmuch-show-insert-header-p-function part hide)
-		   (notmuch-show-insert-part-header nth mime-type content-type
-						    (plist-get part :filename))))
+	 (button (and (funcall notmuch-show-insert-header-p-function part hide)
+		      (notmuch-show-insert-part-header
+		       nth mime-type content-type
+		       (plist-get part :filename))))
 	 ;; Hide the part initially if HIDE is t, or if it is too long
 	 ;; and we have a button to allow toggling.
 	 (show-part (not (or (equal hide t)
@@ -1048,9 +1046,8 @@ (defun notmuch-show-insert-msg (msg depth)
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
     (setq message-start (point-marker))
     (notmuch-show-insert-headerline headers
-				    (or (if notmuch-show-relative-dates
-					    (plist-get msg :date_relative)
-					  nil)
+				    (or (and notmuch-show-relative-dates
+					     (plist-get msg :date_relative))
 					(plist-get headers :Date))
 				    (plist-get msg :tags) depth)
     (setq content-start (point-marker))
@@ -1297,8 +1294,8 @@ (defun notmuch-show--build-buffer (&optional state)
 
 If no messages match the query return NIL."
   (let* ((cli-args (cons "--exclude=false"
-			 (when notmuch-show-elide-non-matching-messages
-			   (list "--entire-thread=false"))))
+			 (and notmuch-show-elide-non-matching-messages
+			      (list "--entire-thread=false"))))
 	 (queries (notmuch-show--build-queries
 		   notmuch-show-thread-id notmuch-show-query-context))
 	 (forest nil)
@@ -2406,7 +2403,7 @@ (defun notmuch-show-current-part-handle (&optional mime-type)
 	 (buf (notmuch-show-generate-part-buffer msg part))
 	 (computed-type (or mime-type (plist-get part :computed-type)))
 	 (filename (plist-get part :filename))
-	 (disposition (if filename `(attachment (filename . ,filename)))))
+	 (disposition (and filename `(attachment (filename . ,filename)))))
     (mm-make-handle buf (list computed-type) nil nil disposition)))
 
 (defun notmuch-show-apply-to-current-part-handle (fn &optional mime-type)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 827acebf..37a5d1c8 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1020,8 +1020,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (erase-buffer)
   (goto-char (point-min))
   (let* ((search-args (concat basic-query
-			      (if query-context
-				  (concat " and (" query-context ")"))))
+			      (and query-context
+				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
     (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
 	(setq search-args basic-query))
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 00ac45b6..31fda61f 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -370,10 +370,10 @@ (defun notmuch-wash-subject-to-patch-sequence-number (subject)
 
 Return the patch sequence number N from the last \"[PATCH N/M]\"
 style prefix in SUBJECT, or nil if such a prefix can't be found."
-  (when (string-match
-	 "^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
-	 subject)
-    (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
+  (and (string-match
+	"^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
+	subject)
+       (string-to-number (substring subject (match-beginning 2) (match-end 2)))))
 
 (defun notmuch-wash-subject-to-patch-filename (subject)
   "Convert a patch mail SUBJECT into a filename.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6ce2b1f9..41207643 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -264,7 +264,8 @@ (defun notmuch-search-last-thread ()
   (goto-char (point-max))
   (forward-line -2)
   (let ((beg (notmuch-search-result-beginning)))
-    (when beg (goto-char beg))))
+    (when beg
+      (goto-char beg))))
 
 (defun notmuch-search-first-thread ()
   "Select the first thread in the search results."
@@ -406,11 +407,12 @@ (defun notmuch-search-result-beginning (&optional pos)
   "Return the point at the beginning of the thread at POS (or point).
 
 If there is no thread at POS (or point), returns nil."
-  (when (notmuch-search-get-result pos)
-    ;; We pass 1+point because previous-single-property-change starts
-    ;; searching one before the position we give it.
-    (previous-single-property-change (1+ (or pos (point)))
-				     'notmuch-search-result nil (point-min))))
+  (and (notmuch-search-get-result pos)
+       ;; We pass 1+point because previous-single-property-change starts
+       ;; searching one before the position we give it.
+       (previous-single-property-change (1+ (or pos (point)))
+					'notmuch-search-result nil
+					(point-min))))
 
 (defun notmuch-search-result-end (&optional pos)
   "Return the point at the end of the thread at POS (or point).
@@ -418,9 +420,10 @@ (defun notmuch-search-result-end (&optional pos)
 The returned point will be just after the newline character that
 ends the result line.  If there is no thread at POS (or point),
 returns nil."
-  (when (notmuch-search-get-result pos)
-    (next-single-property-change (or pos (point)) 'notmuch-search-result
-				 nil (point-max))))
+  (and (notmuch-search-get-result pos)
+       (next-single-property-change (or pos (point))
+				    'notmuch-search-result nil
+				    (point-max))))
 
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
@@ -461,7 +464,8 @@ (defun notmuch-search-find-thread-id (&optional bare)
 
 If BARE is set then do not prefix with \"thread:\"."
   (let ((thread (plist-get (notmuch-search-get-result) :thread)))
-    (when thread (concat (unless bare "thread:") thread))))
+    (when thread
+      (concat (and (not bare) "thread:") thread))))
 
 (defun notmuch-search-find-stable-query ()
   "Return the stable queries for the current thread.
@@ -482,8 +486,8 @@ (defun notmuch-search-find-stable-query-region (beg end &optional only-matched)
 	(push (car queries) query-list))
       (when (and all (cadr queries))
 	(push (cadr queries) query-list)))
-    (when query-list
-      (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
+    (and query-list
+	 (concat "(" (mapconcat 'identity query-list ") or (") ")"))))
 
 (defun notmuch-search-find-authors ()
   "Return the authors for the current thread."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 07/34] emacs: Use 'unless' instead of 'when' and 'not'
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (5 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 06/34] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 08/34] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
                     ` (28 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Also use 'unless' in a few cases where previously 'if' was used with
'not' but without an ELSE part.
---
 emacs/notmuch-hello.el  | 6 +++---
 emacs/notmuch-mua.el    | 4 ++--
 emacs/notmuch-parser.el | 2 +-
 emacs/notmuch-show.el   | 3 +--
 emacs/notmuch-tag.el    | 4 ++--
 emacs/notmuch-tree.el   | 8 ++++----
 emacs/notmuch.el        | 4 ++--
 test/test-lib.el        | 6 +++---
 8 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 89e03c36..1c0b1848 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -638,7 +638,7 @@ (defun notmuch-hello-window-configuration-change ()
     (dolist (window (window-list))
       (let ((last-buf (window-parameter window 'notmuch-hello-last-buffer))
 	    (cur-buf (window-buffer window)))
-	(when (not (eq last-buf cur-buf))
+	(unless (eq last-buf cur-buf)
 	  ;; This window changed or is new.  Update recorded buffer
 	  ;; for next time.
 	  (set-window-parameter window 'notmuch-hello-last-buffer cur-buf)
@@ -652,7 +652,7 @@ (defun notmuch-hello-window-configuration-change ()
       ;; 24, we can't do it right here because something in this
       ;; hook's call stack overrides hello's point placement.
       (run-at-time nil nil #'notmuch-hello t))
-    (when (null hello-buf)
+    (unless hello-buf
       ;; Clean up hook
       (remove-hook 'window-configuration-change-hook
 		   #'notmuch-hello-window-configuration-change))))
@@ -908,7 +908,7 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
 				(notmuch-hello-update))
 		     "hide"))
     (widget-insert "\n")
-    (when (not is-hidden)
+    (unless is-hidden
       (let ((searches (apply 'notmuch-hello-query-counts query-list options)))
 	(when (or (not (plist-get options :hide-if-empty))
 		  searches)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index f6d8ffc5..dc1f518c 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -198,7 +198,7 @@ (defun notmuch-mua-user-agent-emacs ()
 (defun notmuch-mua-add-more-hidden-headers ()
   "Add some headers to the list that are hidden by default."
   (mapc (lambda (header)
-	  (when (not (member header message-hidden-headers))
+	  (unless (member header message-hidden-headers)
 	    (push header message-hidden-headers)))
 	notmuch-mua-hidden-headers))
 
@@ -368,7 +368,7 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
   (interactive)
   (when notmuch-mua-user-agent-function
     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
-      (when (not (string= "" user-agent))
+      (unless (string= "" user-agent)
 	(push (cons 'User-Agent user-agent) other-headers))))
   (unless (assq 'From other-headers)
     (push (cons 'From (message-make-from
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index 06e7487b..fbcfc2ef 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -78,7 +78,7 @@ (defun notmuch-sexp-read (sp)
 	 ;; parse, extend the partial parse to figure out when we
 	 ;; have a complete list.
 	 (catch 'return
-	   (when (null (notmuch-sexp--partial-state sp))
+	   (unless (notmuch-sexp--partial-state sp)
 	     (let ((start (point)))
 	       (condition-case nil
 		   (throw 'return (read (current-buffer)))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 211be091..6102ca2e 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1060,8 +1060,7 @@ (defun notmuch-show-insert-msg (msg depth)
       ;; If the subject of this message is the same as that of the
       ;; previous message, don't display it when this message is
       ;; collapsed.
-      (when (not (string= notmuch-show-previous-subject
-			  bare-subject))
+      (unless (string= notmuch-show-previous-subject bare-subject)
 	(forward-line 1))
       (setq headers-start (point-marker)))
     (setq headers-end (point-marker))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 2fcf5a9e..1067f185 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -382,8 +382,8 @@ (defun notmuch-tag-completions (&rest search-terms)
   "Return a list of tags for messages matching SEARCH-TERMS.
 
 Returns all tags if no search terms are given."
-  (if (null search-terms)
-      (setq search-terms (list "*")))
+  (unless search-terms
+    (setq search-terms (list "*")))
   (split-string
    (with-output-to-string
      (with-current-buffer standard-output
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 37a5d1c8..a5ae0edb 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1063,10 +1063,10 @@ (defun notmuch-tree (&optional query query-context target buffer-name open-targe
   OPEN-TARGET: If TRUE open the target message in the message pane.
   UNTHREADED: If TRUE only show matching messages in an unthreaded view."
   (interactive)
-  (if (null query)
-      (setq query (notmuch-read-query (concat "Notmuch "
-					      (if unthreaded "unthreaded " "tree ")
-					      "view search: "))))
+  (unless query
+    (setq query (notmuch-read-query (concat "Notmuch "
+					    (if unthreaded "unthreaded " "tree ")
+					    "view search: "))))
   (let ((buffer (get-buffer-create (generate-new-buffer-name
 				    (or buffer-name
 					(concat "*notmuch-"
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 41207643..93e92b39 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -803,13 +803,13 @@ (defun notmuch-search-insert-authors (format-string authors)
 	(setq invisible-string (notmuch-search-author-propertize invisible-string)))
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(setq visible-string
 	      (propertize visible-string
 			  'help-echo (concat "..." invisible-string))))
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
-      (when (not (string= invisible-string ""))
+      (unless (string= invisible-string "")
 	(let ((start (point))
 	      overlay)
 	  (insert invisible-string)
diff --git a/test/test-lib.el b/test/test-lib.el
index aae9e833..a1233390 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -81,7 +81,7 @@ (defun visible-buffer-substring (start end)
   (let (str)
     (while (< start end)
       (let ((next-pos (next-char-property-change start end)))
-	(when (not (invisible-p start))
+	(unless (invisible-p start)
 	  (setq str (concat str (buffer-substring-no-properties
 				 start next-pos))))
 	(setq start next-pos)))
@@ -97,8 +97,8 @@ (defun test-process-running (pid)
 (defun orphan-watchdog-check (pid)
   "Periodically check that the process with id PID is still
 running, quit if it terminated."
-  (if (not (test-process-running pid))
-      (kill-emacs)))
+  (unless (test-process-running pid)
+    (kill-emacs)))
 
 (defun orphan-watchdog (pid)
   "Initiate orphan watchdog check."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 08/34] emacs: Use 'when' instead of 'if' when there is no ELSE part
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (6 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 07/34] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 09/34] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
                     ` (27 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 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 +-
 emacs/notmuch-show.el    |  93 ++++++++++++++++++------------------
 emacs/notmuch-tree.el    |  30 ++++++------
 emacs/notmuch-wash.el    |  68 +++++++++++++-------------
 emacs/notmuch.el         | 100 +++++++++++++++++++--------------------
 test/test-lib.el         |   4 +-
 12 files changed, 206 insertions(+), 203 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 2dd08661..85531489 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -171,10 +171,10 @@ (defun notmuch-address-toggle-internal-completion ()
   (if (local-variable-p 'notmuch-address-command)
       (kill-local-variable 'notmuch-address-command)
     (notmuch-setq-local notmuch-address-command 'internal))
-  (if (boundp 'company-idle-delay)
-      (if (local-variable-p 'company-idle-delay)
-	  (kill-local-variable 'company-idle-delay)
-	(notmuch-setq-local company-idle-delay nil))))
+  (when (boundp 'company-idle-delay)
+    (if (local-variable-p 'company-idle-delay)
+	(kill-local-variable 'company-idle-delay)
+      (notmuch-setq-local company-idle-delay nil))))
 
 (defun notmuch-address-matching (substring)
   "Returns a list of completion candidates matching SUBSTRING.
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 388ef70f..3340918f 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -68,9 +68,9 @@ (if (fboundp 'read-char-choice)
 		   ;; This is an inlined copy of help-form-show as that
 		   ;; was introduced in emacs 24 too.
 		   (let ((msg (eval help-form)))
-		     (if (stringp msg)
-			 (with-output-to-temp-buffer " *Char Help*"
-			   (princ msg))))))
+		     (when (stringp msg)
+		       (with-output-to-temp-buffer " *Char Help*"
+			 (princ msg))))))
 	     ((memq char chars)
 	      (setq done t))
 	     ((and executing-kbd-macro (= char -1))
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 1c0b1848..c17b46bc 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -589,8 +589,8 @@ (defun notmuch-hello-insert-buttons (searches)
     (mapc (lambda (elem)
 	    ;; (not elem) indicates an empty slot in the matrix.
 	    (when elem
-	      (if (> column-indent 0)
-		  (widget-insert (make-string column-indent ? )))
+	      (when (> column-indent 0)
+		(widget-insert (make-string column-indent ? )))
 	      (let* ((name (plist-get elem :name))
 		     (query (plist-get elem :query))
 		     (oldest-first (cl-case (plist-get elem :sort-order)
@@ -890,8 +890,8 @@ (defun notmuch-hello-insert-searches (title query-list &rest options)
    the same values as :filter. If :filter and :filter-count are specified, this
    will be used instead of :filter, not in conjunction with it."
   (widget-insert title ": ")
-  (if (and notmuch-hello-first-run (plist-get options :initially-hidden))
-      (add-to-list 'notmuch-hello-hidden-sections title))
+  (when (and notmuch-hello-first-run (plist-get options :initially-hidden))
+    (add-to-list 'notmuch-hello-hidden-sections title))
   (let ((is-hidden (member title notmuch-hello-hidden-sections))
 	(start (point)))
     (if is-hidden
diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index adf79650..e302fe00 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -169,37 +169,37 @@ (defun notmuch-jump--make-keymap (action-map prompt)
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map notmuch-jump-minibuffer-map)
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (= (length key) 1)
-	  (define-key map key
-	    `(lambda () (interactive)
-	       (setq notmuch-jump--action ',fn)
-	       (exit-minibuffer)))))
+      (when (= (length key) 1)
+	(define-key map key
+	  `(lambda () (interactive)
+	     (setq notmuch-jump--action ',fn)
+	     (exit-minibuffer)))))
     ;; By doing this in two passes (and checking if we already have a
     ;; binding) we avoid problems if the user specifies a binding which
     ;; is a prefix of another binding.
     (pcase-dolist (`(,key ,name ,fn) action-map)
-      (if (> (length key) 1)
-	  (let* ((key (elt key 0))
-		 (keystr (string key))
-		 (new-prompt (concat prompt (format-kbd-macro keystr) " "))
-		 (action-submap nil))
-	    (unless (lookup-key map keystr)
-	      (pcase-dolist (`(,k ,n ,f) action-map)
-		(when (= key (elt k 0))
-		  (push (list (substring k 1) n f) action-submap)))
-	      ;; We deal with backspace specially
-	      (push (list (kbd "DEL")
-			  "Backup"
-			  (apply-partially #'notmuch-jump action-map prompt))
-		    action-submap)
-	      (setq action-submap (nreverse action-submap))
-	      (define-key map keystr
-		`(lambda () (interactive)
-		   (setq notmuch-jump--action
-			 ',(apply-partially #'notmuch-jump
-					    action-submap
-					    new-prompt))
-		   (exit-minibuffer)))))))
+      (when (> (length key) 1)
+	(let* ((key (elt key 0))
+	       (keystr (string key))
+	       (new-prompt (concat prompt (format-kbd-macro keystr) " "))
+	       (action-submap nil))
+	  (unless (lookup-key map keystr)
+	    (pcase-dolist (`(,k ,n ,f) action-map)
+	      (when (= key (elt k 0))
+		(push (list (substring k 1) n f) action-submap)))
+	    ;; We deal with backspace specially
+	    (push (list (kbd "DEL")
+			"Backup"
+			(apply-partially #'notmuch-jump action-map prompt))
+		  action-submap)
+	    (setq action-submap (nreverse action-submap))
+	    (define-key map keystr
+	      `(lambda () (interactive)
+		 (setq notmuch-jump--action
+		       ',(apply-partially #'notmuch-jump
+					  action-submap
+					  new-prompt))
+		 (exit-minibuffer)))))))
     map))
 
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 98056eb6..da48bb86 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -664,11 +664,11 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
 ;; is loaded.
-(if (>= emacs-major-version 24)
-    (defadvice mm-shr (before load-gnus-arts activate)
-      (require 'gnus-art nil t)
-      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
-      (ad-activate 'mm-shr)))
+(when (>= emacs-major-version 24)
+  (defadvice mm-shr (before load-gnus-arts activate)
+    (require 'gnus-art nil t)
+    (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
+    (ad-activate 'mm-shr)))
 
 (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
   "Use the mm-decode/mm-view functions to display a part in the
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index dc1f518c..2910a63e 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -275,8 +275,8 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all)
 	(narrow-to-region (point) (point-max))
 	(goto-char (point-max))
 	(if (re-search-backward message-signature-separator nil t)
-	    (if message-signature-insert-empty-line
-		(forward-line -1))
+	    (when message-signature-insert-empty-line
+	      (forward-line -1))
 	  (goto-char (point-max))))
       (let ((from (plist-get original-headers :From))
 	    (date (plist-get original-headers :Date))
@@ -388,7 +388,8 @@ (defun notmuch-mua-mail (&optional to subject other-headers continue
 	  ;; https://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
 	  ;; We need to convert any string input, eg from rmail-start-mail.
 	  (dolist (h other-headers other-headers)
-	    (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))
+	    (when (stringp (car h))
+	      (setcar h (intern (capitalize (car h))))))))
 	(args (list yank-action send-actions))
 	;; Cause `message-setup-1' to do things relevant for mail,
 	;; such as observe `message-default-mail-headers'.
@@ -428,14 +429,15 @@ (defvar notmuch-mua-sender-history nil)
 ;; without some explicit initialization fill freeze the operation.
 ;; Hence, we advice `ido-completing-read' to ensure required initialization
 ;; is done.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 4))
-    (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
-      (ido-init-completion-maps)
-      (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
-      (add-hook 'choose-completion-string-functions
-		'ido-choose-completion-string)
-      (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
-      (ad-activate 'ido-completing-read)))
+(when (and (= emacs-major-version 23)
+	   (< emacs-minor-version 4))
+  (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
+    (ido-init-completion-maps)
+    (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+    (add-hook 'choose-completion-string-functions
+	      'ido-choose-completion-string)
+    (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
+    (ad-activate 'ido-completing-read)))
 
 (defun notmuch-mua-prompt-for-sender ()
   "Prompt for a sender from the user's configured identities."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 1db9d7ca..a8e5d11f 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -30,8 +30,8 @@ (defun notmuch-query-get-threads (search-terms)
 list where the first element is a message, and the second element
 is a possibly empty forest of replies."
   (let ((args '("show" "--format=sexp" "--format-version=4")))
-    (if notmuch-show-process-crypto
-	(setq args (append args '("--decrypt=true"))))
+    (when notmuch-show-process-crypto
+      (setq args (append args '("--decrypt=true"))))
     (setq args (append args search-terms))
     (apply #'notmuch-call-notmuch-sexp args)))
 
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 6102ca2e..f9418a94 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -346,10 +346,10 @@ (defun notmuch-show-with-message-as-text (fn)
 	 (indenting notmuch-show-indent-content))
     (with-temp-buffer
       (insert all)
-      (if indenting
-	  (indent-rigidly (point-min)
-			  (point-max)
-			  (- (* notmuch-show-indent-messages-width depth))))
+      (when indenting
+	(indent-rigidly (point-min)
+			(point-max)
+			(- (* notmuch-show-indent-messages-width depth))))
       ;; Remove the original header.
       (goto-char (point-min))
       (re-search-forward "^$" (point-max) nil)
@@ -392,13 +392,13 @@ (defun notmuch-show-update-tags (tags)
   "Update the displayed tags of the current message."
   (save-excursion
     (goto-char (notmuch-show-message-top))
-    (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
-	(let ((inhibit-read-only t))
-	  (replace-match (concat "("
-				 (notmuch-tag-format-tags
-				  tags
-				  (notmuch-show-get-prop :orig-tags))
-				 ")"))))))
+    (when (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
+      (let ((inhibit-read-only t))
+	(replace-match (concat "("
+			       (notmuch-tag-format-tags
+				tags
+				(notmuch-show-get-prop :orig-tags))
+			       ")"))))))
 
 (defun notmuch-clean-address (address)
   "Try to clean a single email ADDRESS for display. Return a cons
@@ -482,9 +482,9 @@ (defun notmuch-show-insert-headers (headers)
     (mapc (lambda (header)
 	    (let* ((header-symbol (intern (concat ":" header)))
 		   (header-value (plist-get headers header-symbol)))
-	      (if (and header-value
-		       (not (string-equal "" header-value)))
-		  (notmuch-show-insert-header header header-value))))
+	      (when (and header-value
+			 (not (string-equal "" header-value)))
+		(notmuch-show-insert-header header header-value))))
 	  notmuch-message-headers)
     (save-excursion
       (save-restriction
@@ -600,10 +600,10 @@ (defun notmuch-show--get-cid-content (cid)
 (defun notmuch-show-setup-w3m ()
   "Instruct w3m how to retrieve content from a \"related\" part of a message."
   (interactive)
-  (if (boundp 'w3m-cid-retrieve-function-alist)
-      (unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
-	(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
-	      w3m-cid-retrieve-function-alist)))
+  (when (and (boundp 'w3m-cid-retrieve-function-alist)
+	     (not (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)))
+    (push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
+	  w3m-cid-retrieve-function-alist))
   (setq mm-html-inhibit-images nil))
 
 (defvar w3m-current-buffer) ;; From `w3m.el'.
@@ -761,22 +761,22 @@ (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth b
 (defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth button)
   (notmuch-show-insert-part-text/calendar msg part content-type nth depth button))
 
-(if (version< emacs-version "25.3")
-    ;; https://bugs.gnu.org/28350
-    ;;
-    ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
-    ;; (see notmuch-show-handlers-for)
-    (defun notmuch-show-insert-part-text/enriched
-	(msg part content-type nth depth button)
-      ;; By requiring enriched below, we ensure that the function
-      ;; enriched-decode-display-prop is defined before it will be
-      ;; shadowed by the letf below. Otherwise the version in
-      ;; enriched.el may be loaded a bit later and used instead (for
-      ;; the first time).
-      (require 'enriched)
-      (cl-letf (((symbol-function 'enriched-decode-display-prop)
-		 (lambda (start end &optional param) (list start end))))
-	(notmuch-show-insert-part-*/* msg part content-type nth depth button))))
+(when (version< emacs-version "25.3")
+  ;; https://bugs.gnu.org/28350
+  ;;
+  ;; For newer emacs, we fall back to notmuch-show-insert-part-*/*
+  ;; (see notmuch-show-handlers-for)
+  (defun notmuch-show-insert-part-text/enriched
+      (msg part content-type nth depth button)
+    ;; By requiring enriched below, we ensure that the function
+    ;; enriched-decode-display-prop is defined before it will be
+    ;; shadowed by the letf below. Otherwise the version in
+    ;; enriched.el may be loaded a bit later and used instead (for
+    ;; the first time).
+    (require 'enriched)
+    (cl-letf (((symbol-function 'enriched-decode-display-prop)
+	       (lambda (start end &optional param) (list start end))))
+      (notmuch-show-insert-part-*/* msg part content-type nth depth button))))
 
 (defun notmuch-show-get-mime-type-of-application/octet-stream (part)
   ;; If we can deduce a MIME type from the filename of the attachment,
@@ -843,8 +843,8 @@ (defun notmuch-show-handlers-for (content-type)
   "Return a list of content handlers for a part of type CONTENT-TYPE."
   (let (result)
     (mapc (lambda (func)
-	    (if (functionp func)
-		(push func result)))
+	    (when (functionp func)
+	      (push func result)))
 	  ;; Reverse order of prefrence.
 	  (list (intern (concat "notmuch-show-insert-part-*/*"))
 		(intern (concat
@@ -1074,10 +1074,10 @@ (defun notmuch-show-insert-msg (msg depth)
       (insert "\n"))
     (setq content-end (point-marker))
     ;; Indent according to the depth in the thread.
-    (if notmuch-show-indent-content
-	(indent-rigidly content-start
-			content-end
-			(* notmuch-show-indent-messages-width depth)))
+    (when notmuch-show-indent-content
+      (indent-rigidly content-start
+		      content-end
+		      (* notmuch-show-indent-messages-width depth)))
     (setq message-end (point-max-marker))
     ;; Save the extents of this message over the whole text of the
     ;; message.
@@ -1282,7 +1282,8 @@ (defun notmuch-show--build-queries (thread context)
 fallback if the prior matches no messages."
   (let (queries)
     (push (list thread) queries)
-    (if context (push (list thread "and (" context ")") queries))
+    (when context
+      (push (list thread "and (" context ")") queries))
     queries))
 
 (defun notmuch-show--build-buffer (&optional state)
@@ -1779,9 +1780,9 @@ (defun notmuch-show-get-message-ids-for-open-messages ()
     (let (message-ids done)
       (goto-char (point-min))
       (while (not done)
-	(if (notmuch-show-message-visible-p)
-	    (setq message-ids
-		  (append message-ids (list (notmuch-show-get-message-id)))))
+	(when (notmuch-show-message-visible-p)
+	  (setq message-ids
+		(append message-ids (list (notmuch-show-get-message-id)))))
 	(setq done (not (notmuch-show-goto-message-next))))
       message-ids)))
 
@@ -1836,8 +1837,8 @@ (defun notmuch-show-advance-and-archive ()
 thread from the search from which this thread was originally
 shown."
   (interactive)
-  (if (notmuch-show-advance)
-      (notmuch-show-archive-thread-then-next)))
+  (when (notmuch-show-advance)
+    (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
   "Backup through the thread (reverse scrolling compared to \
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index a5ae0edb..6a619ec2 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -967,19 +967,19 @@ (defun notmuch-tree-process-sentinel (proc msg)
 	(never-found-target-thread nil))
     (when (memq status '(exit signal))
       (kill-buffer (process-get proc 'parse-buf))
-      (if (buffer-live-p buffer)
-	  (with-current-buffer buffer
-	    (save-excursion
-	      (let ((inhibit-read-only t)
-		    (atbob (bobp)))
-		(goto-char (point-max))
-		(if (eq status 'signal)
-		    (insert "Incomplete search results (tree view process was killed).\n"))
-		(when (eq status 'exit)
-		  (insert "End of search results.")
-		  (unless (= exit-status 0)
-		    (insert (format " (process returned %d)" exit-status)))
-		  (insert "\n")))))))))
+      (when (buffer-live-p buffer)
+	(with-current-buffer buffer
+	  (save-excursion
+	    (let ((inhibit-read-only t)
+		  (atbob (bobp)))
+	      (goto-char (point-max))
+	      (when (eq status 'signal)
+		(insert "Incomplete search results (tree view process was killed).\n"))
+	      (when (eq status 'exit)
+		(insert "End of search results.")
+		(unless (= exit-status 0)
+		  (insert (format " (process returned %d)" exit-status)))
+		(insert "\n")))))))))
 
 (defun notmuch-tree-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" for tree view."
@@ -1023,8 +1023,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
 			      (and query-context
 				   (concat " and (" query-context ")"))))
 	 (message-arg (if unthreaded "--unthreaded" "--entire-thread")))
-    (if (equal (car (process-lines notmuch-command "count" search-args)) "0")
-	(setq search-args basic-query))
+    (when (equal (car (process-lines notmuch-command "count" search-args)) "0")
+      (setq search-args basic-query))
     (notmuch-tag-clear-cache)
     (let ((proc (notmuch-start-notmuch
 		 "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 31fda61f..ce4b9637 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -216,8 +216,8 @@ (defun notmuch-wash-region-to-button (msg beg end type &optional prefix)
     (goto-char (1+ end))
     (save-excursion
       (goto-char beg)
-      (if prefix
-	  (insert-before-markers prefix))
+      (when prefix
+	(insert-before-markers prefix))
       (let ((button-beg (point)))
 	(insert-before-markers (notmuch-wash-button-label overlay) "\n")
 	(let ((button (make-button button-beg (1- (point))
@@ -229,13 +229,13 @@ (defun notmuch-wash-excerpt-citations (msg depth)
   "Excerpt citations and up to one signature."
   (goto-char (point-min))
   (beginning-of-line)
-  (if (and (< (point) (point-max))
-	   (re-search-forward notmuch-wash-original-regexp nil t))
-      (let* ((msg-start (match-beginning 0))
-	     (msg-end (point-max))
-	     (msg-lines (count-lines msg-start msg-end)))
-	(notmuch-wash-region-to-button
-	 msg msg-start msg-end "original")))
+  (when (and (< (point) (point-max))
+	     (re-search-forward notmuch-wash-original-regexp nil t))
+    (let* ((msg-start (match-beginning 0))
+	   (msg-end (point-max))
+	   (msg-lines (count-lines msg-start msg-end)))
+      (notmuch-wash-region-to-button
+       msg msg-start msg-end "original")))
   (while (and (< (point) (point-max))
 	      (re-search-forward notmuch-wash-citation-regexp nil t))
     (let* ((cite-start (match-beginning 0))
@@ -254,21 +254,21 @@ (defun notmuch-wash-excerpt-citations (msg depth)
 	  (notmuch-wash-region-to-button
 	   msg hidden-start (point-marker)
 	   "citation")))))
-  (if (and (not (eobp))
-	   (re-search-forward notmuch-wash-signature-regexp nil t))
-      (let* ((sig-start (match-beginning 0))
-	     (sig-end (match-end 0))
-	     (sig-lines (count-lines sig-start (point-max))))
-	(if (<= sig-lines notmuch-wash-signature-lines-max)
-	    (let ((sig-start-marker (make-marker))
-		  (sig-end-marker (make-marker)))
-	      (set-marker sig-start-marker sig-start)
-	      (set-marker sig-end-marker (point-max))
-	      (overlay-put (make-overlay sig-start-marker sig-end-marker)
-			   'face 'message-cited-text)
-	      (notmuch-wash-region-to-button
-	       msg sig-start-marker sig-end-marker
-	       "signature"))))))
+  (when (and (not (eobp))
+	     (re-search-forward notmuch-wash-signature-regexp nil t))
+    (let* ((sig-start (match-beginning 0))
+	   (sig-end (match-end 0))
+	   (sig-lines (count-lines sig-start (point-max))))
+      (when (<= sig-lines notmuch-wash-signature-lines-max)
+	(let ((sig-start-marker (make-marker))
+	      (sig-end-marker (make-marker)))
+	  (set-marker sig-start-marker sig-start)
+	  (set-marker sig-end-marker (point-max))
+	  (overlay-put (make-overlay sig-start-marker sig-end-marker)
+		       'face 'message-cited-text)
+	  (notmuch-wash-region-to-button
+	   msg sig-start-marker sig-end-marker
+	   "signature"))))))
 
 ;;
 
@@ -286,12 +286,12 @@ (defun notmuch-wash-elide-blank-lines (msg depth)
     (delete-region (match-beginning 1) (match-end 1)))
   ;; Remove a leading blank line.
   (goto-char (point-min))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0)))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0)))
   ;; Remove a trailing blank line.
   (goto-char (point-max))
-  (if (looking-at "\n")
-      (delete-region (match-beginning 0) (match-end 0))))
+  (when (looking-at "\n")
+    (delete-region (match-beginning 0) (match-end 0))))
 
 ;;
 
@@ -399,12 +399,12 @@ (defun notmuch-wash-convert-inline-patch-to-part (msg depth)
 	  (patch-end (point-max))
 	  part)
       (goto-char patch-start)
-      (if (or
-	   ;; Patch ends with signature.
-	   (re-search-forward notmuch-wash-signature-regexp nil t)
-	   ;; Patch ends with bugtraq comment.
-	   (re-search-forward "^\\*\\*\\* " nil t))
-	  (setq patch-end (match-beginning 0)))
+      (when (or
+	     ;; Patch ends with signature.
+	     (re-search-forward notmuch-wash-signature-regexp nil t)
+	     ;; Patch ends with bugtraq comment.
+	     (re-search-forward "^\\*\\*\\* " nil t))
+	(setq patch-end (match-beginning 0)))
       (save-restriction
 	(narrow-to-region patch-start patch-end)
 	(setq part (plist-put part :content-type "inline patch"))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 93e92b39..4fc338e2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -674,28 +674,28 @@ (defun notmuch-search-process-sentinel (proc msg)
     (when (memq status '(exit signal))
       (catch 'return
 	(kill-buffer (process-get proc 'parse-buf))
-	(if (buffer-live-p buffer)
-	    (with-current-buffer buffer
-	      (save-excursion
-		(let ((inhibit-read-only t)
-		      (atbob (bobp)))
-		  (goto-char (point-max))
-		  (if (eq status 'signal)
-		      (insert "Incomplete search results (search process was killed).\n"))
-		  (when (eq status 'exit)
-		    (insert "End of search results.\n")
-		    ;; For version mismatch, there's no point in
-		    ;; showing the search buffer
-		    (when (or (= exit-status 20) (= exit-status 21))
-		      (kill-buffer)
-		      (throw 'return nil))
-		    (if (and atbob
+	(when (buffer-live-p buffer)
+	  (with-current-buffer buffer
+	    (save-excursion
+	      (let ((inhibit-read-only t)
+		    (atbob (bobp)))
+		(goto-char (point-max))
+		(when (eq status 'signal)
+		  (insert "Incomplete search results (search process was killed).\n"))
+		(when (eq status 'exit)
+		  (insert "End of search results.\n")
+		  ;; For version mismatch, there's no point in
+		  ;; showing the search buffer
+		  (when (or (= exit-status 20) (= exit-status 21))
+		    (kill-buffer)
+		    (throw 'return nil))
+		  (when (and atbob
 			     (not (string= notmuch-search-target-thread "found")))
-			(set 'never-found-target-thread t)))))
-	      (when (and never-found-target-thread
-			 notmuch-search-target-line)
-		(goto-char (point-min))
-		(forward-line (1- notmuch-search-target-line)))))))))
+		    (set 'never-found-target-thread t)))))
+	    (when (and never-found-target-thread
+		       notmuch-search-target-line)
+	      (goto-char (point-min))
+	      (forward-line (1- notmuch-search-target-line)))))))))
 
 (define-widget 'notmuch--custom-face-edit 'lazy
   "Custom face edit with a tag Edit Face"
@@ -760,31 +760,31 @@ (defun notmuch-search-insert-authors (format-string authors)
 	   (invisible-string "")
 	   (padding ""))
       ;; Truncate the author string to fit the specification.
-      (if (> (length formatted-authors)
-	     (length formatted-sample))
-	  (let ((visible-length (- (length formatted-sample)
-				   (length "... "))))
-	    ;; Truncate the visible string according to the width of
-	    ;; the display string.
-	    (setq visible-string (substring formatted-authors 0 visible-length))
-	    (setq invisible-string (substring formatted-authors visible-length))
-	    ;; If possible, truncate the visible string at a natural
-	    ;; break (comma or pipe), as incremental search doesn't
-	    ;; match across the visible/invisible border.
-	    (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
-	      ;; Second clause is destructive on `visible-string', so
-	      ;; order is important.
-	      (setq invisible-string (concat (match-string 3 visible-string)
-					     invisible-string))
-	      (setq visible-string (concat (match-string 1 visible-string)
-					   (match-string 2 visible-string))))
-	    ;; `visible-string' may be shorter than the space allowed
-	    ;; by `format-string'. If so we must insert some padding
-	    ;; after `invisible-string'.
-	    (setq padding (make-string (- (length formatted-sample)
-					  (length visible-string)
-					  (length "..."))
-				       ? ))))
+      (when (> (length formatted-authors)
+	       (length formatted-sample))
+	(let ((visible-length (- (length formatted-sample)
+				 (length "... "))))
+	  ;; Truncate the visible string according to the width of
+	  ;; the display string.
+	  (setq visible-string (substring formatted-authors 0 visible-length))
+	  (setq invisible-string (substring formatted-authors visible-length))
+	  ;; If possible, truncate the visible string at a natural
+	  ;; break (comma or pipe), as incremental search doesn't
+	  ;; match across the visible/invisible border.
+	  (when (string-match "\\(.*\\)\\([,|] \\)\\([^,|]*\\)" visible-string)
+	    ;; Second clause is destructive on `visible-string', so
+	    ;; order is important.
+	    (setq invisible-string (concat (match-string 3 visible-string)
+					   invisible-string))
+	    (setq visible-string (concat (match-string 1 visible-string)
+					 (match-string 2 visible-string))))
+	  ;; `visible-string' may be shorter than the space allowed
+	  ;; by `format-string'. If so we must insert some padding
+	  ;; after `invisible-string'.
+	  (setq padding (make-string (- (length formatted-sample)
+					(length visible-string)
+					(length "..."))
+				     ? ))))
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
 	  ;; The visible string contains both matching and
@@ -1006,8 +1006,8 @@ (defun notmuch-search (&optional query oldest-first target-thread target-line no
     (notmuch-tag-clear-cache)
     (let ((proc (get-buffer-process (current-buffer)))
 	  (inhibit-read-only t))
-      (if proc
-	  (error "notmuch search process already running for query `%s'" query))
+      (when proc
+	(error "notmuch search process already running for query `%s'" query))
       (erase-buffer)
       (goto-char (point-min))
       (save-excursion
@@ -1156,7 +1156,7 @@ (setq mail-user-agent 'notmuch-user-agent)
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-(if init-file-user ; don't load init file if the -q option was used.
-    (load notmuch-init-file t t nil t))
+(when init-file-user ; don't load init file if the -q option was used.
+  (load notmuch-init-file t t nil t))
 
 ;;; notmuch.el ends here
diff --git a/test/test-lib.el b/test/test-lib.el
index a1233390..6a39bbe2 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -36,7 +36,7 @@ (setq read-file-name-function (lambda (&rest _) (read)))
 
 ;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents
 ;; noninteractive (kill-emacs) from emacsclient.
-(if (and (= emacs-major-version 23) (< emacs-minor-version 3))
+(when (and (= emacs-major-version 23) (< emacs-minor-version 3))
   (defadvice kill-emacs (before disable-yes-or-no-p activate)
     "Disable yes-or-no-p before executing kill-emacs"
     (defun yes-or-no-p (prompt) t)))
@@ -46,7 +46,7 @@ (if (and (= emacs-major-version 23) (< emacs-minor-version 3))
 ;; seems to be present in Emacs 23.1.
 ;; Running `list-processes' after `accept-process-output' seems to work
 ;; around this problem.
-(if (and (= emacs-major-version 23) (= emacs-minor-version 1))
+(when (and (= emacs-major-version 23) (= emacs-minor-version 1))
   (defadvice accept-process-output (after run-list-processes activate)
     "run list-processes after executing accept-process-output"
     (list-processes)))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 09/34] emacs: Use one or three lines for 'if' forms
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (7 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 08/34] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 10/34] emacs: Extend face to window edge again Jonas Bernoulli
                     ` (26 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Putting the COND and THEN parts on the same line but ELSE on a
separate line makes it harder to determine if there actually is
an ELSE part.
---
 emacs/notmuch-lib.el  | 6 ++++--
 emacs/notmuch-tag.el  | 3 ++-
 emacs/notmuch-tree.el | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index da48bb86..4496ecd2 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -611,7 +611,8 @@ (defun notmuch--get-bodypart-raw (msg part process-crypto binaryp cache)
 				   ,@(and process-crypto '("--decrypt=true"))
 				   ,(notmuch-id-to-query (plist-get msg :id))))
 			   (coding-system-for-read
-			    (if binaryp 'no-conversion
+			    (if binaryp
+				'no-conversion
 			      (let ((coding-system
 				     (mm-charset-to-coding-system
 				      (plist-get part :content-charset))))
@@ -680,7 +681,8 @@ (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
       ;; `gnus-decoded' charset.  Otherwise, we'll fetch the binary
       ;; part content and let mm-* decode it.
       (let* ((have-content (plist-member part :content))
-	     (charset (if have-content 'gnus-decoded
+	     (charset (if have-content
+			  'gnus-decoded
 			(plist-get part :content-charset)))
 	     (handle (mm-make-handle (current-buffer)
 				     `(,content-type (charset . ,charset)))))
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1067f185..e71de041 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -532,7 +532,8 @@ (defun notmuch-tag-jump (reverse)
 		       (and (symbolp name)
 			    (symbol-name name))))
 	     (name-string (if name
-			      (if reverse (concat "Reverse " name)
+			      (if reverse
+				  (concat "Reverse " name)
 				name)
 			    (mapconcat #'identity tag-change " "))))
 	(push (list key name-string
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 6a619ec2..b498db07 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1009,7 +1009,8 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ
   (setq notmuch-tree-basic-query basic-query)
   (setq notmuch-tree-query-context (if (or (string= query-context "")
 					   (string= query-context "*"))
-				       nil query-context))
+				       nil
+				     query-context))
   (setq notmuch-tree-target-msg target)
   (setq notmuch-tree-open-target open-target)
   ;; Set the default value for `notmuch-show-process-crypto' in this
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 10/34] emacs: Extend face to window edge again
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (8 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 09/34] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 11/34] emacs: Fix some function declarations Jonas Bernoulli
                     ` (25 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Since Emacs 27 each face has to be explicitly configured to "extend
to the edge of the window".  Without doing that the face used for
the newline character only has an effect that spans "one character"
(i.e. it looks like there is a single trailing space character).

We don't want that so extend the face in Emacs 27, so that it looks
the same as it did in older Emacs releases.  We have to do this
conditionally, otherwise older Emacsen would choke on it.
---
 emacs/notmuch.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 4fc338e2..5562ad10 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -273,8 +273,12 @@ (defun notmuch-search-first-thread ()
   (goto-char (point-min)))
 
 (defface notmuch-message-summary-face
-  '((((class color) (background light)) (:background "#f0f0f0"))
-    (((class color) (background dark)) (:background "#303030")))
+  `((((class color) (background light))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#f0f0f0"))
+    (((class color) (background dark))
+     ,@(and (>= emacs-major-version 27) '(:extend t))
+     (:background "#303030")))
   "Face for the single-line message summary in notmuch-show-mode."
   :group 'notmuch-show
   :group 'notmuch-faces)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 11/34] emacs: Fix some function declarations
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (9 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 10/34] emacs: Extend face to window edge again Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 12/34] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
                     ` (24 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 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)
 
-(declare-function notmuch-search-tag "notmuch" tag-changes)
-(declare-function notmuch-show-tag "notmuch-show" tag-changes)
-(declare-function notmuch-tree-tag "notmuch-tree" tag-changes)
+(declare-function notmuch-search-tag "notmuch"
+		  (tag-changes &optional beg end only-matched))
+(declare-function notmuch-show-tag "notmuch-show" (tag-changes))
+(declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
 
 (autoload 'notmuch-jump "notmuch-jump")
 
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 12/34] emacs: No longer define notmuch-hello-mode-map as a function
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (10 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 11/34] emacs: Fix some function declarations Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 13/34] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
                     ` (23 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

It was defined as such for a decade; ever since
a56010ac8b89a2489eee5c78469f05cee85ec858 but there
wasn't a reason to do that then nor is there now.
---
 emacs/notmuch-hello.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index c17b46bc..876d8ef1 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -687,7 +687,6 @@ (defvar notmuch-hello-mode-map
     (define-key map (kbd "<C-tab>") 'widget-backward)
     map)
   "Keymap for \"notmuch hello\" buffers.")
-(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
 
 (define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
   "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 13/34] emacs: notmuch-poll: Let the user know we are polling
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (11 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 12/34] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 14/34] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
                     ` (22 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

It is done synchronously and it can take a while,
so we should let the user know what is going on.
---
 emacs/notmuch-lib.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 4496ecd2..6ff351d7 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -259,11 +259,13 @@ (defun notmuch-poll ()
 Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
 depending on the value of `notmuch-poll-script'."
   (interactive)
+  (message "Polling mail...")
   (if (stringp notmuch-poll-script)
       (unless (string= notmuch-poll-script "")
 	(unless (equal (call-process notmuch-poll-script nil nil) 0)
 	  (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
-    (notmuch-call-notmuch-process "new")))
+    (notmuch-call-notmuch-process "new"))
+  (message "Polling mail...done"))
 
 (defun notmuch-bury-or-kill-this-buffer ()
   "Undisplay the current buffer.
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 14/34] emacs: Use makefile-gmake-mode in Makefile*s
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (12 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 13/34] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 15/34] emacs: Improve doc-strings Jonas Bernoulli
                     ` (21 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

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 are Makefiles (of any flavor).
---
 Makefile.global                  | 1 +
 Makefile.local                   | 2 +-
 bindings/Makefile.local          | 2 +-
 compat/Makefile.local            | 2 +-
 completion/Makefile.local        | 2 +-
 doc/Makefile.local               | 2 +-
 emacs/Makefile.local             | 2 +-
 lib/Makefile.local               | 2 +-
 parse-time-string/Makefile.local | 2 ++
 performance-test/Makefile.local  | 2 +-
 test/Makefile.local              | 2 +-
 util/Makefile.local              | 2 +-
 12 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Makefile.global b/Makefile.global
index 4fd796e3..cd489ef2 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -1,3 +1,4 @@
+# -*- makefile-gmake -*-
 # Here's the (hopefully simple) versioning scheme.
 #
 # Releases of notmuch have a two-digit version (0.1, 0.2, etc.). We
diff --git a/Makefile.local b/Makefile.local
index 39f36d50..156c8ce1 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 .PHONY: all
 all: notmuch notmuch-shared build-man build-info ruby-bindings python-cffi-bindings
diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 19ddd6ea..bc960bbc 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := bindings
 
diff --git a/compat/Makefile.local b/compat/Makefile.local
index bcb9f0ec..2ee1b399 100644
--- a/compat/Makefile.local
+++ b/compat/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := compat
 extra_cflags += -I$(srcdir)/$(dir)
diff --git a/completion/Makefile.local b/completion/Makefile.local
index 8e86c9d2..54df463c 100644
--- a/completion/Makefile.local
+++ b/completion/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := completion
 
diff --git a/doc/Makefile.local b/doc/Makefile.local
index 30411341..60bd7184 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := doc
 
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 141f5868..d1b320c3 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := emacs
 emacs_sources := \
diff --git a/lib/Makefile.local b/lib/Makefile.local
index 5dc057c0..a6400126 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := lib
 
diff --git a/parse-time-string/Makefile.local b/parse-time-string/Makefile.local
index 53534f3e..ee8030cc 100644
--- a/parse-time-string/Makefile.local
+++ b/parse-time-string/Makefile.local
@@ -1,3 +1,5 @@
+# -*- makefile-gmake -*-
+
 dir := parse-time-string
 extra_cflags += -I$(srcdir)/$(dir)
 
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index 9dc260e3..b9f580c7 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := performance-test
 
diff --git a/test/Makefile.local b/test/Makefile.local
index 47244e8f..40574739 100644
--- a/test/Makefile.local
+++ b/test/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := test
 
diff --git a/util/Makefile.local b/util/Makefile.local
index f5d72f79..7ef029a5 100644
--- a/util/Makefile.local
+++ b/util/Makefile.local
@@ -1,4 +1,4 @@
-# -*- makefile -*-
+# -*- makefile-gmake -*-
 
 dir := util
 extra_cflags += -I$(srcdir)/$(dir)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 15/34] emacs: Improve doc-strings
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (13 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 14/34] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 16/34] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
                     ` (20 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

- 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 shouldn't be done.

- Symbols are quoted like `so'.

- There is no clear rule on how to (not) quote non-atomic
  s-expressions, but quoting like '(this) is definitely weird.

- It is a good idea to remember that \" becomes " and to take
  that in mind when adjusting the automatic filling by hand.

- Use the imperative form.

- Arguments are written in all uppercase.
---
 emacs/notmuch-address.el | 42 +++++++++++++++++++++-------------------
 emacs/notmuch-query.el   | 19 +++++++++---------
 emacs/notmuch-show.el    |  4 ++--
 emacs/notmuch-tree.el    |  5 +++--
 emacs/notmuch.el         |  9 ++++-----
 emacs/rstdoc.el          |  6 +++---
 6 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index 85531489..cd0ffb67 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -36,9 +36,9 @@ (defvar notmuch-address-completions (make-hash-table :test 'equal)
 This variable is set by calling `notmuch-address-harvest'.")
 
 (defvar notmuch-address-full-harvest-finished nil
-  "t indicates that full completion address harvesting has been
-finished. Use notmuch-address--harvest-ready to access as that
-will load a saved hash if necessary (and available).")
+  "t indicates that full completion address harvesting has been finished.
+Use notmuch-address--harvest-ready to access as that will load a
+saved hash if necessary (and available).")
 
 (defun notmuch-address--harvest-ready ()
   "Return t if there is a full address hash available.
@@ -54,9 +54,9 @@ (defcustom notmuch-address-command 'internal
 which must take a single argument (searched string) and output a
 list of completion candidates, one per line.
 
-Alternatively, it can be the symbol 'internal, in which case
+Alternatively, it can be the symbol `internal', in which case
 internal completion is used; the variable
-`notmuch-address-internal-completion` can be used to customize
+`notmuch-address-internal-completion' can be used to customize
 this case.
 
 Finally, if this variable is nil then address completion is
@@ -72,12 +72,12 @@ (defcustom notmuch-address-command 'internal
 (defcustom notmuch-address-internal-completion '(sent nil)
   "Determines how internal address completion generates candidates.
 
-This should be a list of the form '(DIRECTION FILTER), where
+This should be a list of the form (DIRECTION FILTER), where
 DIRECTION is either sent or received and specifies whether the
 candidates are searched in messages sent by the user or received
 by the user (note received by is much faster), and FILTER is
-either nil or a filter-string, such as \"date:1y..\" to append
-to the query."
+either nil or a filter-string, such as \"date:1y..\" to append to
+the query."
   :type '(list :tag "Use internal address completion"
 	       (radio
 		:tag "Base completion on messages you have"
@@ -101,8 +101,8 @@ (defcustom notmuch-address-save-filename nil
   "Filename to save the cached completion addresses.
 
 All the addresses notmuch uses for address completion will be
-cached in this file. This has obvious privacy implications so you
-should make sure it is not somewhere publicly readable."
+cached in this file.  This has obvious privacy implications so
+you should make sure it is not somewhere publicly readable."
   :type '(choice (const :tag "Off" nil)
 		 (file :tag "Filename"))
   :group 'notmuch-send
@@ -110,12 +110,14 @@ (defcustom notmuch-address-save-filename nil
   :group 'notmuch-external)
 
 (defcustom notmuch-address-selection-function 'notmuch-address-selection-function
-  "The function to select address from given list. The function is
-called with PROMPT, COLLECTION, and INITIAL-INPUT as arguments
-(subset of what `completing-read' can be called with).
-While executed the value of `completion-ignore-case' is t.
-See documentation of function `notmuch-address-selection-function'
-to know how address selection is made by default."
+  "The function to select address from given list.
+
+The function is called with PROMPT, COLLECTION, and INITIAL-INPUT
+as arguments (subset of what `completing-read' can be called
+with).  While executed the value of `completion-ignore-case'
+is t.  See documentation of function
+`notmuch-address-selection-function' to know how address
+selection is made by default."
   :type 'function
   :group 'notmuch-send
   :group 'notmuch-address
@@ -188,9 +190,9 @@ (defun notmuch-address-matching (substring)
     candidates))
 
 (defun notmuch-address-options (original)
-  "Returns a list of completion candidates. Uses either
-elisp-based implementation or older implementation requiring
-external commands."
+  "Return a list of completion candidates.
+Use either elisp-based implementation or older implementation
+requiring external commands."
   (cond
    ((eq notmuch-address-command 'internal)
     (unless (notmuch-address--harvest-ready)
@@ -352,7 +354,7 @@ (defvar notmuch-address--save-hash-version 1
   "Version format of the save hash.")
 
 (defun notmuch-address--get-address-hash ()
-  "Returns the saved address hash as a plist.
+  "Return the saved address hash as a plist.
 
 Returns nil if the save file does not exist, or it does not seem
 to be a saved address hash."
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index a8e5d11f..3cfccbc3 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -47,22 +47,21 @@ (defun notmuch-query-map-aux  (mapper function seq)
 	  seq)))
 
 (defun notmuch-query-map-threads (fn threads)
-  "Apply FN to every thread in THREADS. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every thread in THREADS.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-forest fn threads))
 
 (defun notmuch-query-map-forest (fn forest)
-  "Apply function to every message in a forest. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information.
-"
+  "Apply function FN to every message in FOREST.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (notmuch-query-map-aux 'notmuch-query-map-tree fn forest))
 
 (defun notmuch-query-map-tree (fn tree)
-  "Apply function FN to every message in TREE. Flatten results to a list.
-
-See the function notmuch-query-get-threads for more information."
+  "Apply function FN to every message in TREE.
+Flatten results to a list.  See the function
+`notmuch-query-get-threads' for more information."
   (cons (funcall fn (car tree)) (notmuch-query-map-forest fn (cadr tree))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f9418a94..015edb0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -446,8 +446,8 @@ (defun notmuch-clean-address (address)
     (error (cons address nil))))
 
 (defun notmuch-show-clean-address (address)
-  "Try to clean a single email ADDRESS for display.  Return
-unchanged ADDRESS if parsing fails."
+  "Try to clean a single email ADDRESS for display.
+Return unchanged ADDRESS if parsing fails."
   (let* ((clean-address (notmuch-clean-address address))
 	 (p-address (car clean-address))
 	 (p-name (cdr clean-address)))
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b498db07..364da240 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -587,7 +587,7 @@ (defun notmuch-tree-scroll-message-window ()
 	(scroll-up)))))
 
 (defun notmuch-tree-scroll-message-window-back ()
-  "Scroll the message window back(if it exists)."
+  "Scroll the message window back (if it exists)."
   (interactive)
   (when (window-live-p notmuch-tree-message-window)
     (with-selected-window notmuch-tree-message-window
@@ -596,7 +596,8 @@ (defun notmuch-tree-scroll-message-window-back ()
 	(scroll-down)))))
 
 (defun notmuch-tree-scroll-or-next ()
-  "Scroll the message window. If it at end go to next message."
+  "Scroll the message window.
+If it at end go to next message."
   (interactive)
   (when (notmuch-tree-scroll-message-window)
     (notmuch-tree-next-matching-message)))
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5562ad10..75fe6900 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -432,11 +432,10 @@ (defun notmuch-search-result-end (&optional pos)
 (defun notmuch-search-foreach-result (beg end fn)
   "Invoke FN for each result between BEG and END.
 
-FN should take one argument.  It will be applied to the
-character position of the beginning of each result that overlaps
-the region between points BEG and END.  As a special case, if (=
-BEG END), FN will be applied to the result containing point
-BEG."
+FN should take one argument.  It will be applied to the character
+position of the beginning of each result that overlaps the region
+between points BEG and END.  As a special case, if (= BEG END),
+FN will be applied to the result containing point BEG."
   (let ((pos (notmuch-search-result-beginning beg))
 	;; End must be a marker in case fn changes the
 	;; text.
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 2af91186..92a337c8 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -36,11 +36,11 @@
 (provide 'rstdoc)
 
 (defun rstdoc-batch-extract ()
-  "Extract docstrings to and from the files on the command line"
+  "Extract docstrings to and from the files on the command line."
   (apply #'rstdoc-extract command-line-args-left))
 
 (defun rstdoc-extract (in-file out-file)
-  "Write docstrings from IN-FILE to OUT-FILE"
+  "Write docstrings from IN-FILE to OUT-FILE."
   (load-file in-file)
   (let* ((definitions (cdr (assoc (expand-file-name in-file) load-history)))
 	 (doc-hash (make-hash-table :test 'eq)))
@@ -72,7 +72,7 @@ (defvar rst--escape-alist
      ("\\([^\\]\\)'" . "\\1`")
      ("^[[:space:]\t]*$" . "|br|")
      ("^[[:space:]\t]" . "|indent| "))
-    "list of (regex . replacement) pairs")
+  "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
   (with-temp-buffer
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 16/34] emacs: Autoload notmuch-jump-search only once
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (14 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 15/34] emacs: Improve doc-strings Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 17/34] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
                     ` (19 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

This function is being autoloaded using an autoload cookie, so it
shouldn't additionally be autoloaded using an `autoload' form.

When building libraries we don't actually load the autoloads file and
dropping the `autoload' form results in an error, which reveals a so
far unspecified dependency: `notmuch-tree' needs `notmuch-jump'.

Before this commit compiling (or even just loading) `notmuch-tree'
resulted in `notmuch-jump' being loaded because the former requires
`notmuch-lib', which autoloaded `notmuch-jump-search'.

The bug was that this dependency was not explicitly specified, which
we fix by adding the respective `require' form.
---
 emacs/notmuch-lib.el  | 3 ---
 emacs/notmuch-tree.el | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 6ff351d7..b86c44ed 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -35,9 +35,6 @@ (unless (require 'notmuch-version nil t)
   (defconst notmuch-emacs-version "unknown"
     "Placeholder variable when notmuch-version.el[c] is not available."))
 
-(autoload 'notmuch-jump-search "notmuch-jump"
-  "Jump to a saved search by shortcut key." t)
-
 (defgroup notmuch nil
   "Notmuch mail reader for Emacs."
   :group 'mail)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 364da240..b538cef9 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -33,6 +33,7 @@ (require 'notmuch-query)
 (require 'notmuch-show)
 (require 'notmuch-tag)
 (require 'notmuch-parser)
+(require 'notmuch-jump)
 
 (declare-function notmuch-search "notmuch"
 		  (&optional query oldest-first target-thread target-line))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 17/34] emacs: Autoload notmuch-jump using an autoload cookie
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (15 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 16/34] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 18/34] emacs: Various cosmetic changes Jonas Bernoulli
                     ` (18 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Doing that is better than using an `autoload' form because the latter
may result in dependencies getting hidden and indeed it turns out we
have to declare `notmuch-jump' in "notmuch-tag.el".
---
 emacs/notmuch-jump.el | 1 +
 emacs/notmuch-tag.el  | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el
index e302fe00..1e2d0497 100644
--- a/emacs/notmuch-jump.el
+++ b/emacs/notmuch-jump.el
@@ -73,6 +73,7 @@ (defun notmuch-jump-search ()
 
 (defvar notmuch-jump--action nil)
 
+;;;###autoload
 (defun notmuch-jump (action-map prompt)
   "Interactively prompt for one of the keys in ACTION-MAP.
 
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index 1cef17e1..ccc1321f 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -36,8 +36,7 @@ (declare-function notmuch-search-tag "notmuch"
 		  (tag-changes &optional beg end only-matched))
 (declare-function notmuch-show-tag "notmuch-show" (tag-changes))
 (declare-function notmuch-tree-tag "notmuch-tree" (tag-changes))
-
-(autoload 'notmuch-jump "notmuch-jump")
+(declare-function notmuch-jump "notmuch-jump" (action-map prompt))
 
 (define-widget 'notmuch-tag-key-type 'list
   "A single key tagging binding."
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 18/34] emacs: Various cosmetic changes
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (16 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 17/34] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 19/34] emacs: Increase consistency of library headers Jonas Bernoulli
                     ` (17 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 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 insertions(+), 44 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index dcac319c..91f4ef3d 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -36,7 +36,8 @@ (defun make-deps (&optional dir)
 This prints make dependencies to `standard-output' based on the
 top-level `require' expressions in the current buffer.  Paths in
 rules will be given relative to DIR, or `default-directory'."
-  (setq dir (or dir default-directory))
+  (unless dir
+    (setq dir default-directory))
   (save-excursion
     (goto-char (point-min))
     (condition-case nil
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index b86c44ed..05d86ea1 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -53,9 +53,8 @@ (defgroup notmuch-show nil
 
 (defgroup notmuch-send nil
   "Sending messages from Notmuch."
-  :group 'notmuch)
-
-(custom-add-to-group 'notmuch-send 'message 'custom-group)
+  :group 'notmuch
+  :group 'message)
 
 (defgroup notmuch-tag nil
   "Tags and tagging in Notmuch."
@@ -782,8 +781,7 @@ (defun notmuch-logged-error (msg &optional extra)
 	(insert extra)
 	(unless (bolp)
 	  (newline)))))
-  (error "%s"
-	 (concat msg (and extra " (see *Notmuch errors* for more details)"))))
+  (error "%s%s" msg (if extra " (see *Notmuch errors* for more details)" "")))
 
 (defun notmuch-check-async-exit-status (proc msg &optional command err)
   "If PROC exited abnormally, pop up an error buffer and signal an error.
diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
index fbcfc2ef..3aa5bd8f 100644
--- a/emacs/notmuch-parser.el
+++ b/emacs/notmuch-parser.el
@@ -39,12 +39,9 @@ (defun notmuch-sexp-create-parser ()
 buffer.  Hence, the caller is allowed to delete any data before
 point and may resynchronize after an error by moving point."
   (vector 'notmuch-sexp-parser
-	  ;; List depth
-	  0
-	  ;; Partial parse position marker
-	  nil
-	  ;; Partial parse state
-	  nil))
+	  0     ; List depth
+	  nil   ; Partial parse position marker
+	  nil)) ; Partial parse state
 
 (defmacro notmuch-sexp--depth (sp)         `(aref ,sp 1))
 (defmacro notmuch-sexp--partial-pos (sp)   `(aref ,sp 2))
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 015edb0c..5640346f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -499,21 +499,17 @@ (define-button-type 'notmuch-show-part-button-type
 
 (defun notmuch-show-insert-part-header (nth content-type declared-type
 					    &optional name comment)
-  (let ((button)
-	(base-label (concat (and name (concat name ": "))
+  (let ((base-label (concat (and name (concat name ": "))
 			    declared-type
 			    (and (not (string-equal declared-type content-type))
 				 (concat " (as " content-type ")"))
 			    comment)))
-    (setq button
-	  (insert-button
-	   (concat "[ " base-label " ]")
-	   :base-label base-label
-	   :type 'notmuch-show-part-button-type
-	   :notmuch-part-hidden nil))
-    (insert "\n")
-    ;; return button
-    button))
+    (prog1 (insert-button
+	    (concat "[ " base-label " ]")
+	    :base-label base-label
+	    :type 'notmuch-show-part-button-type
+	    :notmuch-part-hidden nil)
+      (insert "\n"))))
 
 (defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)
diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 92a337c8..41390bbe 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -24,7 +24,6 @@
 ;;
 
 ;;; Commentary:
-;;
 
 ;; Rstdoc provides a facility to extract all of the docstrings defined in
 ;; an elisp source file. Usage:
@@ -68,10 +67,10 @@ (defun rstdoc--insert-docstring (symbol docstring)
   (insert "\n"))
 
 (defvar rst--escape-alist
-  '( ("\\\\='" . "\\\\'")
-     ("\\([^\\]\\)'" . "\\1`")
-     ("^[[:space:]\t]*$" . "|br|")
-     ("^[[:space:]\t]" . "|indent| "))
+  '(("\\\\='" . "\\\\'")
+    ("\\([^\\]\\)'" . "\\1`")
+    ("^[[:space:]\t]*$" . "|br|")
+    ("^[[:space:]\t]" . "|indent| "))
   "List of (regex . replacement) pairs.")
 
 (defun rstdoc--rst-quote-string (str)
diff --git a/test/test-lib.el b/test/test-lib.el
index 6a39bbe2..e9e7c379 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -154,22 +154,21 @@ (defun notmuch-test-report-unexpected (output expected)
 
 (defun notmuch-test-expect-equal (output expected)
   "Compare OUTPUT with EXPECTED. Report any discrepencies."
-  (if (equal output expected)
-      t
-    (cond
-     ((and (listp output)
-	   (listp expected))
-      ;; Reporting the difference between two lists is done by
-      ;; reporting differing elements of OUTPUT and EXPECTED
-      ;; pairwise. This is expected to make analysis of failures
-      ;; simpler.
-      (apply #'concat (cl-loop for o in output
-			       for e in expected
-			       if (not (equal o e))
-			       collect (notmuch-test-report-unexpected o e))))
-
-     (t
-      (notmuch-test-report-unexpected output expected)))))
+  (cond
+   ((equal output expected)
+    t)
+   ((and (listp output)
+	 (listp expected))
+    ;; Reporting the difference between two lists is done by
+    ;; reporting differing elements of OUTPUT and EXPECTED
+    ;; pairwise. This is expected to make analysis of failures
+    ;; simpler.
+    (apply #'concat (cl-loop for o in output
+			     for e in expected
+			     if (not (equal o e))
+			     collect (notmuch-test-report-unexpected o e))))
+   (t
+    (notmuch-test-report-unexpected output expected))))
 
 (defun notmuch-post-command ()
   (run-hooks 'post-command-hook))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 19/34] emacs: Increase consistency of library headers
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (17 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 18/34] emacs: Various cosmetic changes Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 20/34] Fix typos Jonas Bernoulli
                     ` (16 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 emacs/make-deps.el            |  2 +-
 emacs/notmuch-company.el      | 37 +++++++++++++++++++--------------
 emacs/notmuch-compat.el       | 22 +++++++++++++++++---
 emacs/notmuch-crypto.el       |  2 +-
 emacs/notmuch-lib.el          |  2 --
 emacs/notmuch-maildir-fcc.el  | 39 +++++++++++++++++------------------
 emacs/notmuch-print.el        |  2 +-
 emacs/notmuch-show.el         |  2 +-
 emacs/notmuch-tag.el          |  3 +--
 emacs/notmuch-tree.el         |  2 +-
 emacs/notmuch-version.el.tmpl |  3 +--
 emacs/notmuch.el              |  4 ++--
 12 files changed, 68 insertions(+), 52 deletions(-)

diff --git a/emacs/make-deps.el b/emacs/make-deps.el
index 91f4ef3d..a7699fb1 100644
--- a/emacs/make-deps.el
+++ b/emacs/make-deps.el
@@ -1,4 +1,4 @@
-;; make-deps.el --- compute make dependencies for Elisp sources
+;;; make-deps.el --- compute make dependencies for Elisp sources
 ;;
 ;; Copyright © Austin Clements
 ;;
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index c1f3594e..24e7446c 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -1,29 +1,34 @@
 ;;; notmuch-company.el --- Mail address completion for notmuch via company-mode  -*- lexical-binding: t -*-
-
-;; Authors: Trevor Jim <tjim@mac.com>
-;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
 ;;
-;; Keywords: mail, completion
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
+;; Copyright © Trevor Jim
+;; Copyright © Michal Sojka
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation, either version 3 of the License, or
 ;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Trevor Jim <tjim@mac.com>
+;; 	    Michal Sojka <sojkam1@fel.cvut.cz>
+;; Keywords: mail, completion
 
 ;;; Commentary:
 
-;; To enable this, install company mode (https://company-mode.github.io/)
+;; Mail address completion for notmuch via company-mode.  To enable
+;; this, install company mode from <https://company-mode.github.io/>.
 ;;
 ;; NB company-minimum-prefix-length defaults to 3 so you don't get
-;; completion unless you type 3 characters
+;; completion unless you type 3 characters.
 
 ;;; Code:
 
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 3340918f..9d82a729 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -1,10 +1,26 @@
-;; Compatibility functions for earlier versions of emacs
-
+;;; notmuch-compat.el --- compatibility functions for earlier versions of emacs
+;;
 ;; The functions in this file are copied from more modern versions of
 ;; emacs and are Copyright (C) 1985-1986, 1992, 1994-1995, 1999-2017
 ;; Free Software Foundation, Inc.
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; emacs master has a bugfix for folding long headers when sending
 ;; messages. Include the fix for earlier versions of emacs. To avoid
 ;; interfering with gnus we only run the hook when called from
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index e6bf8339..6df1dd64 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -1,4 +1,4 @@
-;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata.
+;;; notmuch-crypto.el --- functions for handling display of cryptographic metadata
 ;;
 ;; Copyright © Jameson Rollins
 ;;
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 05d86ea1..fded2d7b 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -19,8 +19,6 @@
 ;;
 ;; Authors: Carl Worth <cworth@cworth.org>
 
-;; This is an part of an emacs-based interface to the notmuch mail system.
-
 ;;; Code:
 
 (require 'cl-lib)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 1027e1a7..aa07b26a 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -1,24 +1,23 @@
-;;; notmuch-maildir-fcc.el ---
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published
-;; by the Free Software Foundation; either version 2, or (at your
-;; option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
+;;; notmuch-maildir-fcc.el --- inserting using a fcc handler
+
+;; Copyright © Jesse Rosenthal
+;;
+;; This file is part of Notmuch.
+;;
+;; Notmuch is free software: you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; Notmuch is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+;;
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; To use this as the fcc handler for message-mode,
-;; customize the notmuch-fcc-dirs variable
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;; Authors: Jesse Rosenthal <jrosenthal@jhu.edu>
 
 ;;; Code:
 
diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el
index d9b3d449..6dd9f775 100644
--- a/emacs/notmuch-print.el
+++ b/emacs/notmuch-print.el
@@ -1,4 +1,4 @@
-;;; notmuch-print.el --- printing messages from notmuch.
+;;; notmuch-print.el --- printing messages from notmuch
 ;;
 ;; Copyright © David Edmondson
 ;;
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5640346f..de822357 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1,4 +1,4 @@
-;;; notmuch-show.el --- displaying notmuch forests.
+;;; notmuch-show.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index ccc1321f..c7a1e322 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -20,9 +20,8 @@
 ;;
 ;; Authors: Carl Worth <cworth@cworth.org>
 ;;          Damien Cassou <damien.cassou@gmail.com>
-;;
+
 ;;; Code:
-;;
 
 (require 'cl-lib)
 (eval-when-compile
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b538cef9..fbba4bb3 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -1,4 +1,4 @@
-;;; notmuch-tree.el --- displaying notmuch forests.
+;;; notmuch-tree.el --- displaying notmuch forests
 ;;
 ;; Copyright © Carl Worth
 ;; Copyright © David Edmondson
diff --git a/emacs/notmuch-version.el.tmpl b/emacs/notmuch-version.el.tmpl
index abf52f17..97308295 100644
--- a/emacs/notmuch-version.el.tmpl
+++ b/emacs/notmuch-version.el.tmpl
@@ -1,5 +1,4 @@
-;;; notmuch-version.el --- Version of notmuch
-;; -*- emacs-lisp -*-
+;;; notmuch-version.el --- version of notmuch  -*- emacs-lisp -*-
 ;;
 ;; %AG%
 ;;
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 75fe6900..babddbb6 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -18,7 +18,7 @@
 ;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
 ;;
 ;; Authors: Carl Worth <cworth@cworth.org>
-;; Homepage: https://notmuchmail.org/
+;; Homepage: https://notmuchmail.org
 
 ;;; Commentary:
 
@@ -62,7 +62,7 @@
 ;;
 ;; TL;DR: notmuch-emacs from MELPA and notmuch from distro packages is
 ;; NOT SUPPORTED.
-;;
+
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
-- 
2.28.0\r

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 20/34] Fix typos
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (18 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 19/34] emacs: Increase consistency of library headers Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 21/34] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
                     ` (15 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 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 ++--
 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 +-
 emacs/notmuch-crypto.el                    |  2 +-
 emacs/notmuch-lib.el                       |  2 +-
 emacs/notmuch-mua.el                       |  2 +-
 lib/notmuch.h                              |  4 ++--
 tag-util.c                                 |  2 +-
 tag-util.h                                 |  2 +-
 test/T610-message-property.sh              |  2 +-
 test/T710-message-id.sh                    |  2 +-
 test/random-corpus.c                       |  2 +-
 test/test-lib.el                           |  2 +-
 19 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/NEWS b/NEWS
index 0d8b930f..9f0db031 100644
--- a/NEWS
+++ b/NEWS
@@ -116,7 +116,7 @@ information about cryptographic protections for the Subject header.
 Emacs
 -----
 
-Optionally check for missing attachements in outgoing messages (see
+Optionally check for missing attachments in outgoing messages (see
 function `notmuch-mua-attachment-check`).
 
 Bind `B` to browse URLs in current message.
diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py
index 613317e0..f281edc1 100644
--- a/bindings/python-cffi/notmuch2/__init__.py
+++ b/bindings/python-cffi/notmuch2/__init__.py
@@ -10,7 +10,7 @@ should consider their signatures implementation details.
 Errors
 ======
 
-All errors occuring due to errors from the underlying notmuch database
+All errors occurring due to errors from the underlying notmuch database
 are subclasses of the :exc:`NotmuchError`.  Due to memory management
 it is possible to try and use an object after it has been freed.  In
 this case a :exc:`ObjectDestroyedError` will be raised.
diff --git a/bindings/python-cffi/notmuch2/_base.py b/bindings/python-cffi/notmuch2/_base.py
index 31258149..1cf03c88 100644
--- a/bindings/python-cffi/notmuch2/_base.py
+++ b/bindings/python-cffi/notmuch2/_base.py
@@ -29,7 +29,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     However during some peculiar situations, e.g. interpreter
     shutdown, it is possible for the :meth:`__del__` method to have
     been called, whele there are still references to an object.  This
-    could result in child objects asking their memeory to be freed
+    could result in child objects asking their memory to be freed
     after the parent has already freed the memory, making things
     rather unhappy as double frees are not taken lightly in C.  To
     handle this case all objects need to follow the same protocol to
@@ -73,7 +73,7 @@ class NotmuchObject(metaclass=abc.ABCMeta):
     def _destroy(self):
         """Destroy the object, freeing all memory.
 
-        This method needs to destory the object on the
+        This method needs to destroy the object on the
         libnotmuch-level.  It must ensure it's not been destroyed by
         it's parent object yet before doing so.  It also must be
         idempotent.
@@ -134,7 +134,7 @@ class BinString(str):
 
     Most data in libnotmuch should be valid ASCII or valid UTF-8.
     However since it is a C library these are represented as
-    bytestrings intead which means on an API level we can not
+    bytestrings instead which means on an API level we can not
     guarantee that decoding this to UTF-8 will both succeed and be
     lossless.  This string type converts bytes to unicode in a lossy
     way, but also makes the raw bytes available.
diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py
index 7db5a7f8..5ab0f20a 100644
--- a/bindings/python-cffi/notmuch2/_database.py
+++ b/bindings/python-cffi/notmuch2/_database.py
@@ -422,7 +422,7 @@ class Database(base.NotmuchObject):
            of it as ``dup = db.remove_message(name); if dup: ...``.
         :rtype: bool
 
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ReadOnlyDatabaseError: The database is opened in
            READ_ONLY mode.
         :raises UpgradeRequiredError: The database must be upgraded
@@ -458,7 +458,7 @@ class Database(base.NotmuchObject):
         :raises LookupError: If no message was found.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         msg_pp = capi.ffi.new('notmuch_message_t **')
@@ -489,7 +489,7 @@ class Database(base.NotmuchObject):
            a subclass of :exc:`KeyError`.
         :raises OutOfMemoryError: When there is no memory to allocate
            the message instance.
-        :raises XapianError: A Xapian exception ocurred.
+        :raises XapianError: A Xapian exception occurred.
         :raises ObjectDestroyedError: if used after destroyed.
         """
         if not hasattr(os, 'PathLike') and isinstance(filename, pathlib.Path):
@@ -695,7 +695,7 @@ class AtomicContext:
         """Force ending the atomic section.
 
         This can only be called once __exit__ has been called.  It
-        will attept to close the atomic section (again).  This is
+        will attempt to close the atomic section (again).  This is
         useful if the original exit raised an exception and the atomic
         section is still open.  But things are pretty ugly by now.
 
diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py
index 02de50ad..2f232076 100644
--- a/bindings/python-cffi/notmuch2/_message.py
+++ b/bindings/python-cffi/notmuch2/_message.py
@@ -147,7 +147,7 @@ class Message(base.NotmuchObject):
         """Return an iterator of all files for this message.
 
         If multiple files contained the same message ID they will all
-        be returned here.  The files are returned as intances of
+        be returned here.  The files are returned as instances of
         :class:`pathlib.Path`.
 
         :returns: Iterator yielding :class:`pathlib.Path` instances.
@@ -431,7 +431,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping):
     means the former will yield duplicate keys while the latter won't.
     It also means ``len(list(iter(this_map)))`` could be different
     than ``len(this_map.keys())``.  ``len(this_map)`` will correspond
-    with the lenght of the default iterator.
+    with the length of the default iterator.
 
     Be aware that libnotmuch exposes all of this as iterators, so
     quite a few operations have O(n) performance instead of the usual
diff --git a/bindings/python-cffi/notmuch2/_tags.py b/bindings/python-cffi/notmuch2/_tags.py
index 3b14c981..ee5d2a34 100644
--- a/bindings/python-cffi/notmuch2/_tags.py
+++ b/bindings/python-cffi/notmuch2/_tags.py
@@ -161,7 +161,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
     """
 
     # Since we subclass ImmutableTagSet we inherit a __hash__.  But we
-    # are mutable, setting it to None will make the Python machinary
+    # are mutable, setting it to None will make the Python machinery
     # recognise us as unhashable.
     __hash__ = None
 
@@ -179,7 +179,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the added tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -204,7 +204,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 
         :raises TypeError: If the tag is not a valid type.
         :raises TagTooLongError: If the tag exceeds the maximum
-           lenght, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
+           length, see ``notmuch_cffi.NOTMUCH_TAG_MAX``.
         :raises ReadOnlyDatabaseError: If the database is opened in
            read-only mode.
         """
@@ -286,7 +286,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet):
 class TagsIter(base.NotmuchObject, collections.abc.Iterator):
     """Iterator over tags.
 
-    This is only an interator, not a container so calling
+    This is only an iterator, not a container so calling
     :meth:`__iter__` does not return a new, replenished iterator but
     only itself.
 
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index de7db8e7..6835fd30 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -31,7 +31,7 @@ def notmuch(maildir):
     fixture.
     """
     def run(*args):
-        """Run a notmuch comand.
+        """Run a notmuch command.
 
         This function runs with a timeout error as many notmuch
         commands may block if multiple processes are trying to open
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 88ca836e..8fb507fa 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -65,7 +65,7 @@ class Database(object):
     .. note::
 
         Any function in this class can and will throw an
-        :exc:`NotInitializedError` if the database was not intitialized
+        :exc:`NotInitializedError` if the database was not initialized
         properly.
     """
     _std_db_path = None
@@ -273,9 +273,9 @@ class Database(object):
         return Database._get_version(self._db)
 
     def get_revision (self):
-        """Returns the committed database revison and UUID
+        """Returns the committed database revision and UUID
 
-        :returns: (revison, uuid) The database revision as a positive integer
+        :returns: (revision, uuid) The database revision as a positive integer
         and the UUID of the database.
         """
         self._assert_db_is_initialized()
@@ -574,7 +574,7 @@ class Database(object):
                   in the meantime. In this case, you should close and
                   reopen the database and retry.
             :exc:`NotInitializedError` if
-                    the database was not intitialized.
+                    the database was not initialized.
         """
         self._assert_db_is_initialized()
         msg_p = NotmuchMessageP()
@@ -600,7 +600,7 @@ class Database(object):
                  case, you should close and reopen the database and
                  retry.
         :raises: :exc:`NotInitializedError` if the database was not
-                 intitialized.
+                 initialized.
 
         *Added in notmuch 0.9*"""
         self._assert_db_is_initialized()
@@ -616,7 +616,7 @@ class Database(object):
         """Returns :class:`Tags` with a list of all tags found in the database
 
         :returns: :class:`Tags`
-        :execption: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
+        :exception: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
                     on error
         """
         self._assert_db_is_initialized()
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index bdc18790..ffb86df1 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -95,7 +95,7 @@ class Query(object):
             :exc:`NullPointerError` if the query creation failed
                 (e.g. too little memory).
             :exc:`NotInitializedError` if the underlying db was not
-                intitialized.
+                initialized.
         """
         db._assert_db_is_initialized()
         # create reference to parent db to keep it alive
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 6df1dd64..276c9859 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -128,7 +128,7 @@ (defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
       (setq label (concat "Unknown key ID " keyid " or unsupported algorithm"))
       (setq button-action 'notmuch-crypto-sigstatus-error-callback)
       (setq help-msg (concat "Click to retrieve key ID " keyid
-			     " from keyserver.")))
+			     " from key server.")))
      ((string= status "bad")
       (setq label (concat "Bad signature (claimed key ID " keyid ")"))
       (setq face 'notmuch-crypto-signature-bad))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index fded2d7b..11f6858e 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -656,7 +656,7 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; Workaround: The call to `mm-display-part' below triggers a bug in
 ;; Emacs 24 if it attempts to use the shr renderer to display an HTML
 ;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and
-;; Fedora 17, though unreproducable in other configurations).
+;; Fedora 17, though unreproducible in other configurations).
 ;; `mm-shr' references the variable `gnus-inhibit-images' without
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 2910a63e..f321e0c6 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -337,7 +337,7 @@ (define-key notmuch-message-mode-map (kbd "C-x C-s") #'notmuch-draft-save)
 
 (defun notmuch-mua-pop-to-buffer (name switch-function)
   "Pop to buffer NAME, and warn if it already exists and is
-modified. This function is notmuch addaptation of
+modified. This function is notmuch adaptation of
 `message-pop-to-buffer'."
   (let ((buffer (get-buffer name)))
     (if (and buffer
diff --git a/lib/notmuch.h b/lib/notmuch.h
index f3cb0fe2..c66e78b1 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -1642,7 +1642,7 @@ notmuch_message_remove_tag (notmuch_message_t *message, const char *tag);
  *
  * @retval #NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in
  *	read-only mode so message cannot be modified.
- * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an execption was thrown
+ * @retval #NOTMUCH_STATUS_XAPIAN_EXCEPTION: an exception was thrown
  *      accessing the database.
  */
 notmuch_status_t
@@ -1874,7 +1874,7 @@ notmuch_message_add_property (notmuch_message_t *message, const char *key, const
 /**
  * Remove a (key,value) pair from a message.
  *
- * It is not an error to remove a non-existant (key,value) pair
+ * It is not an error to remove a non-existent (key,value) pair
  *
  * @returns
  * - NOTMUCH_STATUS_ILLEGAL_ARGUMENT: *key* may not contain an '=' character.
diff --git a/tag-util.c b/tag-util.c
index 1837b1ae..accf299e 100644
--- a/tag-util.c
+++ b/tag-util.c
@@ -323,7 +323,7 @@ tag_op_list_apply (notmuch_message_t *message,
     if (flags & TAG_FLAG_MAILDIR_SYNC) {
 	status = notmuch_message_tags_to_maildir_flags (message);
 	if (status) {
-	    message_error (message, status, "synching tags to maildir");
+	    message_error (message, status, "syncing tags to maildir");
 	    return status;
 	}
     }
diff --git a/tag-util.h b/tag-util.h
index bbe54d99..411e8cae 100644
--- a/tag-util.h
+++ b/tag-util.h
@@ -123,7 +123,7 @@ tag_op_list_append (tag_op_list_t *list,
 /*
  * Apply a list of tag operations, in order, to a given message.
  *
- * Flags can be bitwise ORed; see enum above for possibilies.
+ * Flags can be bitwise ORed; see enum above for possibilities.
  */
 
 notmuch_status_t
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index b8774230..d0e52f4a 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -65,7 +65,7 @@ cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
 
-   /* remove non-existant value for key */
+   /* remove non-existent value for key */
    EXPECT0(notmuch_message_remove_property (message, "testkey2", "this value has spaces and = sign"));
    EXPECT0(notmuch_message_get_property (message, "testkey2", &val));
    printf("testkey2 = %s\n", val);
diff --git a/test/T710-message-id.sh b/test/T710-message-id.sh
index e73d6ba9..5129d84c 100755
--- a/test/T710-message-id.sh
+++ b/test/T710-message-id.sh
@@ -29,7 +29,7 @@ GOOD: 1258787708-21121-2-git-send-email-keithp@keithp.com
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
-test_begin_subtest "<> delimeters are required"
+test_begin_subtest "<> delimiters are required"
 ${TEST_DIRECTORY}/message-id-parse <<EOF >OUTPUT
 018b1a8f2d1df62e804ce88b65401304832dfbbf.1346614915.git.jani@nikula.org>
 <1530507300.raoomurnbf.astroid@strange.none
diff --git a/test/random-corpus.c b/test/random-corpus.c
index 8ed7ff76..ff413252 100644
--- a/test/random-corpus.c
+++ b/test/random-corpus.c
@@ -50,7 +50,7 @@ typedef struct {
 
 /*
  *  Choose about half ascii as test characters, as ascii
- *  punctation and whitespace is the main cause of problems for
+ *  punctuation and whitespace is the main cause of problems for
  *  the (old) restore parser.
  *
  *  We then favour code points with 2 byte encodings. Note that
diff --git a/test/test-lib.el b/test/test-lib.el
index e9e7c379..2def7ffe 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -153,7 +153,7 @@ (defun notmuch-test-report-unexpected (output expected)
 	  "Output:\t" (prin1-to-string output) "\n"))
 
 (defun notmuch-test-expect-equal (output expected)
-  "Compare OUTPUT with EXPECTED. Report any discrepencies."
+  "Compare OUTPUT with EXPECTED. Report any discrepancies."
   (cond
    ((equal output expected)
     t)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 21/34] .dir-locals.el: Set variables for correct "shell" mode
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (19 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 20/34] Fix typos Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 22/34] test: Fix indentation Jonas Bernoulli
                     ` (14 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

The major mode used for shell scripts is named 'sh-mode'.
'shell-mode' on the other hand implements an interactive
shell in emacs-lisp.
---
 .dir-locals.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index fc75ae61..b3ddffe8 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -15,7 +15,7 @@ ((c-mode
  (emacs-lisp-mode
   (indent-tabs-mode . t)
   (tab-width . 8))
- (shell-mode
+ (sh-mode
   (indent-tabs-mode . t)
   (tab-width . 8)
   (sh-basic-offset . 4)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 22/34] test: Fix indentation
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (20 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 21/34] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 23/34] .gitignore: Sort using sort-lines Jonas Bernoulli
                     ` (13 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

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 527c9e8b..c23a0d20 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -136,16 +136,16 @@ add_gpgsm_home ()
     at_exit_function _gnupg_exit
     mkdir -p -m 0700 "$GNUPGHOME"
     openssl pkcs12 -export -passout pass: -inkey "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" \
-        < "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
-        gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
+	< "$NOTMUCH_SRCDIR/test/smime/test.crt" | \
+	gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
+	      --disable-dirmngr --import  >"$GNUPGHOME"/import.log 2>&1 3<<<''
     fpr=$(gpgsm --batch --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
     echo "$fpr S relax" >> "$GNUPGHOME/trustlist.txt"
     gpgsm --quiet --batch --no-tty --no-common-certs-import --disable-dirmngr --import < $NOTMUCH_SRCDIR/test/smime/ca.crt
     echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$GNUPGHOME/trustlist.txt"
     printf '%s::1\n' include-certs disable-crl-checks | gpgconf --output /dev/null --change-options gpgsm
     gpgsm --batch --no-tty --no-common-certs-import --pinentry-mode=loopback --passphrase-fd 3 \
-              --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
+	      --disable-dirmngr --import "$NOTMUCH_SRCDIR/test/smime/bob.p12" >>"$GNUPGHOME"/import.log 2>&1 3<<<''
     test_debug "cat $GNUPGHOME/import.log"
 }
 
@@ -394,8 +394,8 @@ emacs_fcc_message ()
     local nmn_args subject body
     nmn_args=''
     while [[ "$1" =~ ^-- ]]; do
-        nmn_args="$nmn_args $1"
-        shift
+	nmn_args="$nmn_args $1"
+	shift
     done
     subject="$1"
     body="$2"
@@ -405,7 +405,7 @@ emacs_fcc_message ()
 
     test_emacs \
 	"(let ((message-send-mail-function (lambda () t))
-               (mail-host-address \"example.com\"))
+	       (mail-host-address \"example.com\"))
 	   (notmuch-mua-mail)
 	   (message-goto-to)
 	   (insert \"test_suite@notmuchmail.org\nDate: 01 Jan 2000 12:00:00 -0000\")
@@ -524,9 +524,9 @@ test_expect_equal_json () {
     # override Python's stdio encoding defaults.
     script='import json, sys; json.dump(json.load(sys.stdin), sys.stdout, sort_keys=True, indent=4)'
     output=$(echo "$1" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$1")
+	|| echo "$1")
     expected=$(echo "$2" | PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c "$script" \
-        || echo "$2")
+	|| echo "$2")
     shift 2
     test_expect_equal "$output" "$expected" "$@"
 }
@@ -540,15 +540,15 @@ test_valid_json () {
 # Sort the top-level list of JSON data from stdin.
 test_sort_json () {
     PYTHONIOENCODING=utf-8 $NOTMUCH_PYTHON -c \
-        "import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
+	"import sys, json; json.dump(sorted(json.load(sys.stdin)),sys.stdout)"
 }
 
 # test for json objects:
 # read the source of test/json_check_nodes.py (or the output when
 # invoking it without arguments) for an explanation of the syntax.
 test_json_nodes () {
-        local output
-        exec 1>&6 2>&7		# Restore stdout and stderr
+	local output
+	exec 1>&6 2>&7		# Restore stdout and stderr
 	if [ -z "$inside_subtest" ]; then
 		error "bug in the test script: test_json_eval without test_begin_subtest"
 	fi
@@ -662,7 +662,7 @@ notmuch_json_show_sanitize ()
 	-e 's|"filename": "signature.asc",||g' \
 	-e 's|"filename": \["/[^"]*"\],|"filename": \["YYYYY"\],|g' \
 	-e 's|"timestamp": 97.......|"timestamp": 42|g' \
-        -e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
+	-e 's|"content-length": [1-9][0-9]*|"content-length": "NONZERO"|g'
 }
 
 notmuch_emacs_error_sanitize ()
@@ -673,7 +673,7 @@ notmuch_emacs_error_sanitize ()
     for file in "$@"; do
 	echo "=== $file ==="
 	cat "$file"
-    done | sed  \
+    done | sed \
 	-e 's/^\[.*\]$/[XXX]/' \
 	-e "s|^\(command: \)\{0,1\}/.*/$command|\1YYY/$command|"
 }
@@ -929,8 +929,8 @@ test_expect_code () {
 # but is a prefix that can be used in the test script, like:
 #
 #	test_expect_success 'complain and die' '
-#           do something &&
-#           do something else &&
+#	    do something &&
+#	    do something else &&
 #	    test_must_fail git checkout ../outerspace
 #	'
 #
@@ -1020,8 +1020,8 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
 
 # Here's what we are using here:
 #
-# --quick              Use minimal customization. This implies --no-init-file,
-#		       --no-site-file and (emacs 24) --no-site-lisp
+# --quick		Use minimal customization. This implies --no-init-file,
+#			--no-site-file and (emacs 24) --no-site-lisp
 #
 # --directory		Ensure that the local elisp sources are found
 #
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 23/34] .gitignore: Sort using sort-lines
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (21 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 22/34] test: Fix indentation Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:49   ` [PATCH v3 24/34] emacs: Provide 'rstdoc' feature at end of file Jonas Bernoulli
                     ` (12 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

---
 .gitignore | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8f3ebec0..3edd1768 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,20 @@
-/.first-build-message
-/Makefile.config
-/sh.config
-/version.stamp
-TAGS
-tags
-*cscope*
-/.deps
-/notmuch
-/notmuch-shared
-/lib/libnotmuch.so*
-/lib/libnotmuch*.dylib
 *.[ao]
+*.stamp
+*cscope*
 *~
 .*.swp
-/releases
+/.deps
+/.first-build-message
 /.stamps
-*.stamp
+/Makefile.config
 /bindings/python-cffi/build/
+/lib/libnotmuch*.dylib
+/lib/libnotmuch.so*
+/notmuch
+/notmuch-shared
+/releases
+/sh.config
 /sphinx.config
+/version.stamp
+TAGS
+tags
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 24/34] emacs: Provide 'rstdoc' feature at end of file
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (22 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 23/34] .gitignore: Sort using sort-lines Jonas Bernoulli
@ 2020-08-08 11:49   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 25/34] emacs: Add end-of-file line to libraries that lack it Jonas Bernoulli
                     ` (11 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:49 UTC (permalink / raw)
  To: notmuch

Features should nearly always be provided at the very end of their
libraries.  This feature isn't one of the rare exceptions.
---
 emacs/rstdoc.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/rstdoc.el b/emacs/rstdoc.el
index 41390bbe..63fa2794 100644
--- a/emacs/rstdoc.el
+++ b/emacs/rstdoc.el
@@ -32,8 +32,6 @@
 
 ;;; Code:
 
-(provide 'rstdoc)
-
 (defun rstdoc-batch-extract ()
   "Extract docstrings to and from the files on the command line."
   (apply #'rstdoc-extract command-line-args-left))
@@ -82,4 +80,6 @@ (defun rstdoc--rst-quote-string (str)
 	(replace-match (cdr pair))))
     (buffer-substring (point-min) (point-max))))
 
+(provide 'rstdoc)
+
 ;;; rstdoc.el ends here
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 25/34] emacs: Add end-of-file line to libraries that lack it
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (23 preceding siblings ...)
  2020-08-08 11:49   ` [PATCH v3 24/34] emacs: Provide 'rstdoc' feature at end of file Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 26/34] NEWS: Add stub for 0.31 Jonas Bernoulli
                     ` (10 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-compat.el | 2 ++
 emacs/notmuch-tag.el    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 9d82a729..370cafa1 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -107,3 +107,5 @@ (if (fboundp 'read-char-choice)
 ;; End of compatibility functions
 
 (provide 'notmuch-compat)
+
+;;; notmuch-compat.el ends here
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index c7a1e322..5d4a6865 100644
--- a/emacs/notmuch-tag.el
+++ b/emacs/notmuch-tag.el
@@ -550,3 +550,5 @@ (defun notmuch-tag-jump (reverse)
 ;;
 
 (provide 'notmuch-tag)
+
+;;; notmuch-tag.el ends here
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 26/34] NEWS: Add stub for 0.31
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (24 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 25/34] emacs: Add end-of-file line to libraries that lack it Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 27/34] NEWS: At least Emacs 25.1 is required now Jonas Bernoulli
                     ` (9 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

---
 NEWS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/NEWS b/NEWS
index 9f0db031..3790204b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Notmuch 0.31 (UNRELEASED)
+=========================
+
 Notmuch 0.30 (2020-07-10)
 =========================
 
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 27/34] NEWS: At least Emacs 25.1 is required now
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (25 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 26/34] NEWS: Add stub for 0.31 Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 28/34] emacs: Use cl-incf where appropriate Jonas Bernoulli
                     ` (8 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

Some backward incompatible changes follow in the next few commits
and going forward contributors don't have to worry about Emacs 24
at all anymore.
---
 NEWS                      | 5 +++++
 emacs/notmuch-pkg.el.tmpl | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 3790204b..4160e39c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,11 @@
 Notmuch 0.31 (UNRELEASED)
 =========================
 
+Emacs
+-----
+
+The minimum supported major version of GNU Emacs is now 25.1.
+
 Notmuch 0.30 (2020-07-10)
 =========================
 
diff --git a/emacs/notmuch-pkg.el.tmpl b/emacs/notmuch-pkg.el.tmpl
index 9d0999c1..85c631de 100644
--- a/emacs/notmuch-pkg.el.tmpl
+++ b/emacs/notmuch-pkg.el.tmpl
@@ -3,5 +3,4 @@
   "notmuch"
   %VERSION%
   "Emacs based front-end (MUA) for notmuch"
-  '((emacs "24")
-    (cl-lib "0.6.1")))
+  '((emacs "25.1")))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 28/34] emacs: Use cl-incf where appropriate
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (26 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 27/34] NEWS: At least Emacs 25.1 is required now Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 29/34] emacs: Remove notmuch-setq-local Jonas Bernoulli
                     ` (7 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

It's shorter.  That's it pretty much.
---
 emacs/notmuch-hello.el | 2 +-
 emacs/notmuch-lib.el   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 876d8ef1..c127bba9 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -609,7 +609,7 @@ (defun notmuch-hello-insert-buttons (searches)
 			       name)
 		(setq column-indent
 		      (1+ (max 0 (- column-width (length name)))))))
-	    (setq count (1+ count))
+	    (cl-incf count)
 	    (when (eq (% count tags-per-line) 0)
 	      (setq column-indent 0)
 	      (widget-insert "\n")))
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 11f6858e..91c94781 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -413,7 +413,7 @@ (defun notmuch-subkeymap-help ()
 	 (i 0))
     (while (< i (length prefix))
       (aset prefix i (aref key i))
-      (setq i (1+ i)))
+      (cl-incf i))
     (let* ((subkeymap (key-binding prefix))
 	   (ua-keys (where-is-internal 'universal-argument nil t))
 	   (prefix-string (notmuch-prefix-key-description prefix))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 29/34] emacs: Remove notmuch-setq-local
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (27 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 28/34] emacs: Use cl-incf where appropriate Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 30/34] emacs: Remove notmuch-read-char-choice Jonas Bernoulli
                     ` (6 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

Just use setq-local, which existed since Emacs 24.3.
---
 emacs/notmuch-address.el | 4 ++--
 emacs/notmuch-company.el | 2 +-
 emacs/notmuch-compat.el  | 8 --------
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index cd0ffb67..8a6d299c 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -172,11 +172,11 @@ (defun notmuch-address-toggle-internal-completion ()
   (interactive)
   (if (local-variable-p 'notmuch-address-command)
       (kill-local-variable 'notmuch-address-command)
-    (notmuch-setq-local notmuch-address-command 'internal))
+    (setq-local notmuch-address-command 'internal))
   (when (boundp 'company-idle-delay)
     (if (local-variable-p 'company-idle-delay)
 	(kill-local-variable 'company-idle-delay)
-      (notmuch-setq-local company-idle-delay nil))))
+      (setq-local company-idle-delay nil))))
 
 (defun notmuch-address-matching (substring)
   "Returns a list of completion candidates matching SUBSTRING.
diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el
index 24e7446c..9ee8ceca 100644
--- a/emacs/notmuch-company.el
+++ b/emacs/notmuch-company.el
@@ -62,7 +62,7 @@ (defun notmuch-company-setup ()
   ;; internal completion) can still be accessed via standard company
   ;; functions, e.g., company-complete.
   (unless (eq notmuch-address-command 'internal)
-    (notmuch-setq-local company-idle-delay nil)))
+    (setq-local company-idle-delay nil)))
 
 ;;;###autoload
 (defun notmuch-company (command &optional arg &rest _ignore)
diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index 370cafa1..fafc64f3 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -40,14 +40,6 @@ (defun notmuch-message--fold-long-headers ()
 (unless (fboundp 'message--fold-long-headers)
   (add-hook 'message-header-hook 'notmuch-message--fold-long-headers))
 
-(if (fboundp 'setq-local)
-    (defalias 'notmuch-setq-local 'setq-local)
-  (defmacro notmuch-setq-local (var val)
-    "Set variable VAR to value VAL in current buffer.
-
-Backport of setq-local for emacs without setq-local (pre 24.3)."
-    `(set (make-local-variable ',var) ,val)))
-
 (if (fboundp 'read-char-choice)
     (defalias 'notmuch-read-char-choice 'read-char-choice)
   (defun notmuch-read-char-choice (prompt chars &optional inhibit-keyboard-quit)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 30/34] emacs: Remove notmuch-read-char-choice
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (28 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 29/34] emacs: Remove notmuch-setq-local Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 31/34] emacs: Drop old advices that were only need for Emacs 23 Jonas Bernoulli
                     ` (5 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

Just use `read-char-choice', which existed since Emacs 24.1.
---
 emacs/notmuch-compat.el      | 56 ------------------------------------
 emacs/notmuch-maildir-fcc.el |  4 +--
 2 files changed, 2 insertions(+), 58 deletions(-)

diff --git a/emacs/notmuch-compat.el b/emacs/notmuch-compat.el
index fafc64f3..3ede6b36 100644
--- a/emacs/notmuch-compat.el
+++ b/emacs/notmuch-compat.el
@@ -40,62 +40,6 @@ (defun notmuch-message--fold-long-headers ()
 (unless (fboundp 'message--fold-long-headers)
   (add-hook 'message-header-hook 'notmuch-message--fold-long-headers))
 
-(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.
-Any input that is not one of CHARS is ignored.
-
-If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
-keyboard-quit events while waiting for a valid input.
-
-This is an exact copy of this function from emacs 24 for use on
-emacs 23, except with the one emacs 24 only function it calls
-inlined."
-    (unless (consp chars)
-      (error "Called `read-char-choice' without valid char choices"))
-    (let (char done show-help (helpbuf " *Char Help*"))
-      (let ((cursor-in-echo-area t)
-	    (executing-kbd-macro executing-kbd-macro)
-	    (esc-flag nil))
-	(save-window-excursion	      ; in case we call help-form-show
-	  (while (not done)
-	    (unless (get-text-property 0 'face prompt)
-	      (setq prompt (propertize prompt 'face 'minibuffer-prompt)))
-	    (setq char (let ((inhibit-quit inhibit-keyboard-quit))
-			 (read-key prompt)))
-	    (and show-help (buffer-live-p (get-buffer helpbuf))
-		 (kill-buffer helpbuf))
-	    (cond
-	     ((not (numberp char)))
-	     ;; If caller has set help-form, that's enough.
-	     ;; They don't explicitly have to add help-char to chars.
-	     ((and help-form
-		   (eq char help-char)
-		   (setq show-help t)
-		   ;; This is an inlined copy of help-form-show as that
-		   ;; was introduced in emacs 24 too.
-		   (let ((msg (eval help-form)))
-		     (when (stringp msg)
-		       (with-output-to-temp-buffer " *Char Help*"
-			 (princ msg))))))
-	     ((memq char chars)
-	      (setq done t))
-	     ((and executing-kbd-macro (= char -1))
-	      ;; read-event returns -1 if we are in a kbd macro and
-	      ;; there are no more events in the macro.  Attempt to
-	      ;; get an event interactively.
-	      (setq executing-kbd-macro nil))
-	     ((not inhibit-keyboard-quit)
-	      (cond
-	       ((and (null esc-flag) (eq char ?\e))
-		(setq esc-flag t))
-	       ((memq char '(?\C-g ?\e))
-		(keyboard-quit))))))))
-      ;; Display the question with the answer.  But without cursor-in-echo-area.
-      (message "%s%s" prompt (char-to-string char))
-      char)))
-
 ;; End of compatibility functions
 
 (provide 'notmuch-compat)
diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index aa07b26a..a9103a20 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -242,7 +242,7 @@ (defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header &optional create)
       ;; typo, or just the user want a new folder, let the user decide
       ;; how to deal with it.
       (error
-       (let ((response (notmuch-read-char-choice "Insert failed: \
+       (let ((response (read-char-choice "Insert failed: \
 \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
 	 (cl-case response
 	   (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
@@ -327,7 +327,7 @@ (defun notmuch-maildir-fcc-file-fcc (fcc-header)
     ;; fix it in some way.
     (let* ((prompt (format "Fcc %s is not a maildir: \
 \(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
-	   (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
+	   (response (read-char-choice prompt '(?r ?c ?i ?e))))
       (cl-case response
 	(?r (notmuch-maildir-fcc-file-fcc fcc-header))
 	(?c (if (file-writable-p fcc-header)
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 31/34] emacs: Drop old advices that were only need for Emacs 23
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (29 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 30/34] emacs: Remove notmuch-read-char-choice Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing Jonas Bernoulli
                     ` (4 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-mua.el | 14 --------------
 test/test-lib.el     | 17 -----------------
 2 files changed, 31 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index f321e0c6..dcddca76 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -425,20 +425,6 @@ (defcustom notmuch-always-prompt-for-sender nil
 
 (defvar notmuch-mua-sender-history nil)
 
-;; Workaround: Running `ido-completing-read' in emacs 23.1, 23.2 and 23.3
-;; without some explicit initialization fill freeze the operation.
-;; Hence, we advice `ido-completing-read' to ensure required initialization
-;; is done.
-(when (and (= emacs-major-version 23)
-	   (< emacs-minor-version 4))
-  (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
-    (ido-init-completion-maps)
-    (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
-    (add-hook 'choose-completion-string-functions
-	      'ido-choose-completion-string)
-    (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
-    (ad-activate 'ido-completing-read)))
-
 (defun notmuch-mua-prompt-for-sender ()
   "Prompt for a sender from the user's configured identities."
   (if notmuch-identities
diff --git a/test/test-lib.el b/test/test-lib.el
index 2def7ffe..044c2da4 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -34,23 +34,6 @@ (require 'smtpmail)
 ;; `read' call.
 (setq read-file-name-function (lambda (&rest _) (read)))
 
-;; Work around a bug in emacs 23.1 and emacs 23.2 which prevents
-;; noninteractive (kill-emacs) from emacsclient.
-(when (and (= emacs-major-version 23) (< emacs-minor-version 3))
-  (defadvice kill-emacs (before disable-yes-or-no-p activate)
-    "Disable yes-or-no-p before executing kill-emacs"
-    (defun yes-or-no-p (prompt) t)))
-
-;; Emacs bug #2930:
-;;	23.0.92; `accept-process-output' and `sleep-for' do not run sentinels
-;; seems to be present in Emacs 23.1.
-;; Running `list-processes' after `accept-process-output' seems to work
-;; around this problem.
-(when (and (= emacs-major-version 23) (= emacs-minor-version 1))
-  (defadvice accept-process-output (after run-list-processes activate)
-    "run list-processes after executing accept-process-output"
-    (list-processes)))
-
 (defun notmuch-test-wait ()
   "Wait for process completion."
   (while (get-buffer-process (current-buffer))
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (30 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 31/34] emacs: Drop old advices that were only need for Emacs 23 Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr Jonas Bernoulli
                     ` (3 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

Use `cl-letf*' instead.
---
 test/T310-emacs.sh | 14 ++++++++------
 test/test-lib.el   |  8 --------
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index 5f74305d..78ac19a8 100755
--- a/test/T310-emacs.sh
+++ b/test/T310-emacs.sh
@@ -40,12 +40,14 @@ test_emacs '(notmuch-search "tag:inbox")
 test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT
 
 test_begin_subtest "Incremental parsing of search results"
-test_emacs "(ad-enable-advice 'notmuch-search-process-filter 'around 'pessimal)
-	    (ad-activate 'notmuch-search-process-filter)
-	    (notmuch-search \"tag:inbox\")
-	    (notmuch-test-wait)
-	    (ad-disable-advice 'notmuch-search-process-filter 'around 'pessimal)
-	    (ad-activate 'notmuch-search-process-filter)
+test_emacs "(cl-letf* (((symbol-function 'orig)
+			(symbol-function 'notmuch-search-process-filter))
+		       ((symbol-function 'notmuch-search-process-filter)
+			(lambda (proc string)
+			  (cl-loop for char across string
+				   do (orig proc (char-to-string char))))))
+	      (notmuch-search \"tag:inbox\")
+	      (notmuch-test-wait))
 	    (test-output)"
 test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT
 
diff --git a/test/test-lib.el b/test/test-lib.el
index 044c2da4..ec16c59c 100644
--- a/test/test-lib.el
+++ b/test/test-lib.el
@@ -97,14 +97,6 @@ (defvar notmuch-hello-refresh-hook-counter -100
 (add-hook 'notmuch-hello-refresh-hook
 	  (lambda () (cl-incf notmuch-hello-refresh-hook-counter)))
 
-(defadvice notmuch-search-process-filter (around pessimal activate disable)
-  "Feed notmuch-search-process-filter one character at a time."
-  (let ((string (ad-get-arg 1)))
-    (cl-loop for char across string
-	     do (progn
-		  (ad-set-arg 1 (char-to-string char))
-		  ad-do-it))))
-
 (defun notmuch-test-mark-links ()
   "Enclose links in the current buffer with << and >>."
   ;; Links are often created by jit-lock functions
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (31 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-08 11:50   ` [PATCH v3 34/34] try-emacs-mua: Trim `require' advice for Emacs 25 Jonas Bernoulli
                     ` (2 subsequent siblings)
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

Also because we now only support Emacs >= 25,
we can remove the check for Emacs >= 24.
---
 emacs/notmuch-lib.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 91c94781..118faf1e 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -661,11 +661,9 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache)
 ;; first loading gnus-art, which defines it, resulting in a
 ;; void-variable error.  Hence, we advise `mm-shr' to ensure gnus-art
 ;; is loaded.
-(when (>= emacs-major-version 24)
-  (defadvice mm-shr (before load-gnus-arts activate)
-    (require 'gnus-art nil t)
-    (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
-    (ad-activate 'mm-shr)))
+(define-advice mm-shr (:before (_handle) notmuch--load-gnus-args)
+  "Require `gnus-art' since we use its variables."
+  (require 'gnus-art nil t))
 
 (defun notmuch-mm-display-part-inline (msg part content-type process-crypto)
   "Use the mm-decode/mm-view functions to display a part in the
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* [PATCH v3 34/34] try-emacs-mua: Trim `require' advice for Emacs 25
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (32 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr Jonas Bernoulli
@ 2020-08-08 11:50   ` Jonas Bernoulli
  2020-08-09  7:15   ` [PATCH v3 00/34] A great number of cosmetic changes Tomi Ollila
  2020-08-09 12:09   ` David Bremner
  35 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-08 11:50 UTC (permalink / raw)
  To: notmuch

- Since Emacs 25 comes with `load-prefer-newer' we can remove the
  complicated variant of the advice, which implemented a poorman's
  version of that.

- Since Emacs 25 comes with the new advice mechanism, we can use
  that now for the simple variant of the advice, which just informs
  about the library that is being required.
---
 devel/try-emacs-mua | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/devel/try-emacs-mua b/devel/try-emacs-mua
index 041f6216..585d6242 100755
--- a/devel/try-emacs-mua
+++ b/devel/try-emacs-mua
@@ -44,28 +44,10 @@ while looking at: " pdir "emacs\n\nexit emacs (y or n)? ")
 	try-notmuch-emacs-directory (concat pdir "emacs/")
 	load-path (cons try-notmuch-emacs-directory load-path)))
 
-;; they say advice doesn't work for primitives (functions from c source)
-;; well, these 'before' advice works for emacs 23.1 - 24.5 (at least)
-;; ...and for our purposes 24.3 is enough (there is no load-prefer-newer there)
-;; note also that the old, "obsolete" defadvice mechanism was used, but that
-;; is the only one available for emacs 23 and 24 up to 24.3.
-
-(if (boundp 'load-prefer-newer)
-    (defadvice require (before before-require activate)
-      (unless (featurep feature)
-	(message "require: %s" feature)))
-  ;; else: special require "short-circuit"; after load feature is provided...
-  ;; ... in notmuch sources we always use require and there are no loops
-  (defadvice require (before before-require activate)
-    (unless (featurep feature)
-      (message "require: %s" feature)
-      (let ((name (symbol-name feature)))
-	(if (and (string-match "^notmuch" name)
-		 (file-newer-than-file-p
-		  (concat try-notmuch-emacs-directory name ".el")
-		  (concat try-notmuch-emacs-directory name ".elc")))
-	    (load (concat try-notmuch-emacs-directory name ".el") nil nil t t)
-	  )))))
+(define-advice require
+    (:before (feature &optional _filename _noerror) notmuch)
+  (unless (featurep feature)
+    (message "require: %s" feature)))
 
 (insert "Found notmuch emacs client in " try-notmuch-emacs-directory "\n")
 
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (33 preceding siblings ...)
  2020-08-08 11:50   ` [PATCH v3 34/34] try-emacs-mua: Trim `require' advice for Emacs 25 Jonas Bernoulli
@ 2020-08-09  7:15   ` Tomi Ollila
  2020-08-09  7:48     ` Jonas Bernoulli
  2020-08-09 12:09   ` David Bremner
  35 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-08-09  7:15 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

On Sat, Aug 08 2020, Jonas Bernoulli wrote:

> David Bremner <david@tethera.net> writes:
>
>> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>>> So we have 3 options:
>>>
>>> 1) apply this patch and now drop support for emacs 24
>>>
>>> 2) apply this patch and somehow infor emacs 24 users to install cl-lib from
>>> ELPA
>>
>> I'm fine with either of these options. I'd hope we can specify what
>> versions we need in emacs/notmuch-pkg.el.templ
>
> I went with option 1: drop support for emacs 24.  Instead of just
> adding a NEWS entry and bump a number, I also removed some old cruft
> that was only necessary for emacs 24 (and in some cases emacs 23!).

I made a quick check of release dates of emacs 25.1, gmime 3 and xapian 1.4
-- gmime 3 released early 2017, xapian 1.4 middle of 2016 and emacs 25.1
sept 2016 -- so requiring emacs 25.1 is pretty much aligned to those
releases and therefore dropping emacs 24 support looks good to me.

> That resulted in a few new commits of course, marked with * below.
> And since I had to add some commit anyway, I also added three other
> minor commits, marked with ^ below.

I checked the new commits, looks good to me. I also was preparing dropping
emacs 23 support code and the changes aligned what I tried. Interestinglyy
this change in notmuch-mua.el:
  ;; There is a bug in emacs 23's message.el that results in a newline
  ;; not being inserted after the References header, so the next header
  ;; is concatenated to the end of it. 
Is still effective in emacs 26.3 -- I wonder whether there is something
wrong notmuch-emacs handles the case `notmuch-mua-insert-references` is
needed.

I trust the earlier changes are the same as in v2 and v1

Tomi


>
>      Cheers,
>      Jonas
>
> Jonas Bernoulli (34):
>   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 '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
> ^ .gitignore: Sort using sort-lines
> ^ emacs: Provide 'rstdoc' feature at end of file
> ^ emacs: Add end-of-file line to libraries that lack it
> * NEWS: Add stub for 0.31
> * NEWS: At least Emacs 25.1 is required now
> * emacs: Use cl-incf where appropriate
> * emacs: Remove notmuch-setq-local
> * emacs: Remove notmuch-read-char-choice
> * emacs: Drop old advices that were only need for Emacs 23
> * emacs: Do not abuse advice to monkey patch while testing
> * emacs: Use new advice mechanism do advice mm-shr
> * try-emacs-mua: Trim `require' advice for Emacs 25
>
>  .dir-locals.el                             |   2 +-
>  .gitignore                                 |  28 +-
>  Makefile.global                            |   1 +
>  Makefile.local                             |   2 +-
>  NEWS                                       |  10 +-
>  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 +-
>  devel/try-emacs-mua                        |  26 +-
>  doc/Makefile.local                         |   2 +-
>  emacs/Makefile.local                       |   2 +-
>  emacs/coolj.el                             |  24 +-
>  emacs/make-deps.el                         |   7 +-
>  emacs/notmuch-address.el                   | 188 ++++-----
>  emacs/notmuch-company.el                   |  56 +--
>  emacs/notmuch-compat.el                    |  88 +----
>  emacs/notmuch-crypto.el                    |  49 ++-
>  emacs/notmuch-draft.el                     |  24 +-
>  emacs/notmuch-hello.el                     | 102 +++--
>  emacs/notmuch-jump.el                      |  61 ++-
>  emacs/notmuch-lib.el                       | 202 +++++-----
>  emacs/notmuch-maildir-fcc.el               | 122 +++---
>  emacs/notmuch-message.el                   |   3 +-
>  emacs/notmuch-mua.el                       | 185 ++++-----
>  emacs/notmuch-parser.el                    |  16 +-
>  emacs/notmuch-pkg.el.tmpl                  |   3 +-
>  emacs/notmuch-print.el                     |   2 +-
>  emacs/notmuch-query.el                     |  29 +-
>  emacs/notmuch-show.el                      | 439 ++++++++++-----------
>  emacs/notmuch-tag.el                       |  43 +-
>  emacs/notmuch-tree.el                      | 189 ++++-----
>  emacs/notmuch-version.el.tmpl              |   3 +-
>  emacs/notmuch-wash.el                      | 109 +++--
>  emacs/notmuch.el                           | 278 ++++++-------
>  emacs/rstdoc.el                            |  22 +-
>  lib/Makefile.local                         |   2 +-
>  lib/notmuch.h                              |   4 +-
>  parse-time-string/Makefile.local           |   2 +
>  performance-test/Makefile.local            |   2 +-
>  tag-util.c                                 |   2 +-
>  tag-util.h                                 |   2 +-
>  test/Makefile.local                        |   2 +-
>  test/T310-emacs.sh                         |  14 +-
>  test/T610-message-property.sh              |   2 +-
>  test/T710-message-id.sh                    |   2 +-
>  test/emacs-address-cleaning.el             |   2 +-
>  test/random-corpus.c                       |   2 +-
>  test/test-lib.el                           |  64 +--
>  test/test-lib.sh                           |  36 +-
>  util/Makefile.local                        |   2 +-
>  58 files changed, 1188 insertions(+), 1319 deletions(-)
>
> -- 
> 2.28.0
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09  7:15   ` [PATCH v3 00/34] A great number of cosmetic changes Tomi Ollila
@ 2020-08-09  7:48     ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-09  7:48 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> I made a quick check of release dates of emacs 25.1, gmime 3 and xapian 1.4
> -- gmime 3 released early 2017, xapian 1.4 middle of 2016 and emacs 25.1
> sept 2016 -- so requiring emacs 25.1 is pretty much aligned to those
> releases and therefore dropping emacs 24 support looks good to me.

Great!

>> That resulted in a few new commits of course, marked with * below.
>> And since I had to add some commit anyway, I also added three other
>> minor commits, marked with ^ below.
>
> I checked the new commits, looks good to me. I also was preparing dropping
> emacs 23 support code and the changes aligned what I tried. Interestinglyy
> this change in notmuch-mua.el:
>   ;; There is a bug in emacs 23's message.el that results in a newline
>   ;; not being inserted after the References header, so the next header
>   ;; is concatenated to the end of it. 
> Is still effective in emacs 26.3 -- I wonder whether there is something
> wrong notmuch-emacs handles the case `notmuch-mua-insert-references` is
> needed.

I'll have a look.

> I trust the earlier changes are the same as in v2 and v1

Almost. In "emacs: Increase consistency of library headers" I did bring
the headers of "notmuch-compat.el" and "emacs/notmuch-version.el.tmpl"
more in line.  But that's it.

     Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
                     ` (34 preceding siblings ...)
  2020-08-09  7:15   ` [PATCH v3 00/34] A great number of cosmetic changes Tomi Ollila
@ 2020-08-09 12:09   ` David Bremner
  2020-08-09 12:41     ` Đoàn Trần Công Danh
                       ` (2 more replies)
  35 siblings, 3 replies; 108+ messages in thread
From: David Bremner @ 2020-08-09 12:09 UTC (permalink / raw)
  To: Jonas Bernoulli, notmuch

Jonas Bernoulli <jonas@bernoul.li> writes:
>
> Jonas Bernoulli (34):
>   emacs: Shorten long lines
>   emacs: Remove excess empty lines


These patches (and Đoàn Trần Công Danh's that I just applied by hand)
both seem to have problem with base64 encoded patches documented at.

     https://lore.kernel.org/git/20191218194144.GL17681@pobox.com/

It seems that the patches have CRLF line endings inside the base64
encoding, and git fails to strip the CRs.

I'm not sure why this happens for some patches and not for others;
I hope there is not re-encoding happening on the mailing list. If there
is we should fix that.

The practical upshot is that I can't really apply such a long series by
hand. Ideas welcome. A short term fix would be to fetch a ref from
somewhere. OTOH, I hope this isn't going to be a recurring problem.

d\r

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09 12:09   ` David Bremner
@ 2020-08-09 12:41     ` Đoàn Trần Công Danh
  2020-08-09 13:21       ` Jonas Bernoulli
  2020-08-09 13:32     ` Jonas Bernoulli
  2020-08-09 14:49     ` Tomi Ollila
  2 siblings, 1 reply; 108+ messages in thread
From: Đoàn Trần Công Danh @ 2020-08-09 12:41 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

On 2020-08-09 09:09:39-0300, David Bremner <david@tethera.net> wrote:
> Jonas Bernoulli <jonas@bernoul.li> writes:
> >
> > Jonas Bernoulli (34):
> >   emacs: Shorten long lines
> >   emacs: Remove excess empty lines
> 
> 
> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
> both seem to have problem with base64 encoded patches documented at.
> 
>      https://lore.kernel.org/git/20191218194144.GL17681@pobox.com/
> 
> It seems that the patches have CRLF line endings inside the base64
> encoding, and git fails to strip the CRs.
> 
> I'm not sure why this happens for some patches and not for others;
> I hope there is not re-encoding happening on the mailing list. If there
> is we should fix that.

It seems like the mailing list base64-encodes utf-8 email.
My email will be sent in utf-8 for obvious reason.

I don't know about Jonas's, some of them are in utf-8 and some other
is in plain ascii.


-- 
Danh

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09 12:41     ` Đoàn Trần Công Danh
@ 2020-08-09 13:21       ` Jonas Bernoulli
  0 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-09 13:21 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, David Bremner; +Cc: notmuch

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

> On 2020-08-09 09:09:39-0300, David Bremner <david@tethera.net> wrote:
>> Jonas Bernoulli <jonas@bernoul.li> writes:
>> >
>> > Jonas Bernoulli (34):
>> >   emacs: Shorten long lines
>> >   emacs: Remove excess empty lines
>> 
>> 
>> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
>> both seem to have problem with base64 encoded patches documented at.
>> 
>>      https://lore.kernel.org/git/20191218194144.GL17681@pobox.com/
>> 
>> It seems that the patches have CRLF line endings inside the base64
>> encoding, and git fails to strip the CRs.
>> 
>> I'm not sure why this happens for some patches and not for others;
>> I hope there is not re-encoding happening on the mailing list. If there
>> is we should fix that.
>
> It seems like the mailing list base64-encodes utf-8 email.
> My email will be sent in utf-8 for obvious reason.
>
> I don't know about Jonas's, some of them are in utf-8 and some other
> is in plain ascii.

That seems to be it.  I don't remember the exact question but when
sending I was asked about what encoding to use and I confirmed the
default, which was utf-8.  Usually I am not asked this question.

     Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09 12:09   ` David Bremner
  2020-08-09 12:41     ` Đoàn Trần Công Danh
@ 2020-08-09 13:32     ` Jonas Bernoulli
  2020-08-09 14:49     ` Tomi Ollila
  2 siblings, 0 replies; 108+ messages in thread
From: Jonas Bernoulli @ 2020-08-09 13:32 UTC (permalink / raw)
  To: David Bremner, notmuch

David Bremner <david@tethera.net> writes:
> A short term fix would be to fetch a ref from somewhere.

You can fetch it with:

git fetch https://github.com/tarsiiformes/notmuch.git cleanup

     Jonas

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09 12:09   ` David Bremner
  2020-08-09 12:41     ` Đoàn Trần Công Danh
  2020-08-09 13:32     ` Jonas Bernoulli
@ 2020-08-09 14:49     ` Tomi Ollila
  2020-08-10  1:25       ` David Bremner
  2 siblings, 1 reply; 108+ messages in thread
From: Tomi Ollila @ 2020-08-09 14:49 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sun, Aug 09 2020, David Bremner wrote:

> Jonas Bernoulli <jonas@bernoul.li> writes:
>>
>> Jonas Bernoulli (34):
>>   emacs: Shorten long lines
>>   emacs: Remove excess empty lines
>
>
> These patches (and Đoàn Trần Công Danh's that I just applied by hand)
> both seem to have problem with base64 encoded patches documented at.
>
>      https://lore.kernel.org/git/20191218194144.GL17681@pobox.com/
>
> It seems that the patches have CRLF line endings inside the base64
> encoding, and git fails to strip the CRs.
>
> I'm not sure why this happens for some patches and not for others;
> I hope there is not re-encoding happening on the mailing list. If there
> is we should fix that.
>
> The practical upshot is that I can't really apply such a long series by
> hand. Ideas welcome. A short term fix would be to fetch a ref from
> somewhere. OTOH, I hope this isn't going to be a recurring problem.

--ignore-whitespace could help...

for the --no-keep-cr (the default) not to work, in thread containing this

   https://lkml.org/lkml/2019/12/1/69

may give some hint why the situation is as unclear as it is now...

Tomi

> d

^ permalink raw reply	[flat|nested] 108+ messages in thread

* Re: [PATCH v3 00/34] A great number of cosmetic changes
  2020-08-09 14:49     ` Tomi Ollila
@ 2020-08-10  1:25       ` David Bremner
  0 siblings, 0 replies; 108+ messages in thread
From: David Bremner @ 2020-08-10  1:25 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

Tomi Ollila <tomi.ollila@iki.fi> writes:

>
> --ignore-whitespace could help...
>
> for the --no-keep-cr (the default) not to work, in thread containing this
>
>    https://lkml.org/lkml/2019/12/1/69
>
> may give some hint why the situation is as unclear as it is now...

--ignore-whitespace adds CRs to the files, which is pretty ick.

I ended up writing a python script to massage the patches, and added
that to my patch application alias.

The series is now applied to master.



[-- Attachment #2: email-to-8bit --]
[-- Type: application/octet-stream, Size: 702 bytes --]

#!/usr/bin/env python3

import sys
import email
import email.policy

from email.charset import Charset
from email.message import EmailMessage

def main():
    msg = email.message_from_file(sys.stdin,policy=email.policy.default.clone(cte_type='8bit'))

    if isinstance(msg, EmailMessage):
        body = msg.get_payload(decode=True).decode(encoding='utf8')
        lines = body.split('\r\n')
        msg.replace_header('Content-Transfer-Encoding','8bit')
        for field in msg.keys():
            print("{:s}: {:s}".format(field,msg[field]))
        print("")
        print('\n'.join(lines))
    else:
        logging.error('Input was not an e-mail message')

if __name__ == '__main__':
    main()

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 108+ messages in thread

end of thread, other threads:[~2020-08-10  1:26 UTC | newest]

Thread overview: 108+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 16:57 [PATCH 00/23] A create number of cosmetic changes Jonas Bernoulli
2020-07-26 16:57 ` [PATCH 01/23] emacs: Shorten long lines Jonas Bernoulli
2020-07-27 17:52   ` Tomi Ollila
2020-07-27 20:13     ` Jonas Bernoulli
2020-07-26 16:57 ` [PATCH 02/23] emacs: Remove excess empty lines Jonas Bernoulli
2020-07-27 18:00   ` Tomi Ollila
2020-07-27 20:25     ` Jonas Bernoulli
2020-07-26 16:57 ` [PATCH 03/23] emacs: Fix indentation Jonas Bernoulli
2020-07-30 20:07   ` Tomi Ollila
2020-08-01 20:37     ` Jonas Bernoulli
2020-07-26 16:57 ` [PATCH 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
2020-07-26 21:27   ` Sean Whitton
2020-07-26 22:02     ` Jonas Bernoulli
2020-07-27 16:43       ` Sean Whitton
2020-07-27 20:32         ` Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 11/23] emacs: Extend face to window edge again Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 12/23] emacs: Fix some function declarations Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 16/23] emacs: Improve doc-strings Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 19/23] emacs: Various cosmetic changes Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 21/23] Fix typos Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
2020-07-26 16:58 ` [PATCH 23/23] test: Fix indentation Jonas Bernoulli
2020-07-30 20:36 ` [PATCH 00/23] A create number of cosmetic changes Tomi Ollila
2020-08-01 20:48   ` [PATCH 00/23] A great " Jonas Bernoulli
2020-08-03 17:32     ` David Bremner
2020-08-06  7:18 ` [PATCH v2 " Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 01/23] emacs: Shorten long lines Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 02/23] emacs: Remove excess empty lines Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 03/23] emacs: Fix indentation Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 04/23] emacs: Closing parenthesis go on the same line Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 05/23] emacs: Only set one variable per setq form Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 06/23] emacs: Use cl-incf where appropriate Jonas Bernoulli
2020-08-06 11:37     ` David Bremner
2020-08-06 13:37       ` Jonas Bernoulli
2020-08-07 17:03         ` Tomi Ollila
2020-08-07 17:22           ` David Bremner
2020-08-06  7:18   ` [PATCH v2 07/23] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 08/23] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 09/23] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 10/23] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 11/23] emacs: Extend face to window edge again Jonas Bernoulli
2020-08-06  7:18   ` [PATCH v2 12/23] emacs: Fix some function declarations Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 13/23] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 14/23] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 15/23] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 16/23] emacs: Improve doc-strings Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 17/23] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 18/23] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 19/23] emacs: Various cosmetic changes Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 20/23] emacs: Increase consistency of library headers Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 21/23] Fix typos Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 22/23] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
2020-08-06  7:19   ` [PATCH v2 23/23] test: Fix indentation Jonas Bernoulli
2020-08-08 11:49 ` [PATCH v3 00/34] A great number of cosmetic changes Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 01/34] emacs: Shorten long lines Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 02/34] emacs: Remove excess empty lines Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 03/34] emacs: Fix indentation Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 04/34] emacs: Closing parenthesis go on the same line Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 05/34] emacs: Only set one variable per setq form Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 06/34] emacs: Use 'and' instead of 'when' when the return value matters Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 07/34] emacs: Use 'unless' instead of 'when' and 'not' Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 08/34] emacs: Use 'when' instead of 'if' when there is no ELSE part Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 09/34] emacs: Use one or three lines for 'if' forms Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 10/34] emacs: Extend face to window edge again Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 11/34] emacs: Fix some function declarations Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 12/34] emacs: No longer define notmuch-hello-mode-map as a function Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 13/34] emacs: notmuch-poll: Let the user know we are polling Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 14/34] emacs: Use makefile-gmake-mode in Makefile*s Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 15/34] emacs: Improve doc-strings Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 16/34] emacs: Autoload notmuch-jump-search only once Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 17/34] emacs: Autoload notmuch-jump using an autoload cookie Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 18/34] emacs: Various cosmetic changes Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 19/34] emacs: Increase consistency of library headers Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 20/34] Fix typos Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 21/34] .dir-locals.el: Set variables for correct "shell" mode Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 22/34] test: Fix indentation Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 23/34] .gitignore: Sort using sort-lines Jonas Bernoulli
2020-08-08 11:49   ` [PATCH v3 24/34] emacs: Provide 'rstdoc' feature at end of file Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 25/34] emacs: Add end-of-file line to libraries that lack it Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 26/34] NEWS: Add stub for 0.31 Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 27/34] NEWS: At least Emacs 25.1 is required now Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 28/34] emacs: Use cl-incf where appropriate Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 29/34] emacs: Remove notmuch-setq-local Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 30/34] emacs: Remove notmuch-read-char-choice Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 31/34] emacs: Drop old advices that were only need for Emacs 23 Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr Jonas Bernoulli
2020-08-08 11:50   ` [PATCH v3 34/34] try-emacs-mua: Trim `require' advice for Emacs 25 Jonas Bernoulli
2020-08-09  7:15   ` [PATCH v3 00/34] A great number of cosmetic changes Tomi Ollila
2020-08-09  7:48     ` Jonas Bernoulli
2020-08-09 12:09   ` David Bremner
2020-08-09 12:41     ` Đoàn Trần Công Danh
2020-08-09 13:21       ` Jonas Bernoulli
2020-08-09 13:32     ` Jonas Bernoulli
2020-08-09 14:49     ` Tomi Ollila
2020-08-10  1:25       ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).