Re: insert-file-contents and format-decode

From:

Richard Stallman

Subject:

Re: insert-file-contents and format-decode

Date:

Tue, 26 Jun 2007 18:48:26 -0400

> If you run format-decode not as part of
> insertion, I think it should record undo info. When it is called from
> `insert-file-contents', that command should arrange just one undo
> entry, for the inserted file contents as finally decoded.
In general `format-decode' should be run only by `insert-file-contents'
and functions like `format-decode-region' and `format-decode-buffer',
that is, functions in format.el.
Right. And these functions should record undo information normally,
except when called from within `insert-file-contents'.
> Would you like to try this?
We'd have to distinguish the calls of `format-decode' by
(1) `insert-file-contents' with `visit-flag' t
In this case, format decoding should make no undo information, just as
inserting the visited file contents makes no undo information. A
newly visited file starts out with no undo information.
(2) `insert-file-contents' with `visit-flag' nil
This is the case where it is desirable to make just one undo entry for
the file contents as finally decoded.
(3) functions within format.el (and maybe other functions)
For this case, they should do nothing special about undo.
The primitives they call should make undo entries normally.