GNU bug report logs - #47146
27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sun, 14 Mar 2021 21:46:04 UTC

Severity: normal

Found in version 27.0.50

Full log


Message #14 received at 47146 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Markus Triska <triska <at> metalevel.at>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 47146 <at> debbugs.gnu.org
Subject: Re: bug#47146: 27.0.50; Unexpected indentation for pcase forms in
 emacs-lisp-mode
Date: Thu, 18 Mar 2021 15:03:29 +0100
On Mär 18 2021, Lars Ingebrigtsen wrote:

> Markus Triska <triska <at> 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 <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 4 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.