From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30891: 26.0.91; indent of malformed lisp Date: Wed, 21 Mar 2018 08:50:41 +0200 Message-ID: <83d0zxly66.fsf@gnu.org> References: <87y3imrzrs.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1521614951 4286 195.159.176.226 (21 Mar 2018 06:49:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Mar 2018 06:49:11 +0000 (UTC) Cc: 30891@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 21 07:49:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyXYX-0000vE-HE for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Mar 2018 07:49:05 +0100 Original-Received: from localhost ([::1]:53179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyXaZ-0005bu-5v for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Mar 2018 02:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyXaT-0005bo-Tu for bug-gnu-emacs@gnu.org; Wed, 21 Mar 2018 02:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyXaP-0004Xz-Vn for bug-gnu-emacs@gnu.org; Wed, 21 Mar 2018 02:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36873) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eyXaP-0004Xu-Ru for bug-gnu-emacs@gnu.org; Wed, 21 Mar 2018 02:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eyXaP-0002gr-KO for bug-gnu-emacs@gnu.org; Wed, 21 Mar 2018 02:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Mar 2018 06:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30891-submit@debbugs.gnu.org id=B30891.152161503910309 (code B ref 30891); Wed, 21 Mar 2018 06:51:01 +0000 Original-Received: (at 30891) by debbugs.gnu.org; 21 Mar 2018 06:50:39 +0000 Original-Received: from localhost ([127.0.0.1]:44770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyXa2-0002gD-MD for submit@debbugs.gnu.org; Wed, 21 Mar 2018 02:50:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eyXa0-0002g0-Nx for 30891@debbugs.gnu.org; Wed, 21 Mar 2018 02:50:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyXZr-0004Ia-Ai for 30891@debbugs.gnu.org; Wed, 21 Mar 2018 02:50:31 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyXZr-0004IT-6i; Wed, 21 Mar 2018 02:50:27 -0400 Original-Received: from [176.228.60.248] (port=1627 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eyXZq-0002em-Kl; Wed, 21 Mar 2018 02:50:27 -0400 In-reply-to: <87y3imrzrs.fsf@gmail.com> (message from Noam Postavsky on Tue, 20 Mar 2018 21:19:35 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144485 Archived-At: > From: Noam Postavsky > Date: Tue, 20 Mar 2018 21:19:35 -0400 > > I recently got a private report about a problem with the new lisp indent > functions: they don't work well when the buffer contains syntax errors. > For example, indent-region in a buffer containing: > > ) > (+ 2 > 3) > > gives > > Debugger entered--Lisp error: (wrong-type-argument consp nil) > lisp-indent-calc-next(#s(lisp-indent-state :stack (nil) :ppss (0 nil nil nil nil nil 0 nil nil nil nil) :ppss-point 146)) > lisp-indent-region(146 158) > indent-region(146 158 nil) > funcall-interactively(indent-region 146 158 nil) > call-interactively(indent-region nil nil) > command-execute(indent-region) > > The error can be fixed with the patch below, I think it's safe for > emacs-26. But, it still gives wrong indentation if you do indent-region > on the latter two lines. That could be fixed with > > (advice-add 'lisp-ppss :override > #'lisp-ppss-open-paren-in-column-0-is-defun-start) > > The lisp-ppss-open-paren-in-column-0-is-defun-start function is included > (but uncalled) in the patch. Using it in the override suggested above > will bring back Bug#27920 though. We could include the function and > suggest to use it (with the aforementioned caveat) in etc/NEWS or > PROBLEMS perhaps? I'd rather go back to the old code, and let the new Lisp indent functions mature on master. Alternatively, we could leave this problem alone and fix it later. But making all these changes at the 95th minute before Emacs 26 is released makes very little sense to me. Thanks.