Mercurial > emacs
comparison lisp/case-table.el @ 17934:b091b787e3e4
(set-case-syntax-1): New function.
(set-case-syntax-delims): Use set-case-syntax-1.
(set-case-syntax-pair, set-case-syntax): Likewise.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 23 May 1997 18:23:31 +0000 |
parents | 99adb4d59379 |
children | 79911e7f54fe |
comparison
equal
deleted
inserted
replaced
17933:a7579056d62e | 17934:b091b787e3e4 |
---|---|
69 (set-char-table-extra-slot copy 0 nil) | 69 (set-char-table-extra-slot copy 0 nil) |
70 (set-char-table-extra-slot copy 1 nil) | 70 (set-char-table-extra-slot copy 1 nil) |
71 (set-char-table-extra-slot copy 2 nil) | 71 (set-char-table-extra-slot copy 2 nil) |
72 copy)) | 72 copy)) |
73 | 73 |
74 (defsubst set-case-syntax-1 (char) | |
75 "Offset CHAR by `set-case-syntax-offset' if CHAR is a non-ASCII 8-bit char." | |
76 (if (and (>= char 128) (< char 256)) | |
77 (+ char set-case-syntax-offset) | |
78 char)) | |
79 | |
74 ;;;###autoload | 80 ;;;###autoload |
75 (defun set-case-syntax-delims (l r table) | 81 (defun set-case-syntax-delims (l r table) |
76 "Make characters L and R a matching pair of non-case-converting delimiters. | 82 "Make characters L and R a matching pair of non-case-converting delimiters. |
77 This sets the entries for L and R in TABLE, which is a string | 83 This sets the entries for L and R in TABLE, which is a string |
78 that will be used as the downcase part of a case table. | 84 that will be used as the downcase part of a case table. |
79 It also modifies `standard-syntax-table' to | 85 It also modifies `standard-syntax-table' to |
80 indicate left and right delimiters." | 86 indicate left and right delimiters." |
81 (setq l (+ set-case-syntax-offset l)) | 87 (setq l (set-case-syntax-1 l)) |
82 (setq r (+ set-case-syntax-offset r)) | 88 (setq r (set-case-syntax-1 r)) |
83 (aset table l l) | 89 (aset table l l) |
84 (aset table r r) | 90 (aset table r r) |
85 ;; Clear out the extra slots so that they will be | 91 ;; Clear out the extra slots so that they will be |
86 ;; recomputed from the main (downcase) table. | 92 ;; recomputed from the main (downcase) table. |
87 (set-char-table-extra-slot table 0 nil) | 93 (set-char-table-extra-slot table 0 nil) |
97 "Make characters UC and LC a pair of inter-case-converting letters. | 103 "Make characters UC and LC a pair of inter-case-converting letters. |
98 This sets the entries for characters UC and LC in TABLE, which is a string | 104 This sets the entries for characters UC and LC in TABLE, which is a string |
99 that will be used as the downcase part of a case table. | 105 that will be used as the downcase part of a case table. |
100 It also modifies `standard-syntax-table' to give them the syntax of | 106 It also modifies `standard-syntax-table' to give them the syntax of |
101 word constituents." | 107 word constituents." |
102 (setq uc (+ set-case-syntax-offset uc)) | 108 (setq uc (set-case-syntax-1 uc)) |
103 (setq lc (+ set-case-syntax-offset lc)) | 109 (setq lc (set-case-syntax-1 lc)) |
104 (aset table uc lc) | 110 (aset table uc lc) |
105 (aset table lc lc) | 111 (aset table lc lc) |
106 (set-char-table-extra-slot table 0 nil) | 112 (set-char-table-extra-slot table 0 nil) |
107 (set-char-table-extra-slot table 1 nil) | 113 (set-char-table-extra-slot table 1 nil) |
108 (set-char-table-extra-slot table 2 nil) | 114 (set-char-table-extra-slot table 2 nil) |
114 "Make character C case-invariant with syntax SYNTAX. | 120 "Make character C case-invariant with syntax SYNTAX. |
115 This sets the entry for character C in TABLE, which is a string | 121 This sets the entry for character C in TABLE, which is a string |
116 that will be used as the downcase part of a case table. | 122 that will be used as the downcase part of a case table. |
117 It also modifies `standard-syntax-table'. | 123 It also modifies `standard-syntax-table'. |
118 SYNTAX should be \" \", \"w\", \".\" or \"_\"." | 124 SYNTAX should be \" \", \"w\", \".\" or \"_\"." |
119 (setq c (+ set-case-syntax-offset c)) | 125 (setq c (set-case-syntax-1 c)) |
120 (aset table c c) | 126 (aset table c c) |
121 (set-char-table-extra-slot table 0 nil) | 127 (set-char-table-extra-slot table 0 nil) |
122 (set-char-table-extra-slot table 1 nil) | 128 (set-char-table-extra-slot table 1 nil) |
123 (set-char-table-extra-slot table 2 nil) | 129 (set-char-table-extra-slot table 2 nil) |
124 (modify-syntax-entry c syntax (standard-syntax-table))) | 130 (modify-syntax-entry c syntax (standard-syntax-table))) |