[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45328: 28.0.50; [PATCH] Compare raw syntax descriptors with equal in
From: |
Lars Ingebrigtsen |
Subject: |
bug#45328: 28.0.50; [PATCH] Compare raw syntax descriptors with equal in `python-indent-region' |
Date: |
Mon, 17 May 2021 17:06:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Andrea Corallo <akrl@sdf.org> writes:
> Uhmm, I thought the patch was correct but re-testing it this is now
> breaking the `python-indent-region-5' test.
>
> Maybe there's a reason why we should use eq there or maybe this is
> unveiling a real bug? Not sure, I guess some expert of that code should
> probably have a look.
The code in question is:
;; Don't mess with strings, unless it's the
;; enclosing set of quotes or a docstring.
(or (not (python-syntax-context 'string))
(eq
(syntax-after
(+ (1- (point))
(current-indentation)
(python-syntax-count-quotes (char-after) (point))))
(string-to-syntax "|"))
(python-info-docstring-p))
That `eq' form will never return anything other than nil, so removing it
gives us identical results. So I'm not quite sure what it's trying to
do -- it's probably meant to be `equal', but that will (as you've found
out) lead to mis-indenting some code.
So I've added Fabián to the CCs; perhaps he has some comments.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#45328: 28.0.50; [PATCH] Compare raw syntax descriptors with equal in `python-indent-region',
Lars Ingebrigtsen <=