emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-clojure 26a2076 305/313: Replace if + not with unless


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 26a2076 305/313: Replace if + not with unless
Date: Wed, 11 Aug 2021 10:00:38 -0400 (EDT)

branch: elpa/inf-clojure
commit 26a2076277087859dda35452193e09b12c44b3ec
Author: Bozhidar Batsov <bozhidar@batsov.com>
Commit: Bozhidar Batsov <bozhidar@batsov.com>

    Replace if + not with unless
---
 inf-clojure.el | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/inf-clojure.el b/inf-clojure.el
index 141d633..88a9c86 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -753,22 +753,24 @@ process buffer for a list of commands.)"
          (repl-buffer-name (if project-dir
                                (format "*inf-clojure %s*" 
(inf-clojure--project-name project-dir))
                              "*inf-clojure*")))
-    (if (not (comint-check-proc repl-buffer-name))
-             ;; run the new process in the project's root when in a project 
folder
-             (let ((default-directory (or project-dir default-directory))
-                   (cmdlist (if (consp cmd)
-                                (list cmd)
-                              (split-string cmd)))
-                   (repl-type (or (unless prefix-arg
-                                    inf-clojure-custom-repl-type)
-                                  (car (rassoc cmd inf-clojure-startup-forms))
-                                  (inf-clojure--prompt-repl-type))))
-               (message "Starting Clojure REPL via `%s'..." cmd)
-               (with-current-buffer (apply #'make-comint
-                                           "inf-clojure" (car cmdlist) nil 
(cdr cmdlist))
-                 (inf-clojure-mode)
-                 (setq-local inf-clojure-repl-type repl-type)
-                 (hack-dir-local-variables-non-file-buffer))))
+    ;; Create a new comint buffer if needed
+    (unless (comint-check-proc repl-buffer-name)
+      ;; run the new process in the project's root when in a project folder
+      (let ((default-directory (or project-dir default-directory))
+            (cmdlist (if (consp cmd)
+                         (list cmd)
+                       (split-string cmd)))
+            (repl-type (or (unless prefix-arg
+                             inf-clojure-custom-repl-type)
+                           (car (rassoc cmd inf-clojure-startup-forms))
+                           (inf-clojure--prompt-repl-type))))
+        (message "Starting Clojure REPL via `%s'..." cmd)
+        (with-current-buffer (apply #'make-comint
+                                    "inf-clojure" (car cmdlist) nil (cdr 
cmdlist))
+          (inf-clojure-mode)
+          (setq-local inf-clojure-repl-type repl-type)
+          (hack-dir-local-variables-non-file-buffer))))
+    ;; update the default comint buffer and switch to it
     (setq inf-clojure-buffer (get-buffer repl-buffer-name))
     (if inf-clojure-repl-use-same-window
         (pop-to-buffer-same-window repl-buffer-name)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]