   `((,(rx "{"
           (group (or "if" "elseif" "switch" "case"))
           (1+ space)
-          (1+ (not space))
+          (1+ (not (any "}")))
           (0+ space)
           "}")
      (1 closure-template-tag-face))


(defun indent-closure-close ()
  (let ((prev (closure-previous-indent)))
    (message "%s" prev)
    (case (first prev)
      (opened (indent-line-to (second prev)))
      (otherwise (indent-line-to (- (second prev) sgml-basic-offset))))))


(defun indent-closure-open ()
  (let ((ind (closure-previous-indent)))
    (case (car ind)
      (opened (indent-line-to (+ (second ind)
                                 sgml-basic-offset)))
