aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-15 18:24:10 +0000
committerRichard M. Stallman1994-06-15 18:24:10 +0000
commit65df085181285cfaa6138bf535894bb7aa087f05 (patch)
tree7cb9cc57e10338275947f477bc0d8a60e31fb711
parentb08c9c8bc78ff17589724305874b6ecb5c578d06 (diff)
downloademacs-65df085181285cfaa6138bf535894bb7aa087f05.tar.gz
emacs-65df085181285cfaa6138bf535894bb7aa087f05.zip
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.
-rw-r--r--lisp/font-lock.el31
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 69a94225f3b..d7ef4013fcf 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -57,10 +57,6 @@
57(or window-system 57(or window-system
58 (error "Can't fontify on an ASCII terminal")) 58 (error "Can't fontify on an ASCII terminal"))
59 59
60(or (internal-find-face 'underline)
61 (copy-face 'default 'underline))
62(set-face-underline-p 'underline t)
63
64(defvar font-lock-comment-face 60(defvar font-lock-comment-face
65 'italic 61 'italic
66 "Face to use for comments.") 62 "Face to use for comments.")
@@ -215,7 +211,9 @@ slow things down!")
215 (setq prev nil)) 211 (setq prev nil))
216 (and prev 212 (and prev
217 (remove-text-properties prev end '(face nil))) 213 (remove-text-properties prev end '(face nil)))
218 (set-buffer-modified-p modified)))) 214 (and (buffer-modified-p)
215 (not modified)
216 (set-buffer-modified-p nil)))))
219 217
220;; This code used to be used to show a string on reaching the end of it. 218;; This code used to be used to show a string on reaching the end of it.
221;; It is probably not needed due to later changes to handle strings 219;; It is probably not needed due to later changes to handle strings
@@ -314,20 +312,21 @@ slow things down!")
314 (if (not (memq allow-overlap-p '(t nil))) 312 (if (not (memq allow-overlap-p '(t nil)))
315 (save-excursion 313 (save-excursion
316 (goto-char s) 314 (goto-char s)
317 (save-restriction 315 (while (< (point) e)
318 (narrow-to-region s e) 316 (let ((next (next-single-property-change (point) 'face
319 (while (not (eobp)) 317 nil e)))
320 (let ((next (next-single-property-change (point) 'face))) 318 (if (or (null next) (> next e))
321 (if (or (null next) (> next (point-max))) 319 (setq next e))
322 (setq next (point-max))) 320 (if (not (get-text-property (point) 'face))
323 (if (not (get-text-property (point) 'face)) 321 (put-text-property (point) next 'face face))
324 (put-text-property (point) next 'face face)) 322 (goto-char next))))
325 (goto-char next)))))
326 (put-text-property s e 'face face)))) 323 (put-text-property s e 'face face))))
327 (if loudly (message "Fontifying %s... (regexps...%s)" 324 (if loudly (message "Fontifying %s... (regexps...%s)"
328 (buffer-name) 325 (buffer-name)
329 (make-string (setq count (1+ count)) ?.)))) 326 (make-string (setq count (1+ count)) ?.))))
330 (set-buffer-modified-p modified))) 327 (and (buffer-modified-p)
328 (not modified)
329 (set-buffer-modified-p nil))))
331 330
332;; The user level functions 331;; The user level functions
333 332
@@ -585,7 +584,7 @@ This does a lot more highlighting.")
585 ;; 584 ;;
586 ;; fontify case targets and goto-tags. This is slow because the 585 ;; fontify case targets and goto-tags. This is slow because the
587 ;; expression is anchored on the right. 586 ;; expression is anchored on the right.
588 "\\(\\(\\sw\\|\\s_\\)+\\):" 587 '("[ \t\n]\\(\\(\\sw\\|\\s_\\)+\\):" . 1)
589 ;; 588 ;;
590 ;; Fontify variables declared with structures, or typedef names. 589 ;; Fontify variables declared with structures, or typedef names.
591 '("}[ \t*]*\\(\\(\\sw\\|\\s_\\)+\\)[ \t]*[,;]" 590 '("}[ \t*]*\\(\\(\\sw\\|\\s_\\)+\\)[ \t]*[,;]"