emacs-devel
[Top][All Lists]
Advanced

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

Re: master b8062be 3/5: Remove some compat code from eudc-bob.el


From: Stefan Monnier
Subject: Re: master b8062be 3/5: Remove some compat code from eudc-bob.el
Date: Thu, 13 Aug 2020 13:43:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> No idea, but before removing that code we would have to find out why it
>> *doesn't* matter.
> It's quite clear that the code wants to put on disk the exact binary
> stream it received.

Yes, the intention is quite clear.  What is less clear is whether that
intention would be fulfilled in all possible cases if the code doesn't
set the file-coding-system to `binary`.

>> Yes, we do: unibyte buffers have no "internal representation of
>> characters" that can spill out.
> In unibyte buffers the coding-system doesn't matter.

Reality check:

    % /usr/bin/emacs -Q --batch --eval '(with-temp-file "foo.txt" 
(set-buffer-multibyte nil) (set-buffer-file-coding-system (quote dos)) (insert 
"a\nb\n"))' 
    % l foo.txt
    -rw-r--r-- 1 monnier monnier 6 aoĆ» 13 13:41 foo.txt
    %

the coding system *does* matter w.r.t EOL.

>> To me `binary` is *the* coding-system to use when you have bytes and
>> want to write them in a file (and same when you want to read the *bytes*
>> of a file into a buffer).
> For a unibyte buffer, it doesn't matter.

See above.

> For a multibyte buffer, it's dangerous.

So you say, but again: Do you know a less "dangerous" alternative?


        Stefan




reply via email to

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