diff options
| author | Justin Burkett | 2020-02-12 09:23:18 -0500 |
|---|---|---|
| committer | Justin Burkett | 2020-02-12 09:23:18 -0500 |
| commit | 7b068f3e95a0d777cbdba92aecb6c876ccddbae5 (patch) | |
| tree | 597143fc1871d09e99889a6723b854074776ec36 | |
| parent | 9ff54fffbb20ad92361aeeae4bc5966dbe793dd0 (diff) | |
| download | emacs-7b068f3e95a0d777cbdba92aecb6c876ccddbae5.tar.gz emacs-7b068f3e95a0d777cbdba92aecb6c876ccddbae5.zip | |
Fix case sorting in alpha sort functions
| -rw-r--r-- | which-key-tests.el | 4 | ||||
| -rw-r--r-- | which-key.el | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/which-key-tests.el b/which-key-tests.el index 81797975184..ae015bec6ef 100644 --- a/which-key-tests.el +++ b/which-key-tests.el | |||
| @@ -170,12 +170,12 @@ | |||
| 170 | (should | 170 | (should |
| 171 | (equal | 171 | (equal |
| 172 | (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha)) | 172 | (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha)) |
| 173 | '("SPC" "a" "A" "b" "B" "p" "C-a")))) | 173 | '("SPC" "A" "a" "B" "b" "p" "C-a")))) |
| 174 | (let (which-key-sort-uppercase-first) | 174 | (let (which-key-sort-uppercase-first) |
| 175 | (should | 175 | (should |
| 176 | (equal | 176 | (equal |
| 177 | (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha)) | 177 | (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha)) |
| 178 | '("SPC" "A" "a" "B" "b" "p" "C-a")))) | 178 | '("SPC" "a" "A" "b" "B" "p" "C-a")))) |
| 179 | (let ((which-key-sort-uppercase-first t)) | 179 | (let ((which-key-sort-uppercase-first t)) |
| 180 | (should | 180 | (should |
| 181 | (equal | 181 | (equal |
diff --git a/which-key.el b/which-key.el index d0a28a10589..e5127eefdbe 100644 --- a/which-key.el +++ b/which-key.el | |||
| @@ -1321,11 +1321,11 @@ width) in lines and characters respectively." | |||
| 1321 | (cond | 1321 | (cond |
| 1322 | ((and alpha (not which-key-sort-uppercase-first)) | 1322 | ((and alpha (not which-key-sort-uppercase-first)) |
| 1323 | (if (string-equal da db) | 1323 | (if (string-equal da db) |
| 1324 | (string-lessp a b) | 1324 | (not (string-lessp a b)) |
| 1325 | (string-lessp da db))) | 1325 | (string-lessp da db))) |
| 1326 | ((and alpha which-key-sort-uppercase-first) | 1326 | ((and alpha which-key-sort-uppercase-first) |
| 1327 | (if (string-equal da db) | 1327 | (if (string-equal da db) |
| 1328 | (not (string-lessp a b)) | 1328 | (string-lessp a b) |
| 1329 | (string-lessp da db))) | 1329 | (string-lessp da db))) |
| 1330 | ((not which-key-sort-uppercase-first) | 1330 | ((not which-key-sort-uppercase-first) |
| 1331 | (let ((aup (not (string-equal da a))) | 1331 | (let ((aup (not (string-equal da a))) |