comparison lisp/mule/mule-category.el @ 3970:949ac151a10d

[xemacs-hg @ 2007-05-20 20:09:20 by aidan] Test that all listed langenv input methods exist; comment out those we can't support while using 21.4 to compile our packages.
author aidan
date Sun, 20 May 2007 20:09:40 +0000
parents c10d0c3f965f
children d402d7b18bd8
comparison
equal deleted inserted replaced
3969:a7c03016302e 3970:949ac151a10d
35 35
36 ;;; Code: 36 ;;; Code:
37 37
38 (defvar defined-category-hashtable (make-hash-table :size 50)) 38 (defvar defined-category-hashtable (make-hash-table :size 50))
39 39
40 (defun define-category (designator doc-string) 40 (defun define-category (designator doc-string &optional table)
41 "Make a new category whose designator is DESIGNATOR. 41 "Make a new category whose designator is DESIGNATOR.
42 DESIGNATOR should be a visible letter of ' ' thru '~'. 42 DESIGNATOR should be a visible letter of ' ' thru '~'.
43 STRING is a doc string for the category. 43 DOC-STRING is a doc string for the category.
44 Letters of 'a' thru 'z' are already used or kept for the system." 44 Letters of 'a' thru 'z' are already used or kept for the system.
45 The category should be defined only in category table TABLE, which defaults
46 to the current buffer's category table, but this is not implemented. "
47 ;; #### Implement the limiting of the definition.
45 (check-argument-type 'category-designator-p designator) 48 (check-argument-type 'category-designator-p designator)
46 (check-argument-type 'stringp doc-string) 49 (check-argument-type 'stringp doc-string)
50 (setq table (or table (category-table)))
51 (check-argument-type 'category-table-p table)
47 (puthash designator doc-string defined-category-hashtable)) 52 (puthash designator doc-string defined-category-hashtable))
48 53
49 (defun undefine-category (designator) 54 (defun undefine-category (designator)
50 "Undefine DESIGNATOR as a designator for a category." 55 "Undefine DESIGNATOR as a designator for a category."
51 (check-argument-type 'category-designator-p designator) 56 (check-argument-type 'category-designator-p designator)
139 `(let ((current-category-table (category-table))) 144 `(let ((current-category-table (category-table)))
140 (set-category-table ,category-table) 145 (set-category-table ,category-table)
141 (unwind-protect 146 (unwind-protect
142 (progn ,@body) 147 (progn ,@body)
143 (set-category-table current-category-table)))) 148 (set-category-table current-category-table))))
149
150 (defun make-category-table ()
151 "Construct a new and empty category table and return it."
152 (make-char-table 'category))
144 153
145 (defun describe-category () 154 (defun describe-category ()
146 "Describe the category specifications in the category table. 155 "Describe the category specifications in the category table.
147 The descriptions are inserted in a buffer, which is then displayed." 156 The descriptions are inserted in a buffer, which is then displayed."
148 (interactive) 157 (interactive)