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: Arash Esbati
Subject: Re: Indenting the code written in square brackets as optional parameters
Date: Tue, 08 Mar 2022 15:05:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

>>>>>> Arash Esbati <arash@gnu.org> writes:
>> Can we use the same trick we use for the fontification of $, i.e., put a
>> closing ] as a comment in the same line?
>
> That didn't work as expected. :-( It seems that indentation command is
> smart enough to ignore "]" in comments.

Dammit, smart code 😉

> That can be an option. I think there are 3 (or more?) candidates:
> 1. New minor mode.
> 2. New user option.
> 3. Leave it as is.
>
> What do others think?

When in doubt, 3. is always a good choice.  But would it make sense to
have a user option and the actual code ignores that in math-mode and
only kicks in within regular text?  With that, one could define 2 macros
like this:

\DeclareTextSymbol{\textbracketleft}{T1}{`\[}
\DeclareTextSymbol{\textbracketright}{T1}{`\]}

and use them for unbalanced brackets.  WDYT?

Best, Arash



reply via email to

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