From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 58a3c54: Avoid using string-make-unibyte in select.el Date: Sun, 23 Jun 2019 23:48:39 -0400 Message-ID: References: <20190622083524.20617.42423@vcs0.savannah.gnu.org> <20190622083525.F1CA5209DE@vcs0.savannah.gnu.org> <838sttohx8.fsf@gnu.org> <834l4ho8wv.fsf@gnu.org> <83v9wwml7t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="62002"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 24 05:49:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfFzP-000FyT-9t for ged-emacs-devel@m.gmane.org; Mon, 24 Jun 2019 05:49:55 +0200 Original-Received: from localhost ([::1]:47816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfFzJ-0003ue-CO for ged-emacs-devel@m.gmane.org; Sun, 23 Jun 2019 23:49:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40939) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfFyS-0003uX-GJ for emacs-devel@gnu.org; Sun, 23 Jun 2019 23:48:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfFyR-0004Oj-F8 for emacs-devel@gnu.org; Sun, 23 Jun 2019 23:48:56 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12670) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hfFyP-0004GZ-R2; Sun, 23 Jun 2019 23:48:54 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 48D9344406D; Sun, 23 Jun 2019 23:48:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DBBCB444068; Sun, 23 Jun 2019 23:48:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1561348125; bh=o/3KrHU3RpOLA0Z0Hy/cOwHY1ODiHCPiMIZilEXdUto=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=M4MgN5QvrVfkbPgJapd2ZoNOkVw2WQo3E69WEsTxrTTjedKuGLxb+IMPj0uh2O4yf qxMnTBTqfdRQPDydrRifStAsxlsFSWkopHepzmZNENWpX79PXQuVpFjlbSV7Wrqcy2 dWlVeu5paC2h3ka+GnyFwipu7ipujp5IXyb4WjkrA8YSm4t4kvzhQJVkIpu5AjswbR pU/Mmo27UU2ccapP4J4+8VhkHK0+vO5zVgiQq04rcHgbpUQb6pVybKu/oMwIfSho6A 4bQgXQyx2DqNP+OaYUhdeqqWRxNbN+LMB/PiAGzi029U3eSyZKn/dg3oHdwwv0RSBb qsDt406jJ3shw== Original-Received: from alfajor (104-195-207-100.cpe.teksavvy.com [104.195.207.100]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8E50D120C1A; Sun, 23 Jun 2019 23:48:45 -0400 (EDT) In-Reply-To: <83v9wwml7t.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 23 Jun 2019 17:26:30 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.emacs.devel:238081 Archived-At: > (a) I wouldn't call anything related to string-to-unibyte "clear", > because the act of converting a string to unibyte is not well defined. > (b) Encoding text can also be defined as "converting between two > representations of a sequence of bytes". No, encoding and decoding change the bytes, whereas string-to preserves the bytes (just once represented as a unibyte string (which can never be anything else than a sequence of bytes) and the other as a sequence of chars (some of which stand for bytes)). A sequence of bytes can be represented in many different ways: - a unibyte string is the canonical way (because it can only do that, so when you receive such a thing you don't need to look for possible non-bytes in the sequence or for a non-proper sequence). - a vector of integers between 0 and 255. - a list of integers between 0 and 255. - a multibyte string with chars within the union of the ascii charset and the eight-bit charset. string-to lets you convert a given sequence of bytes between the first and the last. >> It's also code that clearly does the reverse of string-to-multibyte >> (whereas decode-doding-string doesn't do the reverse of >> encode-coding-string when it comes to `raw-text`). > I think decode-doding-string does do the reverse. No: decode-coding-string returns a unibyte string when called with `raw-text` or `binary`, contrary to string-to-multibyte. >> >> IOW coding-systems like `raw-text` make sense in places like the >> >> `coding:` tag or in buffer-file-coding-system, where we are forced to >> >> put some kind of coding-system and where it is hence handy to be able to >> >> use `raw-text-unix` to basically skip the en/decoding. >> >> But I find them confusing when passed as a constant to >> >> `en/decode-coding-string`. >> > It's the other way around here. >> I don't know what "other way around" means in this context. > It means that our preferences in this case are opposite. AFAIK using `raw-text` or `no-conversion` in auto-coding-alist or in `coding:` tags is not a matter of preference: you simply can't specify string-to-*byte in there. Stefan