Mercurial > emacs
comparison lisp/font-lock.el @ 57416:05afd8f1212e
(font-lock-apply-highlight): Explicitly check the case
where the face expression evals to nil.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 10 Oct 2004 01:54:12 +0000 |
parents | 7a0ad15724f6 |
children | 1b88b2a7544f |
comparison
equal
deleted
inserted
replaced
57415:fdd8f0d7c67d | 57416:05afd8f1212e |
---|---|
1322 (let ((val (eval (nth 1 highlight)))) | 1322 (let ((val (eval (nth 1 highlight)))) |
1323 (when (eq (car-safe val) 'face) | 1323 (when (eq (car-safe val) 'face) |
1324 (add-text-properties start end (cddr val)) | 1324 (add-text-properties start end (cddr val)) |
1325 (setq val (cadr val))) | 1325 (setq val (cadr val))) |
1326 (cond | 1326 (cond |
1327 ((not val) | |
1328 ;; If `val' is nil, don't do anything. It is important to do it | |
1329 ;; explicitly, because when adding nil via things like | |
1330 ;; font-lock-append-text-property, the property is actually | |
1331 ;; changed from <face> to (<face>) which is undesirable. --Stef | |
1332 nil) | |
1327 ((not override) | 1333 ((not override) |
1328 ;; Cannot override existing fontification. | 1334 ;; Cannot override existing fontification. |
1329 (or (text-property-not-all start end 'face nil) | 1335 (or (text-property-not-all start end 'face nil) |
1330 (put-text-property start end 'face val))) | 1336 (put-text-property start end 'face val))) |
1331 ((eq override t) | 1337 ((eq override t) |