diff options
| author | Eli Zaretskii | 2019-11-09 21:56:30 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-11-09 21:56:30 +0200 |
| commit | f2019fc676c2206bbdc53855e3bc4f1086676d3d (patch) | |
| tree | 5396d1b08da9f2592ac76fffee3b5bd93b19b70c /test/src | |
| parent | a1a724d73afae87b8c4daa2d64382be06fa37d0e (diff) | |
| download | emacs-f2019fc676c2206bbdc53855e3bc4f1086676d3d.tar.gz emacs-f2019fc676c2206bbdc53855e3bc4f1086676d3d.zip | |
Fix case-insensitive completion of buffer names
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
New test, suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
* src/minibuf.c (Ftry_completion): Don't treat strings that
are identical but for the case as if they were identical for
the purposes of not counting the same string twice. This
fixes case-insensitive completion when all the candidates are
identical but for the letter-case. (Bug#11339)
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/minibuf-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/src/minibuf-tests.el b/test/src/minibuf-tests.el index 12b018b8228..c64892822d6 100644 --- a/test/src/minibuf-tests.el +++ b/test/src/minibuf-tests.el | |||
| @@ -399,5 +399,16 @@ | |||
| 399 | (minibuf-tests--test-completion-regexp | 399 | (minibuf-tests--test-completion-regexp |
| 400 | #'minibuf-tests--strings-to-symbol-hashtable)) | 400 | #'minibuf-tests--strings-to-symbol-hashtable)) |
| 401 | 401 | ||
| 402 | (ert-deftest test-try-completion-ignore-case () | ||
| 403 | (let ((completion-ignore-case t)) | ||
| 404 | (should (equal (try-completion "bar" '("bAr" "barfoo")) "bAr")) | ||
| 405 | (should (equal (try-completion "bar" '("bArfoo" "barbaz")) "bar")) | ||
| 406 | (should (equal (try-completion "bar" '("bArfoo" "barbaz")) | ||
| 407 | (try-completion "bar" '("barbaz" "bArfoo")))) | ||
| 408 | ;; bug#11339 | ||
| 409 | (should (equal (try-completion "baz" '("baz" "bAz")) "baz")) ;And not `t'! | ||
| 410 | (should (equal (try-completion "baz" '("bAz" "baz")) | ||
| 411 | (try-completion "baz" '("baz" "bAz")))))) | ||
| 412 | |||
| 402 | 413 | ||
| 403 | ;;; minibuf-tests.el ends here | 414 | ;;; minibuf-tests.el ends here |