Hi, Thanks for the comments! Nicolas Goaziou 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. >> + ;; TODO: Cleanup if quit. Unfortunately `cdlatex-environment' >> + ;; always return nil. > > What do you want to clean up? In what situations? Can't `unwind-protect' > help you? 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. > Anyway, why bother? Newlines is very hard to get right with cdlatex. Unintended newlines is a bug. 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? 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)) —Rasmus -- to err is human. To screw up 10⁶ times per second, you need a computer