From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch] better(?) indention for cdlatex-environment Date: Fri, 13 Feb 2015 23:10:00 +0100 Message-ID: <87fva9tqdj.fsf@nicolasgoaziou.fr> References: <87386e0zuy.fsf@gmx.us> <87wq3pwg29.fsf@nicolasgoaziou.fr> <87lhk48z9x.fsf@gmx.us> <87fvacw2jv.fsf@nicolasgoaziou.fr> <87mw4kyq2e.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMOPv-0003Rt-Qp for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:08:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMOPs-00046P-Km for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:08:55 -0500 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:43114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMOPs-00046F-Dw for emacs-orgmode@gnu.org; Fri, 13 Feb 2015 17:08:52 -0500 In-Reply-To: <87mw4kyq2e.fsf@gmx.us> (rasmus@gmx.us's message of "Thu, 12 Feb 2015 00:40:57 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: > 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. 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