From 1ec9e15b441d1841a84bb0bb1001c029af771821 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 23 Jul 1993 05:10:00 +0000 Subject: [PATCH] (font-lock-after-change-function): Scan for comments and strings from beg of line. (c-font-lock-keywords-1): Recognize &, like *, before fn name. (perl-font-lock-keywords): Put digit 1 into function-name-face items. Allow whitespace before the open-brace. --- lisp/font-lock.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index e2c404ce6c1..c2a3a4dfbd8 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -245,11 +245,13 @@ slow things down!") (goto-char end) (end-of-line) (setq end (point)) - ;; First scan for strings and comments. - (font-lock-fontify-region beg (1+ end)) (goto-char beg) (beginning-of-line) (setq beg (point)) + ;; First scan for strings and comments. + ;; Must scan from line start in case of + ;; inserting space into `intfoo () {}'. + (font-lock-fontify-region beg (1+ end)) ;; Now scan for keywords. (font-lock-hack-keywords beg end)))) @@ -485,7 +487,7 @@ This does a lot more highlighting.") "^\\(" ctoken "[ \t]+\\)?" ; type specs; there can be no "\\(" ctoken "[ \t]+\\)?" ; more than 3 tokens, right? "\\(" ctoken "[ \t]+\\)?" - "\\(\\*+[ \t]*\\)?" ; pointer + "\\([*&]+[ \t]*\\)?" ; pointer "\\(" ctoken "\\)[ \t]*(") ; name 5 'font-lock-function-name-face) ;; @@ -559,8 +561,8 @@ This does a lot more highlighting.") '("#endif" "#else" "#ifdef" "#ifndef" "#if" "#include" "#define" "#undef") "\\|") - '("^[ \n\t]*sub[ \t]+\\([^ \t{]+\\)\\{" . font-lock-function-name-face) - '("[ \n\t{]*\\(eval\\)[ \n\t(;]" . font-lock-function-name-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-doc-string-face) ) "Additional expressions to highlight in Perl mode.") -- 2.39.5