          (signal 'scan-error (cdr err)))
        (goto-char limit)))))
 
-(defun* haml-extend-region ()
+(defun* haml-extend-region-filters-comments ()
   "Extend the font-lock region to encompass filters and comments."
   (let ((old-beg font-lock-beg)
         (old-end font-lock-end))

      (beginning-of-line)
      (unless (or (looking-at haml-filter-re)
                  (looking-at haml-comment-re))
        (return-from haml-extend-region))
      (setq font-lock-beg (point))
      (haml-forward-sexp)
      (beginning-of-line)
      (setq font-lock-end (max font-lock-end (point))))
    (or (/= old-beg font-lock-beg)
        (/= old-end font-lock-end))))



\\{haml-mode-map}"
  (set-syntax-table haml-mode-syntax-table)
  (add-to-list 'font-lock-extend-region-functions 'haml-extend-region-filters-comments)
  (add-to-list 'font-lock-extend-region-functions 'haml-extend-region-multiline-hashes)
  (set (make-local-variable 'font-lock-multiline) t)
  (set (make-local-variable 'indent-line-function) 'haml-indent-line)
  (set (make-local-variable 'indent-region-function) 'haml-indent-region)
