summaryrefslogtreecommitdiff
path: root/doc/lispref/syntax.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lispref/syntax.texi')
-rw-r--r--doc/lispref/syntax.texi18
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.
@defun define-category char docstring &optional table
This function defines a new category, with name @var{char} and
documentation @var{docstring}, for the category table @var{table}.
+
+Here's an example of defining a new category for characters that have
+strong right-to-left directionality (@pxref{Bidirectional Display})
+and using it in a special category table:
+
+@example
+(defvar special-category-table-for-bidi
+ (let ((category-table (make-category-table))
+ (uniprop-table (unicode-property-table-internal 'bidi-class)))
+ (define-category ?R "Characters of bidi-class R, AL, or RLO"
+ category-table)
+ (map-char-table
+ #'(lambda (key val)
+ (if (memq val '(R AL RLO))
+ (modify-category-entry key ?R category-table)))
+ uniprop-table)
+ category-table))
+@end example
@end defun
@defun category-docstring category &optional table