Subject: bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer

From: Juri Linkov <[email-masked]>
Date: Mon, 10 Apr 2023 21:20:27 +0300

>> It just needs more testing for different categories of completion.
>
> Which categories do you have in mind?

Actually, I can't find categories where it could fail.
So your patch looks safe to push.

>> Maybe you could find another heuristic for insertion of completion? 
>> The code is located in the same function 'minibuffer-completion-help': 
>>
>>   (if (and (stringp start) (stringp end)) 
>>       (progn 
>>         (delete-minibuffer-contents) 
>>         (insert start choice) 
>>         ;; Keep point after completion before suffix 
>>         (save-excursion (insert end))) 
>>
>> Currently it keeps point before the suffix. 
>
> I will try. Although this is a case where completion-base-position feels
> more suited than completion-base-affixes...

Can you get the same info about positions by calculating the
lengths of prefix/choice/suffix?