Subject: bug#61400: Different filling for verbatim macros

From: Ikumi Keita <[email-masked]>
Date: Wed, 15 Feb 2023 15:30:52 +0900

Hi Arash,

>>>>> Arash Esbati <[email-masked]> writes:
>> However, I'm a bit reluctant.
>> 1. If `LaTeX-verbatim-p' should return non-nil at just before
>> "\verb", then it should also do so just before "\begin{verbatim}" for
>> consistency, shouldn't it?
>> 2. Suppose that you type "$" just before "\verb...". Then
>> `TeX-insert-dollar' inserts only one "$" instead of "$$" under the
>> current behavior of `LaTeX-verbatim-p', because `TeX-insert-dollar'
>> uses `TeX-verbatim-p'. I think it's unexpected. 
>
> I think we have everything we need now so we can change the behavior of
> `LaTeX-verbatim-p' acc. to what you describe above because:

Sorry, I'm unsure what you mean by "to what you describe above".
1. To change `LaTeX-verbatim-p' to return non-nil just before
   "\begin{verbatim}", keeping the current behavior at just before
   "\verb..."?
2. To change `LaTeX-verbatim-p' to return nil just before "\verb..."?

Reading again my paragraphs, my opinion wasn't clear enough probably. I
feel that it isn't natural that `LaTeX-verbatim-p' returns non-nil just
before "\begin{verbatim}". Taking into account `TeX-insert-dollar'
behavior as well, I'm still in favor of changing it to return nil just
before "\verb..." as my first patch, keeping the current behavior just
before "\begin{verbatim}". That's the reason why I feel reluctant.

> Note that I had to apply the patch attached on top of yours in order
> to get it working (some trouble with parens). I've also adjusted the
> comment (the optional arg of \lstinline was already there).

Oops, sorry for those! 😵

>> (By the way, I noticed that `LaTeX-verbatim-p' raises error when "\verb"
>> is at the end of the buffer without delimiters and its contents "|...|".
>> In fact `LaTeX-verbatim-macro-boundaries' and
>> `LaTeX-current-verbatim-macro' raise the same error. The reason is that
>> `LaTeX-verbatim-macro-boundaries' presumes there is nonempty string
>> after the macro body. Should we cater for such corner case?)

> I'd say let's fix the issue at hand and then see if others complain and
> there is a real use for this corner case, and then we can touch that.
> Does it make sense?

I see, let's do so.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine