emacs-devel
[Top][All Lists]
Advanced

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

Re: Clean-up of forward-paragraph [Re: Beginingless paragraphs: second s


From: Richard M. Stallman
Subject: Re: Clean-up of forward-paragraph [Re: Beginingless paragraphs: second stab at a patch.]
Date: Thu, 20 Oct 2005 00:54:27 -0400

    (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.




reply via email to

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