emacs-devel
[Top][All Lists]
Advanced

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

Re: require-hard-newlines to use newline


From: Chong Yidong
Subject: Re: require-hard-newlines to use newline
Date: Thu, 3 Mar 2005 17:32:26 -0500 (EST)
User-agent: SquirrelMail/1.4.4

> As I understand it, the newline that ends the last line in a paragraph
> is normally soft.  A hard newline would end the following blank line.
> The newline added by require-final-newline would be at the end of the
> last line in a paragraph, so it ought to be soft.

Both of the newline ends the last line in a paragraph, as well as the
newline on the following blank line, are hard. You can verify this for
yourself, but I can also illustrate it. First, recall that soft newlines
are equivalent to spaces, so fill-paragraph can delete a soft newline or
replace it with one or more spaces. Now if you have a paragraph

foo foo\n
bar bar\n
\N
foo bar\n
...

where \n denotes a soft newline and \N a hard newline, then it is refilled to

foo foo\n
bar bar\N
foo bar\n
...

whereas

foo foo\n
bar bar\N
\N
foo bar\n

can't be further refilled.

>     It is impossible to distinguish between a soft newline left at the end
>     of a line by require-final-newline, and a soft newline produced by,
>     e.g., a call to kill-line,
>
> I don't see how a call to kill-line can produce a newline.
> I don't understand you.

kill-line deletes up to and including the newline. Suppose the cursor is
at the indicated position:

foo-!-bar\n[EOB]

Calling kill-lines gives

foo-!-\n[EOB]

which, since soft newlines can be converted to spaces, is refilled to

foo-!-[EOB]

The soft newline at the end is gobbled up. That's the problem.




reply via email to

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