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:
parent
0f39b4f25a
commit
f061b66c19
1 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue