From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.help Subject: Re: A question about category name in ELisp Date: Sun, 6 Oct 2013 12:04:25 +0800 Message-ID: References: <83k3hr7uvk.fsf@gnu.org> 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 1381032273 11850 80.91.229.3 (6 Oct 2013 04:04:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Oct 2013 04:04:33 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 06 06:04:38 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 1VSfa9-0001mU-Qq for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Oct 2013 06:04:37 +0200 Original-Received: from localhost ([::1]:53762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSfa9-0007lW-E3 for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Oct 2013 00:04:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSfZz-0007ka-6g for help-gnu-emacs@gnu.org; Sun, 06 Oct 2013 00:04:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSfZy-0001xM-6X for help-gnu-emacs@gnu.org; Sun, 06 Oct 2013 00:04:27 -0400 Original-Received: from mail-ie0-x22b.google.com ([2607:f8b0:4001:c03::22b]:48721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSfZy-0001xH-0Z for help-gnu-emacs@gnu.org; Sun, 06 Oct 2013 00:04:26 -0400 Original-Received: by mail-ie0-f171.google.com with SMTP id at1so13086868iec.30 for ; Sat, 05 Oct 2013 21:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=XIUUs8hQTPQUsUVRx2ANU/Pe+yClpoWrMQqL3E2DxPI=; b=RMWu7h+ilINlEzBJrEK1q/B6G8EKlQ4H7k5iE+y3MtqlR+ssX8T+GbnTCaZndxEW32 mdkVTC1OoQ35M2BmNFmKCClDK9vQw7VTt1eyz9i/ZYF/uHX/skWh9d658yPktSbet3gh p5KUPLiIwWen8SbvrZPqRNoyKojD06PNDlrwi7Dakm8wvLsge1DugBXcbQwwBNHbPdBN +xWKZQQZLwXtM39sINTbBMKMB06nSXLC6H8PGT1N3+hHLm02kII6xLb6NbtNfyK19PWU UHwB/Scoti135WruPLG9k5pYcbM1a1fhalvqMinAUNKGRa+8oq24N2HrsdCsfvJM8a0v t3qA== X-Received: by 10.50.6.106 with SMTP id z10mr12190783igz.9.1381032265321; Sat, 05 Oct 2013 21:04:25 -0700 (PDT) Original-Received: by 10.42.133.72 with HTTP; Sat, 5 Oct 2013 21:04:25 -0700 (PDT) In-Reply-To: <83k3hr7uvk.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22b 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:93859 Archived-At: On Sat, Oct 5, 2013 at 8:41 PM, Eli Zaretskii wrote: >> Date: Sat, 5 Oct 2013 18:43:27 +0800 >> From: Xue Fuqiao >> >> I have a question about category and category table. In (info >> "(elisp) Categories"): >> >> 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 specify 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 belong= s 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. >> >> >From the second paragraph, my impression about a category table is >> something like this: >> >> | | a | - | . | " | >> |-----+-----+-----+-----+-----| >> | bv1 | bv2 | bv3 | bv4 | bv5 | >> >> (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.)) >> >> 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 structure > is wrong. In particular, a char-table is not a flat array, and it is > indexed by characters, not by zero-based integers. Thanks, but IIUC I think bool-vector (the "category set") is not a char-table. The "category table" is a char-table. --=20 Best regards, Xue Fuqiao. http://www.gnu.org/software/emacs/