bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31984: 26.1.50; IELM doesn't indent results printed with #


From: Noam Postavsky
Subject: bug#31984: 26.1.50; IELM doesn't indent results printed with #
Date: Wed, 27 Jun 2018 22:01:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

retitle 31984 26.1; indent-sexp doesn't indent expressions starting with #
found 31984 26.1
tags 31984 + confirmed
quit

Gemini Lasswell <gazally@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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]