cider icon indicating copy to clipboard operation
cider copied to clipboard

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

Open behrica opened this issue 1 year ago • 1 comments

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"

behrica avatar Feb 25 '24 11:02 behrica

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)

vemv avatar Feb 25 '24 13:02 vemv

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.

bbatsov avatar Feb 28 '24 08:02 bbatsov

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.

vemv avatar Feb 28 '24 12:02 vemv

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)

bbatsov avatar Feb 28 '24 12:02 bbatsov

I think that most people have need for 2 things:

  • global alias for some functions they want to have always available, in any project
  • project specific alias, like test , dev in slide variations of name

-> 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)

behrica avatar Feb 29 '24 21:02 behrica

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 avatar Feb 29 '24 21:02 vemv

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

vemv avatar Mar 27 '24 12:03 vemv