From: João Távora Date: Sat, 4 Nov 2023 23:55:55 +0000 (+0000) Subject: Tweak completion-lazy-hilit feature X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46bedebf7cdb123aa59a27f3b22a8fe9a28e0a94;p=emacs.git Tweak completion-lazy-hilit feature * lisp/minibuffer.el (completion-lazy-hilit): Make it a defvar and rework docstring. (completion-lazy-hilit-fn): Rework docstring. --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ee0a547fe9b..9fb1fa27b33 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3754,14 +3754,14 @@ one large \"hole\" and a clumped-together \"oo\" match) higher than the latter (which has two \"holes\" and three one-letter-long matches).") -(defvar-local completion-lazy-hilit nil +(defvar completion-lazy-hilit nil "If non-nil, request completion lazy highlighting. Completion-presenting frontends may opt to bind this variable to non-nil value in the context of completion-producing calls (such as `completion-all-completions'). This hints the intervening completion styles that they do not need to -fontify (i.e. propertize with the `face' property) completion +fontify (i.e. propertize with a `face' property) completion strings with highlights of the matching parts. When doing so, it is the frontend -- not the style -- who becomes @@ -3780,12 +3780,12 @@ To author a completion style that takes advantage see `completion-pcm--hilit-commonality'.") (defvar completion-lazy-hilit-fn nil - "Used by completions styles honoring `completion-lazy-hilit'. + "Function set by lazy-highlighting completions styles. When a given style wants to enable support for `completion-lazy-hilit' (which see), that style should set this variable to a function of one argument, a fresh string to be displayed to the user. The function is responsible for -destructively highlighting the string.") +destructively propertizing the string with a `face' property.") (defun completion-lazy-hilit (str) "Return a copy of completion STR that is `face'-propertized.