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: Thu, 30 Sep 2021 13:57:04 +0000 Message-ID: <87a6junp3j.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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6353"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , 9622@debbugs.gnu.org, "Diogo F. S. Ramos" To: Lars Ingebrigtsen , "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 30 16:11:42 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 1mVwmk-0001RP-Ac for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Sep 2021 16:11:42 +0200 Original-Received: from localhost ([::1]:36960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVwmj-0005qZ-5p for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Sep 2021 10:11:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVwl9-0003at-8f for bug-gnu-emacs@gnu.org; Thu, 30 Sep 2021 10:10:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVwl8-0002EO-NF for bug-gnu-emacs@gnu.org; Thu, 30 Sep 2021 10:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVwl8-0000zZ-DF for bug-gnu-emacs@gnu.org; Thu, 30 Sep 2021 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: akater Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Sep 2021 14:10:02 +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.16330109923787 (code B ref 9622); Thu, 30 Sep 2021 14:10:02 +0000 Original-Received: (at 9622) by debbugs.gnu.org; 30 Sep 2021 14:09:52 +0000 Original-Received: from localhost ([127.0.0.1]:53575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwky-0000z0-5x for submit@debbugs.gnu.org; Thu, 30 Sep 2021 10:09:52 -0400 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:40619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVwkv-0000yi-3d for 9622@debbugs.gnu.org; Thu, 30 Sep 2021 10:09:51 -0400 Original-Received: by mail-ed1-f46.google.com with SMTP id g8so22904137edt.7 for <9622@debbugs.gnu.org>; Thu, 30 Sep 2021 07:09:49 -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=IIgjOfi2UxxtTM0eIe4saAHrkP7BWB7Ubx16Brv2D/8=; b=GOGv4q9D5v0nY8xlMMW39VWNuTLVJ10clKHdwgZnGQQ2HfJCAcjPern0WuydGjHJrl BraWnT98GymnA2KZnW/vHOviDFrnTKy2MkG7WoPRYMWb9wXfCf9HnAZ+aWiP19urKSb7 70jArdxjeuazKNCLg57OdEYfSqwTfWbirVIddkE26hFPhRU8WBAIu1H463O6TMMNXTZS 12jWaBSwZKt4iW5BQgvlAXNE0gK6G4mKu/8GnRWeVCRDllOeT34vXU6jlq414FMGfsUQ 73MMg2ahYF0c0faCTpl4vlu7wVDO0d5ui6fRfqPqVu6KTjumABihSBrJHrI+rXaIn44c wiyw== 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=IIgjOfi2UxxtTM0eIe4saAHrkP7BWB7Ubx16Brv2D/8=; b=HtxZN5FkCXCY0fWX1SKKNVHenHNAdUBHcWczQtVAEKmGpKSwTTrSksXrDSu9Dvs+sR tRmfUDzNQArjI6tTNi8RBrtApZy3qu8O+WAMkwTYfacOFV1Dsd2wlwIPiCYLPyPOb2vy oVYnQBQnaSfa+NWK1+amjzYKhnNIBBT37KYb7W61c9sLaQRHKNy8O9sCMIq3gE0hfucl RzZuRRMqPZulpk6QelNMH3qB5gthhara6HInnidm+LZHu+BB34k6wqXCTTmqqqN1NkEF J5+G3c7boeJXX2bpsMWtWXu96oRicMUh0rd/UCmz9xQubt4ha82Nmj+JVR4Sq8qkFQAB 1oyw== X-Gm-Message-State: AOAM532UjAxp9ujPcv0Q6DNsNLU7VEqYxFw/mBFQFprdW5KKI+T6t53I gHLYaznychW+LUCiRTGs59w= X-Google-Smtp-Source: ABdhPJxXv4tLXzLqmTMG0vB48/2M2kIMfnVQg/cM4Vh3iov2sk850naa1dpVRvXTAHaTwKDjmAcIOA== X-Received: by 2002:a05:6402:50cc:: with SMTP id h12mr7494122edb.216.1633010913439; Thu, 30 Sep 2021 07:08:33 -0700 (PDT) Original-Received: from localhost ([185.31.175.220]) by smtp.googlemail.com with ESMTPSA id q9sm1522078ejf.70.2021.09.30.07.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 07:08:32 -0700 (PDT) In-Reply-To: <8735pm2nai.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:215974 Archived-At: --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Perhaps we should consider backing out these changed in Emacs 28 and > continuing to work on them on the trunk? 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: --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJLBAEBCgA1FiEEgu5SJRdnQOF34djNsr6xYbHsf0QFAmFVwjAXHG51Y2xlYXJz cGFjZUBnbWFpbC5jb20ACgkQsr6xYbHsf0TCaw//dMtMEp0bI53hEdJF53eiZtXs mpT0KVkpLayItJB4pkl1p3g1eUZE4as4GfwrVeOAUkSjEbJT/T+F+RQjwlK0yYC9 H+PVB5HX42fLgEY/r0DZiUwJ2aQkU1QeBVej0zx0zZ2y0JsX6mBpUd78frejz+aA rLSmHTPwbHfcG9+SSFie3ypLFAHqAxuzhJKcfrlVts9t6YKDrO000FGSWCvmDogF 8mNPLJeYhBy7NP4W31fQPyrGOh/2rsYu4SDjFqMgiQ9b/N9Boq474w4fezUARLmk 4GrnBGLdVmdRxJzWsV5XP9a3fptfhS+mV7gxm2kn5NCMnJpNni+YURtlSEIBG70P GaPM4U3onrrYbQuU1yA7w8mzRpi28XnGaRU3M4FqNCWfvIsFgjw45TbRSsW7I4iJ 0DP8YoxvKYYbhfMfsejpdJocZcPXvhrMXUMgcopkwyoIrdWjWK2CDhuclBUe3dEE GIu2djXW6ndG5gsKE/VzZa6tNG4YV8lr0Fx+Txl0B9wt9nLu/8kKPMK0wnVKCSv5 q22HDnu3qlpll5JBENCEMt5yGEf+0XMkYRdfHkn8us4lVXqrVyTuUP181/3krF5m TEoQOGdFFbKHD4RflwzhqICmFxzTjZiTJRld0MG9uzQoAaSayPDD9Ko/NiorqVF5 ZZxKjCy3WAoMHdD4Uos= =UAqe -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-other-regressions-in-cl-flet-indentation.patch Content-Description: Fix indentation regression >From 2e5f87b345d349dc6657f8034102a842d0685232 Mon Sep 17 00:00:00 2001 From: akater Date: Thu, 30 Sep 2021 13:37:59 +0000 Subject: [PATCH] Fix other regressions in cl-flet indentation * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Fix indentation regression introduced by 38037e04cb05cb1f2b604f0b1602d36b0bcf6985 (bug#9622), namely don't fail in unreadable (incl. unbalanced) sexps. --- lisp/emacs-lisp/lisp-mode.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index cd054801bc..57196dfec4 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1124,9 +1124,13 @@ defun lisp--local-defform-body-p (state) (when second-order-parent (save-excursion (goto-char (1+ second-order-parent)) - (and (memq (read (current-buffer)) - '( cl-flet cl-labels cl-macrolet cl-flet* - cl-symbol-macrolet)) + (and (when-let ((head (ignore-errors + ;; FIXME: This does not distinguish + ;; between reading nil and a read error. + ;; We don't care but still, better fix this. + (read (current-buffer))))) + (memq head '( cl-flet cl-labels cl-macrolet cl-flet* + cl-symbol-macrolet))) ;; Now we must check that we are ;; in the second element of the flet-like form. ;; It would be easier if `parse-partial-sexp' also recorded -- 2.32.0 --=-=-=--