Description
Is your feature request related to a problem? Please describe.
When I switched from lein to Clojure CLI on MS Windows 10, cider-jack-in failed. The reason was unclear (to me anyway) from the error messaging. I found Alex Miller's documentation at
Install fails due to permission errors
useful in figuring out the problem.
Describe the solution you'd like
I'd like to be able to set a variable in my init.el like this:
(custom-set-variables '(cider-clojure-cli-powershell-options "-noprofile -executionpolicy bypass"))
which would result in the cider-jack-in command line to be:
;; Startup: "c:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe" -noprofile -executionpolicy bypass -encodedCommand
This would need to be documented at
Customizing the Jack-in Command Behaviour
Describe alternatives you've considered
- Globally change execution policy as Alex Miller documents. This seems unwise.
- I can use C-u M-x cider-jack-in and manually add the options each time, which I did for a while.
Additional context
MS OS Version: 10.0.19041 N/A Build 19041
GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29
CIDER 0.26.0snapshot (package: 20200718.1908), nREPL 0.8.0-alpha5
Clojure 1.10.1, Java 1.8.0_202-ea
I have attached my version of cider.el that implements this enhancement. It works for me, with the caveat that I am not an everyday Clojure developer. I only use this occasionally.
Basically, this code
Adds the variable "(defcustom cider-clojure-cli-powershell-options ...)"
I do not really care what the variable name is; I just picked this.
And modifies "(defun cider--update-jack-in-cmd ...)" to use the new variable. With apologies, my code seems inelegant to me but minimizes the changes to existing code.