Subject: Re: bug#64903: 28.2; completion-at-point deletes next line(s) when completing a single character in elisp

From: Juri Linkov <[email-masked]>
Date: Sun, 03 Sep 2023 20:20:58 +0300

unarchive 62700
reopen 62700
reopen 64903
thanks

>>> When completing a single character with completion-at-point (M-C-i) in elsip,
>>> after you select the desiered completion, it is inserted in the buffer
>>> but some of the following lines are deleted. This does not happen when
>>> the line has two characters.
>
> More information was requested, but none was given within 5 weeks, so
> I'm closing this bug.  If this is still an issue, please reply to this
> email (use "Reply to all" in your email client) and we can reopen the
> bug report.

Sorry, I was able to reproduce this error, but waited for more explanations
from the OP why this happened only with two characters, whereas in my tests
it fails with empty initial input.

I think the analysis from minad was correct in
https://github.com/minad/corfu/issues/350#issuecomment-1653880668
and the bug is in elisp-completion-at-point.

Indeed, when trying to eval M-: (elisp-completion-at-point) after ‘(a’ in

  (a
  ;; This buffer is for text that is not saved, and for Lisp evaluation.
  ;; To create a file, visit it with C-x C-f and enter text in its buffer.

it correctly returns (2 3 ...

But evaluating M-: (elisp-completion-at-point) after ‘(’ in

  (
  ;; This buffer is for text that is not saved, and for Lisp evaluation.
  ;; To create a file, visit it with C-x C-f and enter text in its buffer.

returns (2 148 ...
whereas I think it should return (2 2

PS: Also found a related problem in bug#62700.