From 6b7f34912cd54750971e410dd596fb8b4df7953c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 10 Oct 2004 01:54:12 +0000 Subject: [PATCH] (font-lock-apply-highlight): Explicitly check the case where the face expression evals to nil. --- lisp/font-lock.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 052e92391af..56a4005a41c 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1324,6 +1324,12 @@ HIGHLIGHT should be of the form MATCH-HIGHLIGHT, see `font-lock-keywords'." (add-text-properties start end (cddr val)) (setq val (cadr val))) (cond + ((not val) + ;; If `val' is nil, don't do anything. It is important to do it + ;; explicitly, because when adding nil via things like + ;; font-lock-append-text-property, the property is actually + ;; changed from to () which is undesirable. --Stef + nil) ((not override) ;; Cannot override existing fontification. (or (text-property-not-all start end 'face nil) -- 2.39.5