]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve 'basic' completion candidates highlighting (Bug#71419)
authorEshel Yaron <me@eshelyaron.com>
Sat, 8 Jun 2024 06:50:19 +0000 (08:50 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 8 Jun 2024 06:50:19 +0000 (08:50 +0200)
lisp/minibuffer.el

index 9c3a46371330d5bc69048048fa5e70324c091eec..83bd84861fb7526a14f1a3219f3d04bb089961d3 100644 (file)
@@ -4532,14 +4532,13 @@ Return the new suffix."
   (let* ((beforepoint (substring string 0 point))
          (afterpoint (substring string point))
          (bounds (completion-boundaries beforepoint table pred afterpoint))
-         ;; (suffix (substring afterpoint (cdr bounds)))
          (prefix (substring beforepoint 0 (car bounds)))
-         (pattern (delete
-                   "" (list (substring beforepoint (car bounds))
-                            'point
-                            (substring afterpoint 0 (cdr bounds)))))
+         (pattern
+          (delete "" (completion-basic--pattern beforepoint afterpoint bounds)))
          (all (completion-pcm--all-completions prefix pattern table pred)))
-    (completion-hilit-commonality all point (car bounds))))
+    (when all
+      (nconc (completion-pcm--hilit-commonality pattern all)
+             (car bounds)))))
 
 ;;; Partial-completion-mode style completion.