GNU bug report logs -
#48356
28.0.50; choose-completion discards the suffix after the completion boundary
Previous Next
Full log
View this message in rfc822 format
> ...which translates to "/" because of the double slash -- the filesystem
> root directory (*). But that's the same data which would be used by any
> other proposed solution, too.
More or less, tho the "ideal" solution is to do that in the
completion-style code, which has a bit more knowledge about it.
> So maybe it should be either be fixed in the
> completion table (avoid adding trailing slash when the last boundary is
> already followed by slash?), or the insertion code should do some
> additional post-processing of the completion string.
I think you can fix it in the same ad-hoc way we use elsewhere: compare
the first char after the boundary with the last char of the completion
and drop one of the two if they're the same.
> + (base-suffix (let ((suffix (buffer-substring (point) end)))
> + (substring
> + suffix
> + (cdr (completion-boundaries string
> + minibuffer-completion-table
> + minibuffer-completion-predicate
> + suffix)))))
I think you want to be careful to pass (buffer-substring start (point))
rather than `string` to `completion-boundaries`.
In theory this approach can "do the wrong thing" with some completion
styles, but AFAIK they haven't been written yet. 🙂
Stefan
This bug report was last modified 129 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.