X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/6b71895409837ee7ebea2a66f62d98dbee8b97e7..b21491def4a9ec982a4de1525e9bc8f43c9da920:/elisp/domtool-mode.el diff --git a/elisp/domtool-mode.el b/elisp/domtool-mode.el index 4b23e76..9330e0b 100644 --- a/elisp/domtool-mode.el +++ b/elisp/domtool-mode.el @@ -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) "\\_>") @@ -85,7 +85,10 @@ . 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))) @@ -97,7 +100,7 @@ (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") @@ -118,7 +121,7 @@ (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))) @@ -128,7 +131,7 @@ '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)