From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Beginingless paragraphs Date: Tue, 30 Aug 2005 10:50:41 +0000 (GMT) Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1125399534 336 80.91.229.2 (30 Aug 2005 10:58:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2005 10:58:54 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 12:58:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EA3oJ-0004be-9s for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2005 12:57:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EA3sQ-0002ym-8u for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2005 07:02:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EA3nM-000196-77 for emacs-devel@gnu.org; Tue, 30 Aug 2005 06:56:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EA3nI-00016m-IL for emacs-devel@gnu.org; Tue, 30 Aug 2005 06:56:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EA3nI-0000tJ-Bf for emacs-devel@gnu.org; Tue, 30 Aug 2005 06:56:44 -0400 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EA3fh-0004xo-Oy for emacs-devel@gnu.org; Tue, 30 Aug 2005 06:48:54 -0400 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id KAA00426 for ; Tue, 30 Aug 2005 10:50:42 GMT X-Sender: root@acm.acm Original-To: emacs-devel@gnu.org 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:42498 Archived-At: Hi, Emacs! What is a "paragraph" in Emacs? I can't find a @dfn{paragraph} anywhere in the Emacs/Elisp manuals. I don't have the full CVS of Lispref, but grepping in the released version didn't produce any hits. There are definitions of the two paragraph regexps in the Elisp Manual: - Variable: paragraph-separate This is the regular expression for recognizing the beginning of a line that separates paragraphs. (If you change this, you may have to change `paragraph-start' also.) The default value is `"[ \t\f]*$"', which matches a line that consists entirely of spaces, tabs, and form feeds (after its left margin). - Variable: paragraph-start This is the regular expression for recognizing the beginning of a line that starts _or_ separates paragraphs. The default value is `"[ \t\n\f]"', which matches a line starting with a space, tab, newline, or form feed (after its left margin). . Then there is this evasive "definition" of paragraph in the Emacs manual (taken from text.texi V1.57): The precise definition of a paragraph boundary is controlled by the variables `paragraph-separate' and `paragraph-start'. The value of `paragraph-start' is a regexp that should match any line that either starts or separates paragraphs. The value of `paragraph-separate' is another regexp that should match only lines that separate paragraphs without being part of any paragraph (for example, blank lines). Lines that start a new paragraph and are contained in it must match only `paragraph-start', not `paragraph-separate'. Each regular expression must match at the left margin. For example, in Fundamental mode, `paragraph-start' is `"\f\\|[ \t]*$"', and `paragraph-separate' is `"[ \t\f]*$"'. I don't really want to know what _controls_ the definition of a paragraph boundary. I want that definition itself without having to resort to a kind of contorted reverse logic to get to it. And believe me, working through that logic is hard. Doing that gives this: A paragraph ends just before a line which matches paragraph-start (?or at EOB). A paragraph starts at a line which matches p-start, but _doesn't_ match p-separate (?or at BOB). What happens if these two regexps are the same (as they are by default in Text mode)? There cannot be any lines which start paragraphs, only lines which separate them. Beginningless paragraphs! This is absurd. Incidentally, what happens when a line matches p-start but not p-separate? Shouldn't ever happen, but it surely will. At this point, the Elisp programmer, reduced to tears, starts reading the source code to find out what a paragraph really is. Non-programmers (and there will be a fair number of them using Text mode) need to start experimenting with regexps. SURELY there should be a proper @dfn{paragraph} in the Emacs manual? I'm too confused to write one myself at the moment. "Like a circle in a spiral, Like a wheel within a wheel. Never starting, only ending On an ever-spinning reel. As the images unwind Like the paragraphs you find In the buffers of your mind." -- Alan Mackenzie (Munich, Germany)