bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: I'm sorry that I tried to insert a DOS file


From: Kim F. Storm
Subject: Re: I'm sorry that I tried to insert a DOS file
Date: 13 Feb 2002 10:51:30 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

address@hidden (Eli Zaretskii) writes:

> On 13 Feb 2002, Dan Jacobson wrote:
> 
> > I edit a buffer, I insert a file [C-x i] that is a CR-LF file.  The
> > words "(DOS)" appear in the modeline.  I undo the insert-file step.
> > The (DOS) remains in the modeline
> 
> Undo only undoes buffer changes, and setting the buffer's file coding 
> system doesn't count as a change of the buffer's contents, and isn't 
> recorded in the undo history.  Perhaps it should.

Since changing the coding system changes the modified status of the
buffer (and changes the format in which the file is saved), it
definitely makes sense to record the change in the undo history (both
when it is done automatically, and when done by the user via C-x C-m f).

> 
> > A more pleasant situation would be: I insert the file and I get asked
> > if I want s) strip the DOS jazz; p) poison the whole original buffer
> > with DOS jazz; r) treat me rawly, with ^M before my eyes; etc.
> 
> I think this would be hard to implement, since detection of the EOL 
> format is done at the same time as the file is read and inserted into the 
> buffer.

But maybe it could delay the actual change in the coding system until
it has finished inserting the text, display the buffer using the
current coding system (which may of course look really messy) - and
then ask the user whether he wants to change the coding system of the
buffer or keep what he sees.

-- 
Kim F. Storm  http://www.cua.dk



reply via email to

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