inf-clojure icon indicating copy to clipboard operation
inf-clojure copied to clipboard

`No applicable method: project-root, nil` when starting Squint REPL

Open bhlieberman opened this issue 3 months ago • 2 comments

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.

bhlieberman avatar Sep 12 '25 11:09 bhlieberman

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.

wmealing avatar Oct 26 '25 17:10 wmealing

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

bbatsov avatar Oct 26 '25 19:10 bbatsov