This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-09
Channels
- # aws (4)
- # bangalore-clj (1)
- # beginners (94)
- # boot (19)
- # cider (42)
- # cljs-dev (21)
- # cljsrn (4)
- # clojure (142)
- # clojure-austin (10)
- # clojure-greece (25)
- # clojure-italy (14)
- # clojure-russia (14)
- # clojure-serbia (13)
- # clojure-sg (6)
- # clojure-spec (74)
- # clojure-uk (69)
- # clojurescript (236)
- # consulting (1)
- # cursive (26)
- # data-science (6)
- # datascript (2)
- # datomic (31)
- # editors (5)
- # emacs (24)
- # funcool (5)
- # hoplon (8)
- # jobs-rus (1)
- # luminus (12)
- # lumo (17)
- # off-topic (90)
- # om (45)
- # onyx (5)
- # pedestal (2)
- # powderkeg (12)
- # protorepl (2)
- # re-frame (30)
- # remote-jobs (2)
- # ring-swagger (17)
- # rum (46)
- # slack-help (1)
- # test-check (2)
- # yada (62)
@qqq try clojure-align
don't about ux, i use it very rarely. about the last question, probably the answer is to open an issue in clojure-mode
@qqq https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1014
Btw, you're not really supposed to use this as an interactive command - there a defcustom that enables this alignment by default.
@richiardiandrea I'll cut a new version of inf-clojure
once this patch is merged
I want to add a ‘before-save-hook to indent my Clojure code. How do I add this for only Clojure files?
I was dealing with the inf-clojure problem for a week, but I didn’t get around to reporting it until yesterday. Maybe others hadn’t updated their packages?
@borkdude another option (depending) is https://github.com/Malabarba/aggressive-indent-mode , which indents after any buffer change (that’s better or worse depending on how you feel about it)
One of the problems with automatic indentation on save is that in some files indentation becomes tediously slow on my machine (a few seconds). Don’t know exactly why this is, it’s not in all files.
I used aggressive-indent-mode for a long time and found myself needing to turn it off with long files. Eventually I turned it off completely and was amazed at how much smoother the editing experience was.
@borkdude this is how I've been indenting on save for clojure (and elisp) files:
(defvar auto-indent-modes
'(clojure-mode emacs-lisp-mode))
(defun indent-maybe ()
(when (member major-mode auto-indent-modes)
(indent-region (point-min) (point-max))))
(add-hook 'before-save-hook #'indent-maybe)