Skip to content
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-mode.el (clojure-mode): Force elec. indentation in a docstring #447

Merged
merged 2 commits into from
Oct 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ replacement for `cljr-expand-let`."
\\{clojure-mode-map}"
(clojure-mode-variables)
(clojure-font-lock-setup)
(add-hook 'paredit-mode-hook #'clojure-paredit-setup))
(add-hook 'paredit-mode-hook #'clojure-paredit-setup)
(add-hook 'electric-indent-functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really add some explanations here, as people are going to be confused by this bit of code for sure.

You might also consider adding some simple unit test verifying the correct behavior when electric indent is enabled.

(lambda (c) (if (clojure-in-docstring-p) 'do-indent))))

(defcustom clojure-verify-major-mode t
"If non-nil, warn when activating the wrong `major-mode'."
Expand Down