branch: elpa/inf-clojure
commit ae00aec8e0000a9fcac4e8bbaf548759bf3c3ccb
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Simplify inf-clojure--nil-string-match-p
    
    The old regex \\Ca*nil\\Ca* was obscure and its docstring was
    misleading (said "non-nil iff STRING is not nil" when it did the
    opposite). Replace with a straightforward string comparison on
    the trimmed input, which is what the callers actually need.
---
 inf-clojure.el | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/inf-clojure.el b/inf-clojure.el
index d8add6c5a2..bcab039865 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -1298,11 +1298,8 @@ output from and including the `inf-clojure-prompt`."
           response-string)))))
 
 (defun inf-clojure--nil-string-match-p (string)
-  "Return non-nil iff STRING is not nil.
-This function also takes into consideration weird escape
-character and matches if nil is anywhere within the input
-string."
-  (string-match-p "\\Ca*nil\\Ca*" string))
+  "Return non-nil if STRING represents a nil REPL response."
+  (string= (string-trim string) "nil"))
 
 (defun inf-clojure--some (data)
   "Return DATA unless nil or includes \"nil\" as string."

Reply via email to