I'm having trouble with haml-mode's region-indent-function
, which I'm trying to reuse in another major mode. We're supposed to be able to cycle the region indentation by keeping the region marked after the haml-indent-region is being evaled, but it doesn't work as intended. After some hacking around, I've found out that throwing an error at the end of the function makes Emacs keep the region marked, as in this example:
(defun haml-indent-region (start end)
(save-excursion
...)
(error "")) ;; Terrible hack
But I really don't like it. Is there a clean way of getting this behavior without such an horrible hack?