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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Markus Triska <triska@HIDDEN>; dated Sun, 14 Mar 2021 21:46:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 47146 <at> debbugs.gnu.org:


Received: (at 47146) by debbugs.gnu.org; 18 Mar 2021 13:51:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 18 09:51:40 2021
Received: from localhost ([127.0.0.1]:45435 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lMt3s-0004JY-30
	for submit <at> debbugs.gnu.org; Thu, 18 Mar 2021 09:51:40 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11982)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1lMt3q-0004JK-IG
 for 47146 <at> debbugs.gnu.org; Thu, 18 Mar 2021 09:51:39 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EF1094410E5;
 Thu, 18 Mar 2021 09:51:32 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A72494410E0;
 Thu, 18 Mar 2021 09:51:31 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1616075491;
 bh=12H2zXpUC+2kbuKUbpNWWoCB3xQ0F+cMWd6JmgHrE14=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=gvY2s1/4d8/gaKHyxzpEN9iYtyZI9OAZepNN1Gy7PJXcnXUM/+7m8sm5HdLmSGDFG
 klDxgvpGErD3tTneToBN4Lwc5FjWzqENjAmoeUFEa939SgNMoi3Cem8WdoKI5PnItV
 4zfGLYLOSu9JYKyH8TOl0xBeD/Q+ZU9tjKQhtOPd7EycusUOHsOLwBWDEhmW98btZm
 4JOAWTj1diOmodZw3LiQ7GD3L449sP/ln540yceQJBebh7Kb/elbjCUm29XcjjFrXN
 lVMbJJ4GnCQJJtJn+CpMepg/ZNLZaJVqikxdTZwT4+1hVTqzz3qerpla64hAlRcKCu
 RPa0YJjZZDHiA==
Received: from alfajor (unknown [216.154.43.249])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 463861200A1;
 Thu, 18 Mar 2021 09:51:31 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#47146: 27.0.50; Unexpected indentation for pcase forms in
 emacs-lisp-mode
Message-ID: <jwvczvwfu6b.fsf-monnier+emacs@HIDDEN>
References: <m21rchigtu.fsf@HIDDEN> <87y2elrp46.fsf@HIDDEN>
Date: Thu, 18 Mar 2021 09:51:30 -0400
In-Reply-To: <87y2elrp46.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 18 Mar 2021 06:46:01 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.103 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 47146
Cc: Markus Triska <triska@HIDDEN>, 47146 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> 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





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47146; Package emacs. Full text available.

Message received at 47146 <at> debbugs.gnu.org:


Received: (at 47146) by debbugs.gnu.org; 18 Mar 2021 05:46:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 18 01:46:18 2021
Received: from localhost ([127.0.0.1]:44645 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lMlUA-0002Me-Gk
	for submit <at> debbugs.gnu.org; Thu, 18 Mar 2021 01:46:18 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39046)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lMlU8-0002MP-C3
 for 47146 <at> debbugs.gnu.org; Thu, 18 Mar 2021 01:46:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=gvlxfBvsMHapDPdgTmR3MiRA9aya/LRgOyiqTiSbWWQ=; b=oMKTvRqs6FUBNYe5hJBfASgekD
 WiOr1YROkMXVro/SzhHNJblMAlVfg0d1kYNgfOZJPiyQ5JnZ4x6pq2pj56gWYcDSdMcjSVMvCzxsD
 6Jjze8n848WcV2gQivLpIlFMnZPJV2Rcx8yRrQ/w1df93J3xMeQPZXYe1B/gcmPeThdM=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lMlTv-0000BM-9S; Thu, 18 Mar 2021 06:46:09 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Markus Triska <triska@HIDDEN>
Subject: Re: bug#47146: 27.0.50; Unexpected indentation for pcase forms in
 emacs-lisp-mode
References: <m21rchigtu.fsf@HIDDEN>
X-Now-Playing: T5UMUT5UMU's _Natural Sciences: Age in Decline_:
 =?utf-8?B?IuaatOi1sOaXj+OBr+iHquWLlemBi+i7ouOBruWkouOCkuimi+OCi+OBrg==?=
 =?utf-8?B?44GLIg==?=
Date: Thu, 18 Mar 2021 06:46:01 +0100
In-Reply-To: <m21rchigtu.fsf@HIDDEN> (Markus Triska's message of "Sun,
 14 Mar 2021 22:08:29 +0100")
Message-ID: <87y2elrp46.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Markus Triska <triska@HIDDEN> writes: > Starting Emacs
 with: > > $ emacs -Q > > I get the following indentation: > > (defun word
 (arg) > (pcase arg > ('love > 'amour) > ('always > 'toujours) > ('if > 'si)
 > ('emacs > 'emacs))) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47146
Cc: 47146 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Markus Triska <triska@HIDDEN> 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"?

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

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47146; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Mar 2021 21:45:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 14 17:45:34 2021
Received: from localhost ([127.0.0.1]:34353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lLYYI-0003D8-Do
	for submit <at> debbugs.gnu.org; Sun, 14 Mar 2021 17:45:34 -0400
Received: from lists.gnu.org ([209.51.188.17]:50050)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <triska@HIDDEN>) id 1lLYYH-0003D1-8g
 for submit <at> debbugs.gnu.org; Sun, 14 Mar 2021 17:45:33 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56826)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <triska@HIDDEN>)
 id 1lLYYG-0001nW-SV
 for bug-gnu-emacs@HIDDEN; Sun, 14 Mar 2021 17:45:32 -0400
Received: from [78.47.144.35] (port=41230 helo=metalevel.at)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <triska@HIDDEN>) id 1lLYYF-0007Kp-8A
 for bug-gnu-emacs@HIDDEN; Sun, 14 Mar 2021 17:45:32 -0400
Received: from mts-Mac-mini.localdomain (localhost [127.0.0.1])
 by metalevel.at (Postfix) with ESMTP id CF07D9C73E
 for <bug-gnu-emacs@HIDDEN>; Sun, 14 Mar 2021 22:36:26 +0100 (CET)
Received: by mts-Mac-mini.localdomain (Postfix, from userid 501)
 id 3A5EC1434255; Sun, 14 Mar 2021 22:08:29 +0100 (CET)
From: Markus Triska <triska@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Date: Sun, 14 Mar 2021 22:08:29 +0100
Message-ID: <m21rchigtu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Host-Lookup-Failed: Reverse DNS lookup failed for 78.47.144.35 (failed)
Received-SPF: none client-ip=78.47.144.35; envelope-from=triska@HIDDEN;
 helo=metalevel.at
X-Spam_score_int: 8
X-Spam_score: 0.8
X-Spam_bar: /
X-Spam_report: (0.8 / 5.0 requ) BAYES_20=-0.001, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Starting Emacs with:

    $ emacs -Q

I get the following indentation:

    (defun word (arg)
      (pcase arg
        ('love
         'amour)
        ('always
         'toujours)
        ('if
            'si)
        ('emacs
         'emacs)))

However, the indentation I expected is:

    (defun word (arg)
      (pcase arg
        ('love
         'amour)
        ('always
         'toujours)
        ('if
         'si)
        ('emacs
         'emacs)))

Thank you and all the best,
Markus

In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.0.0, X toolkit, Xaw scroll bars)
 of 2018-11-15 built on mac
Repository revision: b4eb908f858284a7962851fd99c94598f76afa6f
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:  Mac OS X 10.14.2





Acknowledgement sent to Markus Triska <triska@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#47146; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 18 Mar 2021 14:00:02 UTC

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