From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: A question about category name in ELisp Date: Sat, 05 Oct 2013 15:41:19 +0300 Message-ID: <83k3hr7uvk.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1380976920 8943 80.91.229.3 (5 Oct 2013 12:42:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Oct 2013 12:42:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 05 14:42:02 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1VSRBJ-0004CO-1k for geh-help-gnu-emacs@m.gmane.org; Sat, 05 Oct 2013 14:42:01 +0200 Original-Received: from localhost ([::1]:51777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSRBI-0008Bx-NZ for geh-help-gnu-emacs@m.gmane.org; Sat, 05 Oct 2013 08:42:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSRB0-0008Bm-RF for help-gnu-emacs@gnu.org; Sat, 05 Oct 2013 08:41:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSRAo-0005Db-KU for help-gnu-emacs@gnu.org; Sat, 05 Oct 2013 08:41:42 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:64384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSRAo-0005DP-Ch for help-gnu-emacs@gnu.org; Sat, 05 Oct 2013 08:41:30 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MU700D004GQAV00@a-mtaout21.012.net.il> for help-gnu-emacs@gnu.org; Sat, 05 Oct 2013 15:41:29 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MU700DW84L43BB0@a-mtaout21.012.net.il> for help-gnu-emacs@gnu.org; Sat, 05 Oct 2013 15:41:29 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:93856 Archived-At: > Date: Sat, 5 Oct 2013 18:43:27 +0800 > From: Xue Fuqiao >=20 > I have a question about category and category table. In (info > "(elisp) Categories"): >=20 > Each category has a name, which is an ASCII printing character = in > the range =E2=80=98 =E2=80=99 to =E2=80=98~=E2=80=99. You specif= y the name of a category when you > define it with =E2=80=98define-category=E2=80=99. > The category table is actually a char-table (*note Char-Tables:= :). > The element of the category table at index C is a "category set"= =E2=80=94a > bool-vector=E2=80=94that indicates which categories character C b= elongs to. > In this category set, if the element at index CAT is =E2=80=98t= =E2=80=99, that means > category CAT is a member of the set, and that character C belongs= to > category CAT. >=20 > >From the second paragraph, my impression about a category table is > something like this: >=20 > | | a | - | . | " | > |-----+-----+-----+-----+-----| > | bv1 | bv2 | bv3 | bv4 | bv5 | >=20 > (The first row contains the indices of the char-table (i.e., the > "index C" above), and the second row contains the elements at index > C1, C2, ... (i.e., it's a category set, which is a bool-vector.)) >=20 > As with all arrays, bool-vector indices start from 0, so CAT should= be > an integer. But according to my understanding, CAT is a category > name, which should be an ASCII printing character (instead of just = an > integer, from the first paragraph). Why? Am I missing something? You need to read about char-table, your assumption about its structur= e is wrong. In particular, a char-table is not a flat array, and it is indexed by characters, not by zero-based integers.