From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Re: Inadequate documentation of silly characters on screen. Date: Thu, 19 Nov 2009 21:43:29 +0200 Message-ID: <837htmqp0e.fsf@gnu.org> References: <20091118191258.GA2676@muc.de> <20091119082040.GA1720@muc.de> <874ooq8xay.fsf@wanchan.jasonrumney.net> <20091119141852.GC1720@muc.de> <20091119155848.GB1314@muc.de> Reply-To: Eli Zaretskii 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 1258659973 13702 80.91.229.12 (19 Nov 2009 19:46:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2009 19:46:13 +0000 (UTC) Cc: jasonr@gnu.org, schwab@linux-m68k.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 20:46:06 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 1NBCx6-0006nM-0C for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 20:46:00 +0100 Original-Received: from localhost ([127.0.0.1]:38758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBCx5-0004hw-J6 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2009 14:45:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBCum-0002fw-3d for emacs-devel@gnu.org; Thu, 19 Nov 2009 14:43:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBCuh-0002aM-9v for emacs-devel@gnu.org; Thu, 19 Nov 2009 14:43:35 -0500 Original-Received: from [199.232.76.173] (port=45866 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBCuh-0002aD-44 for emacs-devel@gnu.org; Thu, 19 Nov 2009 14:43:31 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:47447) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBCue-00038C-Ra; Thu, 19 Nov 2009 14:43:29 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0KTD00800FJJGT00@a-mtaout21.012.net.il>; Thu, 19 Nov 2009 21:43:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.37.193]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KTD006CFG49N690@a-mtaout21.012.net.il>; Thu, 19 Nov 2009 21:43:22 +0200 (IST) In-reply-to: <20091119155848.GB1314@muc.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:117286 Archived-At: > Date: Thu, 19 Nov 2009 15:58:48 +0000 > From: Alan Mackenzie > Cc: emacs-devel@gnu.org, Andreas Schwab , > =09Jason Rumney >=20 > > No: the string does not contain any characters, only bytes, becau= se it's > > a unibyte string. >=20 > I'm thinking from the lisp viewpoint. The string is a data structu= re > which contains characters. I really don't want to have to think ab= out > the difference between "chars" and "bytes" when I'm hacking lisp. = If I > do, then the abstraction "string" is broken. No, it isn't. Emacs supports unibyte strings and multibyte strings. The latter hold characters, but the former hold raw bytes. See "(elisp) Text Representations". > > The byte 241 can be inserted in multibyte strings and buffers bec= ause > > it is also a char of code 4194289 (which gets displayed as \361). >=20 > 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 awa= re > of. ;-) That's how Emacs 23 represents raw bytes in multibyte buffers and strings. > At this point, would you please just agree with me that when I do >=20 > (setq nl "\n") > (aset nl 0 ?=F1) > (insert nl) >=20 > , what should appear on the screen should be "=F1", NOT "\361"? No, I don't agree. If you want to get a human-readable text string, don't use aset; use string operations instead.