all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: completion-regexp-list and case-fold-search
Date: Wed, 31 Dec 2003 21:17:04 -0600 (CST)	[thread overview]
Message-ID: <200401010317.i013H4Q00357@raven.dms.auburn.edu> (raw)

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.

(2) would be simpler and very intuitive and would necessitate less
extra documentation.  On the other hand, it _would_ take away the
possibility of considering case significant in completion, but not in
using `completion-regexp-list' to eliminate some of the found
completions.

Do we want to go for (1) or (2)?  With (1) we are absolutely certain
that we do not break any code that was not already broken.  (Because
all we do is make both values of `partial-completion-mode' consistent.)
There is no such certainty with (2), but I do not believe that it
would not break any code currently included with the Emacs distribution.

Sincerely,

Luc.

             reply	other threads:[~2004-01-01  3:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-01  3:17 Luc Teirlinck [this message]
2004-01-05  3:41 ` completion-regexp-list and case-fold-search Richard Stallman
2004-01-05  4:17   ` Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401010317.i013H4Q00357@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.