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 #11 received at 47146 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Markus Triska <triska <at> metalevel.at>, 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 09:51:30 -0400
>> 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"?

Looks like it, indeed.

> I must admit I have some difficulties in following the logic in that
> function, perhaps Stefan has some insights here (added to CCs).

I'm not very familiar with our Lisp indentation code, I'm afraid (so
much so that I often feel like replacing it with one based on SMIE, tho
I luckily recognize it as NIH-syndrome so I managed to resist the
temptation so far).


        Stefan





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.