From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode Subject: Re: Alinea filling (hanlding of explicit line-breaks) Date: Sat, 12 Mar 2011 22:59:00 -0500 Message-ID: References: <801v2cnizz.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299988754 20394 80.91.229.12 (13 Mar 2011 03:59:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2011 03:59:14 +0000 (UTC) Cc: emacs-devel@gnu.org, Org mode , Karl Berry To: Vincent =?iso-8859-1?Q?Bela=EFche?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 13 04:59:10 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PycST-0008Bf-CF for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2011 04:59:09 +0100 Original-Received: from localhost ([127.0.0.1]:44793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PycSS-0004Q4-Si for ged-emacs-devel@m.gmane.org; Sat, 12 Mar 2011 22:59:08 -0500 Original-Received: from [140.186.70.92] (port=54205 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PycSN-0004Pz-U7 for emacs-devel@gnu.org; Sat, 12 Mar 2011 22:59:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PycSM-0006qv-V4 for emacs-devel@gnu.org; Sat, 12 Mar 2011 22:59:03 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:58427 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PycSM-0006qo-Sa; Sat, 12 Mar 2011 22:59:02 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAJfPe03O+IG+/2dsb2JhbACmQ3i/SIViBIUrkCE X-IronPort-AV: E=Sophos;i="4.62,309,1297054800"; d="scan'208";a="96084248" Original-Received: from 206-248-129-190.dsl.teksavvy.com (HELO pastel.home) ([206.248.129.190]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 12 Mar 2011 22:59:01 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 0A39A58FE0; Sat, 12 Mar 2011 22:59:01 -0500 (EST) In-Reply-To: <801v2cnizz.fsf@gmail.com> ("Vincent =?iso-8859-1?Q?Bela=EFch?= =?iso-8859-1?Q?e=22's?= message of "Sat, 12 Mar 2011 22:09:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137180 gmane.emacs.orgmode:39300 Archived-At: >> Actually, no, because paragraph-separate would cause the whole line >> that ends with \\ to be treated as not being part of a paragraph, and >> paragraph-start wouldn't be appropriate either. Hence the "good" >> above :-( [...] > I have implemented the thing locally on my machine. It works well but > there is still something missing: the line containing the `\\' alinea > separtor is not filled. As you can see above, I'm not surprised. Just don't use paragraph-separate. What I'd do is to use a fill-forward-paragraph-function which calls forward-paragraph, then searches for a "\\\\\\\\$" between the start and end point, and if found adjust the end result accordingly. If/when you come up with this function, please submit for inclusion in tex-mode.el where it will come in handy as well. > So, after more thinking about it the problem is the following: the > fill-forward-paragraph has only one parameter which is the paragraph > number --- with n = 0 => current --- but for finding the paragraph > boundary we need *two* parameter > => 1st argument: paragraph number > => 2nd argument: whether we want to point at the beginning the > paragraph or to the end of the paragraph. AFAIK the sign of the argument gives you this information. > => maybe paragraph-separate could be a list of 3 items (REGEXP BEG END) > where REGEXP is the usual regexp matching the separator, and BEG and > END when non nil are function to go the the beginning of next or to > the end of previous assuming that the match data corresponds to a > match of REGEXP. This way would be really the most flexible. Could be, but once you're in fill-forward-paragraph-function, you can do it by hand with Elisp code, so it's not that important. If/when we have enough fill-forward-paragraph-functions we may revisit this opinion, but I don't think we have enough experience yet to make a good design. Stefan