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

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

bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp


From: Andreas Schwab
Subject: bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Date: Thu, 18 Mar 2021 15:03:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.91 (gnu/linux)

On Mär 18 2021, Lars Ingebrigtsen wrote:

> Markus Triska <triska@metalevel.at> writes:
>
>> Starting Emacs with:
>>
>>     $ emacs -Q
>>
>> I get the following indentation:
>>
>>     (defun word (arg)
>>       (pcase arg
>>         ('love
>>          'amour)
>>         ('always
>>          'toujours)
>>         ('if
>>             'si)
>>         ('emacs
>>          'emacs)))
>
> I guess `lisp-indent-calc-next' is interpreting the "('if" as if it were
> "(if"?

It's lisp-indent-function that calculates the indentation.  It is called
with a pps state where start of last complete sexp terminated points to
`if' and start of innermost containing list points to the preceding
paren.  It then determines that `if' has a lisp-indent-function property
of 2.

So if there is any bug, it is probably in parse-partial-sexp.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

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