all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master b8062be 3/5: Remove some compat code from eudc-bob.el
Date: Thu, 13 Aug 2020 13:43:55 -0400	[thread overview]
Message-ID: <jwvv9hmh2db.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83364qmr7f.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 13 Aug 2020 19:43:48 +0300")

>> 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	other threads:[~2020-08-13 17:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200812175454.4839.92908@vcs0.savannah.gnu.org>
     [not found] ` <20200812175456.C5D122172E@vcs0.savannah.gnu.org>
2020-08-12 17:56   ` master b8062be 3/5: Remove some compat code from eudc-bob.el Lars Ingebrigtsen
2020-08-12 18:15     ` Stefan Monnier
2020-08-13  8:08       ` Lars Ingebrigtsen
2020-08-13 13:14         ` Eli Zaretskii
2020-08-13 13:58           ` Stefan Monnier
2020-08-13 14:14             ` Eli Zaretskii
2020-08-13 14:23               ` Stefan Monnier
2020-08-13 16:43                 ` Eli Zaretskii
2020-08-13 17:43                   ` Stefan Monnier [this message]
2020-08-13 18:25                     ` Eli Zaretskii
2020-08-13 19:02                       ` Stefan Monnier
2020-08-13 19:06                         ` Eli Zaretskii
2020-08-13 19:54                           ` Stefan Monnier
2020-08-14  6:05                             ` Eli Zaretskii
2020-08-14  9:54                               ` Lars Ingebrigtsen
2020-08-14 10:35                                 ` Eli Zaretskii
2020-08-14 11:03                                   ` Eli Zaretskii
2020-08-15  9:53                                     ` Lars Ingebrigtsen
2020-08-15 12:56                                       ` Stefan Monnier
2020-08-15 15:10                                       ` Eli Zaretskii
2020-08-16 11:17                                         ` Lars Ingebrigtsen
2020-08-16 14:41                                           ` Eli Zaretskii
2020-08-17  8:32                                             ` Lars Ingebrigtsen
2020-08-17 13:15                                               ` Stefan Monnier
2020-08-18 14:56                                                 ` Lars Ingebrigtsen
2020-08-18 15:08                                                   ` Eli Zaretskii
2020-08-18 17:02                                                   ` Stefan Monnier
2020-08-19 10:20                                                     ` Lars Ingebrigtsen
2020-08-17 14:17                                               ` Eli Zaretskii
2020-08-13 13:33         ` Stefan Monnier
2020-08-15 21:19         ` Stefan Monnier
2020-08-15 21:27           ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvv9hmh2db.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.