Gustav Bertram
Gustav Bertram

Reputation: 14901

Calling cider-refresh shows "Don't know how to make a localized variable an alias"

I'm using Emacs 25 and CIDER 0.18.0.

I'm using cider-connect to attach to a running nREPL process. After connecting, when trying to call cider-refresh, it responds with "Don't know how to make a localized variable an alias".

I've tried debugging by setting Emacs to trace the function, and by looking at the byte-code compile buffers.

Loads of posts on the net refer to using cider-refresh so I'm fairly sure it should work.

How can I identify and fix this problem?

Upvotes: 3

Views: 390

Answers (1)

Gustav Bertram
Gustav Bertram

Reputation: 14901

In CIDER version 0.18.0, the cider-rename function was renamed to cider-ns-rename. The code defines an alias for the old function that points to the new function.

The project I'm working on had a .dir-locals.el file (as well as my .emacs file) containing code that hooks to the old function name:

((nil . ((cider-refresh-before-fn . "integrant.repl/suspend")
         (cider-refresh-after-fn . "integrant.repl/resume"))))

Because these refer to cider-refresh (which is now an alias) instead of cider-ns-refresh, calling the function fails with the error message mentioned above.

Modifying .dir-locals.el and .emacs to refer to the new function (eg. cider-ns-refresh-before-fn) fixed the problem.

Upvotes: 2

Related Questions