]> git.eshelyaron.com Git - emacs.git/commit
Implement case-insensitivity in hi-lock (bug#40337)
authorJuri Linkov <juri@linkov.net>
Sat, 11 Apr 2020 23:45:02 +0000 (02:45 +0300)
committerJuri Linkov <juri@linkov.net>
Sat, 11 Apr 2020 23:45:02 +0000 (02:45 +0300)
commit86b820752349de572bfbb306cc0d8f7cea41d0a7
tree31fd8df7c51e4ec37fba45a3273f7da78b666e49
parente7b4233d9bccf4f65c008682eef4f88d0f003d6d
Implement case-insensitivity in hi-lock (bug#40337)

* lisp/hi-lock.el (hi-lock-interactive-lighters): New buffer-local variable.
(hi-lock-mode): Set hi-lock-interactive-lighters to nil.
(hi-lock-line-face-buffer): Use case-fold-search and search-upper-case.
(hi-lock-face-buffer): Add new arg LIGHTER. Use case-fold-search,
search-upper-case and search-spaces-regexp.
(hi-lock-face-phrase-buffer): Don't call hi-lock-process-phrase.
Use case-fold-search, search-upper-case and search-whitespace-regexp.
(hi-lock-face-symbol-at-point): Use case-fold-search and search-upper-case.
(hi-lock-unface-buffer): Use hi-lock-interactive-lighters to get
a human-readable string for completion and x-popup-menu.
(hi-lock-process-phrase): Remove function.
(hi-lock-set-pattern): Add new args LIGHTER, CASE-FOLD, SPACES-REGEXP.
Set font-lock pattern to a search function.  Add mapping from
lighter or regexp to pattern to hi-lock-interactive-lighters.
Let-bind case-fold-search and search-spaces-regexp in search functions.

* lisp/isearch.el (isearch--highlight-regexp-or-lines): Replace ugly code
with let-binding of case-fold-search, search-upper-case, search-spaces-regexp.
(isearch-highlight-regexp, isearch-highlight-lines-matching-regexp):
Use lambda.
etc/NEWS
lisp/hi-lock.el
lisp/isearch.el