all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A question about category name in ELisp
@ 2013-10-05 10:43 Xue Fuqiao
  2013-10-05 12:41 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Xue Fuqiao @ 2013-10-05 10:43 UTC (permalink / raw)
  To: help-gnu-emacs

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/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-07  0:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05 10:43 A question about category name in ELisp Xue Fuqiao
2013-10-05 12:41 ` Eli Zaretskii
2013-10-06  4:04   ` Xue Fuqiao
2013-10-06 15:47     ` Eli Zaretskii
2013-10-07  0:56       ` Xue Fuqiao

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.