Improve domtool-mode indentation
[hcoop/domtool2.git] / elisp / domtool-mode.el
index cbd5175..db93b74 100644 (file)
 
 (defun until-closed-helper (level)
   (if
-      (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\)\\_>"
+      (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\|val\\|type\\|if\\)\\_>"
                          nil t)
       (cond
        ((string= (match-string 0) "end")
     (back-to-indentation)
     (multiple-value-bind (previous-keyword base-indent)
         (save-excursion
-          (if (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\|in\\)\\_>"
+          (if (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\|in\\|val\\|type\\|if\\)\\_>"
                                   nil t)
               (values (match-string 0) (current-indentation))
             (values nil 0)))
           'noindent)
          ((nth 4 state)
           (domtool-calculate-comment-indent state))
-         ((looking-at "\\_<\\(with\\|end\\|in\\)\\_>")
+         ((looking-at "\\_<\\(with\\|end\\|in\\|else\\)\\_>")
           (until-closed))
          ((not previous-keyword)
           base-indent)