aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2015-09-10 20:39:02 +0300
committerEli Zaretskii2015-09-10 20:39:02 +0300
commit0fafb582957135a16a9603c420e992dc46a50544 (patch)
treeefd13a9596d13b88fc583091add7578a206d27ae /doc
parentcdb0ae37ab925b79b379fdfa780f57dad8607a3c (diff)
downloademacs-0fafb582957135a16a9603c420e992dc46a50544.tar.gz
emacs-0fafb582957135a16a9603c420e992dc46a50544.zip
Improve documentation of categories
* doc/lispref/syntax.texi (Categories): Clarify the example of using define-category and modify-category-entry. (Bug#21448)
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/syntax.texi11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index 3ab1e9d81d8..5d9935dc556 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -1084,14 +1084,23 @@ documentation @var{docstring}, for the category table @var{table}.
1084 1084
1085Here's an example of defining a new category for characters that have 1085Here's an example of defining a new category for characters that have
1086strong right-to-left directionality (@pxref{Bidirectional Display}) 1086strong right-to-left directionality (@pxref{Bidirectional Display})
1087and using it in a special category table: 1087and using it in a special category table. To obtain the information
1088about the directionality of characters, the example code uses the
1089@samp{bidi-class} Unicode property (@pxref{Character Properties,
1090bidi-class}).
1088 1091
1089@example 1092@example
1090(defvar special-category-table-for-bidi 1093(defvar special-category-table-for-bidi
1094 ;; Make an empty category-table.
1091 (let ((category-table (make-category-table)) 1095 (let ((category-table (make-category-table))
1096 ;; Create a char-table which gives the 'bidi-class' Unicode
1097 ;; property for each character.
1092 (uniprop-table (unicode-property-table-internal 'bidi-class))) 1098 (uniprop-table (unicode-property-table-internal 'bidi-class)))
1093 (define-category ?R "Characters of bidi-class R, AL, or RLO" 1099 (define-category ?R "Characters of bidi-class R, AL, or RLO"
1094 category-table) 1100 category-table)
1101 ;; Modify the category entry of each character whose 'bidi-class'
1102 ;; Unicode property is R, AL, or RLO -- these have a
1103 ;; right-to-left directionality.
1095 (map-char-table 1104 (map-char-table
1096 #'(lambda (key val) 1105 #'(lambda (key val)
1097 (if (memq val '(R AL RLO)) 1106 (if (memq val '(R AL RLO))