[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can customize case conversion by installing a special case table. A case table specifies the mapping between upper case and lower case letters. It affects both the case conversion functions for Lisp objects (see the previous section) and those that apply to text in the buffer (see section 32.18 Case Changes). Each buffer has a case table; there is also a standard case table which is used to initialize the case table of new buffers.
A case table is a char-table (see section 6.6 Char-Tables) whose subtype is
case-table
. This char-table maps each character into the
corresponding lower case character. It has three extra slots, which
hold related tables:
In simple cases, all you need to specify is the mapping to lower-case; the three related tables will be calculated automatically from that one.
For some languages, upper and lower case letters are not in one-to-one correspondence. There may be two different lower case letters with the same upper case equivalent. In these cases, you need to specify the maps for both lower case and upper case.
The extra table canonicalize maps each character to a canonical equivalent; any two characters that are related by case-conversion have the same canonical equivalent character. For example, since `a' and `A' are related by case-conversion, they should have the same canonical equivalent character (which should be either `a' for both of them, or `A' for both of them).
The extra table equivalences is a map that cyclicly permutes each equivalence class (of characters with the same canonical equivalent). (For ordinary ASCII, this would map `a' into `A' and `A' into `a', and likewise for each set of equivalent characters.)
When you construct a case table, you can provide nil
for
canonicalize; then Emacs fills in this slot from the lower case
and upper case mappings. You can also provide nil
for
equivalences; then Emacs fills in this slot from
canonicalize. In a case table that is actually in use, those
components are non-nil
. Do not try to specify equivalences
without also specifying canonicalize.
Here are the functions for working with case tables:
nil
if object is a valid case
table.
The following three functions are convenient subroutines for packages that define non-ASCII character sets. They modify the specified case table case-table; they also modify the standard syntax table. See section 35. Syntax Tables. Normally you would use these functions to change the standard case table.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |