diff options
| author | Richard M. Stallman | 1994-04-17 23:02:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-17 23:02:52 +0000 |
| commit | 5a0fd72f90459141bb100754a58b0543f720908c (patch) | |
| tree | b13cf8f2430b3ed12b36eec8fa4b26f339c63cba /src | |
| parent | 762f2b928d51fe4fb78e5ab037edf106ffd8fe5e (diff) | |
| download | emacs-5a0fd72f90459141bb100754a58b0543f720908c.tar.gz emacs-5a0fd72f90459141bb100754a58b0543f720908c.zip | |
(set_case_table): Handle nil for EQV with non-nil CANON.
(Fcase_table_p): Accept nil for EQV with non-nil CANON.
Diffstat (limited to 'src')
| -rw-r--r-- | src/casetab.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/casetab.c b/src/casetab.c index 5b99d44940f..5a225d4d600 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -47,7 +47,8 @@ See `set-case-table' for more information on these data structures.") | |||
| 47 | return (STRING256_P (down) | 47 | return (STRING256_P (down) |
| 48 | && (NILP (up) || STRING256_P (up)) | 48 | && (NILP (up) || STRING256_P (up)) |
| 49 | && ((NILP (canon) && NILP (eqv)) | 49 | && ((NILP (canon) && NILP (eqv)) |
| 50 | || (STRING256_P (canon) && STRING256_P (eqv))) | 50 | || (STRING256_P (canon) |
| 51 | && (NILP (eqv) || STRING256_P (eqv)))) | ||
| 51 | ? Qt : Qnil); | 52 | ? Qt : Qnil); |
| 52 | } | 53 | } |
| 53 | 54 | ||
| @@ -99,11 +100,11 @@ UPCASE maps each character to its upper-case equivalent;\n\ | |||
| 99 | you may use nil and the upcase table will be deduced from DOWNCASE.\n\ | 100 | you may use nil and the upcase table will be deduced from DOWNCASE.\n\ |
| 100 | CANONICALIZE maps each character to a canonical equivalent;\n\ | 101 | CANONICALIZE maps each character to a canonical equivalent;\n\ |
| 101 | any two characters that are related by case-conversion have the same\n\ | 102 | any two characters that are related by case-conversion have the same\n\ |
| 102 | canonical equivalent character.\n\ | 103 | canonical equivalent character; it may be nil, in which case it is\n\ |
| 104 | deduced from DOWNCASE and UPCASE.\n\ | ||
| 103 | EQUIVALENCES is a map that cyclicly permutes each equivalence class\n\ | 105 | EQUIVALENCES is a map that cyclicly permutes each equivalence class\n\ |
| 104 | (of characters with the same canonical equivalent).\n\ | 106 | (of characters with the same canonical equivalent); it may be nil,\n\ |
| 105 | Both CANONICALIZE and EQUIVALENCES may be nil, in which case\n\ | 107 | in which case it is deduced from CANONICALIZE.") |
| 106 | both are deduced from DOWNCASE and UPCASE.") | ||
| 107 | (table) | 108 | (table) |
| 108 | Lisp_Object table; | 109 | Lisp_Object table; |
| 109 | { | 110 | { |
| @@ -146,13 +147,17 @@ set_case_table (table, standard) | |||
| 146 | unsigned char *downvec = XSTRING (down)->data; | 147 | unsigned char *downvec = XSTRING (down)->data; |
| 147 | 148 | ||
| 148 | canon = Fmake_string (make_number (256), make_number (0)); | 149 | canon = Fmake_string (make_number (256), make_number (0)); |
| 149 | eqv = Fmake_string (make_number (256), make_number (0)); | ||
| 150 | 150 | ||
| 151 | /* Set up the CANON vector; for each character, | 151 | /* Set up the CANON vector; for each character, |
| 152 | this sequence of upcasing and downcasing ought to | 152 | this sequence of upcasing and downcasing ought to |
| 153 | get the "preferred" lowercase equivalent. */ | 153 | get the "preferred" lowercase equivalent. */ |
| 154 | for (i = 0; i < 256; i++) | 154 | for (i = 0; i < 256; i++) |
| 155 | XSTRING (canon)->data[i] = downvec[upvec[downvec[i]]]; | 155 | XSTRING (canon)->data[i] = downvec[upvec[downvec[i]]]; |
| 156 | } | ||
| 157 | |||
| 158 | if (NILP (eqv)) | ||
| 159 | { | ||
| 160 | eqv = Fmake_string (make_number (256), make_number (0)); | ||
| 156 | 161 | ||
| 157 | compute_trt_inverse (XSTRING (canon)->data, XSTRING (eqv)->data); | 162 | compute_trt_inverse (XSTRING (canon)->data, XSTRING (eqv)->data); |
| 158 | } | 163 | } |