Subject: Re: bug#68514: 30.0.50; minibuffer-choose-completion + elisp-c-a-p delete next sexp when completing after open paren

From: Spencer Baugh <[email-masked]>
Date: Wed, 17 Jan 2024 12:22:48 -0500

Juri Linkov <[email-masked]> writes:
>>> This is a known bug without a known fix:
>>> https://debbugs.gnu.org/64903#18
>>
>> Alright, how about this patch?  Should fix most of the issue without
>> changing the code too much.
>>
>> diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
>> @@ -668,6 +668,9 @@ elisp-completion-at-point
>>  		    (goto-char beg)
>>  		    (forward-sexp 1)
>>                      (skip-chars-backward "'’")
>> +                    (when (member (char-syntax (char-before (point)))
>> +                                  '(?\" ?\)))
>> +                      (goto-char beg))
>>  		    (when (>= (point) pos)
>>  		      (point)))
>
> Thanks.  I tried this patch, but it doesn't seem to have any effect.

How did you test?

If I insert:

( (foo)

and move point to:

(| (foo)

then hit M-TAB and select a completion, for me, after my patch, (foo) is
not deleted, whereas before it would be.