unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 30891@debbugs.gnu.org
Subject: bug#30891: 26.0.91; indent of malformed lisp
Date: Wed, 21 Mar 2018 08:50:41 +0200	[thread overview]
Message-ID: <83d0zxly66.fsf@gnu.org> (raw)
In-Reply-To: <87y3imrzrs.fsf@gmail.com> (message from Noam Postavsky on Tue, 20 Mar 2018 21:19:35 -0400)

> From: Noam Postavsky <npostavs@gmail.com>
> 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.





  reply	other threads:[~2018-03-21  6:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21  1:19 bug#30891: 26.0.91; indent of malformed lisp Noam Postavsky
2018-03-21  6:50 ` Eli Zaretskii [this message]
2018-03-21 11:50   ` Noam Postavsky
2018-10-24 23:39   ` Noam Postavsky
2018-10-25 14:53     ` Eli Zaretskii
2018-10-25 22:04       ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d0zxly66.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30891@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).