changeset 4239:e8cf7a7d0102

(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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 23 Jul 1993 05:10:00 +0000
parents 6a22eb586080
children 7a33be8c3192
files lisp/font-lock.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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.")