ericprud / shexc-mode-for-emacs

MIT License
2 stars 2 forks source link

case-insensitive keywords #3

Open VladimirAlexiev opened 5 years ago

VladimirAlexiev commented 5 years ago

https://github.com/ericprud/shexc-mode-for-emacs/blob/master/shexc-mode.el#L73 can be simplified to

(regexp-opt '("base" "prefix" ...) 'words)

The syntax of this variable is defined in:

(describe-variable 'font-lock-keywords)
(info "(elisp)Search-based fontification")

Then to have case-insensitivity, do this:

  (setq font-lock-defaults '(shexc-highlights nil t))

The last t means CASE-FOLD, see

(describe-variable 'font-lock-defaults)
ericprud commented 5 years ago

[Ww][Hh][Yy], [Ii][Ss] [Mm][Yy] [Cc][Uu][Rr][Rr][Ee][Nn][Tt] [Aa][Pp][Pp][Rr][Oo][Aa][Cc][Hh] [Hh][Aa][Rr][Dd] [Tt][Oo] [Rr][Ee][Aa][Dd]?

VladimirAlexiev commented 5 years ago

[aA][nN][Dd] [Ww][rR][iI][Tt][eE]