From 2caf3e997e2a4013ffad10a047f24c98d02ab1d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 May 2020 17:25:45 +0300 Subject: [PATCH] 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) --- lisp/hi-lock.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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))) -- 2.39.2