From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Re: Inadequate documentation of silly characters on screen. Date: Thu, 19 Nov 2009 15:02:22 -0500 Message-ID: References: <20091118191258.GA2676@muc.de> <20091119082040.GA1720@muc.de> <874ooq8xay.fsf@wanchan.jasonrumney.net> <20091119141852.GC1720@muc.de> <20091119155848.GB1314@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1258661024 17946 80.91.229.12 (19 Nov 2009 20:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 20:03:44 +0000 (UTC) Cc: emacs-devel@gnu.org, Andreas Schwab , Jason Rumney To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 21:03:36 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBDE7-0006uY-A7 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 21:03:35 +0100 Original-Received: from localhost ([127.0.0.1]:45608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBDE7-00025k-0f for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 15:03:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBDD6-0001UN-FA for emacs-devel@gnu.org; Thu, 19 Nov 2009 15:02:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBDD1-0001QU-Or for emacs-devel@gnu.org; Thu, 19 Nov 2009 15:02:31 -0500 Original-Received: from [199.232.76.173] (port=57999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBDD1-0001QP-FT for emacs-devel@gnu.org; Thu, 19 Nov 2009 15:02:27 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40924) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBDCy-0007Qq-Nu; Thu, 19 Nov 2009 15:02:25 -0500 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nAJK2Mc8025636; Thu, 19 Nov 2009 15:02:23 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id DF8D83A0FA; Thu, 19 Nov 2009 15:02:22 -0500 (EST) In-Reply-To: <20091119155848.GB1314@muc.de> (Alan Mackenzie's message of "Thu, 19 Nov 2009 15:58:48 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3410=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117292 Archived-At: >> No: the string does not contain any characters, only bytes, because it's >> a unibyte string. > I'm thinking from the lisp viewpoint. So am I. Lisp also manipulates bytes sometimes. What happens is that you're working mostly on a major mode, so you mostly never deal with processes and files, so basically your whole world is (or should be) multibyte and you never want to bump into a byte. > I really don't want to have to think about the difference between > "chars" and "bytes" when I'm hacking lisp. When you write code that gets an email message via a connection to an IMAP server, you have no choice but to care about the distinction between the sequence of bytes you receive and the sequence of chars&images you want to turn it into. That's true for any language, Elisp included. > If I do, then the abstraction "string" is broken. Not sure in which way. >> So it contains the byte 241, not the character =F1. > That is then a bug. I wrote "(aset nl 0 ?=F1)", not "(aset nl 0 241)". ?=F1 =3D 241 =3D #xf1 =3D #o361 There is absolutely no difference between the two expressions once they've been read: the reader turns ?=F1 into the integer 241. >> The byte 241 can be inserted in multibyte strings and buffers because >> it is also a char of code 4194289 (which gets displayed as \361). > Hang on a mo'! How can the byte 241 "be" a char of code 4194289? This > is some strange usage of the word "be" that I wasn't previously aware > of. ;-) Agreed. > At this point, would you please just agree with me that when I do > (setq nl "\n") > (aset nl 0 ?=F1) > (insert nl) > , what should appear on the screen should be "=F1", NOT "\361"? Thanks! I have already agreed. Stefan