From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: completion-regexp-list and case-fold-search Date: Wed, 31 Dec 2003 21:17:04 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200401010317.i013H4Q00357@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1072927253 20586 80.91.224.253 (1 Jan 2004 03:20:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Jan 2004 03:20:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jan 01 04:20:45 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AbtO9-0001NE-00 for ; Thu, 01 Jan 2004 04:20:45 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AbtO8-0005vW-00 for ; Thu, 01 Jan 2004 04:20:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AbuJw-0001MG-1R for emacs-devel@quimby.gnus.org; Wed, 31 Dec 2003 23:20:28 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AbuJr-0001Lu-DH for emacs-devel@gnu.org; Wed, 31 Dec 2003 23:20:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AbuJL-00017w-Jt for emacs-devel@gnu.org; Wed, 31 Dec 2003 23:20:22 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AbuJL-00016Y-CI for emacs-devel@gnu.org; Wed, 31 Dec 2003 23:19:51 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by mx20.gnu.org with esmtp (Exim 4.24) id 1AbtKX-0004i1-2p for emacs-devel@gnu.org; Wed, 31 Dec 2003 22:17:01 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i013HLKk009286 for ; Wed, 31 Dec 2003 21:17:21 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i013H4Q00357; Wed, 31 Dec 2003 21:17:04 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18936 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18936 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.