[Top][All Lists]

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

Re: Changing of line format and undo

From: Lennart Borgman
Subject: Re: Changing of line format and undo
Date: Thu, 22 Jun 2006 00:45:39 +0200
User-agent: Thunderbird (Windows/20060516)

Stuart D. Herring wrote:
Lennart Borgman wrote:
Eli Zaretskii wrote:
If you mean "C-x RET f", then it doesn't really change anything.  It
just sets a buffer-local variable to some value.  So there's nothing
to undo.

That is an internal Emacs perpective. From a users point of view there
is truly a change. If you for example change the line endings the file
will be saved with this new line endings.


(add-hook 'local-write-file-functions 'erase-buffer)

also would change how files were written out.  Changing how Emacs works
(via variables like the coding systems, hooks, or outright rewriting
functions) is not within the scope of the undo mechanism, which is for
modifications to text, not Emacs.
I would say that the line endings is a border case. I would expect most users to look like it like changing the text (even if that is not what is done internally). However I realize it is a lot of work to fix this border case and it is perhaps not worth the trouble.
BTW should not changes of this kind also set the buffer to modified?

If and only if they should be undoable (which they shouldn't, IMHO).  It
would be very odd to have a buffer unmodified before and after an undo, or
to be marked modified with no way (via undo) to remove that marking.
My mistake. As David pointed out the buffer is marked modified if you change the line endings in a supported way. It is natural to make the buffer modified since perhaps it will not get saved otherwise. Unfortunately this change is not undoable and that is a bit confusing sometimes.

reply via email to

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