From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Clean-up of forward-paragraph [Re: Beginingless paragraphs: second stab at a patch.] Date: Thu, 20 Oct 2005 00:54:27 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1129784748 24102 80.91.229.2 (20 Oct 2005 05:05:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2005 05:05:48 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 20 07:05:35 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ESSaM-0007Yx-Fl for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2005 07:03:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESSaL-0003L9-W2 for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2005 01:03:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ESSRm-0000Xg-Sk for emacs-devel@gnu.org; Thu, 20 Oct 2005 00:54:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ESSRj-0000W4-IW for emacs-devel@gnu.org; Thu, 20 Oct 2005 00:54:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ESSRi-0000VH-9U for emacs-devel@gnu.org; Thu, 20 Oct 2005 00:54:30 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ESSRi-0004bK-Ha for emacs-devel@gnu.org; Thu, 20 Oct 2005 00:54:30 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1ESSRf-0006Iz-VG; Thu, 20 Oct 2005 00:54:27 -0400 Original-To: Alan Mackenzie In-reply-to: (message from Alan Mackenzie on Wed, 19 Oct 2005 16:56:30 +0000 (GMT)) 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:44384 Archived-At: (i) When there is a left margin, sometimes forward paragraph moves to column zero, sometimes to after the margin. I think it should always move to after the margin if it can. (It can't when the line doesn't contain enough whitespace to constitute the margin.) I am not sure of that. We have to look at how this affects use of M-h C-w to move a paragraph, followed by doing M-} M-} M-} C-y to yank it back in between two other paragraphs. That is the crucial criterion for what these commands should do. So please try that in all the various cases you can think of, and try to design the behavior of paragraph starts so that it leads to desirable results in that usage. (ii) When `use-hard-newlines' is non-nil (i.e. Longlines Mode is enabled), forward-paragraph can spuriously recognise a line "in the middle of a paragraph" as a separator line when it "looks like" one. (This only shows itself with a non-blank separator line.) Sorry, I do not understand. (iii) When there is a non-nil fill-prefix, f-p uses it in place of paragraph-start when searching backwards, but not when searching forwards. Half of these cases is a bug. I am not sure either one of them is right. What is right is to implement the proper criterion--see the next issue. Incidentally: The Elisp manual is a bit unclear on the page "Paragraphs", where it says: When there is a fill prefix, then paragraphs are delimited by all lines which don't start with the fill prefix. This doesn't make clear (? clear enough) whether this scheme of terminating paragraphs is in addition to or in place of paragraph-s\(tart\|eparate\). I think one of the words "also" and "instead" should be inserted before "delimited". Which one? It should be "in addition". If the fill-prefix is followed by text that would normally separate or start paragraphs, that does separate or start paragraphs. Also, a line that doesn't start with the fill-prefix separates paragraphs. So this is three paragraphs if the fill prefix is "**********". **********Here is one paragraph **********in two lines. ********** **********Here is another paragraph. **********Here is a third paragraph **********in two lines. M-{ and M-} seem to work properly on that text; I see no bug. AAMOI (2): Having told people precisely how to set up paragraph-s\(tart\|eparate\), why does forward-paragraph then go to such lengths to correct incorrect settings: It removes spurious leading "^"s from these variables, and it combine the two into a regexp for searching, even though p-start should match anything that p-separate does. I think that is for compatibility with old code that used these variables when they had a different spec. Please leave this alone. It would make a bigger transient and we don't want that now. As a first step to fixing the bugs in forward-paragraph, I've cleaned up the code somewhat and added some comments (though some of these are prolix enough to need removing later on). The patch below is intended only to clean up the code without changing its function. Should I commit this patch? Not yet. Please consider the issues above, first.