Categories provide an alternate way of classifying characters syntactically. You can define several categories as needed, then independently assign each character to one or more categories. Unlike syntax classes, categories are not mutually exclusive; it is normal for one character to belong to several categories.
Each buffer has a category table which records which categories are defined and also which characters belong to each category. Each category table defines its own categories, but normally these are initialized by copying from the standard categories table, so that the standard categories are available in all modes.
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 (see section 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.
The new category is defined for category table table, which defaults to the current buffer's category table.
(category-docstring ?a) => "ASCII" (category-docstring ?l) => "Latin"
nil
.
t
if object is a category table,
otherwise nil
.
nil
), it returns a copy of the
current category table. Otherwise, an error is signaled if table
is not a category table.
t
for each of those categories, and nil
for all
other categories.
(make-category-set "al") => #&128"\0\0\0\0\0\0\0\0\0\0\0\0\2\20\0\0"
char-category-set
does not
allocate storage, because it returns the same bool-vector that exists in
the category table.
(char-category-set ?a) => #&128"\0\0\0\0\0\0\0\0\0\0\0\0\2\20\0\0"
(category-set-mnemonics (char-category-set ?a)) => "al"
Normally, it modifies the category set by adding category to it.
But if reset is non-nil
, then it deletes category
instead.
Go to the first, previous, next, last section, table of contents.