emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Beginingless paragraphs


From: Alan Mackenzie
Subject: Beginingless paragraphs
Date: Tue, 30 Aug 2005 10:50:41 +0000 (GMT)

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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]