emacs-devel
[Top][All Lists]
Advanced

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

Re: Can this indentation be achieved with treesit-simple-indent-rules?


From: Nicolás Ojeda Bär
Subject: Re: Can this indentation be achieved with treesit-simple-indent-rules?
Date: Tue, 20 Jun 2023 18:16:52 +0200

On Tue, Jun 20, 2023 at 5:34 PM Dmitry Gutov <dmitry@gutov.dev> wrote:
>
> On 19/06/2023 22:11, Nicolás Ojeda Bär wrote:
> >      ((parent-is "b") parent-bol 0)
>
> Try 'parent' instead of 'parent-bol'.

Hello,

Thanks for the suggestion.

That would work in the "abstract" example because "a" is of width 1,
but would not work in general. You can see it clearly if we use "aaa",
"bbb" and "ccc" instead of "a", "b", "c": starting from the correctly
indented

aaa
  bbb
  ccc

if we put "bbb" in the same line as "aaa" we will get (using parent
instead of parent-bol)

aaa bbb
    ccc

but would like to get

aaa bbb
  ccc

In the concrete example in OCaml I mentioned in a previous reply, starting from

let x =
  match e with
  | Foo -> 0

if I put the "match" in the same line as the "let" (using parent
instead of parent-bol) I will get

let x = match e with
        | Foo -> 0

but would like to get instead

let x = match e with
  | Foo -> 0

Do let me know if anything is still unclear.

Cheers,
Nicolas



reply via email to

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