auctex-devel
[Top][All Lists]

## Re: [AUCTeX-devel] indenting split long command lines

 From: Julien Cubizolles Subject: Re: [AUCTeX-devel] indenting split long command lines Date: Tue, 09 Apr 2013 22:54:05 +0200 User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Tassilo Horn <address@hidden> writes:

>
>> As far as I know, AucTeX doesn't deal with pstricks in tikz code in
>> any special way. Very often in this environments one needs very long
>> lines, and some kind of splitting/indenting would be useful. What I
>> would like is something like:
>>
>> \begin{tikzpicture}
>>    \draw (0,0) -- (1,1) -- (2,2) -- (3,3)
>>          -- (4,4) -- (5,5);
>> \end{tikzpicture}

> You can define custom indentation functions on a per-environment basis.
> See (info "(auctex)Indenting").

I knew of this configuration possibilities but I still looking for the
right function to use/code for indenting.

> I think you can use indent-rigidly' with a negative prefix arg.

Actually, indent-relative would be even better it seems. I think the
way to do it would be, without using AucTeX indenting:
* newline-and-indent followed by indent-relative to split a long line
starting by \draw or any other command with a backlash, storing
the value of the column where the beginning backlash is
* newline-and-indent for the next splits for lines not ending with a
semicolon
* indent back to the value stored after a newline following a semicolon

I'm not sure how i would go about coding this, my lisp skills are
definitely not up to it.

Julien.

`