From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Barrett Newsgroups: gmane.emacs.bugs,gmane.emacs.devel Subject: bug in minibuffer-complete-and-exit, fix included Date: Tue, 27 Dec 2005 00:38:38 -0800 (PST) Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1135675429 8940 80.91.229.2 (27 Dec 2005 09:23:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2005 09:23:49 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 27 10:23:46 2005 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ErB3Z-0006JG-EX for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2005 10:23:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ErB4o-0001hJ-9E for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2005 04:25:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ErANR-0004sm-77 for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2005 03:40:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ErANL-0004s7-Hk for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2005 03:40:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ErANK-0004rp-Rx; Tue, 27 Dec 2005 03:40:07 -0500 Original-Received: from [216.239.45.12] (helo=smtp-out.google.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1ErANI-0002qD-Jk; Tue, 27 Dec 2005 03:40:04 -0500 Original-Received: from nappa.corp.google.com (nappa.corp.google.com [172.24.0.4]) by smtp-out.google.com with ESMTP id jBR8cfql019723; Tue, 27 Dec 2005 00:38:41 -0800 Original-Received: from davis.corp.google.com (davis.corp.google.com [172.22.84.67]) by nappa.corp.google.com with ESMTP id jBR8ccn1031066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Dec 2005 00:38:38 -0800 X-X-Sender: ryanb@davis.corp.google.com Original-To: bug-gnu-emacs@gnu.org, emacs-devel@gnu.org X-Mailman-Approved-At: Tue, 27 Dec 2005 04:17:24 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:14678 gmane.emacs.devel:48404 Archived-At: hi all. i recently noticed a bug in minibuffer-complete-and-exit. if completion-ignore-case is t, and the minibuffer contains a valid completion in the wrong case, its case isn't fixed. it should be. sorry, that was a mouthful. :P here's an example. if foo is a possible completion, and you enter FoO in the minibuffer, minibuffer-complete-and-exit returns FoO. it should return foo instead. this spreads to other code that uses the minibuffer. for example, read-buffer has an optional arg require-match. if t, an existing buffer name must be entered. the list of existing buffer names is used as completions. if completion-ignore-case is t, and you enter an existing buffer name *in the wrong case*, it's not completed to the right case. (same with read-file-name and mustmatch.) here's a test case. run emacs -q, then evaluate these forms: (setq completion-ignore-case t) (read-buffer "buffer name: " nil t) enter *scrATCH* at the prompt. it returns *scrATCH*, but it should return *scratch*. the patch below, against CVS, fixes this. if i understand the process right, it's small enough that you can include it without papers. hopefully it's also small enough to consider for the emacs 22 release. *** minibuf.c 21 Dec 2005 17:33:40 -0000 1.297 --- minibuf.c 27 Dec 2005 07:39:07 -0000 *************** *** 2139,2145 **** if (STRINGP (compl) /* If it weren't for this piece of paranoia, I'd replace the whole thing with a call to do_completion. */ ! && EQ (Flength (val), Flength (compl))) { del_range (XINT (Fminibuffer_prompt_end ()), ZV); Finsert (1, &compl); --- 2139,2145 ---- if (STRINGP (compl) /* If it weren't for this piece of paranoia, I'd replace the whole thing with a call to do_completion. */ ! && EQ (XFASTINT (Flength (val)), XFASTINT (Flength (compl)))) { del_range (XINT (Fminibuffer_prompt_end ()), ZV); Finsert (1, &compl); -Ryan -- http://snarfed.org/