Skip to content

Instantly share code, notes, and snippets.

@shoover
Created September 30, 2010 19:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoover/cd2f5a888aaab4f33fe9 to your computer and use it in GitHub Desktop.
Save shoover/cd2f5a888aaab4f33fe9 to your computer and use it in GitHub Desktop.
(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