emacs-devel
[Top][All Lists]
Advanced

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

Re: Thinking about changed buffers


From: Eli Zaretskii
Subject: Re: Thinking about changed buffers
Date: Mon, 28 Mar 2016 21:22:13 +0300

> From: Lars Magne Ingebrigtsen <address@hidden>
> Date: Mon, 28 Mar 2016 20:00:30 +0200
> Cc: address@hidden
> 
> Andreas Schwab <address@hidden> writes:
> 
> > You cannot just look at the decoded contents.  If the coding system is
> > changed the encoded contents will change even if the buffer contents
> > didn't.
> 
> I don't think that's correct.  Loading a file does (basically)
> 
> 1) put the bytes from the file into memory
> 2) decode them into internal representation

Decoding can change the bytes in memory.  For example, when a Latin-1
text is decoded, you end up with (2-byte) UTF-8 sequences for every
non-ASCII character in memory that was only one byte on disk.

> 3) (set-buffer-modified-p nil)

Yes, and if the user changes the encoding, then saves the buffer, the
file on disk will have different bytes.



reply via email to

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