bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54663: 29.0.50; align-current changed behavior


From: Stephen Berman
Subject: bug#54663: 29.0.50; align-current changed behavior
Date: Fri, 01 Apr 2022 10:16:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Fri, 01 Apr 2022 02:37:27 +0000 Henri Menke via "Bug reports for GNU Emacs, 
the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> 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 <larsi@gnus.org>
Commit:     Lars Ingebrigtsen <larsi@gnus.org>
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]