GNU bug report logs -
#31984
26.1; indent-sexp doesn't indent expressions starting with #
Previous Next
Reported by: Gemini Lasswell <gazally <at> runbox.com>
Date: Tue, 26 Jun 2018 19:44:01 UTC
Severity: minor
Tags: confirmed, fixed, patch
Found in versions 26.1, 26.1.50
Fixed in version 26.2
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #14 received at control <at> debbugs.gnu.org (full text, mbox):
retitle 31984 26.1; indent-sexp doesn't indent expressions starting with #
found 31984 26.1
tags 31984 + confirmed
quit
Gemini Lasswell <gazally <at> runbox.com> writes:
> When the result of evaluation in IELM is something with a printed
> representation beginning with #, such as a record or char-table,
> it is pretty-printed without indentation.
>
> To reproduce, M-x ielm RET and then evaluate this:
>
> (require 'cl-lib)
> (cl-defstruct (foo) a)
> (make-foo :a (lambda (x) (- 1 x)))
>
> Result:
>
> #s(foo :a
> (lambda
> (x)
> (- 1 x)))
Which is because pp-buffer doesn't indent this, which is because
indent-sexp doesn't indent it, which is because indent-sexp now relies
on forward-sexp to find the end, and forward-sexp only goes over the
"#s".
Another example:
With point before the (foo), Emacs 25 indent-sexp turns this
(foo) (blah
etc)
into this
(foo) (blah
etc)
Emacs 26 indent-sexp doesn't do anything from that position. It's less
clear which is correct in that case, but restoring to the Emacs 25
behaviour would fix the #s(...) case as well. Alternatively, we could
fix elisp sexp movement to handle such expressions, which we should
probably do anyway (see also Bug#15998).
This bug report was last modified 6 years and 296 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.