emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105468: Improve documentation of reg


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105468: Improve documentation of regexp search for categories.
Date: Tue, 16 Aug 2011 10:53:33 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105468
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Tue 2011-08-16 10:53:33 +0300
message:
  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.
modified:
  doc/lispref/ChangeLog
  doc/lispref/searching.texi
  doc/lispref/syntax.texi
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2011-08-09 21:14:11 +0000
+++ b/doc/lispref/ChangeLog     2011-08-16 07:53:33 +0000
@@ -1,3 +1,13 @@
+2011-08-16  Eli Zaretskii  <address@hidden>
+
+       * syntax.texi (Categories): Add an example of defining a new
+       category and category table.
+
+       * 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.
+
 2011-08-09  Chong Yidong  <address@hidden>
 
        * text.texi (Special Properties):

=== modified file 'doc/lispref/searching.texi'
--- a/doc/lispref/searching.texi        2011-07-03 18:44:53 +0000
+++ b/doc/lispref/searching.texi        2011-08-16 07:53:33 +0000
@@ -717,11 +717,15 @@
 @cindex @samp{\S} in regexp
 matches any character whose syntax is not @var{code}.
 
address@hidden category, regexp search for
 @item address@hidden
 matches any character whose category is @var{c}.  Here @var{c} is a
 character that represents a category: thus, @samp{c} for Chinese
 characters or @samp{g} for Greek characters in the standard category
-table.
+table.  You can see the list of all the currently defined categories
+with @kbd{M-x describe-categories @key{RET}}.  You can also define
+your own categories in addition to the standard ones using the
address@hidden function (@pxref{Categories}).
 
 @item address@hidden
 matches any character whose category is not @var{c}.

=== modified file 'doc/lispref/syntax.texi'
--- a/doc/lispref/syntax.texi   2011-07-11 15:30:28 +0000
+++ b/doc/lispref/syntax.texi   2011-08-16 07:53:33 +0000
@@ -1084,6 +1084,24 @@
 @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:
+
address@hidden
+(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))
address@hidden example
 @end defun
 
 @defun category-docstring category &optional table


reply via email to

[Prev in Thread] Current Thread [Next in Thread]