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

From: Arash Esbati <[email-masked]>
Date: Wed, 03 Apr 2024 14:22:16 +0200

Hi Keita,

Ikumi Keita <[email-masked]> writes:

> Sorry, I included a spurious quote at
>      (modes    . '(latex-mode))
> in my proposal. The proposal for `tex-tabbing-separator' should have
> been:
> ----------------------------------------------------------------------
>     (tex-tabbing-separator
>      (regexp   . ,(lambda (end reverse)
>                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
>      (group    . (1 2))
>      (modes    . (latex-mode))
>      (repeat   . t))
> ----------------------------------------------------------------------

Thanks for raising this issue.  I have a question though: Does the
change below fit the bill as well:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/align.el b/lisp/align.el
index 81ccc4b5e2d..21e2e12ac24 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -538,9 +538,7 @@ align-rules-list
                     (align-match-tex-pattern "\\\\[=>]" end reverse)))
      (group    . (1 2))
      (modes    . align-tex-modes)
-     (repeat   . t)
-     (run-if   . ,(lambda ()
-                    (eq major-mode 'latex-mode))))
+     (repeat   . t))

     (tex-record-break
      (regexp   . "\\(\\s-*\\)\\\\\\\\")
--8<---------------cut here---------------end--------------->8---

`align-tex-modes' is defined like this:

,----[ C-h v align-tex-modes RET ]
| align-tex-modes is a variable defined in ‘align.el’.
| 
| Its value is (tex-mode plain-tex-mode latex-mode slitex-mode)
| 
| A list of modes whose syntax resembles TeX (and family).
| 
|   You can customize this variable.
| 
`----

And IIUC, the `run-if' attribute doesn't make sense, i.e., define 4
modes and then run the show only in `latex-mode'.  WDYT?

Best, Arash