Rasmus <ras...@gmx.us> writes: > Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > >> I don't see how it is desirable. The logical behaviour is to split the >> line, unless, of course, docstring clearly specifies this. > > I don't feel strongly about it. Anyway, I like this better. Cdlatex is, > um, "opinionated" about is insertion of newlines.
I still think it is better to split line. Your behaviour just requires a C-e before calling the function. This is also simpler to implement, which is non negligible. > cdlatex-environment always return nil. I would have to analyze if > something got inserted "manually". IOW, I don't have the name of the > environment, and cdlatex-environment returns nil if I press C-g and if I > select and environment. I don't know how to distinguish the cases. If point moved, some text was inserted. > The attached patch works "as expected" at all locations marked with "|", > but not the one marked with "/" and "\", which lead to the next question. > | - i1 | i2 | > / - i3 | > \ > > I expect indentation at all points not at bol. > > At "\" (org-get-indentation) returns 2 even though I'm at bol. Why? `org-get-indentation' returns the column of the first non-blank character on the line. This has nothing to do with the point. > Regarding "/". In the following i2 is indented meaning that > (org-get-indentation) becomes 2. Is that a feature? > > (with-temp-buffer > (org-mode) > (insert "\n- i1\n- i2") > (beginning-of-line) > (org-return-indent) > (buffer-string)) Well, if you have (X being the point) - i1 - i2 X indenting like should give - i1 - i2 X so that is indeed correct. Regards, -- Nicolas Goaziou