auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a brace-based indenting patch


From: Sašo Živanović
Subject: Re: a brace-based indenting patch
Date: Tue, 8 Mar 2022 14:50:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2

Hi Tassilo & all!

Tassilo Horn je 8. 03. 22 ob 14:00 napisal:
Sašo Živanović <saso.zivanovic@guest.arnes.si> writes:

Hi Sašo,

Sorry for bothering the mailing list with this, but I'm new at
Savannah and I'm not sure how to propose a patch.

That's exactly the right way. :-)
Great!

I have generalized the brace-based indenting to support arbitrary
delimiters (like "[]" or "()"). I have been using this for a while
myself, and it has recently been asked for at TeX.SE
(https://tex.stackexchange.com/q/635747/16819), for indentation of
Forest trees (something I care about, as I'm the author of Forest).

Have you seen the thread starting with the below message on the auctex
users list?

   https://lists.gnu.org/archive/html/auctex/2022-03/msg00004.html
Sorry, I haven't --- otherwise I'd have posted my message as a reply there ...

Especially, how does your patch work in the presence of valid interval
notation like [1,10[ or [1,10)?  Will that break indentation for the
remainder of the whole document?
For [1,10[  yes it will break it
but closing braces in the comment can prevent that:
[1,10[%]]

For [1,10) no, this will not break the indentation, because the patch does not distinguish between different opening and closing delimiters. (I'm fine with that myself, because I've got show-paren-mode to point out any mistakes I make.)

In निरंजन's thread, Arash mentiones deliminers prefixed by a backslash. That works as expected, this is the indentation produced by the patched code:
-------
Text {%
  this is indented and we trust that a closing \( will
  come.%
}
Text {%
  this is indented and we trust that a closing \) will
  come.%
}
-------
(Note that \[ and \], being a LaTeX display environment, already increase/decrease the indent anyways.)


All this said, I realize that not everybody would want indentation based on [] () etc. so the patch actually adds two custom variables to set the desired opening and closing delimiters, and they default to { and }, as not to change the default behaviour.


I kindly ask you to let me know how I can make a contribution to the
project.

Submitting a patch to auctex-devel is the right way.  And in order to
commit your patch to our repository (which one of the maintainers will
do), you'd need to assign copyright to the FSF.  (I or some other
maintainer will send you the form for starting that process then.)
Gladly!

Best,
Sašo


Bye,
Tassilo




reply via email to

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