all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* test-completion and hash-tables
@ 2003-12-15  3:17 Luc Teirlinck
  2003-12-15  3:46 ` Luc Teirlinck
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Luc Teirlinck @ 2003-12-15  3:17 UTC (permalink / raw)


`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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-12-21 23:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-15  3:17 test-completion and hash-tables Luc Teirlinck
2003-12-15  3:46 ` Luc Teirlinck
2003-12-15  4:23 ` Luc Teirlinck
2003-12-18 23:05 ` Stefan Monnier
2003-12-18 23:57   ` Luc Teirlinck
2003-12-20  0:28     ` Luc Teirlinck
2003-12-21 23:28       ` Stefan Monnier
2003-12-20 16:58     ` Luc Teirlinck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.