GNU bug report logs -
#74408
30.0.92; FR: Add a function completion-list-candidate-at-point
Previous Next
Reported by: Daniel Mendler <mail <at> daniel-mendler.de>
Date: Sun, 17 Nov 2024 21:11:02 UTC
Severity: wishlist
Found in version 30.0.92
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 74408 <at> debbugs.gnu.org (full text, mbox):
> Thanks. Patch attached.
Thanks, Daniel. Minor comments below.
> @@ -2628,8 +2628,10 @@ minibuffer-completion-help
> (when-let* ((buffer (get-buffer "*Completions*"))
> (window (get-buffer-window buffer 0)))
> (with-current-buffer buffer
> - (when-let* ((beg (completions--start-of-candidate-at (window-point window))))
> - (cons (get-text-property beg 'completion--string) (- (point) beg))))))
> + (when-let* ((cand (save-excursion
> + (goto-char (window-point window))
> + (completion-list-candidate-at-point))))
> + (cons (car cand) (- (point) (cadr cand)))))))
> ;; If the *Completions* buffer is shown in a new
> ;; window, mark it as softly-dedicated, so bury-buffer in
> ;; minibuffer-hide-completions will know whether to
AFAICT, it's easy to make `completion-list-candidate-at-point` accept an
optional position argument (which would default to point), which would
be helpful in the two places where we use that function.
WDYT?
> +(defun completion-list-candidate-at-point ()
> + "Return candidate string at point and bounds in completions buffer."
I suggest you use something like "(STRING BEG END)" to describe the format.
Stefan
This bug report was last modified 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.