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: Sun, 06 Mar 2022 18:47:26 +0900

Hi all,

>>>>> 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.

>>>>> Tassilo Horn <tsdh@gnu.org> writes:
> I guess that's most probably the reason nobody tried indenting stuff in
> [...], yet.  And unbalanced brackets are quite common in variants of
> interval notation, e.g., the interval from 0 (inclusive) to 10
> (exclusive) is frequently written as [0,10) or [0,10[ so I guess one
> wouldn't want to have an effect on indentation at least in math context.

Ah, indeed. It would certainly be annoying in such cases that unwanted
indentation persists all along the way after that.

>>>>> निरंजन <hi.niranjan@protonmail.com> writes:
> Other suggestion(s):
> If these changes are dangerous for a lot of documents and
> mathematical writing; then maybe can we have a minor mode,
> like say, M-x LaTeX-indent-braces with these new settings
> and not make them default? OTOH if the problem-cases are
> trivial and rare, can we have the new settings enabled by
> default and a minor mode to turn then off?

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?

>> You don't have to clone git repository just to apply a
>> patch and test it. In the directory
>> ~/.emacs.d/elpa/auctex-13.0.14/, issue a command
>> patch -p1 < PATH_TO_PATCH_FILE
>> That will update latex.el, leaving the original file as
>> latex.el.orig.

> Ah! I didn't know this. Thanks. I will remember this. Is
> this done with git or some other program by the way? (I mean
> the patch command.)

Yes. At least I think so.

>> Try M-x byte-recompile-directory RET and specify
>> ~/.emacs.d/elpa/auctex-13.0.14/ as the target
>> directory. It will byte-compile latex.el and generates new
>> latex.elc there. After that, restart emacs. Then you can
>> taste updated behavior.

> Thanks for this Ikumi, but this produced the following
> message in my *Messages* buffer.

> --------8<-------------------------------------------8<--------
> Done (Total of 0 files compiled, 292 skipped in 2 directories)
> --------8<-------------------------------------------8<--------

Oh, sorry, did it? That is strange according to your previous message...
> Source file ‘~/.emacs.d/elpa/auctex-13.0.14/latex.el’ newer
> than byte-compiled file; using older file

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine



reply via email to

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