-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clojure--valid-put-clojure-indent-call-p signals error with the indentation spec used for letfn #600
Comments
Actually I guess this is a problem with (clojure--valid-indent-spec-p '(1 ((:defn)) nil))
;; -> nil There seem to be a lot of things it doesn't like: ELISP> (clojure--valid-indent-spec-p '(1 ((:defn)) nil))
nil
ELISP> (clojure--valid-indent-spec-p '(1))
nil
ELISP> (clojure--valid-indent-spec-p '1)
t
ELISP> (clojure--valid-indent-spec-p '(1))
nil
ELISP> (clojure--valid-indent-spec-p ':defn)
(:defn)
ELISP> (clojure--valid-indent-spec-p '(:defn))
nil |
I've moved the ticket to |
I think I was working from the docs, but maybe I just missed something, or maybe the docs are incomplete. I'll take a look. |
These docs iirc: https://docs.cider.mx/cider/indent_spec.html |
Looks like I might not get to this today, but it's now on the short list, fwiw. |
I think I have a fix (overlooked a bit of the spec), and should be able to raise a pr tomorrow, but wondered about this example from above: |
I’ll follow up on Monday. Totally forgot I had to respond here last week.
…On Sat, Dec 4, 2021, at 7:12 PM, Rob Browning wrote:
@bbatsov <https://github.com/bbatsov> @camsaul <https://github.com/camsaul> Wondered how either of you read that spec (or maybe you already know the expectations), i.e. I need to decide what, if anything we should (or even can) be checking there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#600 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAZLSV6MV7PTRO6SMR6MKDUPJDY5ANCNFSM5C7CNR7Q>.
|
No worries. |
The real problem with the spec is that we put it quickly together at first and we never spent much time polishing it. I think we should probably spent a bit of time on the spec first and take it from there.
|
Ahh, right -- just meant anything that's not a list with items. I suppose it's also true that if we were "certain" that the function itself is "safe", i.e. always handles the form safely itself, then we might not need a separate validation function/step. |
@bbatsov so how should we proceed? Assuming we still want form validation, should I adjust the predicate to handle more of the cases @camsaul listed above? For example, should |
I was trying to use the same indentation spec for
clojure.tools.macro/macrolet
. In my.dir-locals.el
I haveput-clojure-indent
has thesafe-local-eval-function
propertyclojure--valid-put-clojure-indent-call-p
, i.e. that form in my.dir-locals.el
would be considered safe to eval without prompting so long asclojure--valid-put-clojure-indent-call-p
returnedt
when passed that form. It doesn't, however -- it signals an error.The form seems to be correct as far as I can tell -- If I manually eval
(put-clojure-indent 'tools.macro/macrolet '(1 ((:defn)) nil))
then it works as expected. So I'm assuming there's a bug inclojure--valid-put-clojure-indent-call-p
The text was updated successfully, but these errors were encountered: