[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: require-hard-newlines to use newline
From: |
Oliver Scholz |
Subject: |
Re: require-hard-newlines to use newline |
Date: |
Mon, 07 Mar 2005 11:45:42 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> Because, everywhere else in the buffer, the newline at the end of a
> paragraph is hard.
>
> That doesn't seem like a convincing reason.
>
> Now suppose the user goes to another buffer to do his editing, and comes
> back to this buffer a long time later. He does not remember the exact
> sequence of edits he performed on that buffer -- in particular, whether he
> typed RET or not. From moving point around, he observes that the buffer
> contains "some text" followed by a final newline.
>
> If he did not finish the paragraph, he will probably assume the
> newline is soft. If he did finish the paragraph, he will probably
> assume the newline is hard. Either way, he might be wrong.
>
> So I think that use-hard-newlines should inhibit the effect of
> require-final-newline. It is the only way to get reliable results.
Sorry if I missed something: as I understand it the problem arises
from the fact that `require-final-newline' will not only make sure
that the *file* ends with a newline, but will that newline add to the
*buffer*.
If I understand things correctly, the problem would go away, if
require-f-n would just add the newline when writing the file but not
to the buffer (a bit similar to a function in
`write-region-annotate-functions') . Then the user would only come to
see it, if she reverts the buffer; in this case it is longlines.el's
job to use its heuristics to detect whether the final newline is hard
or soft.
Oliver
--
17 Ventôse an 213 de la Révolution
Liberté, Egalité, Fraternité!