bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#33937: 26.1; mhtml-mode fails to capture font-lock-keywords-case-fol


From: Lars Ingebrigtsen
Subject: bug#33937: 26.1; mhtml-mode fails to capture font-lock-keywords-case-fold-search
Date: Wed, 30 Oct 2019 20:26:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Leo Liu <sdl.web@gmail.com> writes:

> In mhtml-mode moving into <script>...</script> doesn't set up
> font-lock-keywords-case-fold-search properly, which still has the value
> carried over from html-mode.
>
> The reason is font-lock doesn't make font-lock-keywords-case-fold-search
> buffer-local when its value is nil thus it is skipped by
> mhtml--construct-submode.

This is due to

commit 558ca3c1225f6035442733d5d3fb5fd4c40a0a45
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Tue Feb 12 16:49:21 2008 +0000

    (font-lock-set-defaults): Unset previously set variables when needed.

which does this with many of the font-lock variables:

       ;; Case fold during regexp fontification?
-      (when (nth 2 defaults)
-       (set (make-local-variable 'font-lock-keywords-case-fold-search) t))
+      (if (nth 2 defaults)
+          (set (make-local-variable 'font-lock-keywords-case-fold-search) t)
+        (kill-local-variable 'font-lock-keywords-case-fold-search))

It's slightly puzzling -- font-lock-keywords-case-fold-search is
permanently buffer-local, but I guess that puzzlement was there before
this patch, but the kill-local-variable thing is what makes mhtlm not
work.

Stefan, do you remember the reason for this change?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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