inf-clojure
inf-clojure copied to clipboard
`No applicable method: project-root, nil` when starting Squint REPL
As reported in the inf-clojure channel on Slack, I cannot start a Squint REPL as documented in the Squint README. The minibuffer provides the message in the issue title.
I had similar issues with the erlang repl, had to set the project explicity. I had it check for rebar.config, but maybe you could check for squint.edn.
(defun my-erlang-set-project-root ()
"Set `default-directory` to the parent dir containing `rebar.config` or `rebar.config.script`, if found."
(when (derived-mode-p 'erlang-mode)
(let* ((start (or (buffer-file-name) default-directory))
(proj-root
(locate-dominating-file
start
(lambda (dir)
(or (file-exists-p (expand-file-name "rebar.config" dir))
(file-exists-p (expand-file-name "rebar.config.script" dir)))))))
(when proj-root
(setq-local default-directory proj-root)))))
I was able to follow instructions from the cited page and didnt get the error on Emacs 28.
I guess it'd be nice to add a mention of squint.edn here https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L803