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: Mon, 08 Nov 2021 06:38:03 +0000 Message-ID: <8735o79mpg.fsf@gmail.com> References: <504153FB-8633-4755-A91A-DF5DD64E6FAA@acm.org> <87lf3fntdx.fsf@gmail.com> <878rxz8n6b.fsf_-_@web.de> <875yt39nmk.fsf@gmail.com> <877ddj9moq.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="35691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 9622@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 08 07:50:49 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 1mjyUS-000998-SH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 07:50:48 +0100 Original-Received: from localhost ([::1]:40398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjyUQ-0005y1-W2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 01:50:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjyTl-0005xK-Pv for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 01:50:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjyTi-0002rG-JO for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 01:50:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mjyTi-0008Vl-Fp for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 01:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: akater Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Nov 2021 06:50: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.163635418332689 (code B ref 9622); Mon, 08 Nov 2021 06:50:02 +0000 Original-Received: (at 9622) by debbugs.gnu.org; 8 Nov 2021 06:49:43 +0000 Original-Received: from localhost ([127.0.0.1]:55847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjyTP-0008VB-A7 for submit@debbugs.gnu.org; Mon, 08 Nov 2021 01:49:43 -0500 Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:37561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjyTM-0008Uw-Ny for 9622@debbugs.gnu.org; Mon, 08 Nov 2021 01:49:41 -0500 Original-Received: by mail-ed1-f43.google.com with SMTP id f8so58475322edy.4 for <9622@debbugs.gnu.org>; Sun, 07 Nov 2021 22:49:40 -0800 (PST) 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=daEyGT+Y00HhD6qFBal4EgIZGmqriVTAj6O8RcpHZI4=; b=cf8F6nyH7VGqaXYhh2k/bJdLXNIk89bYCgdG7yLY/0+tm/2gaOW5E0fCYlCZENK9BH PuynDX4+KCZiVIP4eFUSmkI6BdvXJsIxJaJ/hrPO4AZBCDxwFscmLXFkkKEmBg3gnB6J qfA4tcxtsBM9NiBHqkBgNprtDVdDxRpdvuZdab9fEfCC1BtQMlbE0EQmljgQEGNlXm77 EiYngZeQolU59LNq7MOFTqmetVQwtqnbmpCwySjplocTS7TGkGUuw67RIqFJ7EQIZGE7 Qu77Dte0U7EACisz3f8c0k23nT2r2sZKvo2lTFFQntiFh6wsehmIKKRZPX4tAKCkRZAs uNCQ== 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=daEyGT+Y00HhD6qFBal4EgIZGmqriVTAj6O8RcpHZI4=; b=WAewFft66mu47znQsDsx+nb94K5xGuf50H3wVCLxn5VXEDrmvkc9udzrArdHK54hO4 KpwgBKfPeYkB6Of1IX4MXhstDY8umtJfZLh9zlIPURPWK4aaRGUn/LowykC0vILYPDBa /KPbldebQPppq2N19v7hspKZ24vQHfM2JKRBBm2C5GPGJlQGdqBHNTlLh6Veg5y6I6+Y oryK9ixDSMCZ30V+8Kla6sd/VnhXHaa1Ywl9KnUcR80/iO0GnJDDFvzMe1CLCZVf63lP ffALDRdehI/x33msq85q7ud0371Rm/vCUOlzhUVYMwR5gOewfulOcMGNzZ9YTmhZcSUX DvLw== X-Gm-Message-State: AOAM532s9AlxuS8wKw628zBK8BSlrCCSU3B7BzJ+gAH9kHpL9Vx0JnxD vMMOuV0RTyzYFhDnPoRB+1Y= X-Google-Smtp-Source: ABdhPJxyrLTi2PWGVn/n2wPmYBLMroq80i7vG+UiZb7NaWvg8G07PfPjIPRj702LMudphicx3BWtBw== X-Received: by 2002:a17:906:144c:: with SMTP id q12mr43834113ejc.72.1636354174800; Sun, 07 Nov 2021 22:49:34 -0800 (PST) Original-Received: from localhost (tor-exit1.dustin.in. [37.48.74.28]) by smtp.googlemail.com with ESMTPSA id y6sm9000489edc.17.2021.11.07.22.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 22:49:34 -0800 (PST) In-Reply-To: <877ddj9moq.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:219329 Archived-At: --=-=-= Content-Type: text/plain Sorry: even though half of the tests pass, I did not preserve one check with the last patch and it better be preserved just to be safe: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-lisp-emacs-lisp-lisp-mode.el-Fix-parser-state-corrup.patch Content-Transfer-Encoding: quoted-printable Content-Description: Fix flet indntation >From 2f35789d67115ccd7288ce0b759d6b52c08dde4c Mon Sep 17 00:00:00 2001 From: akater Date: Mon, 8 Nov 2021 04:48:13 +0000 Subject: [PATCH] ; * lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption. * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Preserve the point * test/lisp/progmodes/elisp-mode-resources/flet.erts: Add corresponding test example --- lisp/emacs-lisp/lisp-mode.el | 13 +++++++------ test/lisp/progmodes/elisp-mode-resources/flet.erts | 10 ++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 15afdef0252..d90d0f5f6ac 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1148,12 +1148,13 @@ defun lisp--local-defform-body-p (state) ;; that starts a sexp. t) (point)))))) - (ignore-errors - ;; We rely on `backward-up-list' working - ;; even when sexp is incomplete =E2=80=9Cto the right=E2= =80=9D. - (backward-up-list 2) - t) - (=3D local-definitions-starting-point (point)))))))) + (save-excursion + (when (ignore-errors + ;; We rely on `backward-up-list' working + ;; even when sexp is incomplete =E2=80=9Cto the r= ight=E2=80=9D. + (backward-up-list 2) + t) + (=3D local-definitions-starting-point (point)))))))))) =20 (defun lisp-indent-function (indent-point state) "This function is the normal value of the variable `lisp-indent-function= '. diff --git a/test/lisp/progmodes/elisp-mode-resources/flet.erts b/test/lisp= /progmodes/elisp-mode-resources/flet.erts index 7c4a0f304e9..da3dcb6ec3e 100644 --- a/test/lisp/progmodes/elisp-mode-resources/flet.erts +++ b/test/lisp/progmodes/elisp-mode-resources/flet.erts @@ -221,6 +221,16 @@ Name: flet15 i))) =3D-=3D-=3D =20 +Name: flet16 + +=3D-=3D +(cl-flet ((f (x) + (g x))) + (pcase e + ((dangerous-expression) + (form)))) +=3D-=3D-=3D + Name: flet-indentation-incomplete-sexp-no-side-effects-1 Code: (lambda () (emacs-lisp-mode) (setq indent-tabs-mode nil) (newline ni= l t)) Point-Char: | --=20 2.32.0 --=-=-=--