From: Eli Zaretskii Date: Fri, 8 May 2020 14:25:45 +0000 (+0300) Subject: Improve documentation of Hi Lock mode X-Git-Tag: emacs-27.1-rc1~142 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2caf3e997e;p=emacs.git Improve documentation of Hi Lock mode * lisp/hi-lock.el (hi-lock-mode, hi-lock-face-buffer) (hi-lock-face-phrase-buffer, hi-lock-face-symbol-at-point): Clarify when 'hi-lock-mode' will use Font Lock and when it will use overlays. (Bug#41124) --- diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index de258935e18..0f685464cdd 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -318,7 +318,10 @@ or add (global-hi-lock-mode 1) to your init file. In buffers where Font Lock mode is enabled, patterns are highlighted using font lock. In buffers where Font Lock mode is disabled, patterns are applied using overlays; in this case, the -highlighting will not be updated as you type. +highlighting will not be updated as you type. The Font Lock mode +is considered \"enabled\" in a buffer if its `major-mode' +causes `font-lock-specified-p' to return non-nil, which means +the major mode specifies support for Font Lock. When Hi Lock mode is enabled, a \"Regexp Highlighting\" submenu is added to the \"Edit\" menu. The commands in the submenu, @@ -462,7 +465,10 @@ If SUBEXP is omitted or nil, the entire REGEXP is highlighted. Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, use overlays for highlighting. If overlays are used, the -highlighting will not update as you type." +highlighting will not update as you type. The Font Lock mode +is considered \"enabled\" in a buffer if its `major-mode' +causes `font-lock-specified-p' to return non-nil, which means +the major mode specifies support for Font Lock." (interactive (list (hi-lock-regexp-okay @@ -487,7 +493,10 @@ letters case-insensitive, before highlighting with `hi-lock-set-pattern'. Use Font lock mode, if enabled, to highlight REGEXP. Otherwise, use overlays for highlighting. If overlays are used, the -highlighting will not update as you type." +highlighting will not update as you type. The Font Lock mode +is considered \"enabled\" in a buffer if its `major-mode' +causes `font-lock-specified-p' to return non-nil, which means +the major mode specifies support for Font Lock." (interactive (list (hi-lock-regexp-okay @@ -508,7 +517,10 @@ unless you use a prefix argument. Uses `find-tag-default-as-symbol-regexp' to retrieve the symbol at point. This uses Font lock mode if it is enabled; otherwise it uses overlays, -in which case the highlighting will not update as you type." +in which case the highlighting will not update as you type. The Font +Lock mode is considered \"enabled\" in a buffer if its `major-mode' +causes `font-lock-specified-p' to return non-nil, which means +the major mode specifies support for Font Lock." (interactive) (let* ((regexp (hi-lock-regexp-okay (find-tag-default-as-symbol-regexp)))