Nicolas Goaziou writes: > I don't think you need `org-element-at-point' at all. You already have > BEG and END markers available. I didn't test it, but this should be > enough to indent the environment. 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}... I think playing the "deterministic" card is non-trivial to get right in all cases and org-cdlatex-environment-indent is already longer than cdlatex-environment. > Also you shouldn't apply `org-indent-to-column' when line is empty. I don't see why not, but OK... 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... —Rasmus -- I hear there's rumors on the, uh, Internets. . .