annotate src/category.c @ 72894:26df5bbb5d61

* progmodes/compile.el (compilation-error-regexp-alist-alist): Disallow filenames containing " -" to avoid confusion with libtool compilation messages.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 15 Sep 2006 15:37:36 +0000
parents 8adcaaf366b4
children e74524ea3f55 8a8e69664178
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1 /* GNU Emacs routines to deal with category tables.
68651
3bd95f4f2941 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 67658
diff changeset
2 Copyright (C) 1998, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
67658
547f2b420666 Copyright fixed
Kenichi Handa <handa@m17n.org>
parents: 64084
diff changeset
3 Copyright (C) 1995, 1997, 1998, 1999
547f2b420666 Copyright fixed
Kenichi Handa <handa@m17n.org>
parents: 64084
diff changeset
4 National Institute of Advanced Industrial Science and Technology (AIST)
547f2b420666 Copyright fixed
Kenichi Handa <handa@m17n.org>
parents: 64084
diff changeset
5 Registration Number H14PRO021
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7 This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9 GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14 GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 along with GNU Emacs; see the file COPYING. If not, write to
64084
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63694
diff changeset
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
a8fa7c632ee4 Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63694
diff changeset
22 Boston, MA 02110-1301, USA. */
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 /* Here we handle three objects: category, category set, and category
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26 table. Read comments in the file category.h to understand them. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28 #include <config.h>
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29 #include <ctype.h>
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 #include "lisp.h"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31 #include "buffer.h"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
32 #include "charset.h"
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
33 #include "category.h"
39748
42b7a798ff79 Include keymap.h.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 34984
diff changeset
34 #include "keymap.h"
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
35
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36 /* The version number of the latest category table. Each category
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37 table has a unique version number. It is assigned a new number
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38 also when it is modified. When a regular expression is compiled
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39 into the struct re_pattern_buffer, the version number of the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
40 category table (of the current buffer) at that moment is also
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
41 embedded in the structure.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
42
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
43 For the moment, we are not using this feature. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44 static int category_table_version;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
46 Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, Qcategory_table_p;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
47
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
48 /* Variables to determine word boundary. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
49 Lisp_Object Vword_combining_categories, Vword_separating_categories;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
50
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
51 /* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
52 Lisp_Object _temp_category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
53
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
54
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
55 /* Category set staff. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
56
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
57 DEFUN ("make-category-set", Fmake_category_set, Smake_category_set, 1, 1, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
58 doc: /* Return a newly created category-set which contains CATEGORIES.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
59 CATEGORIES is a string of category mnemonics.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
60 The value is a bool-vector which has t at the indices corresponding to
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
61 those categories. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
62 (categories)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63 Lisp_Object categories;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
64 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
65 Lisp_Object val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
66 int len;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
67
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
68 CHECK_STRING (categories);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
69 val = MAKE_CATEGORY_SET;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
70
20612
5a0922f8c841 (Fmake_category_set): Don't allow multibyte string.
Richard M. Stallman <rms@gnu.org>
parents: 20189
diff changeset
71 if (STRING_MULTIBYTE (categories))
63694
8f10ba0f0a86 (Fmake_category_set): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 54091
diff changeset
72 error ("Multibyte string in `make-category-set'");
20612
5a0922f8c841 (Fmake_category_set): Don't allow multibyte string.
Richard M. Stallman <rms@gnu.org>
parents: 20189
diff changeset
73
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 41643
diff changeset
74 len = SCHARS (categories);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 while (--len >= 0)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
76 {
17369
566b26e1930e (Fmake_category_set): Use XSETFASTINT.
Karl Heuer <kwzh@gnu.org>
parents: 17324
diff changeset
77 Lisp_Object category;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 41643
diff changeset
79 XSETFASTINT (category, SREF (categories, len));
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
80 CHECK_CATEGORY (category);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
81 SET_CATEGORY_SET (val, category, Qt);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
82 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
83 return val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
85
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
86
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
87 /* Category staff. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
88
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
89 Lisp_Object check_category_table ();
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
90
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
91 DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
92 doc: /* Define CATEGORY as a category which is described by DOCSTRING.
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
93 CATEGORY should be an ASCII printing character in the range ` ' to `~'.
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
94 DOCSTRING is the documentation string of the category.
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
95 The category is defined only in category table TABLE, which defaults to
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
96 the current buffer's category table. */)
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
97 (category, docstring, table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
98 Lisp_Object category, docstring, table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
99 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
100 CHECK_CATEGORY (category);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
101 CHECK_STRING (docstring);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
102 table = check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
103
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
104 if (!NILP (CATEGORY_DOCSTRING (table, XFASTINT (category))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
105 error ("Category `%c' is already defined", XFASTINT (category));
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
106 CATEGORY_DOCSTRING (table, XFASTINT (category)) = docstring;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
107
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
108 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
109 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
110
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111 DEFUN ("category-docstring", Fcategory_docstring, Scategory_docstring, 1, 2, 0,
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
112 doc: /* Return the documentation string of CATEGORY, as defined in TABLE.
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
113 TABLE should be a category table and defaults to the current buffer's
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
114 category table. */)
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
115 (category, table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
116 Lisp_Object category, table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
117 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
118 CHECK_CATEGORY (category);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
119 table = check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
121 return CATEGORY_DOCSTRING (table, XFASTINT (category));
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
123
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
124 DEFUN ("get-unused-category", Fget_unused_category, Sget_unused_category,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125 0, 1, 0,
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
126 doc: /* Return a category which is not yet defined in TABLE.
41038
a882905d8a96 (Fget_unused_category): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
127 If no category remains available, return nil.
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
128 The optional argument TABLE specifies which category table to modify;
41038
a882905d8a96 (Fget_unused_category): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 40656
diff changeset
129 it defaults to the current buffer's category table. */)
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
130 (table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
131 Lisp_Object table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
132 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
133 int i;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
134
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
135 table = check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
136
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
137 for (i = ' '; i <= '~'; i++)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
138 if (NILP (CATEGORY_DOCSTRING (table, i)))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
139 return make_number (i);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
140
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
141 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
142 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
143
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
144
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
145 /* Category-table staff. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
146
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
147 DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
148 doc: /* Return t if ARG is a category table. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
149 (arg)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
150 Lisp_Object arg;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
151 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
152 if (CHAR_TABLE_P (arg)
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
153 && EQ (XCHAR_TABLE (arg)->purpose, Qcategory_table))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
154 return Qt;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
155 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
156 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
157
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
158 /* If TABLE is nil, return the current category table. If TABLE is
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
159 not nil, check the validity of TABLE as a category table. If
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
160 valid, return TABLE itself, but if not valid, signal an error of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
161 wrong-type-argument. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
162
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
163 Lisp_Object
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
164 check_category_table (table)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
165 Lisp_Object table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
166 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
167 if (NILP (table))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
168 return current_buffer->category_table;
71829
8adcaaf366b4 (check_category_table): Use CHECK_TYPE.
Kim F. Storm <storm@cua.dk>
parents: 68651
diff changeset
169 CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
170 return table;
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46370
diff changeset
171 }
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
172
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
173 DEFUN ("category-table", Fcategory_table, Scategory_table, 0, 0, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
174 doc: /* Return the current category table.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
175 This is the one specified by the current buffer. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
176 ()
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
177 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
178 return current_buffer->category_table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
179 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
180
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
181 DEFUN ("standard-category-table", Fstandard_category_table,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 Sstandard_category_table, 0, 0, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
183 doc: /* Return the standard category table.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
184 This is the one used for new buffers. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
185 ()
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
187 return Vstandard_category_table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
188 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
190 /* Return a copy of category table TABLE. We can't simply use the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
191 function copy-sequence because no contents should be shared between
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
192 the original and the copy. This function is called recursively by
20189
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
193 binding TABLE to a sub char table. */
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
194
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
195 Lisp_Object
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
196 copy_category_table (table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197 Lisp_Object table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
198 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
199 Lisp_Object tmp;
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
200 int i, to;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
201
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
202 if (!NILP (XCHAR_TABLE (table)->top))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
203 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
204 /* TABLE is a top level char table.
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
205 At first, make a copy of tree structure of the table. */
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
206 table = Fcopy_sequence (table);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
207
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
208 /* Then, copy elements for single byte characters one by one. */
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
209 for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
210 if (!NILP (tmp = XCHAR_TABLE (table)->contents[i]))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
211 XCHAR_TABLE (table)->contents[i] = Fcopy_sequence (tmp);
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
212 to = CHAR_TABLE_ORDINARY_SLOTS;
20189
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
213
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
214 /* Also copy the first (and sole) extra slot. It is a vector
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
215 containing docstring of each category. */
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
216 Fset_char_table_extra_slot
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
217 (table, make_number (0),
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
218 Fcopy_sequence (Fchar_table_extra_slot (table, make_number (0))));
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
219 }
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
220 else
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
221 {
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
222 i = 32;
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
223 to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
224 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
225
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
226 /* If the table has non-nil default value, copy it. */
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
227 if (!NILP (tmp = XCHAR_TABLE (table)->defalt))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
228 XCHAR_TABLE (table)->defalt = Fcopy_sequence (tmp);
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
229
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
230 /* At last, copy the remaining elements while paying attention to a
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
231 sub char table. */
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
232 for (; i < to; i++)
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
233 if (!NILP (tmp = XCHAR_TABLE (table)->contents[i]))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
234 XCHAR_TABLE (table)->contents[i]
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
235 = (SUB_CHAR_TABLE_P (tmp)
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
236 ? copy_category_table (tmp) : Fcopy_sequence (tmp));
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
237
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 return table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
239 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
240
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
241 DEFUN ("copy-category-table", Fcopy_category_table, Scopy_category_table,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
242 0, 1, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
243 doc: /* Construct a new category table and return it.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
244 It is a copy of the TABLE, which defaults to the standard category table. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
245 (table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
246 Lisp_Object table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
247 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
248 if (!NILP (table))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
249 check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
250 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
251 table = Vstandard_category_table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
252
20189
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
253 return copy_category_table (table);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
254 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
255
26841
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
256 DEFUN ("make-category-table", Fmake_category_table, Smake_category_table,
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
257 0, 0, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
258 doc: /* Construct a new and empty category table and return it. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
259 ()
26841
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
260 {
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
261 Lisp_Object val;
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
262
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
263 val = Fmake_char_table (Qcategory_table, Qnil);
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
264 XCHAR_TABLE (val)->defalt = MAKE_CATEGORY_SET;
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
265 Fset_char_table_extra_slot (val, make_number (0),
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
266 Fmake_vector (make_number (95), Qnil));
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
267 return val;
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
268 }
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
269
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 DEFUN ("set-category-table", Fset_category_table, Sset_category_table, 1, 1, 0,
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
271 doc: /* Specify TABLE as the category table for the current buffer.
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
272 Return TABLE. */)
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
273 (table)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
274 Lisp_Object table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
275 {
28315
16ed41346de7 (Fset_category_table): Use new macros for per-buffer
Gerd Moellmann <gerd@gnu.org>
parents: 26841
diff changeset
276 int idx;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
277 table = check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
278 current_buffer->category_table = table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
279 /* Indicate that this buffer now has a specified category table. */
28351
e3d57f7fba49 Use new macro names
Gerd Moellmann <gerd@gnu.org>
parents: 28315
diff changeset
280 idx = PER_BUFFER_VAR_IDX (category_table);
e3d57f7fba49 Use new macro names
Gerd Moellmann <gerd@gnu.org>
parents: 28315
diff changeset
281 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
282 return table;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
283 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
284
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
285
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286 DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
287 doc: /* Return the category set of CHAR. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
288 (ch)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
289 Lisp_Object ch;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
290 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
291 CHECK_NUMBER (ch);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
292 return CATEGORY_SET (XFASTINT (ch));
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
293 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
294
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
295 DEFUN ("category-set-mnemonics", Fcategory_set_mnemonics,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
296 Scategory_set_mnemonics, 1, 1, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
297 doc: /* Return a string containing mnemonics of the categories in CATEGORY-SET.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
298 CATEGORY-SET is a bool-vector, and the categories \"in\" it are those
54091
15dabc5988ff (Fdefine_category, Fcategory_docstring)
Luc Teirlinck <teirllm@auburn.edu>
parents: 52401
diff changeset
299 that are indexes where t occurs in the bool-vector.
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
300 The return value is a string containing those same categories. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
301 (category_set)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
302 Lisp_Object category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
303 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
304 int i, j;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
305 char str[96];
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
306
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
307 CHECK_CATEGORY_SET (category_set);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
308
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
309 j = 0;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
310 for (i = 32; i < 127; i++)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
311 if (CATEGORY_MEMBER (i, category_set))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
312 str[j++] = i;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
313 str[j] = '\0';
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
314
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
315 return build_string (str);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
316 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
317
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
318 /* Modify all category sets stored under sub char-table TABLE so that
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
319 they contain (SET_VALUE is t) or don't contain (SET_VALUE is nil)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
320 CATEGORY. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
321
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
322 void
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
323 modify_lower_category_set (table, category, set_value)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
324 Lisp_Object table, category, set_value;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
325 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
326 Lisp_Object val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
327 int i;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
328
25835
265202db376b (modify_lower_category_set): Set default value of
Kenichi Handa <handa@m17n.org>
parents: 25662
diff changeset
329 val = XCHAR_TABLE (table)->defalt;
265202db376b (modify_lower_category_set): Set default value of
Kenichi Handa <handa@m17n.org>
parents: 25662
diff changeset
330 if (!CATEGORY_SET_P (val))
265202db376b (modify_lower_category_set): Set default value of
Kenichi Handa <handa@m17n.org>
parents: 25662
diff changeset
331 val = MAKE_CATEGORY_SET;
265202db376b (modify_lower_category_set): Set default value of
Kenichi Handa <handa@m17n.org>
parents: 25662
diff changeset
332 SET_CATEGORY_SET (val, category, set_value);
265202db376b (modify_lower_category_set): Set default value of
Kenichi Handa <handa@m17n.org>
parents: 25662
diff changeset
333 XCHAR_TABLE (table)->defalt = val;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
334
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
335 for (i = 32; i < SUB_CHAR_TABLE_ORDINARY_SLOTS; i++)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
336 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
337 val = XCHAR_TABLE (table)->contents[i];
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
338
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
339 if (CATEGORY_SET_P (val))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
340 SET_CATEGORY_SET (val, category, set_value);
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
341 else if (SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
342 modify_lower_category_set (val, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
343 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
344 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
345
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
346 void
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
347 set_category_set (category_set, category, val)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
348 Lisp_Object category_set, category, val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
349 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
350 do {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
351 int idx = XINT (category) / 8;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
352 unsigned char bits = 1 << (XINT (category) % 8);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
353
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
354 if (NILP (val))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
355 XCATEGORY_SET (category_set)->data[idx] &= ~bits;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
356 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
357 XCATEGORY_SET (category_set)->data[idx] |= bits;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
358 } while (0);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
359 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
360
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
361 DEFUN ("modify-category-entry", Fmodify_category_entry,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
362 Smodify_category_entry, 2, 4, 0,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
363 doc: /* Modify the category set of CHARACTER by adding CATEGORY to it.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
364 The category is changed only for table TABLE, which defaults to
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
365 the current buffer's category table.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
366 If optional fourth argument RESET is non-nil,
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
367 then delete CATEGORY from the category set instead of adding it. */)
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
368 (character, category, table, reset)
20825
1b98a0ab1bee (Fmodify_category_entry): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 20612
diff changeset
369 Lisp_Object character, category, table, reset;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
370 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
371 int c, charset, c1, c2;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
372 Lisp_Object set_value; /* Actual value to be set in category sets. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
373 Lisp_Object val, category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
374
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
375 CHECK_NUMBER (character);
20825
1b98a0ab1bee (Fmodify_category_entry): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 20612
diff changeset
376 c = XINT (character);
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40103
diff changeset
377 CHECK_CATEGORY (category);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
378 table = check_category_table (table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
379
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
380 if (NILP (CATEGORY_DOCSTRING (table, XFASTINT (category))))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
381 error ("Undefined category: %c", XFASTINT (category));
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46370
diff changeset
382
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
383 set_value = NILP (reset) ? Qt : Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
384
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
385 if (c < CHAR_TABLE_SINGLE_BYTE_SLOTS)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
386 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387 val = XCHAR_TABLE (table)->contents[c];
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388 if (!CATEGORY_SET_P (val))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389 XCHAR_TABLE (table)->contents[c] = (val = MAKE_CATEGORY_SET);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
390 SET_CATEGORY_SET (val, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
393
29001
5cd01794225d (Fmodify_category_entry): Use SPLIT_CHAR, not
Kenichi Handa <handa@m17n.org>
parents: 28351
diff changeset
394 SPLIT_CHAR (c, charset, c1, c2);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 /* The top level table. */
17187
9ab0c08a3359 Adjusted for the change of CHAR_TABLE_ORDINARY_SLOTS.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
397 val = XCHAR_TABLE (table)->contents[charset + 128];
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
398 if (CATEGORY_SET_P (val))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
399 category_set = val;
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
400 else if (!SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
402 category_set = val = MAKE_CATEGORY_SET;
17187
9ab0c08a3359 Adjusted for the change of CHAR_TABLE_ORDINARY_SLOTS.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
403 XCHAR_TABLE (table)->contents[charset + 128] = category_set;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
405
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
406 if (c1 <= 0)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
408 /* Only a charset is specified. */
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
409 if (SUB_CHAR_TABLE_P (val))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
410 /* All characters in CHARSET should be the same as for having
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
411 CATEGORY or not. */
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
412 modify_lower_category_set (val, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
413 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
414 SET_CATEGORY_SET (category_set, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
415 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
416 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 /* The second level table. */
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
419 if (!SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
420 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
421 val = make_sub_char_table (Qnil);
17187
9ab0c08a3359 Adjusted for the change of CHAR_TABLE_ORDINARY_SLOTS.
Kenichi Handa <handa@m17n.org>
parents: 17071
diff changeset
422 XCHAR_TABLE (table)->contents[charset + 128] = val;
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
423 /* We must set default category set of CHARSET in `defalt' slot. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
424 XCHAR_TABLE (val)->defalt = category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
425 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
426 table = val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
427
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
428 val = XCHAR_TABLE (table)->contents[c1];
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
429 if (CATEGORY_SET_P (val))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
430 category_set = val;
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
431 else if (!SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
432 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
433 category_set = val = Fcopy_sequence (XCHAR_TABLE (table)->defalt);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
434 XCHAR_TABLE (table)->contents[c1] = category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
435 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
436
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
437 if (c2 <= 0)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
438 {
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
439 if (SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
440 /* All characters in C1 group of CHARSET should be the same as
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
441 for CATEGORY. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
442 modify_lower_category_set (val, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
443 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
444 SET_CATEGORY_SET (category_set, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
445 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
446 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
447
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 /* The third (bottom) level table. */
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
449 if (!SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
450 {
17459
22fc94ab9e79 (Fmodify_category_entry): Delete second arg in call to make_sub_char_table.
Karl Heuer <kwzh@gnu.org>
parents: 17369
diff changeset
451 val = make_sub_char_table (Qnil);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
452 XCHAR_TABLE (table)->contents[c1] = val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453 /* We must set default category set of CHARSET and C1 in
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 `defalt' slot. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
455 XCHAR_TABLE (val)->defalt = category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
456 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
457 table = val;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
458
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
459 val = XCHAR_TABLE (table)->contents[c2];
17324
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
460 if (CATEGORY_SET_P (val))
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
461 category_set = val;
ed53084a1655 (category-table-p): Check only type and purpose.
Kenichi Handa <handa@m17n.org>
parents: 17187
diff changeset
462 else if (!SUB_CHAR_TABLE_P (val))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
463 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
464 category_set = Fcopy_sequence (XCHAR_TABLE (table)->defalt);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
465 XCHAR_TABLE (table)->contents[c2] = category_set;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
466 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
467 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
468 /* This should never happen. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
469 error ("Invalid category table");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
470
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
471 SET_CATEGORY_SET (category_set, category, set_value);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
472
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
473 return Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
474 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
475
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
476 /* Return 1 if there is a word boundary between two word-constituent
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
477 characters C1 and C2 if they appear in this order, else return 0.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
478 Use the macro WORD_BOUNDARY_P instead of calling this function
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
479 directly. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
480
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 int
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
482 word_boundary_p (c1, c2)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
483 int c1, c2;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
484 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
485 Lisp_Object category_set1, category_set2;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
486 Lisp_Object tail;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
487 int default_result;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
488
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
489 if (CHAR_CHARSET (c1) == CHAR_CHARSET (c2))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
490 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
491 tail = Vword_separating_categories;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
492 default_result = 0;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
493 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
494 else
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
495 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
496 tail = Vword_combining_categories;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497 default_result = 1;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
498 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
499
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 category_set1 = CATEGORY_SET (c1);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 if (NILP (category_set1))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
502 return default_result;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
503 category_set2 = CATEGORY_SET (c2);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504 if (NILP (category_set2))
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505 return default_result;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506
25662
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
507 for (; CONSP (tail); tail = XCDR (tail))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508 {
25662
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
509 Lisp_Object elt = XCAR (tail);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
510
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
511 if (CONSP (elt)
25662
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
512 && CATEGORYP (XCAR (elt))
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
513 && CATEGORYP (XCDR (elt))
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
514 && CATEGORY_MEMBER (XFASTINT (XCAR (elt)), category_set1)
0a7261c1d487 Use XCAR, XCDR, and XFLOAT_DATA instead of explicit member access.
Ken Raeburn <raeburn@raeburn.org>
parents: 23755
diff changeset
515 && CATEGORY_MEMBER (XFASTINT (XCDR (elt)), category_set2))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
516 return !default_result;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
517 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
518 return default_result;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
519 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
520
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21244
diff changeset
522 void
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523 init_category_once ()
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
524 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
525 /* This has to be done here, before we call Fmake_char_table. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526 Qcategory_table = intern ("category-table");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
527 staticpro (&Qcategory_table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
528
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
529 /* Intern this now in case it isn't already done.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
530 Setting this variable twice is harmless.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
531 But don't staticpro it here--that is done in alloc.c. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
532 Qchar_table_extra_slots = intern ("char-table-extra-slots");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
533
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
534 /* Now we are ready to set up this property, so we can
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
535 create category tables. */
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
536 Fput (Qcategory_table, Qchar_table_extra_slots, make_number (2));
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
537
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
538 Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil);
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46370
diff changeset
539 /* Set a category set which contains nothing to the default. */
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
540 XCHAR_TABLE (Vstandard_category_table)->defalt = MAKE_CATEGORY_SET;
20189
16f5b56c2f68 (copy_category_table): Copy also the first extra slot
Kenichi Handa <handa@m17n.org>
parents: 19659
diff changeset
541 Fset_char_table_extra_slot (Vstandard_category_table, make_number (0),
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
542 Fmake_vector (make_number (95), Qnil));
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
543 }
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
544
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21244
diff changeset
545 void
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
546 syms_of_category ()
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
547 {
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
548 Qcategoryp = intern ("categoryp");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
549 staticpro (&Qcategoryp);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
550 Qcategorysetp = intern ("categorysetp");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
551 staticpro (&Qcategorysetp);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
552 Qcategory_table_p = intern ("category-table-p");
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
553 staticpro (&Qcategory_table_p);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
554
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
555 DEFVAR_LISP ("word-combining-categories", &Vword_combining_categories,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
556 doc: /* List of pair (cons) of categories to determine word boundary.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
557
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
558 Emacs treats a sequence of word constituent characters as a single
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
559 word (i.e. finds no word boundary between them) iff they belongs to
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
560 the same charset. But, exceptions are allowed in the following cases.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
561
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
562 \(1) The case that characters are in different charsets is controlled
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
563 by the variable `word-combining-categories'.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
564
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
565 Emacs finds no word boundary between characters of different charsets
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
566 if they have categories matching some element of this list.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
567
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
568 More precisely, if an element of this list is a cons of category CAT1
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
569 and CAT2, and a multibyte character C1 which has CAT1 is followed by
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
570 C2 which has CAT2, there's no word boundary between C1 and C2.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
571
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
572 For instance, to tell that ASCII characters and Latin-1 characters can
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
573 form a single word, the element `(?l . ?l)' should be in this list
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
574 because both characters have the category `l' (Latin characters).
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
575
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
576 \(2) The case that character are in the same charset is controlled by
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
577 the variable `word-separating-categories'.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
578
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
579 Emacs find a word boundary between characters of the same charset
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
580 if they have categories matching some element of this list.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
581
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
582 More precisely, if an element of this list is a cons of category CAT1
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
583 and CAT2, and a multibyte character C1 which has CAT1 is followed by
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
584 C2 which has CAT2, there's a word boundary between C1 and C2.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
585
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
586 For instance, to tell that there's a word boundary between Japanese
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
587 Hiragana and Japanese Kanji (both are in the same charset), the
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
588 element `(?H . ?C) should be in this list. */);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
589
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
590 Vword_combining_categories = Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
591
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
592 DEFVAR_LISP ("word-separating-categories", &Vword_separating_categories,
40103
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
593 doc: /* List of pair (cons) of categories to determine word boundary.
6b389fb978bc Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents: 39748
diff changeset
594 See the documentation of the variable `word-combining-categories'. */);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
595
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
596 Vword_separating_categories = Qnil;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
597
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
598 defsubr (&Smake_category_set);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
599 defsubr (&Sdefine_category);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
600 defsubr (&Scategory_docstring);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
601 defsubr (&Sget_unused_category);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
602 defsubr (&Scategory_table_p);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
603 defsubr (&Scategory_table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
604 defsubr (&Sstandard_category_table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
605 defsubr (&Scopy_category_table);
26841
dfead1ef574c (word_boundary_p): Delete codes for a composite
Kenichi Handa <handa@m17n.org>
parents: 25835
diff changeset
606 defsubr (&Smake_category_table);
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
607 defsubr (&Sset_category_table);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
608 defsubr (&Schar_category_set);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
609 defsubr (&Scategory_set_mnemonics);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
610 defsubr (&Smodify_category_entry);
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
611
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
612 category_table_version = 0;
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
613 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
614
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
615 /* arch-tag: 74ebf524-121b-4d9c-bd68-07f8d708b211
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
616 (do not change this comment) */