From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: completing-read case problem Date: Mon, 15 Nov 2004 17:06:34 -0500 Message-ID: References: <200411101929.iAAJThfq007309@haifa.math.ias.edu> <200411140703.iAE73Gd1019094@haifa.math.ias.edu> <005e01c4cb29$c7b8ef20$0200a8c0@sedrcw11488> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1100556474 29104 80.91.229.6 (15 Nov 2004 22:07:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Nov 2004 22:07:54 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 15 23:07:40 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CTp0d-0004q2-00 for ; Mon, 15 Nov 2004 23:07:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTp9M-00087S-07 for ged-emacs-devel@m.gmane.org; Mon, 15 Nov 2004 17:16:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTp9D-00086G-DL for emacs-devel@gnu.org; Mon, 15 Nov 2004 17:16:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTp9B-000855-4n for emacs-devel@gnu.org; Mon, 15 Nov 2004 17:16:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTp9A-000850-PC for emacs-devel@gnu.org; Mon, 15 Nov 2004 17:16:28 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CTozj-0008LX-BZ for emacs-devel@gnu.org; Mon, 15 Nov 2004 17:06:43 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id EE7238282A8; Mon, 15 Nov 2004 17:06:42 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 0CFC24AC763; Mon, 15 Nov 2004 17:06:35 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id EED678CA69; Mon, 15 Nov 2004 17:06:34 -0500 (EST) Original-To: Kevin Rodgers In-Reply-To: (Kevin Rodgers's message of "Mon, 15 Nov 2004 11:49:22 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29890 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29890 How 'bout the patch below, which is a free adaptation from my elisp code ... (cond ((or (= (field-beginning) (field-end)) (test-completion (field-string) minibuffer-completion-table minibuffer-completion-predicate)) (when completion-ignore-case ;; Fixup case of the field, if necessary. (let* ((string (field-string)) (compl (try-completion string minibuffer-completion-table minibuffer-completion-predicate))) (if (and (stringp string) ;; If it weren't for this piece of paranoia, I'd replace ;; the whole thing with a call to complete-do-completion. (= (length string) (length compl))) (let ((beg (field-beginning)) (end (field-end))) (goto-char end) (insert compl) (delete-region beg end))))) (exit-minibuffer)) ... Stefan --- minibuf.c 15 nov 2004 10:41:18 -0500 1.273 +++ minibuf.c 15 nov 2004 16:57:59 -0500 @@ -2076,10 +2076,27 @@ if (XINT (Fminibuffer_prompt_end ()) == ZV) goto exit; - if (!NILP (Ftest_completion (Fminibuffer_contents (), + if (!NILP (Ftest_completion (val = Fminibuffer_contents (), Vminibuffer_completion_table, Vminibuffer_completion_predicate))) + { + if (completion_ignore_case) + { /* Fixup case of the field, if necessary. */ + Lisp_Object compl + = Ftry_completion (val, + Vminibuffer_completion_table, + Vminibuffer_completion_predicate); + 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); + } + } goto exit; + } /* Call do_completion, but ignore errors. */ SET_PT (ZV);