From mboxrd@z Thu Jan 1 00:00:00 1970 From: Federico Beffa Subject: Re: [PATCH] org.el: make org-paragraph-fill ignore \[...\] regions starting and ending a line Date: Sat, 9 Aug 2014 12:20:08 +0200 Message-ID: References: <87tx5mxfck.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG3kx-0005ra-9S for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 06:20:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XG3kw-0003uJ-9M for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 06:20:11 -0400 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:54356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG3kw-0003t6-19 for emacs-orgmode@gnu.org; Sat, 09 Aug 2014 06:20:10 -0400 Received: by mail-la0-f49.google.com with SMTP id hz20so5347117lab.22 for ; Sat, 09 Aug 2014 03:20:09 -0700 (PDT) In-Reply-To: <87tx5mxfck.fsf@nicolasgoaziou.fr> 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 , emacs-orgmode@gnu.org, Nicolas Goaziou >> without having to introduce the undesired Cons. The behavior is a >> follows: >> - if \[...\] is inline, behave as before. >> - if \[ is the first non space character of a line and the closing \] >> is the last non space character of a line (possibly spanning several >> lines), then do not fill this region of the paragraph. > > But then, you introduce a discrepancy between M-q results and Org > syntax. This is not optimal either. Would you mind elaborating on the discrepancy. I do not quite understand what do you mean. Doesn't the Org syntax "just" defines the result of parsing a buffer (like in most programming languages where indentation and line breaks are just to help people reading code)? > > Also, this will not be consistent anyway with \begin{...} ... \end{...} > markup, which is handled differently, unlike to LaTeX. Yes, I agree. But, given that we do not want to make \[...\] an `org-mode' environment for backward compatibility reasons, this appears to be the only alternative. Note that (as noted earlier) `latex-mode' behaves similarly: it does not fill parts of a paragraph where a line begins with \[ and ends with \]. The reason and goal is to achieve that a carefully typed long equation does not get scrambled by M-q because if it does it becomes difficult to read for humans. > >> Attached you find a patch with the proposed modification. I would >> greatly appreciate if you could consider it for inclusion in org-mode >> and provide feedback. > > Note that you should use master to provide patches. `org-fill-paragraph' > was modified recently. OK, will pull again. Regards, Federico