changeset 30684:8488e2964306

(do_completion): Don't consider a simple change of case as `completion'.
author Miles Bader <miles@gnu.org>
date Tue, 08 Aug 2000 16:26:31 +0000
parents 386d91b16514
children 8d91aa85240f
files src/minibuf.c
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/minibuf.c	Tue Aug 08 14:45:00 2000 +0000
+++ b/src/minibuf.c	Tue Aug 08 16:26:31 2000 +0000
@@ -1,5 +1,5 @@
 /* Minibuffer input and completion.
-   Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+   Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
          Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -1574,7 +1574,7 @@
 int
 do_completion ()
 {
-  Lisp_Object completion, tem;
+  Lisp_Object completion, string, tem;
   int completedp;
   Lisp_Object last;
   struct gcpro gcpro1, gcpro2;
@@ -1601,10 +1601,18 @@
       return 1;
     }
 
-  /* compiler bug */
-  tem = Fstring_equal (completion, Ffield_string(make_number (ZV)));
-  completedp = NILP (tem);
-  if (completedp)
+  string = Ffield_string (make_number (ZV));
+
+  /* COMPLETEDP should be true if some completion was done, which
+     doesn't include simply changing the case of the entered string.
+     However, for appearance, the string is rewritten if the case
+     changes.  */
+  tem = Fcompare_strings (completion, Qnil, Qnil, string, Qnil, Qnil, Qt);
+  completedp = (tem != Qt);
+
+  tem = Fstring_equal (completion, string);
+  if (NILP (tem))
+    /* Rewrite the user's input.  */
     {
       Fdelete_field (make_number (ZV)); /* Some completion happened */
       Finsert (1, &completion);