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 11:41:26 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

address@hidden (Eli Zaretskii) writes:

> On 13 Feb 2002, Kim F. Storm wrote:
> 
> > > > 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.
> > 

I really don't understand why INSERTING a file (or another buffer)
into a buffer should change the coding system of the target buffer --
if the ONLY difference is in the EOL format of the inserted file.

In that case, the EOL format of the source file should simply be
ignored (i.e. converted to the EOL format of the target buffer)!

The exception may be if the target buffer is empty, in which case it
could inherit the EOL format from the inserted 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.
> 
> That would be too late for the r) option above.


> 
> Note that similar situations occur when the buffer's file encoding is 
> different from the encoding of the inserted text.  E.g., imagine a buffer 
> visiting a Latin-1 file into which you insert an ISO-2022 file.  In those 
> situations, too, asking the question after C-x i already inserted the 
> text is too late.  (I assume that any feature that asks the user should 
> handle the latter case as well, not be limited to the EOL format alone.)

I haven't look at the code (and I'm not really using the coding stuff
except for the EOL support), but are you saying that if I have a
Latin-1 buffer, and I insert an ISO-2022 file into it, emacs will
automatically convert all the Latin-1 stuff already in the buffer into
ISO-2022 ?

That MIGHT BE ok if all of Latin-1 can be represented in ISO-2022...

But what if I insert an Latin-9 file instead...  What happens to the
parts of Latin-1 file which cannot be represented in Latin-9 ?  In
that case, I would most likely prefer to keep my Latin-1 stuff, and not
being able to see the part of the Latin-9 file which does not fit into
Latin-1.

And what does yank do (at least I can see that it converts EOL to the
target buffer format)?

In any case, the documentation on insert-file-contents is a bit
vague on the consequences of mixing coding systems....

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



reply via email to

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