# HG changeset patch # User Richard M. Stallman # Date 743404200 0 # Node ID e8cf7a7d0102d3dc2c4e024471418fcf70c4008c # Parent 6a22eb58608049cb22e61b6accf86efe6a160026 (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. diff -r 6a22eb586080 -r e8cf7a7d0102 lisp/font-lock.el --- a/lisp/font-lock.el Fri Jul 23 04:44:06 1993 +0000 +++ b/lisp/font-lock.el Fri Jul 23 05:10:00 1993 +0000 @@ -245,11 +245,13 @@ (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 @@ "^\\(" 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 @@ '("#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.")