diff options
| author | Richard M. Stallman | 2004-11-20 22:32:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-20 22:32:07 +0000 |
| commit | 36baf3b70ed00000fe4dafe2fed72575cfd93dbd (patch) | |
| tree | 68a397af6713d4d94769defcd81c88bedc2f25b0 /src | |
| parent | bbe9f1755cc18041e60f4d4be48bfa3aceaf1b9d (diff) | |
| download | emacs-36baf3b70ed00000fe4dafe2fed72575cfd93dbd.tar.gz emacs-36baf3b70ed00000fe4dafe2fed72575cfd93dbd.zip | |
(Fminibuffer_complete_and_exit):
Fixup the case of the completed value, for case-indep completion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 0037bd70535..fd90a73f8eb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -2082,9 +2082,29 @@ a repetition of this command will exit. */) | |||
| 2082 | if (XINT (Fminibuffer_prompt_end ()) == ZV) | 2082 | if (XINT (Fminibuffer_prompt_end ()) == ZV) |
| 2083 | goto exit; | 2083 | goto exit; |
| 2084 | 2084 | ||
| 2085 | if (!NILP (Ftest_completion (Fminibuffer_contents (), | 2085 | val = Fminibuffer_contents (); |
| 2086 | if (!NILP (Ftest_completion (val, | ||
| 2086 | Vminibuffer_completion_table, | 2087 | Vminibuffer_completion_table, |
| 2087 | Vminibuffer_completion_predicate))) | 2088 | Vminibuffer_completion_predicate))) |
| 2089 | { | ||
| 2090 | if (completion_ignore_case) | ||
| 2091 | { /* Fixup case of the field, if necessary. */ | ||
| 2092 | Lisp_Object compl | ||
| 2093 | = Ftry_completion (val, | ||
| 2094 | Vminibuffer_completion_table, | ||
| 2095 | Vminibuffer_completion_predicate); | ||
| 2096 | if (STRINGP (compl) | ||
| 2097 | /* If it weren't for this piece of paranoia, I'd replace | ||
| 2098 | the whole thing with a call to do_completion. */ | ||
| 2099 | && EQ (Flength (val), Flength (compl))) | ||
| 2100 | { | ||
| 2101 | del_range (XINT (Fminibuffer_prompt_end ()), ZV); | ||
| 2102 | Finsert (1, &compl); | ||
| 2103 | } | ||
| 2104 | } | ||
| 2105 | goto exit; | ||
| 2106 | } | ||
| 2107 | |||
| 2088 | goto exit; | 2108 | goto exit; |
| 2089 | 2109 | ||
| 2090 | /* Call do_completion, but ignore errors. */ | 2110 | /* Call do_completion, but ignore errors. */ |