diff options
| author | Michal Nazarewicz | 2016-09-07 21:00:57 +0200 |
|---|---|---|
| committer | Michal Nazarewicz | 2017-02-15 16:54:07 +0100 |
| commit | 6220faeb4e9be16b9dec728e72ea8dff2cfe35ba (patch) | |
| tree | d329bc3c65eb858ea8f03a2705ea5de696abac05 /test/src/casefiddle-tests.el | |
| parent | 5ec3a58462e99533ea5200de356302181d634d0b (diff) | |
| download | emacs-6220faeb4e9be16b9dec728e72ea8dff2cfe35ba.tar.gz emacs-6220faeb4e9be16b9dec728e72ea8dff2cfe35ba.zip | |
casing: don’t assume letters are *either* upper- or lower-case (bug#24603)
A compatibility digraph characters, such as Dž, are neither upper- nor
lower-case. At the moment however, those are reported as upper-case¹
despite the fact that they change when upper-cased.
Stop checking if a character is upper-case before trying to up-case it
so that title-case characters are handled correctly. This fixes one of
the issues mentioned in bug#24603.
¹ Because they change when converted to lower-case. Notice an asymmetry
in that for a character to be considered lower-case it must not be
upper-case (plus the usual condition of changing when upper-cased).
* src/buffer.h (upcase1): Delete.
(upcase): Change to upcase character unconditionally just like downcase
does it. This is what upcase1 was.
* src/casefiddle.c (casify_object, casify_region): Use upcase instead
of upcase1 and don’t check !uppercasep(x) before calling upcase.
* src/keyboard.c (read_key_sequence): Don’t check if uppercase(x), just
downcase(x) and see if it changed.
* test/src/casefiddle-tests.el (casefiddle-tests--characters,
casefiddle-tests-casing): Update test cases which are now passing.
Diffstat (limited to 'test/src/casefiddle-tests.el')
| -rw-r--r-- | test/src/casefiddle-tests.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el index c752bb09172..152d85de006 100644 --- a/test/src/casefiddle-tests.el +++ b/test/src/casefiddle-tests.el | |||
| @@ -63,13 +63,13 @@ | |||
| 63 | (?Ł ?Ł ?ł ?Ł) | 63 | (?Ł ?Ł ?ł ?Ł) |
| 64 | (?ł ?Ł ?ł ?Ł) | 64 | (?ł ?Ł ?ł ?Ł) |
| 65 | 65 | ||
| 66 | ;; FIXME(bug#24603): We should have: | 66 | ;; FIXME(bug#24603): Commented ones are what we want. |
| 67 | ;;(?DŽ ?DŽ ?dž ?Dž) | 67 | ;;(?DŽ ?DŽ ?dž ?Dž) |
| 68 | ;; but instead we have: | ||
| 69 | (?DŽ ?DŽ ?dž ?DŽ) | 68 | (?DŽ ?DŽ ?dž ?DŽ) |
| 70 | ;; FIXME(bug#24603): Those two are broken at the moment: | ||
| 71 | ;;(?Dž ?DŽ ?dž ?Dž) | 69 | ;;(?Dž ?DŽ ?dž ?Dž) |
| 70 | (?Dž ?DŽ ?dž ?DŽ) | ||
| 72 | ;;(?dž ?DŽ ?dž ?Dž) | 71 | ;;(?dž ?DŽ ?dž ?Dž) |
| 72 | (?dž ?DŽ ?dž ?DŽ) | ||
| 73 | 73 | ||
| 74 | (?Σ ?Σ ?σ ?Σ) | 74 | (?Σ ?Σ ?σ ?Σ) |
| 75 | (?σ ?Σ ?σ ?Σ) | 75 | (?σ ?Σ ?σ ?Σ) |
| @@ -197,7 +197,7 @@ | |||
| 197 | ;;("ΌΣΟΣ" "ΌΣΟΣ" "όσος" "Όσος" "Όσος") | 197 | ;;("ΌΣΟΣ" "ΌΣΟΣ" "όσος" "Όσος" "Όσος") |
| 198 | ;; And here’s what is actually happening: | 198 | ;; And here’s what is actually happening: |
| 199 | ("DŽUNGLA" "DŽUNGLA" "džungla" "DŽungla" "DŽUNGLA") | 199 | ("DŽUNGLA" "DŽUNGLA" "džungla" "DŽungla" "DŽUNGLA") |
| 200 | ("Džungla" "UNGLA" "džungla" "ungla" "ungla") | 200 | ("Džungla" "UNGLA" "džungla" "ungla" "ungla") |
| 201 | ("džungla" "DŽUNGLA" "džungla" "DŽungla" "DŽungla") | 201 | ("džungla" "DŽUNGLA" "džungla" "DŽungla" "DŽungla") |
| 202 | ("define" "DEfiNE" "define" "Define" "Define") | 202 | ("define" "DEfiNE" "define" "Define" "Define") |
| 203 | ("fish" "fiSH" "fish" "fish" "fish") | 203 | ("fish" "fiSH" "fish" "fish" "fish") |