Hi, while working on https://github.com/scicloj/clay (we have Clojure file parser tests there) I hit a problem, so
I have code like this in a file
(ns wtf) (def foo " (ns bar) " )Expected behavior
foo evals to #'wtf/foo
#'user/foo
put the code above into a file, start repl, eval it in cider
Environment & Version information CIDER version information;; CIDER 1.16.0 (Kherson), babashka.nrepl 0.0.6-SNAPSHOT
;; Babashka 1.3.191
Lein / Clojure CLI version
Babashka 1.3.191
Emacs version29.4
Operating systemUbuntu 22.04
JDK distributionBabashka 1.3.191
The problems is the regex used in cider-ns-form-p
- "^[[:space:]]*\(ns\\([[:space:]]*$\\|[[:space:]]+\\)"
treats namespace in a string as a real namespace, so cider-interactive-eval
evals it in user
namespace instead of the current one.
I tried to fix it by myself but unfortunately, Emacs regexes don't support look ahead, so probably we should discuss the way it should be fixed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4