emacs-devel
[Top][All Lists]
Advanced

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

Re: save-buffer in tar-mode


From: Richard Stallman
Subject: Re: save-buffer in tar-mode
Date: Mon, 09 Feb 2004 04:39:31 -0500

    Yes.  tar-mode toggles enable-multibyte-characters on saving
    a file by set-buffer-multibyte and that function discards
    undo info.  To fix it, we must record this toggling in
    buffer-undo-list.

That is one way to fix it.  Another way would be to avoid changing
enable-multibyte-characters.  The reason for doing so is to control
how insert-buffer copies the text.  This suggests that the cleanest
approach is to define a new primitive that does exactly the kind of
copying that is desired.  I think that should be easy.

Would you like to fix it that way?

I agree that it would be cleaner if set-buffer-multibyte did not
destroy the undo list.  In principle it certainly ought to preserve
the undo list.  But I think that could be a lot of work, too much
to be worth the trouble.

However, the judgment that it was too much trouble was in Emacs 20 or
so.  Since then we have made substantial changes in how multibyte
encoding works.  Maybe now it is not so hard.  By all means think
about it.

I don't think that the planned new extension to undo-list format will
help.  That could be useful for recording the set-buffer-multibyte
operation, so that it can be undone.  However, the real problem is to
update the existing undo-list entries so that they still make sense.
The new kind of undo entry won't help with that.

Meanwhile, even if set-buffer-multibyte is fixed to correct the undo
list, the other solution (a new copy operation) would be a better way
to do this operation.






reply via email to

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