From: Xue Fuqiao <xfq.free@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: A question about category name in ELisp
Date: Sat, 5 Oct 2013 18:43:27 +0800 [thread overview]
Message-ID: <CAAF+z6GYqbf2mRL7kFjew-06E_BnePppRDEhxvyrP-GbTu7g-Q@mail.gmail.com> (raw)
Hi,
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 ‘ ’ to ‘~’. You specify the name of a category when you
define it with ‘define-category’.
The category table is actually a char-table (*note Char-Tables::).
The element of the category table at index C is a "category set"—a
bool-vector—that indicates which categories character C belongs to.
In this category set, if the element at index CAT is ‘t’, 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?
--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/
next reply other threads:[~2013-10-05 10:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-05 10:43 Xue Fuqiao [this message]
2013-10-05 12:41 ` A question about category name in ELisp Eli Zaretskii
2013-10-06 4:04 ` Xue Fuqiao
2013-10-06 15:47 ` Eli Zaretskii
2013-10-07 0:56 ` Xue Fuqiao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAF+z6GYqbf2mRL7kFjew-06E_BnePppRDEhxvyrP-GbTu7g-Q@mail.gmail.com \
--to=xfq.free@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.