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: Wed, 16 Mar 2022 17:59:04 +0900

Hi all,

>>>>> Ikumi Keita <ikumi@ikumi.que.jp> writes:
>>>>> Sašo Živanović <saso.zivanovic@guest.arnes.si> writes:
>> Summing up: while I find []-indenting indispensable for Forest trees,
>> and TikZ in general, I would definitely want to have an way to
>> override it for specific cases, and counting stuff in comments seems
>> the simplest way to implement the override.

>> On the other hand, I have a hard time imagining a situation where I
>> would want to override a {}-based indent via a comment, so I would say 
>> that the AuCTeX's current behaviour to ignore these in comments makes
>> perfect sense and should be kept (even without the historical
>> reasons). So I would propose that the extended indenting mechanism
>> would ignore {} in comments but count all other delimiters.

> That seems reasonable direction: In comments, ignore {} while count []
> (and other symbols?).
> And it seems that AUCTeX should consider to indent inside [] only
> optionally; by default it should indent inside {} only.

I think the attached patch works as expected. My approach is to include
only additional delimiters in new user options, since braces "{" and "}"
should always be considered to pull in indentation.

To try indent inside square brackets, include
(setq TeX-indent-open-delimiters "[")
(setq TeX-indent-close-delimiters "]")
somewhere in your init.el.

If this proposal is acceptable, I can commit it the git repo and I'd
appreciate if someone could write suitable paragraphs to include in
.texi documentation ;-) .

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine

Attachment: 0001-Enable-indent-by-square-bracket.patch
Description: tentative patch


reply via email to

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