help-gnu-emacs
[Top][All Lists]
Advanced

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

forward-paragraph, paragraph-start trouble


From: John J Foerch
Subject: forward-paragraph, paragraph-start trouble
Date: Sat, 05 Apr 2008 19:20:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Hello,

I am writing a major mode for a particular flavor of plain text file.  I
am having trouble coercing `forward-paragraph' to recognize the
paragraph style.  Here is some example text:

==begin example==

    This is the first paragraph.  It is
totally awesome.
    This is the second paragraph.  forward-paragraph
won't normally treat this one as a separate paragraph.

    But the real difficulty is when
    there is a paragraph like this.
    To find out whether a given line
    is a start-paragraph, you have
    to be able to look at the previous
    line to compare the amount of
    indentation.
        Crazy though it may seem,
    this sentence begins a new
    paragraph.

    This sentence, though formatted
    a bit strangely, should also be
treated as a single paragraph.

==end example==


`forward-paragraph' uses two regular expressions, `paragraph-start' and
`paragraph-separate' to find paragraphs.  I simply need to be able to
say that a line with more identation than the previous line is a
paragraph-start.  However, since emacs regular expressions lack
look-behind assertions, I am under the impression that what I want to do
is impossible.

Any advice?

Thank you,
John Foerch





reply via email to

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