]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Various cosmetic changes
authorJonas Bernoulli <jonas@bernoul.li>
Sat, 8 Aug 2020 11:49:53 +0000 (13:49 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 10 Aug 2020 00:14:36 +0000 (21:14 -0300)
emacs/make-deps.el
emacs/notmuch-lib.el
emacs/notmuch-parser.el
emacs/notmuch-show.el
emacs/rstdoc.el
test/test-lib.el

index dcac319ce282c35bce12ce0451104bdc32bb0312..91f4ef3dd08c5f8bd757a2423c1afc15693a2945 100644 (file)
@@ -36,7 +36,8 @@
 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
index b86c44edee283c6982373d401707f92611bdd3f6..05d86ea196bd9378c90b15a0e5734dcdd95e4f3d 100644 (file)
@@ -53,9 +53,8 @@
 
 (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 @@ signaled error.  This function does not return."
        (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.
index fbcfc2efb4e6ca624a17198c4b84fc37669e5ec5..3aa5bd8ff1cdc45f6265d9f2133e9e8b9e070c57 100644 (file)
@@ -39,12 +39,9 @@ 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
-         ;; 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))
index a210898b7e8bccf71e33d8162a02b81799ca9ff6..eb07e450f34e0c80935becac89131daac9e0ff77 100644 (file)
@@ -505,21 +505,17 @@ message at DEPTH in the current thread."
 
 (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)
index 92a337c841fad6bbf90ca8d0772c9a00cf65f099..41390bbef5d223acf32f4fa750f375adcbc9e4af 100644 (file)
@@ -24,7 +24,6 @@
 ;;
 
 ;;; Commentary:
-;;
 
 ;; Rstdoc provides a facility to extract all of the docstrings defined in
 ;; an elisp source file. Usage:
   (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)
index 6a39bbe2140995f9bb58cbfb2f6a9a68a0af14ef..e9e7c3798770e53c33fe7020133199b80e3d9982 100644 (file)
@@ -154,22 +154,21 @@ running, quit if it terminated."
 
 (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))