GNU bug report logs - #77005
31.0.50; Add note about font-lock-keywords-case-fold-search usage

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Fri, 14 Mar 2025 05:43:02 UTC

Severity: wishlist

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77005 <at> debbugs.gnu.org
Subject: bug#77005: 31.0.50; Add note about font-lock-keywords-case-fold-search usage
Date: Fri, 14 Mar 2025 13:20:06 -0600
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

#+begin_quote
How did you see that, and where?
#+end_quote

Mostly in third-party major-mode.  But also in built-in ones, for
example css-mode that have font-lock-keywords-case-fold-search set to 't.

I haven't seen any minor mode that uses this variable.  I guess the
reason is to avoid conflicts with the major mode.

#+begin_quote
We need to understand the issue better to reply to this question.  So
please provide more details.
#+end_quote

My idea is to add a kind of note to
font-lock-keywords-case-fold-search documentation in lispref tex file
to avoid any confusion that this can be used in minor modes.

Something like this:
#+begin_src diff
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 768d78229aa..02e7a6f553f 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -3573,6 +3573,9 @@ Search-based Fontification
 @defvar font-lock-keywords-case-fold-search
 Non-@code{nil} means that regular expression matching for the sake of
 @code{font-lock-keywords} should be case-insensitive.
+
+@strong{Warning:} This variable is intended to be used by major modes
+and it's not recommended change it by minor modes
 @end defvar
 
 @node Customizing Keywords
#+end_src

[Message part 2 (text/html, inline)]
[Message part 3 (text/plain, inline)]

-- 
                                          - E.G via GNU Emacs and Org.

This bug report was last modified 66 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.