]> git.eshelyaron.com Git - emacs.git/commitdiff
(font-lock-after-change-function):
authorRichard M. Stallman <rms@gnu.org>
Fri, 23 Jul 1993 05:10:00 +0000 (05:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 23 Jul 1993 05:10:00 +0000 (05:10 +0000)
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

index e2c404ce6c1eaa441f64a0dfd7cce0539cef4e01..c2a3a4dfbd84d90d37ca6146fcbb1a0262568593 100644 (file)
@@ -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))))
 \f
@@ -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.")