1 Jan 2004 04:17
completion-regexp-list and case-fold-search
Luc Teirlinck <teirllm <at> dms.auburn.edu>
2004-01-01 03:17:04 GMT
2004-01-01 03:17:04 GMT
The case sensitivity of regex matching in the use of
`completion-regexp-list' by the basic completion functions is
determined by `case-fold-search' and _not_ by
`completion-ignore-case'. Whether something is a valid completion for
the minibuffer completion functions has nothing to do with whether the
user prefers _interactive regexp searches_ to be case-sensitive or
not. Hence, `case-fold-search' should be bound around all calls to
`{try,test}-completion' and `all-completions'. If `partial-completion-mode'
is enabled, that is the case: `case-fold-search' is bound to the
value of `completion-ignore-case' around all calls. That seems to
make sense and is correct for the one single use of
`completion-regexp-list' in the Emacs source code (`customize-mode').
With `partial-completion-mode' set to nil (the default) this is not the
case however. This is a bug.
Two solutions:
1. Make all the basic minibuffer completion functions bind
`case-fold-search' to the value of `completion-ignore-case' around
all calls to `{try,test}-completion' and `all-completions', as
`partial-completion-mode' already does.
2. More radically, make `{try,test}-completion' and `all-completions'
_themselves_ bind `case-fold-search' to the value of
`completion-ignore-case', thereby effectively making the
case-sensitivity of `completion-regexp-list' entirely determined
by `completion-ignore-case'.
I have implemented (1) in my private Emacs and it seems to work
perfectly.
(Continue reading)
RSS Feed