On Mon, Feb 23, 2026 at 06:01 (+0100), Arash Esbati wrote:
> Jim <[email protected]> writes:
>
>> 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.)
>
> Thanks. I agree, the indentation is wrong. Consider this code:
>
> --8<---------------cut here---------------start------------->8---
> \starttext
>
> \def\mymac#1{
> /#1/ or anything else you want here
> }
>
> \def\mymac#1{
> /#1/ or anything else you want here
> }
>
> \def\yourmac#1#2{
> text
> }
>
> \stoptext
>
> %%% Local Variables:
> %%% mode: ConTeXt
> %%% TeX-master: t
> %%% ConTeXt-Mark-version: "IV"
> %%% End:
> --8<---------------cut here---------------end--------------->8---
>
> If you put the opening brace in the same line as \def, you get good
> results.
Quite true. I had noticed that, but didn't include it in my bug report.
> The indentation code in latex.el works as expected on how you
> put insert the braces, i.e.:
>
> --8<---------------cut here---------------start------------->8---
> \def\mymac#1
> {
> /#1/ or anything else you want here
> }
> --8<---------------cut here---------------end--------------->8---
>
> Do you want to try your examples in a file in LaTeX-mode?
My basic tests show LaTeX mode indents fine.
> I haven't checked, but I think this is part of the TODO in context.el:
>
> ;; 1. indentation still bad.
>
I had taken a very very very quick look at the indentation for LaTeX, but
didn't (yet, anyway) try adapting that to ConTeXt mode... there is a fair
bit of code there!
I do have a couple of lines of elisp that works-around this particular
problem with the ConTeXt indentation, but it falls more into the "quick
hack" category than the "elegant fix" category.
Pragmatically, I'll take "quick hack fix" over "horribly broken", but I
realize others may disagree. It would be nicer to have completely
well-written indenting code that Does The Right Thing.
If/when my copyright assignment comes through, I'll submit a patch for this
and see if you and/or any others with write permission are willing to
accept it (while waiting for a proper fix for ConTeXt indentation to
happen, whenever that might be).
Cheers.
Jim
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex