[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35286: 26.2; indent-sexp broken
From: |
Noam Postavsky |
Subject: |
bug#35286: 26.2; indent-sexp broken |
Date: |
Mon, 15 Apr 2019 20:54:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Leo Liu <sdl.web@gmail.com> writes:
> On 2019-04-15 19:57 -0400, Noam Postavsky wrote:
>> I put that code there because Emacs 25 and earlier also indents more
>> than one sexps after point in some cases.
>
> I didn't know that. Are those cases obscure?
The minimal example would be (with point before "foo", the "xx)"
part gets indented too):
foo (bar
xx)
I'm not sure if anyone relies on that (I broke it in 26.1 and nobody
reported it). The main motivating example is
#s(foo
bar)
which is due to forward-sexp not handling #s correctly for Emacs Lisp
(it's treated as a separate sexp rather than as a whole record
expression).
>> The regression is that the Emacs 26 code gets confused by comments at
>> the end of line. Here's a patch for emacs-26 to fix this:
>
> Not just comments though it can be anything. For example, put the
> following in prolog-mode. Move point to the first `{' char and then M-x
> indent-sexp.
Hmm, I'm a bit confused here. I thought indent-sexp is only good for
Lisp-based languages. Do lisp-indent-calc-next/calculate-lisp-indent
give usable results for prolog or ruby??