Subject: bug#69187: 29.2; Poor compatibility in align.el

From: Ikumi Keita <[email-masked]>
Date: Sat, 06 Apr 2024 18:30:49 +0900

Hi Arash and Eli,

>> > That would practically do the job as well, because this entry wouldn't
>> > be relevant in buffers in modes other than latex (LaTeX) mode
>> > actually. My proposal is just to keep the precise behavior the same.
>> 
>> Agreed, so the change would look like this, right?

Yes, that's exactly the same with the one at the tail of my previous
message.

>>>>> Eli Zaretskii <[email-masked]> writes:
> Please explain the issue in more detail and in terms that someone who
> doesn't use AUCTeX and has only superficial understanding of align.el
> can understand and reason about.

> Three questions that pop up immediately, perhaps because I'm missing
> something:

>   . why not use derived-mode-p instead of 'equal' in the run-if form

That's what I thought. Arash and I are proposing to _remove_ the run-if
form so that `derived-mode-p' in `align-region' would do the expected
job.

>     (and why remove it in the first place)?

See above.

>   . what is the rationale for not using align-tex-modes here, only
>     latex-mode?

Because the current `tex-tabbing-separator' entry in `align-rules-list'
excludes other modes by `run-if' form. I'm just following that behavior
for AUCTeX modes. As I said in my previous message, this isn't much
relavant; using `align-tex-modes' instead of '(latex-mode) would almost
be the same for practical usage, provided that the `run-if' form is
removed.

>   . why not just add the new LaTeX-mode to the list in
>     align-tex-modes, so that people who use an old AUCTeX will not
>     have their align rules broken?

That isn't necessary. Only `latex-mode' is needed there because
`derived-mode-p' considers that `latex-mode' is parent of `LaTeX-mode'.
However, the current `run-if' form excludes `LaTeX-mode' because if uses
`eq', not `derived-mode-p'.

> (And, btw, why did AUCTeX change the name of the mode?  What useful
> purpose could that possibly serve?  Changing names of major modes is
> the last thing I'd expect from a veteran package that respects its
> users.)

Major motivation is the following two:
(1) to follow emacs standard convention about naming scheme of user
    customize option.
(2) to get rid of ugly hack and simplify the code.

The thread beginning with [1] motivated this change. This thread was
stimulated by a thread beginning with [2], which claims that
the major mode name `latex-mode' and hook name `LaTeX-mode-hook' are
inconsistent and doesn't follow the emacs standard naming convention
without good reason.
In addition, there have been very ugly hack to put dual roles on the
symbol `latex-mode', which accidentaly broke a compatibility[3]. This
topic is discussed in the thread [1], too.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

[1] https://lists.gnu.org/r/auctex-devel/2022-09/msg00039.html
[2] https://lists.gnu.org/r/help-gnu-emacs/2022-09/msg00104.html
[3] https://lists.gnu.org/r/auctex/2022-08/msg00001.html
    https://tex.stackexchange.com/questions/648955/auctex-inconsistent-behavior-tex-vs-latex