Created
September 30, 2010 19:47
-
-
Save shoover/cd2f5a888aaab4f33fe9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-indent-line () | |
"Make single-semicolon lisp comments indent like ;;-comments. | |
Mostly cribbed from `lisp-indent-line'." | |
(interactive) | |
(let ((indent (calculate-lisp-indent)) shift-amt end | |
(beg (progn (beginning-of-line) (point)))) | |
(skip-chars-forward " \t") | |
(if (or (looking-at "\\s<\\s<") (not (looking-at "\\s<"))) | |
(lisp-indent-line) | |
(if (listp indent) (setq indent (car indent))) | |
(setq shift-amt (- indent (current-column))) | |
(if (zerop shift-amt) | |
nil | |
(delete-region beg (point)) | |
(indent-to indent))))) | |
(add-hook 'clojure-mode-hook | |
(lambda () | |
(set (make-local-variable 'indent-line-function) | |
'my-indent-line))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment