emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/minibuf.c,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/minibuf.c,v
Date: Thu, 16 Aug 2007 02:20:59 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       07/08/16 02:20:59

Index: minibuf.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/minibuf.c,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -b -r1.332 -r1.333
--- minibuf.c   26 Jul 2007 05:27:55 -0000      1.332
+++ minibuf.c   16 Aug 2007 02:20:58 -0000      1.333
@@ -1288,11 +1288,14 @@
   int bestmatchsize = 0;
   /* These are in bytes, too.  */
   int compare, matchsize;
-  int type = (HASH_TABLE_P (collection) ? 3
-             : VECTORP (collection) ? 2
-             : NILP (collection) || (CONSP (collection)
+  enum { function_table, list_table, obarray_table, hash_table}
+    type = (HASH_TABLE_P (collection) ? hash_table
+           : VECTORP (collection) ? obarray_table
+           : ((NILP (collection)
+               || (CONSP (collection)
                                      && (!SYMBOLP (XCAR (collection))
-                                         || NILP (XCAR (collection)))));
+                       || NILP (XCAR (collection)))))
+              ? list_table : function_table));
   int index = 0, obsize = 0;
   int matchcount = 0;
   int bindcount = -1;
@@ -1300,7 +1303,7 @@
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
   CHECK_STRING (string);
-  if (type == 0)
+  if (type == function_table)
     return call3 (collection, string, predicate, Qnil);
 
   bestmatch = bucket = Qnil;
@@ -1308,7 +1311,7 @@
 
   /* If COLLECTION is not a list, set TAIL just for gc pro.  */
   tail = collection;
-  if (type == 2)
+  if (type == obarray_table)
     {
       collection = check_obarray (collection);
       obsize = XVECTOR (collection)->size;
@@ -1322,7 +1325,7 @@
       /* elt gets the alist element or symbol.
         eltstring gets the name to check as a completion. */
 
-      if (type == 1)
+      if (type == list_table)
        {
          if (!CONSP (tail))
            break;
@@ -1330,7 +1333,7 @@
          eltstring = CONSP (elt) ? XCAR (elt) : elt;
          tail = XCDR (tail);
        }
-      else if (type == 2)
+      else if (type == obarray_table)
        {
          if (!EQ (bucket, zero))
            {
@@ -1351,7 +1354,7 @@
              continue;
            }
        }
-      else /* if (type == 3) */
+      else /* if (type == hash_table) */
        {
          while (index < HASH_TABLE_SIZE (XHASH_TABLE (collection))
                 && NILP (HASH_HASH (XHASH_TABLE (collection), index)))
@@ -1405,15 +1408,17 @@
                tem = Fcommandp (elt, Qnil);
              else
                {
-                 if (bindcount >= 0) {
+                 if (bindcount >= 0)
+                   {
                    unbind_to (bindcount, Qnil);
                    bindcount = -1;
                  }
                  GCPRO4 (tail, string, eltstring, bestmatch);
-                 tem = type == 3
+                 tem = (type == hash_table
                    ? call2 (predicate, elt,
-                            HASH_VALUE (XHASH_TABLE (collection), index - 1))
-                   : call1 (predicate, elt);
+                                 HASH_VALUE (XHASH_TABLE (collection),
+                                             index - 1))
+                        : call1 (predicate, elt));
                  UNGCPRO;
                }
              if (NILP (tem)) continue;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]