GNU bug report logs -
#30891
26.0.91; indent of malformed lisp
Previous Next
Reported by: Noam Postavsky <npostavs <at> gmail.com>
Date: Wed, 21 Mar 2018 01:20:02 UTC
Severity: normal
Merged with 34722
Found in versions 26.0.91, 26.1
Fixed in version 26.2
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Noam Postavsky <npostavs <at> 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.
This bug report was last modified 6 years and 79 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.