[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test-completion and hash-tables
From: |
Luc Teirlinck |
Subject: |
test-completion and hash-tables |
Date: |
Sun, 14 Dec 2003 21:17:59 -0600 (CST) |
`try-completion' and `all-completions' use `compare-strings' to compare
strings, in its case-sensitive or case-insensitive variant, depending
on `completion-ignore-case', independently of how the collection of
strings is specified (alist, list, obarray, hash-table, function).
However, when the collection of strings is specified as a hash-table,
then `test-completion' uses whichever test the hash-table uses and, in
particular, `completion-ignore-case' is ignored.
Which of the following possibilities applies?
1. This is a bug.
2. `test-completion' is only supposed to be used on the results of
calling either `try-completion' or `all-completions'. In all
cases where I saw `test-completion' being used, this was the case.
If so, there is no inconsistency, as even `eq' hash-tables will
work.
3. It is the job of the programmer passing the hash table to
`test-completion' to make sure that the hash-table uses the correct
test, that is, the version of compare-strings that is consistent
with `completion-ignore-case'.
In cases (2) or (3), this should be clearly documented in
`(elisp)Basic Completion' as well as in the docstring of
`test-completion', which I could do. But I am not sure which of 1--3
applies.
Sincerely,
Luc.
- test-completion and hash-tables,
Luc Teirlinck <=