changeset 7915:970912d4f413

Don't alter the underline face. (font-lock-hack-keywords, font-lock-fontify-region): Don't call set-buffer-modified-p if no change in its value. (font-lock-hack-keywords): Avoid changing the narrowing. (c-font-lock-keywords-2): Insist on whitespace before a label.
author Richard M. Stallman <rms@gnu.org>
date Wed, 15 Jun 1994 18:24:10 +0000
parents f6ff66f6a358
children 50e9e0c8806a
files lisp/font-lock.el
diffstat 1 files changed, 15 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-lock.el	Wed Jun 15 18:19:56 1994 +0000
+++ b/lisp/font-lock.el	Wed Jun 15 18:24:10 1994 +0000
@@ -57,10 +57,6 @@
 (or window-system
     (error "Can't fontify on an ASCII terminal"))
 
-(or (internal-find-face 'underline)
-    (copy-face 'default 'underline))
-(set-face-underline-p 'underline t)
-
 (defvar font-lock-comment-face
   'italic
   "Face to use for comments.")
@@ -215,7 +211,9 @@
 	(setq prev nil))
       (and prev
 	   (remove-text-properties prev end '(face nil)))
-      (set-buffer-modified-p modified))))
+      (and (buffer-modified-p)
+	   (not modified)
+	   (set-buffer-modified-p nil)))))
 
 ;; This code used to be used to show a string on reaching the end of it.
 ;; It is probably not needed due to later changes to handle strings
@@ -314,20 +312,21 @@
 	    (if (not (memq allow-overlap-p '(t nil)))
 		(save-excursion
 		  (goto-char s)
-		  (save-restriction
-		    (narrow-to-region s e)
-		    (while (not (eobp))
-		      (let ((next (next-single-property-change (point) 'face)))
-			(if (or (null next) (> next (point-max)))
-			    (setq next (point-max)))
-			(if (not (get-text-property (point) 'face))
-			    (put-text-property (point) next 'face face))
-			(goto-char next)))))
+		  (while (< (point) e)
+		    (let ((next (next-single-property-change (point) 'face
+							     nil e)))
+		      (if (or (null next) (> next e))
+			  (setq next e))
+		      (if (not (get-text-property (point) 'face))
+			  (put-text-property (point) next 'face face))
+		      (goto-char next))))
 	      (put-text-property s e 'face face))))
       (if loudly (message "Fontifying %s... (regexps...%s)"
 			  (buffer-name)
 			  (make-string (setq count (1+ count)) ?.))))
-    (set-buffer-modified-p modified)))
+    (and (buffer-modified-p)
+	 (not modified)
+	 (set-buffer-modified-p nil))))
 
 ;; The user level functions
 
@@ -585,7 +584,7 @@
     ;;
     ;; fontify case targets and goto-tags.  This is slow because the
     ;; expression is anchored on the right.
-    "\\(\\(\\sw\\|\\s_\\)+\\):"
+    '("[ \t\n]\\(\\(\\sw\\|\\s_\\)+\\):" . 1)
     ;;
     ;; Fontify variables declared with structures, or typedef names.
     '("}[ \t*]*\\(\\(\\sw\\|\\s_\\)+\\)[ \t]*[,;]"