; I hacked a quick modification to pascal.el to do syntax highlighting ; and change the indentation level of colons when I had to do a quick ; fix on some Delphi code. I'm not a Delphi programmer, so I won't be ; taking this any further. Here it is, in case anyone is interested: ; below is the modified version I use (defun pascal-indent-level () "Return the indent-level the current statement has. Do not count labels, case-statements or records." (save-excursion (beginning-of-line) (if (looking-at "[ \t]*[0-9a-zA-Z]+[ \t]*:[^=]") ;rds (search-forward ":" nil t) (beginning-of-line) (if (looking-at ".*=[ \t]*record\\>") (search-forward "=" nil t))) (skip-chars-forward " \t") (current-column))) ;;; (setq pascal-keywords '("and" "array" "begin" "case" "const" "div" "do" "downto" "else" "end" "file" "for" "function" "goto" "if" "in" "label" "mod" "nil" "not" "of" "or" "packed" "procedure" "program" "record" "repeat" "set" "then" "to" "type" "until" "var" "while" "with" "try" "except" ;; The following are not standard in pascal, but widely used. "get" "put" "input" "output" "read" "readln" "reset" "rewrite" "write" "writeln")) (setq pascal-beg-block-re "\\<\\(begin\\|case\\|record\\|repeat\\|try\\)\\>") ;;;(defconst pascal-end-block-re "\\<\\(end\\|until\\)\\>") ;;;(defconst pascal-declaration-re "\\<\\(const\\|label\\|type\\|var\\)\\>") ;;;(defconst pascal-defun-re "\\<\\(function\\|procedure\\|program\\)\\>") ;;;(defconst pascal-sub-block-re "\\<\\(if\\|else\\|for\\|while\\|with\\)\\>") (setq pascal-noindent-re "\\<\\(begin\\|end\\|until\\|else\\|except\\)\\>") (setq pascal-nosemi-re "\\<\\(begin\\|repeat\\|then\\|do\\|else\\|try\\)\\>") (setq pascal-autoindent-lines-re "\\<\\(label\\|var\\|type\\|const\\|until\\|end\\|begin\\|repeat\\|e lse\\|try\\)\\>") (setq pascal-font-lock-keywords (list '("^[ \t]*\\(function\\|pro\\(cedure\\|gram\\)\\)\\>[ \t]*\\(\\sw+\\)?" (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t)) ; ("type" "const" "real" "integer" "char" "boolean" "var" ; "record" "array" "file") (cons (concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|" "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>") 'font-lock-type-face) '("\\<\\(label\\|external\\|forward\\)\\>" . font-lock-reference-face) '("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-reference-face) ; ("of" "to" "for" "if" "then" "else" "case" "while" ; "do" "until" "and" "or" "not" "in" "with" "repeat" "begin" "end" "try" "except") (concat "\\<\\(" "and\\|begin\\|case\\|do\\|e\\(lse\\|nd\\|xcept\\)\\|for\\|i[fn]\\ |" "not\\|o[fr]\\|repeat\\|t\\(hen\\|o\\|ry\\)\\|until\\|w\\(hile\\|i th\\)" "\\)\\>") '("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?" (1 font-lock-keyword-face) (2 font-lock-reference-face nil t))) ); "Additional expressions to highlight in Pascal mode.") ; Richard Schulte Idea Development Incorporated ; http://ideadev.com/Richard