Subject: bug#54663: 29.0.50; align-current changed behavior

From: Stephen Berman <[email-masked]>
Date: Fri, 01 Apr 2022 10:16:22 +0200

On Fri, 01 Apr 2022 02:37:27 +0000 Henri Menke via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> wrote:

> Somewhere between version 27.1 and 29.0.50 the `align' command changed
> its behavior. Examples below are executed in emacs -Q.
>
> Consider the following file `test.tex':
>
>    \documentclass{article}
>    \begin{document}
>    \begin{tabular}{lr}
>      abc def & zzz \\
>      foo & bar \\
>    \end{tabular}
>    \end{document}
>
> Opening this file in 27.1 and using M-x align-current yields the
> expected
>
>    \documentclass{article}
>    \begin{document}
>    \begin{tabular}{lr}
>      abc def & zzz \\
>      foo     & bar \\
>    \end{tabular}
>    \end{document}
>
> but opening the file in 29.0.50 and using M-x align-current produces
> something weird:
>
>    \documentclass{article}
>    \begin{document}
>    \begin{tabular}{lr}
>     abc def   & zzz \\
>     foo & bar \\
>    \end{tabular}
>    \end{document}
>
> There is only a single space of indentation and alignment is now at
> spaces instead of & and \\ as expected for align-tex-modes.

If I debugged this correctly, this behavior change is due to this
commit:

commit 90266b8356dc5e7e6e437fb37b49970205b01408
Author:     Lars Ingebrigtsen <[email-masked]>
Commit:     Lars Ingebrigtsen <[email-masked]>
CommitDate: Tue Oct 19 22:39:05 2021 +0200

    Tweak how 'align' and 'align-regexp' align text

    * lisp/align.el (align-rules-list): Change to work without `C-u'.

diff --git a/lisp/align.el b/lisp/align.el
index 7ced7b7044..2fd6dcda6d 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -553,8 +553,7 @@ align-rules-list
      (modes    . align-text-modes)
      (repeat   . t)
      (run-if   . ,(lambda ()
-                    (and current-prefix-arg
-                         (not (eq '- current-prefix-arg))))))
+                    (not (eq '- current-prefix-arg)))))

Steve Berman