Subject: bug#45328: 28.0.50; [PATCH] Compare raw syntax descriptors with equal in `python-indent-region'

From: Stefan Kangas <[email-masked]>
Date: Fri, 19 Mar 2021 21:51:39 -0500

Andrea Corallo <[email-masked]> writes:

> In `python-indent-region' we are comparing raw syntax descriptors using
> `eq' but I think we should use `equal' (as we do underneath in
> `python-fill-string').
>
> I'm quite convinced the fix is correct but; should this go also in 27
> where the code is the same?

That was in December, and there were no followups.

We are one week away from Emacs 27.2, so I don't think we want this on
emacs-27 right now.  If you think the fix is correct, I don't see why we
couldn't push it there after Emacs 27.2 is released.

Should we perhaps start by getting the fix pushed to master?

>>>From 9163724fcd8eea5c9e2908ecb38d90406669a8d3 Mon Sep 17 00:00:00 2001
> From: Andrea Corallo <[email-masked]>
> Date: Sat, 19 Dec 2020 23:51:36 +0100
> Subject: [PATCH] * Compare raw syntax descriptors with equal in
>  `python-indent-region'.
>
> 	* lisp/progmodes/python.el (python-indent-region): Compare raw
> 	syntax descriptors with equal.
> ---
>  lisp/progmodes/python.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index d75944a702..dc2efdfcf7 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -1259,7 +1259,7 @@ Called from a program, START and END specify the region to indent."
>                     ;; Don't mess with strings, unless it's the
>                     ;; enclosing set of quotes or a docstring.
>                     (or (not (python-syntax-context 'string))
> -                       (eq
> +                       (equal
>                          (syntax-after
>                           (+ (1- (point))
>                              (current-indentation)