# HG changeset patch # User Richard M. Stallman # Date 781524528 0 # Node ID 17dfca2d42e2290572a68dda08f7d621da43d8cd # Parent 297f0781c8aea12b971e3ce1186e149c2b021720 (perl-font-lock-keywords): New variable. (perl-mode): Set font-lock-keywords locally. diff -r 297f0781c8ae -r 17dfca2d42e2 lisp/progmodes/perl-mode.el --- a/lisp/progmodes/perl-mode.el Fri Oct 07 10:07:02 1994 +0000 +++ b/lisp/progmodes/perl-mode.el Fri Oct 07 10:08:48 1994 +0000 @@ -146,6 +146,25 @@ (modify-syntax-entry ?| "." perl-mode-syntax-table) ) +(defvar perl-font-lock-keywords + (list +; ("if" "until" "while" "elsif" "else" "unless" "for" "foreach" "continue" +; "exit" "die" "last" "goto" "next" "redo" "return" "local" "exec") + (concat "\\<\\(" + "continue\\|die\\|e\\(ls\\(e\\|if\\)\\|x\\(ec\\|it\\)\\)\\|" + "for\\(\\|each\\)\\|goto\\|if\\|l\\(ast\\|ocal\\)\\|next\\|" + "re\\(do\\|turn\\)\\|un\\(less\\|til\\)\\|while" + "\\)\\>") +; ("#endif" "#else" "#ifdef" "#ifndef" "#if" "#include" "#define" "#undef") + (cons (concat "#\\(define\\|e\\(lse\\|ndif\\)\\|" + "i\\(f\\(\\|def\\|ndef\\)\\|nclude\\)\\|undef\\)\\>") + 'font-lock-reference-face) + '("^[ \n\t]*sub[ \t]+\\([^ \t{]+\\)[ \t]*[{]" 1 font-lock-function-name-face) + '("[ \n\t{]*\\(eval\\)[ \n\t(;]" 1 font-lock-function-name-face) + '("\\(--- .* ---\\|=== .* ===\\)" . font-lock-string-face) + ) + "Additional expressions to highlight in Perl mode.") + (defvar perl-indent-level 4 "*Indentation of Perl statements with respect to containing block.") (defvar perl-continued-statement-offset 4 @@ -249,6 +268,8 @@ (setq comment-indent-function 'perl-comment-indent) (make-local-variable 'parse-sexp-ignore-comments) (setq parse-sexp-ignore-comments t) + (make-local-variable 'font-lock-keywords) + (setq font-lock-keywords perl-font-lock-keywords) (run-hooks 'perl-mode-hook)) ;; This is used by indent-for-comment