1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Emacs] Add a function for commenting blocks of Haml.

This commit is contained in:
Nathan Weizenbaum 2008-12-11 15:29:04 -08:00
parent 0f39b4f25a
commit f061b66c19

View file

@ -153,6 +153,20 @@ text nested beneath them.")
(setq indent-tabs-mode nil)
(setq font-lock-defaults '((haml-font-lock-keywords) nil t)))
;; Useful functions
(defun haml-comment-block ()
"Comment the current block of Haml code."
(interactive)
(save-excursion
(let ((indent (current-indentation)))
(back-to-indentation)
(insert "-#")
(newline)
(indent-to indent)
(haml-indent-region
(point) (save-excursion (haml-forward-sexp) (point))))))
;; Navigation
(defun haml-forward-through-whitespace (&optional backward)