GNU bug report logs -
#39600
[PATCH] Fix handling of non-exclusive non-prefix completion functions
Previous Next
Full log
View this message in rfc822 format
Amai Kinono <amaikinono <at> gmail.com> writes:
> Currently, with non-exclusive completion functions, Emacs will do
> `try-completion` on the current text, and decide whether to try next
> completion function based on that. This makes completion functions that
> can do non-prefix completions fails when the current text only occurs in
> the middle of the candidates. This is a problem I found in a FIXME in
> the code.
>
> # How does this work?
>
> I use `completion-all-completions` instead. As far as I know, this
> respects the `completion-styles`.
[...]
Stefan, how does this patch look to you?
> - ;; FIXME: Here we'd need to decide whether there are
> - ;; valid completions against the current text. But this depends
> - ;; on the actual completion UI (e.g. with the default completion
> - ;; it depends on completion-style) ;-(
> - ;; We approximate this result by checking whether prefix
> - ;; completion might work, which means that non-prefix completion
> - ;; will not work (or not right) for completion functions that
> - ;; are non-exclusive.
> - (null (try-completion (buffer-substring-no-properties
> - (car res) (point))
> - (nth 2 res)
> - (plist-get (nthcdr 3 res) :predicate)))
> + (null (completion-all-completions
> + (buffer-substring-no-properties (car res) (point))
> + (nth 2 res)
> + (plist-get (nthcdr 3 res) :predicate)
> + (- (point) (car res))))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 306 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.