This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-17
Channels
- # announcements (6)
- # beginners (117)
- # calva (22)
- # cider (7)
- # clara (56)
- # clj-kondo (8)
- # cljdoc (3)
- # cljfx (26)
- # clojure (58)
- # clojure-czech (2)
- # clojure-europe (20)
- # clojure-greece (1)
- # clojure-india (7)
- # clojure-nl (11)
- # clojure-uk (100)
- # clojurescript (48)
- # conjure (24)
- # cursive (117)
- # data-science (3)
- # datascript (5)
- # datomic (33)
- # emacs (29)
- # figwheel-main (3)
- # fulcro (12)
- # jobs (1)
- # malli (40)
- # parinfer (4)
- # pathom (1)
- # quil (2)
- # re-frame (17)
- # reagent (20)
- # reitit (1)
- # reveal (97)
- # ring (5)
- # shadow-cljs (11)
- # spacemacs (12)
- # sql (4)
- # tools-deps (18)
- # xtdb (25)
Hi guys, I switched from doom emacs to building my own emacs from the ground up. Today I set up everything related to Clojure. However, somehow clojure-mode won‘t allow my to indent code by myself when I press TAB
. The reason why I believe clojure-mode is causing this is because after removing clojure-mode I was able to use TAB
again. Has anybody encountered that? Is this standard behavior? Because in doom emacs it was possible to manually indent with TAB
in clojure source files. I‘m using evil-mode as well in case that‘s related to this issue.
to find out what command is run by a keybinding, try C-c h tab
. for me its company-indent-or-complete-common
. personally i wouldn't want to indent with tab as newlines should already be correctly aligned. and for formatting i hit M-q
to format the current top level form
No, but only in Clojure source files. When I try to TAB on an empty line then nothing happens.
ok. so i did C-h f indent-for-tab-command
and it mentions
> The function called to actually indent the line or insert a tab is given by the variable ‘indent-line-function’.
and in clojure-mode this is
(defun clojure-indent-line ()
"Indent current line as Clojure code."
(if (clojure-in-docstring-p)
(save-excursion
(beginning-of-line)
(when (and (looking-at "^\\s-*")
(<= (string-width (match-string-no-properties 0))
(string-width (clojure-docstring-fill-prefix))))
(replace-match (clojure-docstring-fill-prefix))))
(lisp-indent-line)))
I see! Thanks! I already spent quite some time on that, thanks to you I have a new direction which I can check.
can you post a form with |
where your cursor is and what the form looks like before you indent it?
for instance, when i type
(let [thing 1])
when i press enter after the 1
i get it automatically indented
(let [thing 1
<cursor>])
and if i erase all of the spaces introduced for me and hit tab, it indents it back to the correct level
to me the only valid indentation level there is against the margin where your cursor is
Then I would press TAB and enter []
and parinfer would put the end parentheses from above to the next line
oh i see. i never use parinfer but i can see why its not indenting. not sure how to help you with that though