   (save-excursion
     (while (and (zerop (forward-line -1))
                 (or (looking-at "[ \t]*$")
-                    (closure-any-com))))
+                    (closure-any-com)
+                    (not (looking-at ".*[{}<>]")))))
     (back-to-indentation)
     (list (cond
+           ((closure-composite-line) 'composite)
            ((closure-tag-closed) 'closed)
            ((closure-tag-opened) 'opened)
            (t nil))

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

(defun closure-indent-line ()
  (interactive)
  (cond
   ((closure-close) (indent-closure-close))
   ((closure-open) (indent-closure-open))
   ((closure-any-com) nil)
   (t (indent-sgml-in-closure))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Compilation

               (save-excursion (indent-line-to indent-col))
             (indent-line-to indent-col))))))))

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

