emacs-diffs
[Top][All Lists]
Advanced

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

master 111a95f: Ensure that font-local variables are buffer-local


From: Lars Ingebrigtsen
Subject: master 111a95f: Ensure that font-local variables are buffer-local
Date: Thu, 31 Oct 2019 09:06:18 -0400 (EDT)

branch: master
commit 111a95fe6d209aff6e7f26cb6777fbdf02aae15d
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Ensure that font-local variables are buffer-local
    
    * lisp/font-lock.el (font-lock-set-defaults): Ensure that the font
    lock variables are buffer-local even when nil, so that they're
    copied correctly by mhtml mode when changing sub-modes (bug#33937).
---
 lisp/font-lock.el | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 4eb7bb8..875f5b0 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1902,18 +1902,13 @@ Sets various variables using `font-lock-defaults' and
           (removed-keywords
            (cdr-safe (assq major-mode font-lock-removed-keywords-alist))))
       ;; Syntactic fontification?
-      (if (nth 1 defaults)
-          (set (make-local-variable 'font-lock-keywords-only) t)
-        (kill-local-variable 'font-lock-keywords-only))
+      (setq-local font-lock-keywords-only (nth 1 defaults))
       ;; Case fold during regexp fontification?
-      (if (nth 2 defaults)
-          (set (make-local-variable 'font-lock-keywords-case-fold-search) t)
-        (kill-local-variable 'font-lock-keywords-case-fold-search))
+      (setq-local font-lock-keywords-case-fold-search (nth 2 defaults))
       ;; Syntax table for regexp and syntactic fontification?
       (if (null (nth 3 defaults))
-          (kill-local-variable 'font-lock-syntax-table)
-       (set (make-local-variable 'font-lock-syntax-table)
-            (copy-syntax-table (syntax-table)))
+          (setq-local font-lock-syntax-table nil)
+       (setq-local font-lock-syntax-table (copy-syntax-table (syntax-table)))
        (dolist (selem (nth 3 defaults))
          ;; The character to modify may be a single CHAR or a STRING.
          (let ((syntax (cdr selem)))



reply via email to

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