all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Kenichi Handa <handa@gnu.org>, emacs-devel@gnu.org
Subject: Re: request to revert the chnage of revno 112925
Date: Wed, 19 Jun 2013 16:49:38 -0400	[thread overview]
Message-ID: <jwvy5a56dl2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <51C1D83E.7020501@cs.ucla.edu> (Paul Eggert's message of "Wed, 19 Jun 2013 09:11:42 -0700")

>> I'd like to find a better solution, but at first please
>> clarify the requirements.
> I assume these requirements should be the same for Elisp
> files as for other files that Emacs is asked to read;

No.  We're talking here about files which can/will be shared by
thousands of people who have very little in common in terms the kind of
locale/coding-system they use.  So it's important for the coding-system
to be decided independently from the locale.

This is not specific to Elisp, of course, it's true of most programming
languages, and indeed most of those used to specify that the code had to
be written in "pure ascii" for the code part and "anything compatible
with ascii" for the comments.  But nowadays, most programming languages
are shifting towards allowing non-ascii in the code part and this is
usually done by specifying an encoding such as utf-8.

IOW I consider it a bug to have an Elisp files that use non-utf-8
encoding without an explicit coding: cookie.

> If I edit a file that's undecided-xxx, and insert
> a character that can be encoded either as UTF-8 or
> as ISO-2022-JP say, the buffer becomes utf-8-xxx,
> right?

That depends on the locale.  Which is why I prefer the use of utf-8 for
ascii-only files.

>> * What to do with an invalid UTF-8 file.  Previously,
>> find-file detects a proper coding-system for such a file.
>> Now utf-8 is forced and any invalid UTF-8 byte sequences
>> are decoded as raw bytes.
> Surely this should be fixed: the file should be decoded
> properly, as before.

Yes, tho only as a temporary measure to give people time to fix their files.

> I suggest going back to the old behavior (that's the normal
> behavior for random files that Emacs edits, right?).

These are not random files.

> Elisp files normally don't contain null bytes;

Most don't, indeed.  But there's no reason why they shouldn't contain
a nul byte, e.g. embedded in a string.

> such files are not considered to be text files in the POSIXish world.

The POSIX world doesn't care too much about labeling files as
text-vs-binary except when it's really useful (e.g. to try and avoid
spewing crap in the output of grep).  Disallowing nul bytes in Elisp
files doesn't serve any such purpose, AFAICT, so I think the natural
POSIX behavior here would be to allow nul bytes.


        Stefan



  reply	other threads:[~2013-06-19 20:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-19 11:54 request to revert the chnage of revno 112925 Kenichi Handa
2013-06-19 12:59 ` Stefan Monnier
2013-06-19 15:35   ` Kenichi Handa
2013-06-19 16:11     ` Paul Eggert
2013-06-19 20:49       ` Stefan Monnier [this message]
2013-06-19 21:15         ` Paul Eggert
2013-06-20  2:09           ` Stefan Monnier
2013-06-21  5:25           ` Achim Gratz
2013-06-21  6:48             ` Stephen J. Turnbull
2013-06-19 16:54     ` Stefan Monnier
2013-06-22 12:36       ` Kenichi Handa
2013-06-22 12:46         ` Eli Zaretskii
2013-06-22 12:54           ` Juanma Barranquero
2013-06-22 15:26         ` Stefan Monnier
2013-06-29  3:50           ` request to revert the change " Kenichi Handa

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=jwvy5a56dl2.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=handa@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.