+ '(0 mdw-punct-face)))))
+
+;;;--------------------------------------------------------------------------
+;;; Dylan programming configuration.
+
+(defun mdw-fontify-dylan ()
+
+ (make-local-variable 'font-lock-keywords)
+
+ ;; Horrors. `dylan-mode' sets the `major-mode' name after calling this
+ ;; hook, which undoes all of our configuration.
+ (setq major-mode 'dylan-mode)
+ (font-lock-set-defaults)
+
+ (let* ((word "[-_a-zA-Z!*@<>$%]+")
+ (dylan-keywords (mdw-regexps
+
+ "C-address" "C-callable-wrapper" "C-function"
+ "C-mapped-subtype" "C-pointer-type" "C-struct"
+ "C-subtype" "C-union" "C-variable"
+
+ "above" "abstract" "afterwards" "all"
+ "begin" "below" "block" "by"
+ "case" "class" "cleanup" "constant" "create"
+ "define" "domain"
+ "else" "elseif" "end" "exception" "export"
+ "finally" "for" "from" "function"
+ "generic"
+ "handler"
+ "if" "in" "instance" "interface" "iterate"
+ "keyed-by"
+ "let" "library" "local"
+ "macro" "method" "module"
+ "otherwise"
+ "profiling"
+ "select" "slot" "subclass"
+ "table" "then" "to"
+ "unless" "until" "use"
+ "variable" "virtual"
+ "when" "while"))
+ (sharp-keywords (mdw-regexps
+ "all-keys" "key" "next" "rest" "include"
+ "t" "f")))
+ (setq font-lock-keywords
+ (list (list (concat "\\<\\(" dylan-keywords
+ "\\|" "with\\(out\\)?-" word
+ "\\)\\>")
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<" word ":" "\\|"
+ "#\\(" sharp-keywords "\\)\\>")
+ '(0 font-lock-variable-name-face))
+ (list (concat "\\("
+ "\\([-+]\\|\\<\\)[0-9]+" "\\("
+ "\\(\\.[0-9]+\\)?" "\\([eE][-+][0-9]+\\)?"
+ "\\|" "/[0-9]+"
+ "\\)"
+ "\\|" "\\.[0-9]+" "\\([eE][-+][0-9]+\\)?"
+ "\\|" "#b[01]+"
+ "\\|" "#o[0-7]+"
+ "\\|" "#x[0-9a-zA-Z]+"
+ "\\)\\>")
+ '(0 mdw-number-face))
+ (list (concat "\\("
+ "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\|"
+ "\\_<[-+*/=<>:&|]+\\_>"
+ "\\)")
+ '(0 mdw-punct-face))))))
+
+;;;--------------------------------------------------------------------------
+;;; Algol 68 configuration.
+
+(setq a68-indent-step 2)
+
+(defun mdw-fontify-algol-68 ()
+
+ ;; Fix up the syntax table.
+ (modify-syntax-entry ?# "!" a68-mode-syntax-table)
+ (dolist (ch '(?- ?+ ?= ?< ?> ?* ?/ ?| ?&))
+ (modify-syntax-entry ch "." a68-mode-syntax-table))
+
+ (make-local-variable 'font-lock-keywords)
+
+ (let ((not-comment
+ (let ((word "COMMENT"))
+ (do ((regexp (concat "[^" (substring word 0 1) "]+")
+ (concat regexp "\\|"
+ (substring word 0 i)
+ "[^" (substring word i (1+ i)) "]"))
+ (i 1 (1+ i)))
+ ((>= i (length word)) regexp)))))
+ (setq font-lock-keywords
+ (list (list (concat "\\<COMMENT\\>"
+ "\\(" not-comment "\\)\\{0,5\\}"
+ "\\(\\'\\|\\<COMMENT\\>\\)")
+ '(0 font-lock-comment-face))
+ (list (concat "\\<CO\\>"
+ "\\([^C]+\\|C[^O]\\)\\{0,5\\}"
+ "\\($\\|\\<CO\\>\\)")
+ '(0 font-lock-comment-face))
+ (list "\\<[A-Z_]+\\>"
+ '(0 font-lock-keyword-face))
+ (list (concat "\\<"
+ "[0-9]+"
+ "\\(\\.[0-9]+\\)?"
+ "\\([eE][-+]?[0-9]+\\)?"
+ "\\>")
+ '(0 mdw-number-face))
+ (list "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/"
+ '(0 mdw-punct-face))))))