]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.el
emacs: Use one or three lines for 'if' forms
[notmuch] / test / test-lib.el
index aae9e8333f5f7558b4116b83c5263774a5769782..6a39bbe2140995f9bb58cbfb2f6a9a68a0af14ef 100644 (file)
@@ -36,7 +36,7 @@
 
 ;; 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 @@
 ;; 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)))
@@ -81,7 +81,7 @@ invisible text."
   (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 @@ invisible text."
 (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."