emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/font-lock.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/font-lock.el,v
Date: Sun, 18 Feb 2007 20:36:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/02/18 20:36:06

Index: font-lock.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/font-lock.el,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -b -r1.312 -r1.313
--- font-lock.el        18 Feb 2007 18:52:18 -0000      1.312
+++ font-lock.el        18 Feb 2007 20:36:06 -0000      1.313
@@ -350,7 +350,7 @@
  (MATCHER . SUBEXP)
  (MATCHER . FACENAME)
  (MATCHER . HIGHLIGHT)
- (MATCHER . HIGHLIGHTS)
+ (MATCHER HIGHLIGHT ...)
  (eval . FORM)
 
 where MATCHER can be either the regexp to search for, or the function name to
@@ -1040,13 +1040,6 @@
 Useful for things like RMAIL and Info where the whole buffer is not
 a very meaningful entity to highlight.")
 
-(defvar font-lock-syntax-props-depend-on-themselves nil
-  "If non-nil, syntax-table changes may influence syntactic keywords.
-If the syntax-table properties set by syntactic-keywords themselves depend
-on syntax-table properties set on the text before it by syntactic-keywords,
-this variable should be set to non-nil, so that whenever syntaxtic-keywords
-is applied, the subsequent text is marked for syntactic re-fontification.")
-
 
 (defvar font-lock-beg) (defvar font-lock-end)
 (defvar font-lock-extend-region-functions
@@ -1131,22 +1124,8 @@
             (setq beg font-lock-beg end font-lock-end))
          ;; Now do the fontification.
          (font-lock-unfontify-region beg end)
-          (let ((sbeg beg))
-            (cond
-             ((< font-lock-syntactically-fontified sbeg)
-              ;; Ensure the syntax-table prop is properly set on the text
-              ;; before beg.
-              (setq sbeg (max font-lock-syntactically-fontified (point-min)))
-              (setq font-lock-syntactically-fontified end))
-             ((and font-lock-syntax-props-depend-on-themselves
-                   (> font-lock-syntactically-fontified end))
-              ;; If the syntax-table properties set by
-              ;; font-lock-syntactic-keywords themselves depend on
-              ;; syntax-table props set in the text above it, then we'll
-              ;; need to update all the syntax-table props below end.
-              (setq font-lock-syntactically-fontified end)))
             (when font-lock-syntactic-keywords
-              (font-lock-fontify-syntactic-keywords-region sbeg end)))
+           (font-lock-fontify-syntactic-keywords-region beg end))
           (unless font-lock-keywords-only
             (font-lock-fontify-syntactically-region beg end loudly))
           (font-lock-fontify-keywords-region beg end loudly))
@@ -1439,6 +1418,11 @@
 (defun font-lock-fontify-syntactic-keywords-region (start end)
   "Fontify according to `font-lock-syntactic-keywords' between START and END.
 START should be at the beginning of a line."
+  ;; Ensure the beginning of the file is properly syntactic-fontified.
+  (when (and font-lock-syntactically-fontified
+            (< font-lock-syntactically-fontified start))
+    (setq start (max font-lock-syntactically-fontified (point-min)))
+    (setq font-lock-syntactically-fontified end))
   ;; If `font-lock-syntactic-keywords' is a symbol, get the real keywords.
   (when (symbolp font-lock-syntactic-keywords)
     (setq font-lock-syntactic-keywords (font-lock-eval-keywords




reply via email to

[Prev in Thread] Current Thread [Next in Thread]