diff options
| author | Stefan Monnier | 2013-03-27 10:33:03 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-03-27 10:33:03 -0400 |
| commit | f557c1b1a9b24212728bf27027f0d0cc1d9bbecb (patch) | |
| tree | ef5c289924788904c1c1c8585786ca7782349280 /src | |
| parent | 002668e109fe71527f564a797d4c5e0756e45530 (diff) | |
| download | emacs-f557c1b1a9b24212728bf27027f0d0cc1d9bbecb.tar.gz emacs-f557c1b1a9b24212728bf27027f0d0cc1d9bbecb.zip | |
* lisp/case-table.el (case-table-get-table): New function.
* lisp/case-table.el: Use lexical-binding.
(case-table-get-table): New function.
(get-upcase-table): Use it. Mark as obsolete. Adjust callers.
* src/casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
the upcase table.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/casetab.c | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7b25fb54441..6698cfe0fcf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for | ||
| 4 | the upcase table. | ||
| 5 | |||
| 1 | 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes) | 6 | 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes) |
| 2 | 7 | ||
| 3 | * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function. | 8 | * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function. |
diff --git a/src/casetab.c b/src/casetab.c index 76f72b26db3..13bed64e4b2 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -246,7 +246,7 @@ void | |||
| 246 | init_casetab_once (void) | 246 | init_casetab_once (void) |
| 247 | { | 247 | { |
| 248 | register int i; | 248 | register int i; |
| 249 | Lisp_Object down, up; | 249 | Lisp_Object down, up, eqv; |
| 250 | DEFSYM (Qcase_table, "case-table"); | 250 | DEFSYM (Qcase_table, "case-table"); |
| 251 | 251 | ||
| 252 | /* Intern this now in case it isn't already done. | 252 | /* Intern this now in case it isn't already done. |
| @@ -275,13 +275,21 @@ init_casetab_once (void) | |||
| 275 | 275 | ||
| 276 | for (i = 0; i < 128; i++) | 276 | for (i = 0; i < 128; i++) |
| 277 | { | 277 | { |
| 278 | int c = (i >= 'a' && i <= 'z') ? i + ('A' - 'a') : i; | ||
| 279 | CHAR_TABLE_SET (up, i, make_number (c)); | ||
| 280 | } | ||
| 281 | |||
| 282 | eqv = Fmake_char_table (Qcase_table, Qnil); | ||
| 283 | |||
| 284 | for (i = 0; i < 128; i++) | ||
| 285 | { | ||
| 278 | int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A') | 286 | int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A') |
| 279 | : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a') | 287 | : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a') |
| 280 | : i)); | 288 | : i)); |
| 281 | CHAR_TABLE_SET (up, i, make_number (c)); | 289 | CHAR_TABLE_SET (up, i, make_number (c)); |
| 282 | } | 290 | } |
| 283 | 291 | ||
| 284 | set_char_table_extras (down, 2, Fcopy_sequence (up)); | 292 | set_char_table_extras (down, 2, eqv); |
| 285 | 293 | ||
| 286 | /* Fill in what isn't filled in. */ | 294 | /* Fill in what isn't filled in. */ |
| 287 | set_case_table (down, 1); | 295 | set_case_table (down, 1); |