From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: akater Newsgroups: gmane.emacs.bugs Subject: bug#9622: [PATCH] Re: bug#9622: 23.3; flet indentation Date: Sat, 09 Oct 2021 07:26:04 +0000 Message-ID: <871r4ud5gz.fsf@gmail.com> References: <504153FB-8633-4755-A91A-DF5DD64E6FAA@acm.org> <87lf3fntdx.fsf@gmail.com> <87tui26027.fsf@gnus.org> <87r1d62owt.fsf@tcd.ie> <8735pm2nai.fsf@gnus.org> <87a6junp3j.fsf@gmail.com> <87ilyhx9wb.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36492"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Basil L. Contovounesios" , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 9622@debbugs.gnu.org, "Diogo F. S. Ramos" To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 09 09:38:32 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZ6wB-0009IP-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Oct 2021 09:38:31 +0200 Original-Received: from localhost ([::1]:36362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZ6wA-0000YC-M9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Oct 2021 03:38:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZ6vi-0000Y0-BQ for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 03:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mZ6vi-0008Ga-46 for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 03:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mZ6vh-0006di-W7 for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 03:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: akater Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Oct 2021 07:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9622 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 9622-submit@debbugs.gnu.org id=B9622.163376506725498 (code B ref 9622); Sat, 09 Oct 2021 07:38:01 +0000 Original-Received: (at 9622) by debbugs.gnu.org; 9 Oct 2021 07:37:47 +0000 Original-Received: from localhost ([127.0.0.1]:52249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZ6vT-0006d8-Fp for submit@debbugs.gnu.org; Sat, 09 Oct 2021 03:37:47 -0400 Original-Received: from mail-il1-f177.google.com ([209.85.166.177]:44992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZ6vR-0006cs-Uk for 9622@debbugs.gnu.org; Sat, 09 Oct 2021 03:37:46 -0400 Original-Received: by mail-il1-f177.google.com with SMTP id j8so421825ila.11 for <9622@debbugs.gnu.org>; Sat, 09 Oct 2021 00:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Bnkzl5KuiuSP+Ndd+Rp/loqoeuGqlqCARwv6KV61InE=; b=SmBowmm/WquUKAamORiyZ/rM1BrQfC6Xi+urogpglkTJsTWaocCx+2797K0PCD3zBq Fpw8rQ+ZjSRp4Ayz3aW1iPA4IBRlxcNAkBh2I5m42S0WbRy9cFmz9xO4+qPAhbWY8EPa a5LVcJdA/Mgqb4ayGzlmJHltdstX7ij7OJNyxVy2qq+/DcqxCMyJZ2ySMb6pbvx7hy05 1UslYitmdVLv6ftH6QCYnYYsh8OHCO2NpalJZ2VG23GRFP8NROSl4ZRN0hzUI0L+7wMa 6druykYyuUKF8al6Fdi5SOq3YphsbZWAg9JzaPSVAs1H+uy4F8FDtQtmWb+MXubFCHIr bdNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Bnkzl5KuiuSP+Ndd+Rp/loqoeuGqlqCARwv6KV61InE=; b=Q0QDJjZogWALpCYuE+nTgxKwOUyqBta/h2xVZmXeGTw8ofII7o+Nlq8c3cLlXHFa77 YAmGWjeyAGZJCTDDGiOi7oOgU52PqjbTnjp3lwBydjutKOpncHcm+ocRvIwF37drlgN6 Bhr3BnNulOVDml8e+WlTe54zn2VB8A9ZCBJ7EAEw/xDhydQBONerqFNSoAIvAFnINsmV AQKjo0bys8Rp6V4x/Vi3Tilj09RW21gShdOSPOcjC1sttsXQKduwO3Xs78nI5fLPZSe+ HXsj8kFKI3NCgrN5+5WBG5lwLXHQ5mBdr/W+/S5jM4+uo1Wih2LsY5EsKJnDdJ9TC3q7 o9PA== X-Gm-Message-State: AOAM531KAJB8IAqgndX68AE8OrP24G95NqjKCPYSo6/hYvILoyqrGPYf 6+bp23VcfEisf4WDd60Lq2A= X-Google-Smtp-Source: ABdhPJyYXlJTxIabmGcjcy98sCKH25WetPsujREHCR/d78h3STu1ZhIoWix2A9uI1pKkxf7QX9lA7A== X-Received: by 2002:a05:6e02:17c6:: with SMTP id z6mr10748085ilu.185.1633765060293; Sat, 09 Oct 2021 00:37:40 -0700 (PDT) Original-Received: from localhost ([23.154.177.130]) by smtp.googlemail.com with ESMTPSA id g3sm770283ile.61.2021.10.09.00.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Oct 2021 00:37:39 -0700 (PDT) In-Reply-To: <87ilyhx9wb.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216749 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > akater writes: > >> I don't think so. The first attempt was written in a hurry, and merged >> without extensive testing; in the second I did exhaustive tests, it just >> never crossed my mind to test on unbalanced expressions. This very much >> looks like the last ignore-errors of them: > > Thanks, but I think we're just too late to get this into Emacs 28, so I > resurrected your patch series and pushed it as one patch to the trunk. > (I also added all the test cases from your second patch to ert.) > > Please have a look and see if I missed something when I did the merge. Everything from my last patch is in its place (my branch is even with master, and 15 tests are there) but: We need to also include partial sexps, and a test should ensure RET brings point to the proper position. I have not familiarized myself with this test routine yet so I'm not sure how to do this right. The important aspect I w= ant to point out now is, especially since previous partial sexps affect the indentation of all consequent sexps, we must ensure this will not affect bo= th the =E2=80=9CRET tests=E2=80=9D and tests where the region is indented. Th= is presumes all our test cases will reside in a single file but they should be because otherwis= e it will be terrible. This is important enough so I write this message in adva= nce even though the indentation is sometimes wrong and I've not yet figured it = out. Here go =E2=80=9CRET test cases=E2=80=9D; looks like they are exhaustive, m= odulo variations with longer excessive whitespace. Not everything of what follows is indent= ed correctly with my patch. I'm investigating; some issues might be present e= ven without my patch. In what follows, ^ points to the appropriate position after RET is pressed. The last case that broke my patch: (let ((x (and y ^ A variation of it, just in case: (let ((x ^ ; N.B.: This is the way it is in elisp-mode right now but in lisp-mode, the= point is one step further. 5 cases with some whitespace missing: flet-missing-whitespace-1 (cl-flet((f (x) ^ flet-missing-whitespace-2 (cl-flet((f(x) ^ flet-missing-whitespace-3 (cl-flet ((f(x) ^ flet-missing-whitespace-4 (cl-flet( (f (x) ^ flet-missing-whitespace-5 (cl-flet( (f(x) ^ Combinations of missing and excessive whitespace flet-missing-and-excessive-whitespace-1 (cl-flet((f (x) ^ flet-missing-and-excessive-whitespace-2 (cl-flet ((f(x) ^ flet-missing-and-excessive-whitespace-3 (cl-flet( (f (x) ^ flet-missing-and-excessive-whitespace-4 (cl-flet( (f (x) ^ flet-missing-and-excessive-whitespace-5 (cl-flet( (f (x) ^ flet-missing-and-excessive-whitespace-6 (cl-flet( (f(x) ^ There's another problem: in some of these cases, even though initial indentation is incorrect, once the sexp is completed, it is indented correc= tly. But in some other cases, it's not! I'm looking into this. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJLBAEBCgA1FiEEgu5SJRdnQOF34djNsr6xYbHsf0QFAmFhRAwXHG51Y2xlYXJz cGFjZUBnbWFpbC5jb20ACgkQsr6xYbHsf0Tjrg//cXF7txcHMtsKGfhJmUG/26In hq9Hv6Qf43d59bST1xJHGGZcX/MGDdfyZsHK9OxhaKe0PcaZELU1/8zgY0WVTNB/ 5b9SKk829c2YN33urFzHe5kFeDIKo9ga28w1/hy3NlPxs8BaGTAgU2iBQUOpQxtC GtxyuTEnGTOITz15psCnhvkFlo7JhQ4Cj2vZLIu5uu3bPG/FQGuLxiJZVW/r62/N Xn5480MwTDvqtZ6dbIkjmkmgZq2XuuxYp6OFLYs/sqa5hMc2NslLU7czVYStLygs LfN0w4/8XUH8XeEnAfmhHkH/LsXSnIQEFo0Fo/wKASSZTujJi/bIEKbX2Bdv0AYr ogMyHSBjW75RT/ewQcl0oP7hojMJh70HK5u1KuCWT4wDLh8MCmdpzRw/V9uRj8zE MVR1+ELQwiW+xft9cp8k7uuKJLfAkICL4F7RlBPI7pX0UT1oGeDOpNx44W4CSSQ0 SPkSTHtFc2CSLrGmyHaQ1zWmfWZE+Z/YaKpZKj1+RBtt2VvZvgSf+Z4Ct+6WkFYY kg+9GPstItxM5uCXYETa+gtefvBUWdouU0vafW7WxY11fjK95I/0jZn5CRA5g6Zo 8/qyCSESuZ+6VsaAwJ3BwjGKmsOiEKPn1cm1Xo8hryH81YNofmpZk+7AmMKDDKo9 Z72P74Luzns8MbwuGv4= =JZWI -----END PGP SIGNATURE----- --=-=-=--