# HG changeset patch # User Richard M. Stallman # Date 1100989927 0 # Node ID f8ac0eb0faa372e5ad6cfe9387bccef7f5088ba0 # Parent 0301caf145d2975b64ded1b00ecdd5fe9f76e1de (Fminibuffer_complete_and_exit): Fixup the case of the completed value, for case-indep completion. diff -r 0301caf145d2 -r f8ac0eb0faa3 src/minibuf.c --- a/src/minibuf.c Sat Nov 20 22:09:50 2004 +0000 +++ b/src/minibuf.c Sat Nov 20 22:32:07 2004 +0000 @@ -2082,9 +2082,29 @@ if (XINT (Fminibuffer_prompt_end ()) == ZV) goto exit; - if (!NILP (Ftest_completion (Fminibuffer_contents (), + val = Fminibuffer_contents (); + if (!NILP (Ftest_completion (val, 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; + } + goto exit; /* Call do_completion, but ignore errors. */