]> git.eshelyaron.com Git - emacs.git/commitdiff
(font-lock-after-change-function): Fix typo in prev chg.
authorRichard M. Stallman <rms@gnu.org>
Wed, 18 May 1994 23:38:24 +0000 (23:38 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 18 May 1994 23:38:24 +0000 (23:38 +0000)
(font-lock-mode): Use after-change-functions not after-change-function.

lisp/font-lock.el

index 4c0d4c0c37985043a7ea459bd195957ba4abb959..da7373db79f005159493ae6bbcbe43ef2a99f95a 100644 (file)
@@ -265,7 +265,7 @@ slow things down!")
       ;; Must scan from line start in case of
       ;; inserting space into `intfoo () {}'.
       (if font-lock-no-comments
-         (remove-text-properties beg (1+ end) '(face nil))
+         (remove-text-properties beg (min (1+ end) (point-max)) '(face nil))
        (font-lock-fontify-region beg (min (1+ end) (point-max))))
       ;; Now scan for keywords.
       (font-lock-hack-keywords beg end))))
@@ -365,11 +365,14 @@ can use \\[font-lock-fontify-buffer]."
                (> (prefix-numeric-value arg) 0))))
     (if (equal (buffer-name) " *Compiler Input*") ; hack for bytecomp...
        (setq on-p nil))
-    (or (memq after-change-function
-             '(nil font-lock-after-change-function))
-       (error "after-change-function is %s" after-change-function))
-    (set (make-local-variable 'after-change-function)
-        (if on-p 'font-lock-after-change-function nil))
+    (make-local-variable 'after-change-functions)
+    (if on-p
+       (or (memq 'font-lock-after-change-function after-change-functions)
+           (setq after-change-functions (cons 'font-lock-after-change-function
+                                              after-change-functions)))
+      (setq after-change-functions
+           (delq 'font-lock-after-change-function
+                 (copy-sequence after-change-functions))))
     (set (make-local-variable 'font-lock-mode) on-p)
     (make-local-variable 'font-lock-no-comments)
     (cond (on-p