Stefan Monnier <[email protected]> writes:
> I can't remember a specific change in this area, but that's doesn't
> really surprise me because the behavior of
> `LaTeX--arguments-completion-at-point` is rather odd/cornercase in this
> regard,
Can you please elaborate why or what is rather odd/cornercase?
> so if it worked the way you liked in the past you were just lucky.
This is a pity, the whole thing was built around the behavior of Emacs
in 2022 as I wrote the code. This is what happens if one does things
which he doesn't really understand :-(
> To make sure you get the behavior you want, make sure
> `LaTeX--arguments-completion-at-point` returns the same completion table
> with the same start position for
>
> \setlength{}
>
> as for
>
> \setlength{\ba}
>
> It will also provide better completion, because AFAICT currently it
> includes `backmatter` in the candidates for `ba`, which is not helpful.
I think the issue is the value of `completion-at-point-functions' in
LaTeX-mode:
(TeX--completion-at-point t LaTeX--arguments-completion-at-point
ispell-completion-at-point)
So with
\setlength{\ba*}
and * indicating point, hitting RET makes `TeX--completion-at-point'
taking over the lead for returning candidates, hence the `backmatter`
you see, which is indeed not useful. I remember I had some reasons not
to put `LaTeX--arguments-completion-at-point' in front of that list, I
can't remember them, though.
I thought I could avoid bisecting this in Emacs sources, but maybe I
give it a try. Otherwise, I have currently no idea how to fix this.
Best, Arash