From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Emacs Lisp's future Date: Tue, 07 Oct 2014 18:52:18 +0200 Message-ID: <87iojvakl9.fsf@fencepost.gnu.org> References: <54193A70.9020901@member.fsf.org> <87d2ahm3nw.fsf@fencepost.gnu.org> <871tqneyvl.fsf@netris.org> <87d2a54t1m.fsf@yeeloong.lan> <83lhotme1e.fsf@gnu.org> <871tql17uw.fsf@yeeloong.lan> <838uktm9gw.fsf@gnu.org> <87ppe5rt5l.fsf@uwakimon.sk.tsukuba.ac.jp> <87d2a4arju.fsf@fencepost.gnu.org> <878ukrc2sr.fsf@fencepost.gnu.org> <87vbnvamut.fsf@fencepost.gnu.org> <87mw97alvn.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1412700779 11905 80.91.229.3 (7 Oct 2014 16:52:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2014 16:52:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 07 18:52:52 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XbY0I-0003Hw-Vg for ged-emacs-devel@m.gmane.org; Tue, 07 Oct 2014 18:52:51 +0200 Original-Received: from localhost ([::1]:59920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbY0I-0007KA-N3 for ged-emacs-devel@m.gmane.org; Tue, 07 Oct 2014 12:52:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbXzq-0006pf-A1 for emacs-devel@gnu.org; Tue, 07 Oct 2014 12:52:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbXzp-00012I-6r for emacs-devel@gnu.org; Tue, 07 Oct 2014 12:52:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbXzp-00012E-3c for emacs-devel@gnu.org; Tue, 07 Oct 2014 12:52:21 -0400 Original-Received: from localhost ([127.0.0.1]:51955 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbXzn-0000ZM-Cn; Tue, 07 Oct 2014 12:52:19 -0400 Original-Received: by lola (Postfix, from userid 1000) id BBDF9E0545; Tue, 7 Oct 2014 18:52:18 +0200 (CEST) In-Reply-To: (Andreas Schwab's message of "Tue, 07 Oct 2014 18:31:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175086 Archived-At: Andreas Schwab writes: > David Kastrup writes: > >> Andreas Schwab writes: >> >>> David Kastrup writes: >>> >>>> Andreas Schwab writes: >>>> >>>>> David Kastrup writes: >>>>> >>>>>> Andreas Schwab writes: >>>>>> >>>>>>> David Kastrup writes: >>>>>>> >>>>>>>> One problem with that is that quite often Emacs' choice of a coding >>>>>>>> system for a buffer is the result of heuristics rather than dependable >>>>>>>> information. Not making a fuzz might often be simplest. >>>>>>> >>>>>>> If you try to save a buffer Emacs will check whether all characters are >>>>>>> encodable, and complain (and ask) if they aren't. >>>>>> >>>>>> Sure, but a raw byte is trivially encodable since it is no character. >>>>> >>>>> This is a contradiction. It isn't a character, so it isn't encodable. >>>> >>>> The character representation of "raw byte" is trivially encodable since >>>> it represents a single byte in any encoding. >>> >>> No encoding (except raw-text) can encode characters from the eight-bit >>> charset. >> >> (encode-coding-string (string (decode-char 'eight-bit 128)) 'utf-8) >> => "\200" > > That's what you get if you *force* the coding system. It would appear that you are forcing your logic. "No encoding can ..." does not mean that. > But Emacs will still complain and ask if you try to save such a > buffer. (let ((coding-system-for-write 'utf-8-unix)) (with-temp-file "/tmp/bozo" (insert(encode-coding-string (string (decode-char 'eight-bit 128)) 'utf-8)))) od /tmp/bozo 0000000 000200 0000001 What you mean is that Emacs is asked to _select_ or to _verify_ a coding system (as is customary for interactive editing of a file) it will do so and get back to the user when necessary. But that is _quite_ different from Emacs being _incapable_ of encoding raw bytes to a file or a stream of a specified encoding. It means that when you are using an _application_ that is expected to deliver only decodable characters, then the _application_ will _ask_ before going ahead. But the _engine_ is perfectly capable of going through here. Once you confuse engine and application and state "Emacs should not be able to encode characters from the eight-bit set" rather than "the normal file saving operation defaulting to using buffer-file-coding-system for coding-system-for-write after verifying its suitability should ask before picking a value of coding-system-for-write that cause a file to be written that is not representable without raw bytes" you are proposing to cripple Emacs. Or GUILE. -- David Kastrup