comparison lisp/case-table.el @ 89138:1bb0a40ed1ce

(set-case-syntax-set-multibyte): This variable deleted. (set-case-syntax-charset): New variable. (set-case-syntax-1): New function. (set-case-syntax-delims, set-case-syntax-pair, set-case-syntax): Call set-case-syntax-1 on arguments.
author Kenichi Handa <handa@m17n.org>
date Tue, 01 Oct 2002 01:33:07 +0000
parents bab63e51dbaa
children b05fd8a2ca53
comparison
equal deleted inserted replaced
89137:eab9038a8e03 89138:1bb0a40ed1ce
25 25
26 ;;; Commentary: 26 ;;; Commentary:
27 27
28 ;;; Code: 28 ;;; Code:
29 29
30 (defvar set-case-syntax-set-multibyte nil) 30 ;; Temporary workaround for loading latin-X.el. They must bind this
31 ;; variable to a charset to convert code points to characters.
32 (defvar set-case-syntax-charset nil)
31 33
32 (defun describe-buffer-case-table () 34 (defun describe-buffer-case-table ()
33 "Describe the case table of the current buffer." 35 "Describe the case table of the current buffer."
34 (interactive) 36 (interactive)
35 (let ((description (make-char-table 'case-table))) 37 (let ((description (make-char-table 'case-table)))
62 (set-char-table-extra-slot copy 0 nil) 64 (set-char-table-extra-slot copy 0 nil)
63 (set-char-table-extra-slot copy 1 nil) 65 (set-char-table-extra-slot copy 1 nil)
64 (set-char-table-extra-slot copy 2 nil) 66 (set-char-table-extra-slot copy 2 nil)
65 copy)) 67 copy))
66 68
69 (defun set-case-syntax-1 (code)
70 (if (and (charsetp set-case-syntax-charset)
71 (< code 256))
72 (decode-char set-case-syntax-charset code)
73 code))
74
67 (defun set-case-syntax-delims (l r table) 75 (defun set-case-syntax-delims (l r table)
68 "Make characters L and R a matching pair of non-case-converting delimiters. 76 "Make characters L and R a matching pair of non-case-converting delimiters.
69 This sets the entries for L and R in TABLE, which is a string 77 This sets the entries for L and R in TABLE, which is a string
70 that will be used as the downcase part of a case table. 78 that will be used as the downcase part of a case table.
71 It also modifies `standard-syntax-table' to 79 It also modifies `standard-syntax-table' to
72 indicate left and right delimiters." 80 indicate left and right delimiters."
81 (setq l (set-case-syntax-1 l))
82 (setq r (set-case-syntax-1 r))
73 (aset table l l) 83 (aset table l l)
74 (aset table r r) 84 (aset table r r)
75 ;; Clear out the extra slots so that they will be 85 ;; Clear out the extra slots so that they will be
76 ;; recomputed from the main (downcase) table. 86 ;; recomputed from the main (downcase) table.
77 (set-char-table-extra-slot table 0 nil) 87 (set-char-table-extra-slot table 0 nil)
86 "Make characters UC and LC a pair of inter-case-converting letters. 96 "Make characters UC and LC a pair of inter-case-converting letters.
87 This sets the entries for characters UC and LC in TABLE, which is a string 97 This sets the entries for characters UC and LC in TABLE, which is a string
88 that will be used as the downcase part of a case table. 98 that will be used as the downcase part of a case table.
89 It also modifies `standard-syntax-table' to give them the syntax of 99 It also modifies `standard-syntax-table' to give them the syntax of
90 word constituents." 100 word constituents."
101 (setq uc (set-case-syntax-1 uc))
102 (setq lc (set-case-syntax-1 lc))
91 (aset table uc lc) 103 (aset table uc lc)
92 (aset table lc lc) 104 (aset table lc lc)
93 (set-char-table-extra-slot table 0 nil) 105 (set-char-table-extra-slot table 0 nil)
94 (set-char-table-extra-slot table 1 nil) 106 (set-char-table-extra-slot table 1 nil)
95 (set-char-table-extra-slot table 2 nil) 107 (set-char-table-extra-slot table 2 nil)
100 "Make character C case-invariant with syntax SYNTAX. 112 "Make character C case-invariant with syntax SYNTAX.
101 This sets the entry for character C in TABLE, which is a string 113 This sets the entry for character C in TABLE, which is a string
102 that will be used as the downcase part of a case table. 114 that will be used as the downcase part of a case table.
103 It also modifies `standard-syntax-table'. 115 It also modifies `standard-syntax-table'.
104 SYNTAX should be \" \", \"w\", \".\" or \"_\"." 116 SYNTAX should be \" \", \"w\", \".\" or \"_\"."
117 (setq c (set-case-syntax-1 c))
105 (aset table c c) 118 (aset table c c)
106 (set-char-table-extra-slot table 0 nil) 119 (set-char-table-extra-slot table 0 nil)
107 (set-char-table-extra-slot table 1 nil) 120 (set-char-table-extra-slot table 1 nil)
108 (set-char-table-extra-slot table 2 nil) 121 (set-char-table-extra-slot table 2 nil)
109 (modify-syntax-entry c syntax (standard-syntax-table))) 122 (modify-syntax-entry c syntax (standard-syntax-table)))