X-Loop: help-debbugs@HIDDEN
Subject: bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Resent-From: Markus Triska <triska@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 14 Mar 2021 21:46:04 +0000
Resent-Message-ID: <handler.47146.B.161575833412350 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 47146
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 47146 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.161575833412350
(code B ref -1); Sun, 14 Mar 2021 21:46:04 +0000
Received: (at submit) by debbugs.gnu.org; 14 Mar 2021 21:45:34 +0000
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>
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-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
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Markus Triska <triska@HIDDEN> Subject: bug#47146: Acknowledgement (27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode) Message-ID: <handler.47146.B.161575833412350.ack <at> debbugs.gnu.org> References: <m21rchigtu.fsf@HIDDEN> X-Gnu-PR-Message: ack 47146 X-Gnu-PR-Package: emacs Reply-To: 47146 <at> debbugs.gnu.org Date: Sun, 14 Mar 2021 21:46:05 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 47146 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 47146: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D47146 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 18 Mar 2021 05:47:01 +0000
Resent-Message-ID: <handler.47146.B47146.16160463789096 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 47146
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Markus Triska <triska@HIDDEN>
Cc: 47146 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 47146-submit <at> debbugs.gnu.org id=B47146.16160463789096
(code B ref 47146); Thu, 18 Mar 2021 05:47:01 +0000
Received: (at 47146) by debbugs.gnu.org; 18 Mar 2021 05:46:18 +0000
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>
References: <m21rchigtu.fsf@HIDDEN>
X-Now-Playing: T5UMUT5UMU's _Natural Sciences: Age in Decline_:
"=?UTF-8?Q?=E6=9A=B4=E8=B5=B0=E6=97=8F=E3=81=AF=E8=87=AA?= =?UTF-8?Q?=E5=8B=95=E9=81=8B=E8=BB=A2=E3=81=AE=E5=A4=A2=E3=82=92=E8=A6=8B=E3=82=8B=E3=81=AE=E3=81=8B?="
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-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
X-Loop: help-debbugs@HIDDEN
Subject: bug#47146: 27.0.50; Unexpected indentation for pcase forms in emacs-lisp-mode
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 18 Mar 2021 13:52:01 +0000
Resent-Message-ID: <handler.47146.B47146.161607550016592 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 47146
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Markus Triska <triska@HIDDEN>, 47146 <at> debbugs.gnu.org
Received: via spool by 47146-submit <at> debbugs.gnu.org id=B47146.161607550016592
(code B ref 47146); Thu, 18 Mar 2021 13:52:01 +0000
Received: (at 47146) by debbugs.gnu.org; 18 Mar 2021 13:51:40 +0000
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>
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-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
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.