On Sun, Feb 22, 2026 at 20:30 (+0100), Arash Esbati wrote:
> Jim <[email protected]> writes:
>> If you define a macro without arguments, as follows
>> \def\mymac
>> {
>> ... whatever ...
>> }
>> and hit TAB when dot is in the open-brace line, all is good: the open
>> brace stays aligned with the '\' of '\def'. (Or, if '\def' is indented,
>> then TAB will align the '{' with the '\' of '\def'.)
>> But if you have one or more arguments, like
>> \def\mymac#1#2#3
>> or
>> \def\mymac[#1]
>> then the open brace is indented so that it is aligned with the first char
>> following the macro name; '#' or '[', respectively, in these examples.
> Can you please show a complete example incl. the major mode you're
> using? I can't reproduce the above. Thanks.
Arash (et al)
Oops, sorry, ConTeXt mode. Mea culpa!
More complete example: enter
\def\mymac#1
{
/#1/ or anything else you want here
}
And then go to the '{' line. Hit the tab key.
Now you have
\def\mymac#1
{
/#1/ or anything else you want here
}
The open brace really doesn't want to be out there, IMHO. (And I haven't
seen any plain TeX or ConTeXt code indented like that. Don't know about
LaTeX.)
Even for someone who thinks that indenting the brace all the way over there
is The Right Thing To Do, moving down a line, typing tab, and down one more
line and typing tab, the close brace aligns with the open brace, like this:
\def\mymac#1
{
/#1/ or anything else you want here
}
and now the indentation code will want to indent following lines that much
(10 spaces in this example), and you could end up with this:
\def\mymac#1
{
/#1/ or anything else you want here
}
\def\yourmac
{
text
}
or, worse yet,
\def\mymac#1
{
/#1/ or anything else you want here
}
\def\yourmac#1#2
{
text
}
And on it goes.
I hope that makes the problem clearer.
Jim
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex