From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Char code to Emacs string. Date: Wed, 01 Jun 2011 10:30:24 +0200 Message-ID: <87sjruhs2n.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1306917132 16272 80.91.229.12 (1 Jun 2011 08:32:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2011 08:32:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 01 10:32:08 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QRgqW-0008Ak-Bc for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jun 2011 10:32:08 +0200 Original-Received: from localhost ([::1]:47558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRgqV-0005kq-IU for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jun 2011 04:32:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRgp9-0005kY-3x for help-gnu-emacs@gnu.org; Wed, 01 Jun 2011 04:30:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRgp7-00084F-PV for help-gnu-emacs@gnu.org; Wed, 01 Jun 2011 04:30:43 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:40526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRgp6-00082x-Q5 for help-gnu-emacs@gnu.org; Wed, 01 Jun 2011 04:30:41 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QRgp4-0007RP-V3 for help-gnu-emacs@gnu.org; Wed, 01 Jun 2011 10:30:38 +0200 Original-Received: from 65.77.197.77.rev.sfr.net ([77.197.77.65]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Jun 2011 10:30:38 +0200 Original-Received: from thierry.volpiatto by 65.77.197.77.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Jun 2011 10:30:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 65.77.197.77.rev.sfr.net User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3.50 (gnu/linux) Cancel-Lock: sha1:h8zuvAe857F/ogVITGjzgb9i168= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81270 Archived-At: Oleksandr Gavenko writes: > This code not work because 'make-char' do not understand 'unicode' arg > (which intended to print chars with it unicode code): > > (let (i (start ?\x1B6) (end ?\x1B7C)) > (setq i start) > (while (<= i end) > (message "%s - %x" (make-char 'unicode i) i) > (setq i (+ 1 i)) > ) ) > > How I can get list of possible CHARSET for 'make-char' > and how this code must be fixed to work properly? You can use `string' instead of `make-char' #+BEGIN_SRC emacs-lisp (let ((start ?\x1B6) (end ?\x1B7C)) (while (<= start end) (message "%s - %x" (string start) start) (sit-for 0.2) (setq start (+ 1 start)))) #+END_SRC To store in a list:(maybe more useful) #+BEGIN_SRC emacs-lisp (let ((start ?\x1B6) (end ?\x1B7C) result) (while (<= start end) (push (cons (string start) start) result) (setq start (+ 1 start))) (nreverse result)) ;; => (("ƶ" . 438) ("Ʒ" . 439) ("Ƹ" . 440) ("ƹ" . 441)...) #+END_SRC -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997