]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix Icomplete error during candidate highlighting
authorEshel Yaron <me@eshelyaron.com>
Fri, 14 Jun 2024 17:49:21 +0000 (19:49 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Jun 2024 17:21:15 +0000 (19:21 +0200)
* 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

index 9e793f77d3dcff67ab5dabf91b2c0b12d160e7d5..4506aa9e35e96d7256cb074690b7333819c5dbec 100644 (file)
@@ -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))))