auctex
[Top][All Lists]
Advanced

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

Re: Indenting the code written in square brackets as optional parameters


From: Ikumi Keita
Subject: Re: Indenting the code written in square brackets as optional parameters
Date: Fri, 04 Mar 2022 17:47:21 +0900

Hi, may I call you निरंजन?

>>>>> निरंजन <hi.niranjan@protonmail.com> writes:
> I am having a code like the following in my mind:

> -----------------------
> \documentclass{article}
> \usepackage[%
>   Scale=1.5,%
>   Renderer=Harfbuzz%
> ]{fontspec}
> -----------------------

> Why not to support indentation of the code inside the square
> brackets? Currently it doesn't get indented. This support
> can be very useful for packages which have complicated
> optional parameters, like say, package `hyperref'. Or even
> better would be an example from package `forest'. See the
> following code which has nested square brackets:

> -----------------------
> \begin{forest}
> [a
>   [b
>     [c]
>   ]
> ]
> \end{forest}
> -----------------------

> Please let me know if this is possible. Feel free to point
> out the challenges or problem cases with this approach.

Thanks for your suggestion, I think it is useful. It seems that the
attached patch achieves what you want. Unless someone finds difficulties
with it, I can polish it and commit into the git repo.

Maybe I should modify `TeX-brace-count-line' instead of introducing a
new function `LaTeX-brace-count-line'. Currently I'm not sure which is
better.

Regards,
Ikumi Keita

Attachment: patch
Description: rough sketch of the idea


reply via email to

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