-I- Hilit 19 Tcl モード
AI. Aaron Roydhouse [aaron@comp.vuw.ac.nz] が作成し,
Julian.Anderson@comp.vuw.ac.nz (Julian Anderson) が投稿した,以下のも
のがあります.
(hilit-set-mode-patterns
'tcl-mode
'(("\\s #.*$" nil comment)
("^#.*$" nil comment)
("\"[^\\\"]*\\(\\\\\\(.\\|\n\\)[^\\\"]*\\)*\"" nil string)
("\\$[-_a-zA-Z]+" nil varref)
("^source.*$" nil include)
("\\b\\(global\\|upvar\\)\\b" nil decl)
("\\b\\(error\\|debug\\)\\b" nil decl)
("^\\s *proc\\s +\\(\\w\\|[_']\\)+" nil defun)
("\\b\\(set\\|lset\\|list\\|if\\|case\\|while\\|switch\\|then\\|else\\|
for\\|foreach\\|return\\|expr\\|catch\\)\\b" nil keyword)))
Dwight Shih は後に,以下の font lock モードを投稿しました.
(defvar tcl-font-lock-keywords
(list
(list (concat "\\b\\("
(mapconcat 'identity
'("set" "lset" "list" "if" "case" "while"
"switch" "then" "else" "for" "foreach"
"return" "expr" "catch" "puts" "proc"
"trace")
"\\|")
"\\)\\b")
1 'font-lock-keyword-face t)
(list (concat "\\b\\("
(mapconcat 'identity
'("global" "upvar" "uplevel" "error" "debug")
"\\|")
"\\)\\b")
1 'font-lock-type-face t)
(list "^\\s *proc\\s +\\(\\(\\w\\|[_']\\)+\\)" 1 'font-lock-function-name-fac
e t))
"keywords for tcl-mode")
(defun font-lock-set-defaults ()
"Set `font-lock-keywords' to something appropriate for this mode."
(setq font-lock-keywords
(cond ((eq major-mode 'lisp-mode) lisp-font-lock-keywords)
((eq major-mode 'emacs-lisp-mode) lisp-font-lock-keywords)
((eq major-mode 'c-mode) c-font-lock-keywords)
((eq major-mode 'c++-c-mode) c-font-lock-keywords)
((eq major-mode 'c++-mode) c++-font-lock-keywords)
((eq major-mode 'tex-mode) tex-font-lock-keywords)
((eq major-mode 'perl-mode) perl-font-lock-keywords)
((eq major-mode 'tcl-mode) tcl-font-lock-keywords)
((eq major-mode 'texinfo-mode) texi-font-lock-keywords)
(t nil))))
------------------------------