diff options
| author | Lars Ingebrigtsen | 2019-10-31 14:06:08 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-31 14:06:08 +0100 |
| commit | 111a95fe6d209aff6e7f26cb6777fbdf02aae15d (patch) | |
| tree | 8af9f525e40b3e537ce6978c90e99b3e7ee94e1b | |
| parent | 60ad3d63cf6100f30801eb9c0256a84907da1dca (diff) | |
| download | emacs-111a95fe6d209aff6e7f26cb6777fbdf02aae15d.tar.gz emacs-111a95fe6d209aff6e7f26cb6777fbdf02aae15d.zip | |
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).
| -rw-r--r-- | lisp/font-lock.el | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 4eb7bb8c2d4..875f5b0592d 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1902,18 +1902,13 @@ Sets various variables using `font-lock-defaults' and | |||
| 1902 | (removed-keywords | 1902 | (removed-keywords |
| 1903 | (cdr-safe (assq major-mode font-lock-removed-keywords-alist)))) | 1903 | (cdr-safe (assq major-mode font-lock-removed-keywords-alist)))) |
| 1904 | ;; Syntactic fontification? | 1904 | ;; Syntactic fontification? |
| 1905 | (if (nth 1 defaults) | 1905 | (setq-local font-lock-keywords-only (nth 1 defaults)) |
| 1906 | (set (make-local-variable 'font-lock-keywords-only) t) | ||
| 1907 | (kill-local-variable 'font-lock-keywords-only)) | ||
| 1908 | ;; Case fold during regexp fontification? | 1906 | ;; Case fold during regexp fontification? |
| 1909 | (if (nth 2 defaults) | 1907 | (setq-local font-lock-keywords-case-fold-search (nth 2 defaults)) |
| 1910 | (set (make-local-variable 'font-lock-keywords-case-fold-search) t) | ||
| 1911 | (kill-local-variable 'font-lock-keywords-case-fold-search)) | ||
| 1912 | ;; Syntax table for regexp and syntactic fontification? | 1908 | ;; Syntax table for regexp and syntactic fontification? |
| 1913 | (if (null (nth 3 defaults)) | 1909 | (if (null (nth 3 defaults)) |
| 1914 | (kill-local-variable 'font-lock-syntax-table) | 1910 | (setq-local font-lock-syntax-table nil) |
| 1915 | (set (make-local-variable 'font-lock-syntax-table) | 1911 | (setq-local font-lock-syntax-table (copy-syntax-table (syntax-table))) |
| 1916 | (copy-syntax-table (syntax-table))) | ||
| 1917 | (dolist (selem (nth 3 defaults)) | 1912 | (dolist (selem (nth 3 defaults)) |
| 1918 | ;; The character to modify may be a single CHAR or a STRING. | 1913 | ;; The character to modify may be a single CHAR or a STRING. |
| 1919 | (let ((syntax (cdr selem))) | 1914 | (let ((syntax (cdr selem))) |