From debc43f7f0eb5ab507a773c2c1da0ce69b918ee9 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 14 Jun 2024 19:49:21 +0200 Subject: [PATCH] ; Fix Icomplete error during candidate highlighting * lisp/icomplete.el (icomplete-completions): Pass completion candidates through 'completion-lazy-hilit' before trimming common prefix, rather than after. https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00271.html (cherry picked from commit 3b07d33059150671d0af1cc7b51fa7c8cc4b4ea1) --- lisp/icomplete.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 9e793f77d3d..4506aa9e35e 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -1029,7 +1029,8 @@ matches exist." (setq determ (concat open-bracket "" close-bracket))) (while (and comps (not limit)) (setq comp - (if prefix-len (substring (car comps) prefix-len) (car comps)) + (let ((cur (completion-lazy-hilit (car comps)))) + (if prefix-len (substring cur prefix-len) cur)) comps (cdr comps)) (setq prospects-len (+ (string-width comp) @@ -1038,8 +1039,7 @@ matches exist." (if (< prospects-len prospects-max) (push comp prospects) (setq limit t))) - (setq prospects - (nreverse (mapcar #'completion-lazy-hilit prospects))) + (setq prospects (nreverse prospects)) ;; Decorate first of the prospects. (when prospects (let ((first (copy-sequence (pop prospects)))) -- 2.39.2