Created
February 28, 2012 17:44
-
-
Save PhilHudson/1933912 to your computer and use it in GitHub Desktop.
C-style closing-paren indent for elisp
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
(defadvice lisp-indent-line (after my-trailing-parens-lisp-indentation) | |
"Make close parens on their own line indent like C" | |
(interactive) | |
(let (col-num) | |
(save-excursion | |
(beginning-of-line) | |
(when (looking-at "^\\s-*\)") | |
(search-forward "\)") | |
(backward-sexp) | |
(setf col-num (current-column)) | |
(forward-sexp) | |
(backward-char) | |
(delete-region (line-beginning-position) (point)) | |
(indent-to col-num))) | |
(when col-num (move-to-column col-num)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on: https://gist.github.com/467011