This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-15
Channels
- # admin-announcements (7)
- # alda (1)
- # aws-lambda (1)
- # beginners (12)
- # boot (20)
- # cider (59)
- # cljs-dev (4)
- # cljsrn (69)
- # clojure (232)
- # clojure-austin (3)
- # clojure-austria (1)
- # clojure-belgium (2)
- # clojure-canada (3)
- # clojure-dev (16)
- # clojure-greece (33)
- # clojure-nl (4)
- # clojure-quebec (12)
- # clojure-russia (12)
- # clojure-spec (27)
- # clojure-uk (38)
- # clojurescript (29)
- # community-development (7)
- # component (53)
- # core-async (16)
- # core-logic (1)
- # datascript (7)
- # datomic (11)
- # editors (7)
- # emacs (69)
- # hoplon (157)
- # keechma (1)
- # lambdaisland (2)
- # lein-figwheel (31)
- # leiningen (8)
- # mount (3)
- # off-topic (11)
- # om (23)
- # onyx (64)
- # planck (2)
- # re-frame (18)
- # reagent (21)
- # specter (118)
- # untangled (145)
- # yada (1)
I'll try tomorrow thanks Malabarba
How does clojure-defun-indents
work?
I tried setting it as a file-local variable but it doesn't seem to have any effect.
@stuartsierra: Looks like the way it's designed it won't work as a file-local variable.
Obviously, the variable's doc shouldn't say that: > This variable is safe as a file local variable if its value satisfies the predicate βlistpβ.
ah, thanks @malabarba
@bozhidar I think this variable is left-over from a previous version of the indentation engine. We should either change the way it's used so that it works as a file-local, or make it obsolete and tell people to use define-clojure-indent
instead.
@stuartsierra: You can still have file-local indent by putting something like this as a file-local eval: (define-clojure-indent (my-fn :defn) (some-def :defn))
Yes, that's what I've been doing.
mmm no, I don't think (trace-handlers (lambda () 0)
works here...
the doc of clojure-indent-function
is pretty clear:
The property value can be
- `defun', meaning indent `defun'-style;
- an integer N, meaning indent the first N arguments specially
like ordinary function arguments and then indent any further
arguments like a body;
- a function to call just as this function was called.
If that function returns nil, that means it doesn't specify
the indentation.
- a list, which is used by `clojure-backtracking-indent'.
so I tried to return nil
, but the minimum indendantation I get is 1 space, probably taking into consideration the initial paren
(rf/trace-handlers
(rf/reghandler :reset-db app-mw
[_ []]
db/initial-state))
with (trace-handlers (lambda () nil))
@richiardiandrea: Try this instead: (define-clojure-indent (trace-handlers (lambda (&rest _) 0)))
Oh ok, I also opened an issue in clojure-mode to add :never-align
I was playing with clojure-mode earlier
It looks like that 0 is not directly the column shift
So that is why I was thinking of adding a keyword to handle that case
@malabarba: I checked the code and it looks like your option should work but for some reason (functionp method)
returns nil
here https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1238
where method
is the lambda (not an emacs expert here so maybe it does not match against lambdas?)
edebug returns lambda
the doc says and returns nil for special forms
again, dunno what this means in elisp though π
ah @malabarba ok, lambda
is a special form π
everything makes sense now ahah
I opened an issue, I can take care of the pr if you tell which is the right function π
but I still think that a :never-align
option might be good
so #'(lambda () ...
should work right?
true, I tried
great, I can try it out
I am adding the test
@malabarba: no honey with (trace-handlers (lambda (_ _) 0))
it worked for me with (define-clojure-indent (trace-handlers (lambda (&rest _) 0)))
I'll check again
the test passes