HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Factor path prefixes into ConfigCore structure
[hcoop/domtool2.git]
/
elisp
/
domtool-mode.el
diff --git
a/elisp/domtool-mode.el
b/elisp/domtool-mode.el
index
292acfa
..
17c90c5
100644
(file)
--- a/
elisp/domtool-mode.el
+++ b/
elisp/domtool-mode.el
@@
-40,13
+40,13
@@
(defun domtool-syms-re (&rest syms)
(concat "\\<" (regexp-opt syms t) "\\>"))
(defun domtool-syms-re (&rest syms)
(concat "\\<" (regexp-opt syms t) "\\>"))
-(
load-file "/usr/local/share/emacs/site-lisp/domtool-mode/domtool-tables.el"
)
+(
require 'domtool-tables
)
(defvar domtool-font-lock-keywords
`(,(concat
"\\_<"
(regexp-opt '("let" "in" "begin" "end" "with" "where" "extern" "type"
(defvar domtool-font-lock-keywords
`(,(concat
"\\_<"
(regexp-opt '("let" "in" "begin" "end" "with" "where" "extern" "type"
- "val" "context" "Root")
+ "val" "context" "Root"
"if" "then" "else"
)
t)
"\\_>")
t)
"\\_>")
@@
-83,8
+83,8
@@
. domtool-font-lock-syntactic-keywords)
(font-lock-syntactic-face-function
. domtool-font-lock-syntactic-face-function)))
. domtool-font-lock-syntactic-keywords)
(font-lock-syntactic-face-function
. domtool-font-lock-syntactic-face-function)))
- (set (make-local-variable 'comment-start
) "(*
")
- (set (make-local-variable 'comment-end
) " *)
")
+ (set (make-local-variable 'comment-start
-regexp) "(\\*\\|{{
")
+ (set (make-local-variable 'comment-end
-regexp) "\\*)\\|}}
")
(set (make-local-variable 'comment-nested) t)
(set (make-local-variable 'compile-command)
(set (make-local-variable 'comment-nested) t)
(set (make-local-variable 'compile-command)
@@
-100,13
+100,19
@@
(defun until-closed-helper (level)
(if
(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")
(until-closed-helper (+ level 1)))
((= level 0)
(current-indentation))
nil t)
(cond
((string= (match-string 0) "end")
(until-closed-helper (+ level 1)))
((= level 0)
(current-indentation))
+ ((and
+ (string= (match-string 0) "with")
+ (save-excursion
+ (backward-char)
+ (looking-at "\\s-")))
+ (until-closed-helper level))
(t
(until-closed-helper (- level 1))))
(t
(until-closed-helper (- level 1))))
@@
-121,7
+127,7
@@
(back-to-indentation)
(multiple-value-bind (previous-keyword base-indent)
(save-excursion
(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)))
nil t)
(values (match-string 0) (current-indentation))
(values nil 0)))
@@
-131,12
+137,16
@@
'noindent)
((nth 4 state)
(domtool-calculate-comment-indent state))
'noindent)
((nth 4 state)
(domtool-calculate-comment-indent state))
- ((looking-at "\\_<\\(with\\|end\\|in\\)\\_>")
+ ((looking-at "{{\\|\\_<\\(extern\\|val\\|type\\|context\\)\\_>")
+ 0)
+ ((looking-at "\\_<\\(with\\|end\\|in\\|else\\)\\_>")
(until-closed))
((not previous-keyword)
base-indent)
((string= previous-keyword "end")
base-indent)
(until-closed))
((not previous-keyword)
base-indent)
((string= previous-keyword "end")
base-indent)
+ ((looking-at "\\_<\\(val\\|extern\\|context\\)\\_>")
+ base-indent)
(t
(+ base-indent domtool-indent)))))))
(t
(+ base-indent domtool-indent)))))))
@@
-152,3
+162,5
@@
(incf depth)
(decf depth)))
(+ (current-indentation) depth)))))
(incf depth)
(decf depth)))
(+ (current-indentation) depth)))))
+
+(provide 'domtool-mode)