clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 646 forks source link

introduced variable `cider-clojure-cli-global-aliases` #3623

Closed behrica closed 5 months ago

behrica commented 7 months ago

This PR introduces a variable cider-clojure-cli-global-aliases Discussed here: https://clojurians.slack.com/archives/C0617A8PQ/p1708857780583699

It allows a user to have a "global" system wide set of aliases, which get added by cider to each repl start. It allows to combine "project specific aliases" and" global aliases"

vemv commented 7 months ago

Looks like a reasonable start, let's see what @bbatsov thinks as well

(note as future steps: there's test coverage for this area - easy to extend)

bbatsov commented 7 months ago

I get the intent, but I'm curious why is the current variable considered to be project-specific, given that nothing about it implies it. Might be better to actually add something name cider-clojure-cli-project-aliases instead that's meant to be used only via .dir-locals.el.

If we go with your approach the documentation for the existing defcustom will need to be updated. I also think this will need some coverage in the user manual.

vemv commented 7 months ago

Might be better to actually add something name cider-clojure-cli-project-aliases instead that's meant to be used only via .dir-locals.el.

This would work as well (it's basically the same endgame as proposed in this PR - two variables).

However over the last few years we've taught people to set cider-clojure-cli-aliases in .dir-locals.el (and/or that's what people do anyway), so changing the intended semantics for cider-clojure-cli-aliases would seem overly disruptive.

bbatsov commented 7 months ago

Yeah, that's fair. As I never used clojure-cli much, it's hard for me to assess whether people have more need for global aliases or project aliases (e.g. how like it is that those differ at all, as with many build system I have more or less the same setup across many projects)

behrica commented 7 months ago

I think that most people have need for 2 things:

-> ideally you want be able to "add" them together -> the globals, should usually be first (they do not define :main entry points, the add functions to ns 'user for example)

vemv commented 7 months ago

Agreed - that's what most people would expect. You have the green light for the PR as-is, simply follow the suggestions when you have the chance!

vemv commented 6 months ago

Hi @behrica, feel free to polish this PR these days, would be good timing in preparation for the next major CIDER release.