diff options
| author | Eli Zaretskii | 2011-08-16 10:53:33 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-08-16 10:53:33 +0300 |
| commit | 1ea897d542c8de7858ff5ea1bf7e26c8e5bca135 (patch) | |
| tree | e0bae183f9acb326e4b3dff1d0fc140d6bd0a247 /doc/lispref/syntax.texi | |
| parent | 5b409b390c68db74ab80d061f80d5524095eacb4 (diff) | |
| download | emacs-1ea897d542c8de7858ff5ea1bf7e26c8e5bca135.tar.gz emacs-1ea897d542c8de7858ff5ea1bf7e26c8e5bca135.zip | |
Improve documentation of regexp search for categories.
doc/lispref/searching.texi (Regexp Backslash): Document how to display
existing categories. Mention the possibility of adding
categories, and add an xref to where this is described. Add an
index entry.
doc/lispref/syntax.texi (Categories): Add an example of defining a new
category and category table.
Diffstat (limited to 'doc/lispref/syntax.texi')
| -rw-r--r-- | doc/lispref/syntax.texi | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 31ee7eb4e7d..0d7a0c0bed4 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -1084,6 +1084,24 @@ defaults to the current buffer's category table. | |||
| 1084 | @defun define-category char docstring &optional table | 1084 | @defun define-category char docstring &optional table |
| 1085 | This function defines a new category, with name @var{char} and | 1085 | This function defines a new category, with name @var{char} and |
| 1086 | documentation @var{docstring}, for the category table @var{table}. | 1086 | documentation @var{docstring}, for the category table @var{table}. |
| 1087 | |||
| 1088 | Here's an example of defining a new category for characters that have | ||
| 1089 | strong right-to-left directionality (@pxref{Bidirectional Display}) | ||
| 1090 | and using it in a special category table: | ||
| 1091 | |||
| 1092 | @example | ||
| 1093 | (defvar special-category-table-for-bidi | ||
| 1094 | (let ((category-table (make-category-table)) | ||
| 1095 | (uniprop-table (unicode-property-table-internal 'bidi-class))) | ||
| 1096 | (define-category ?R "Characters of bidi-class R, AL, or RLO" | ||
| 1097 | category-table) | ||
| 1098 | (map-char-table | ||
| 1099 | #'(lambda (key val) | ||
| 1100 | (if (memq val '(R AL RLO)) | ||
| 1101 | (modify-category-entry key ?R category-table))) | ||
| 1102 | uniprop-table) | ||
| 1103 | category-table)) | ||
| 1104 | @end example | ||
| 1087 | @end defun | 1105 | @end defun |
| 1088 | 1106 | ||
| 1089 | @defun category-docstring category &optional table | 1107 | @defun category-docstring category &optional table |