emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 21 Jun 2006 18:47:27 +0200
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

David Kastrup wrote:
Lennart Borgman <address@hidden> writes:

David Kastrup wrote:
Lennart Borgman <address@hidden> writes:

Eli Zaretskii wrote:
Date: Wed, 21 Jun 2006 00:15:17 +0200
From: Lennart Borgman <address@hidden>

If you change line endings this change is not saved to undo. Is
this the expected behaviour?
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.

BTW should not changes of this kind also set the buffer to modified?
What makes you think they don't?

Test this for example:

   (defun test-set-eol()
     (interactive)
     (let* ((coding buffer-file-coding-system)
            (new-coding (coding-system-change-eol-conversion coding 2)))
       (setq buffer-file-coding-system new-coding)))

Very funny.  setq most certainly does not trigger effects like a
changed buffer modification flag.  But setq is not a user-level
command.  Here is one that is:
Thanks, you are right ;-) Now I see what Eli meant. I still believe that everything that can result in changing an external file should go into the undo history but this is really a corner case of course.




reply via email to

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