Unused environment variable analysis
[hcoop/domtool2.git] / elisp / domtool-mode.el
index 4b23e76..9330e0b 100644 (file)
@@ -46,7 +46,7 @@
   `(,(concat
       "\\_<"
       (regexp-opt '("let" "in" "begin" "end" "with" "where" "extern" "type"
-                    "val" "context" "Root")
+                    "val" "context" "Root" "if" "then" "else")
                   t)
       "\\_>")
 
           . domtool-font-lock-syntactic-face-function)))
   (set (make-local-variable 'comment-start) "(* ")
   (set (make-local-variable 'comment-end) " *)")
-  (set (make-local-variable 'comment-nested) t))
+  (set (make-local-variable 'comment-nested) t)
+
+  (set (make-local-variable 'compile-command)
+       (concat "domtool -tc " (file-relative-name buffer-file-name))))
 
 (defun domtool-indent-line ()
   (let ((savep (> (current-column) (current-indentation)))
 
 (defun until-closed-helper (level)
   (if
-      (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\)\\_>"
+      (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\)\\_>"
                          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\\)\\_>"
+          (if (re-search-backward "\\_<\\(with\\|where\\|begin\\|end\\|let\\|in\\)\\_>"
                                   nil t)
               (values (match-string 0) (current-indentation))
             (values nil 0)))
           'noindent)
          ((nth 4 state)
           (domtool-calculate-comment-indent state))
-         ((looking-at "\\_<\\(with\\|end\\)\\_>")
+         ((looking-at "\\_<\\(with\\|end\\|in\\)\\_>")
           (until-closed))
          ((not previous-keyword)
           base-indent)