branch: elpa/cider
commit 61ad615e00cd82c22c208bf70d38c9fb1b4c7376
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Replace (when (not ...)) with (unless ...)
    
    Use the more idiomatic (unless ...) form instead of (when (not ...))
    across cider-xref.el, cider-repl.el, nrepl-client.el, and
    cider-stacktrace.el.
---
 lisp/cider-repl.el       |  2 +-
 lisp/cider-stacktrace.el |  2 +-
 lisp/cider-xref.el       |  2 +-
 lisp/nrepl-client.el     | 16 ++++++++--------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisp/cider-repl.el b/lisp/cider-repl.el
index 9acd3f0ef12..7be6d4b449a 100644
--- a/lisp/cider-repl.el
+++ b/lisp/cider-repl.el
@@ -636,7 +636,7 @@ the input stream may block the whole colorization process."
                 (let* ((sgr-end-pos (match-end 0))
                        (fragment-matches-whole? (or (= sgr-end-pos 0)
                                                     (= sgr-end-pos (length 
fragment)))))
-                  (when (not fragment-matches-whole?)
+                  (unless fragment-matches-whole?
                     ;; Definitely not an partial SGR seq, flush it out of
                     ;; `ansi-color-context'.
                     t)))))))
diff --git a/lisp/cider-stacktrace.el b/lisp/cider-stacktrace.el
index 4bff1a231bd..937cbf1532e 100644
--- a/lisp/cider-stacktrace.el
+++ b/lisp/cider-stacktrace.el
@@ -782,7 +782,7 @@ the NAME.  The whole group is prefixed by string INDENT."
       (dolist (prob problems)
         (nrepl-dbind-response prob (in val predicate reason spec at extra)
           (insert "\n")
-          (when (not (string= val value))
+          (unless (string= val value)
             (cider-stacktrace--insert-named-group indent2 "   val: " val))
           (when in
             (cider-stacktrace--insert-named-group indent2 "    in: " in))
diff --git a/lisp/cider-xref.el b/lisp/cider-xref.el
index 26a38f12fdd..4e65ee6c209 100644
--- a/lisp/cider-xref.el
+++ b/lisp/cider-xref.el
@@ -67,7 +67,7 @@ the symbol found by the xref search as argument."
                                    'help-echo "Display doc")
       (insert-text-button var-name 'type 'apropos-symbol))
     (when-let ((doc (nrepl-dict-get result "doc")))
-      (when (not (string-equal "(not documented)" doc))
+      (unless (string-equal "(not documented)" doc)
         (insert "\n  ")
         (let ((beg (point)))
           (insert (propertize doc 'font-lock-face 'font-lock-doc-face))
diff --git a/lisp/nrepl-client.el b/lisp/nrepl-client.el
index 7ef590ad60c..92e0d92151d 100644
--- a/lisp/nrepl-client.el
+++ b/lisp/nrepl-client.el
@@ -243,8 +243,8 @@ Discards it if it can be determined that the port is not 
active."
                 (port-number (nrepl--port-string-to-number port-string)))
       (if (eq system-type 'windows-nt)
           port-string
-        (when (not (equal ""
-                          (shell-command-to-string (format "lsof -i:%s" 
port-number))))
+        (unless (equal ""
+                      (shell-command-to-string (format "lsof -i:%s" 
port-number)))
           port-string)))))
 
 (defun nrepl--ssh-file-name-matches-host-p (file-name host)
@@ -368,7 +368,7 @@ STACK is as in `nrepl--bdecode-1'.  Return a cons (INFO . 
STACK)."
 
 (defun nrepl--ensure-fundamental-mode ()
   "Enable `fundamental-mode' if it is not enabled already."
-  (when (not (eq 'fundamental-mode major-mode))
+  (unless (eq 'fundamental-mode major-mode)
     (fundamental-mode)))
 
 (defun nrepl-bdecode (string-q &optional response-q)
@@ -695,10 +695,10 @@ Do not kill the server if there is a REPL connected to 
that server."
   (when (buffer-live-p server-buf)
     (with-current-buffer server-buf
       ;; Don't kill if there is at least one REPL connected to it.
-      (when (not (seq-find (lambda (b)
-                             (eq (buffer-local-value 'nrepl-server-buffer b)
-                                 server-buf))
-                           (buffer-list)))
+      (unless (seq-find (lambda (b)
+                          (eq (buffer-local-value 'nrepl-server-buffer b)
+                              server-buf))
+                        (buffer-list))
         (nrepl-kill-server-buffer server-buf)))))
 
 (defun nrepl-start-client-process (&optional host port server-proc 
buffer-builder socket-file)
@@ -1217,7 +1217,7 @@ If the nREPL PROCESS failed to initiate and encountered a 
fatal EVENT
 signal, raise an `error'.  Additionally, if the EVENT signal is SIGHUP,
 close any existing client connections."
   ;; only interested on fatal signals.
-  (when (not (process-live-p process))
+  (unless (process-live-p process)
     (emacs-bug-46284/when-27.1-windows-nt
      ;; There is a bug in emacs 27.1 (since fixed) that sets all EVENT
      ;; descriptions for signals to "unknown signal". We correct this by

Reply via email to