bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71419: 30.0.50; Completion does not always highlight the "common par


From: Dmitry Gutov
Subject: bug#71419: 30.0.50; Completion does not always highlight the "common part" corresponding to suffix
Date: Thu, 13 Jun 2024 02:57:43 +0300
User-agent: Mozilla Thunderbird

On 10/06/2024 00:06, Stefan Monnier wrote:
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index f62cb2566b2..144cda8cfdc 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3816,7 +3816,7 @@ completion-basic-all-completions
                              'point
                              (substring afterpoint 0 (cdr bounds)))))
           (all (completion-pcm--all-completions prefix pattern table pred)))
-    (completion-hilit-commonality all point (car bounds))))
+    (completion-pcm--hilit-commonality pattern all)))

  ;;; Partial-completion-mode style completion.

Thanks for tracking it down.  It matches my expectation.

Thanks, now fixed on master.

But it would have been nice to be able to use it in the "progressive
  improvement" kind of fashion: when the suffix and the other parts are
  highlighted correctly, we do the right thing; if the style missed the
  suffix highlighting, we do the other thing - and put the responsibility on
the third party.

🙂

It could work like in the attached. I agree that it's somewhat brittle, though.

If you're not in favor of installing this patch, what would be your preferred strategy for fixing bug#70968? We could try resurrecting the relevant part of Daniel's patch for completion-all-completions, but it means a fair amount of breakage. Or another dynamic variable similar to completion-lazy-hilit-fn...

FWIW my interest here is how to better implement the same step in company-mode, but the default UI is a good common ground.

Attachment: completions--count-common-spans.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]