GNU bug report logs -
#74019
[PATCH] Optionally preserve selected candidate across *Completions* update
Previous Next
Reported by: Spencer Baugh <sbaugh <at> janestreet.com>
Date: Fri, 25 Oct 2024 21:34:01 UTC
Severity: wishlist
Tags: patch
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 74019 <at> debbugs.gnu.org (full text, mbox):
>> Hmm... are we sure here that the `*Completions*`s content is related to
>> the current completion session? I don't think we want to preserve the
>> selection when it came from an unrelated use of completion half an
>> hour earlier.
>
> That's why I'm doing get-buffer-window here - I figure that if
> *Completions* is currently displayed in a window, it's reasonable to
> preserve the selected candidate.
>
> (The selected candidate in that window, I guess - so maybe I should use
> window-point here?)
>
> It still might not be related to the current completion session, since
> the user might have just manually switched buffers to *Completions*, but
> I wasn't sure there was a good way to determine that... any suggestions?
Indeed, it might not be related. E.g in my setup, `*Completions*` is
placed in a dedicated window&frame that is simply iconified/deiconified
as needed, so your heuristic would fail.
I think we need to store in the *Completions* buffer some info about the
completion session for which it was last used. Or set some buffer-local
var that indicates that the corresponding completion session is "done"
(we can do that when we hide the *Completions* buffer, when we exit the
minibuffer or the `completion-in-region-mode`).
> This is kind of an unrelated improvement, since this is probably nicer
> anyway - if the user moves point around manually in *Completions*, IMO
> that should have the same behavior as minibuffer-next-completion, but
> currently it doesn't highlight the same way if they leave *Completions*
> because cursor-face-highlight-nonselected-window doesn't get set.
I see, thanks.
Stefan
This bug report was last modified 190 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.