1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix font locking of booleans in conf-toml-mode

* lisp/textmodes/conf-mode.el (conf-toml-mode): Do not use case
folding when font locking.
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
Expand test.
This commit is contained in:
Stefan Kangas 2023-08-01 12:18:12 +02:00
parent a3979a6643
commit 742104abd7
2 changed files with 21 additions and 2 deletions

View file

@ -245,6 +245,7 @@ This variable is best set in the file local variables, or through
("^\\s-*\\(.+?\\)\\(?:\\[\\(.*?\\)\\]\\)?\\s-*="
(1 'font-lock-variable-name-face)
(2 'font-lock-constant-face nil t))
;; Must be lower-case according to the TOML spec.
("\\_<false\\|true\\_>" 0 'font-lock-keyword-face))
"Keywords to highlight in Conf TOML mode.")
@ -643,7 +644,10 @@ For details see `conf-mode'. Example:
\[entry]
value = \"some string\""
(conf-mode-initialize "#" 'conf-toml-font-lock-keywords)
(conf-mode-initialize "#")
;; Booleans are "always lowercase", so we must *not* use case
;; folding. Therefore, we can't set it using `conf-mode-initialize´.
(setq-local font-lock-defaults `(,conf-toml-font-lock-keywords nil nil nil nil))
(setq-local conf-assignment-column 0)
(setq-local conf-assignment-sign ?=))