 
 (defvar *closure-template-foreach-keywords*
   `((,(rx "{"
-          (group "foreach")
+          (group (or "foreach" "ifempty"))
           (1+ space)
           (1+ (not space))
           (1+ space)

(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
    (beginning-of-line)
    (looking-at *closure-close*)))

(defun closure-composite-line ()
  (save-excursion
    (some (lambda (key)
            (back-to-indentation)
            (looking-at (format "{%s" key)))
          closure-composite-tag-keywords)))

(defun closure-tag-closed ()
  (save-excursion
