emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [patch] better(?) indention for cdlatex-environment


From: Nicolas Goaziou
Subject: Re: [O] [patch] better(?) indention for cdlatex-environment
Date: Wed, 18 Feb 2015 01:39:17 +0100

Rasmus <address@hidden> writes:

> Perhaps there are clever ways to figure it out.  I say there are too many
> dynamics and "fixes" in the code to get cdlatex-environment to work
> already.  Just consider this example where | is cursor
>
>    - foo | bar
>
> Midway through, when ENV is reinserted, but before indentation the
> end-marker will be *after* bar which is a line after \end{ENV}...

This is exactly what we want: indent (non empty) lines starting in
[BEG ; END[. Or am I missing something?

>> Also you shouldn't apply `org-indent-to-column' when line is empty.
>
> I don't see why not, but OK...

Because it introduces trailing white spaces, which can irritate some
users.

> Anyway it reminded me that I missed "re-implementing" one feature of
> cdlatex, namely moving the cursor to the right place. I refind this
> place do it by inserting a funny string and replacing it. A poor man's
> marker, I guess...

Another option: when ENV is inserted the first time, store (e.g., in N)
how many (forward-line -1) are needed to go back to BEG. At the end of
the process, move to BEG then (forward-line n). I assume point is always
left on an empty lines. If it is not the case, you also need to store
current column, relatively to end of line.

BTW, You didn't update the patch.

Regards,



reply via email to

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