emacs-diffs
[Top][All Lists]
Advanced

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

pkg 62582ea927 72/76: Fix completion for new symbol table layout


From: Gerd Moellmann
Subject: pkg 62582ea927 72/76: Fix completion for new symbol table layout
Date: Fri, 21 Oct 2022 00:16:20 -0400 (EDT)

branch: pkg
commit 62582ea927aee0212ef08702d07880e86f64c442
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Fix completion for new symbol table layout
---
 src/minibuf.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/src/minibuf.c b/src/minibuf.c
index 886d2dec93..36b8d401d9 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1658,6 +1658,12 @@ or from one of the possible completions.  */)
            idx++;
          if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
            break;
+         else if (symbol_table_p)
+           {
+             elt = HASH_KEY (XHASH_TABLE (collection), idx);
+             eltstring = SYMBOL_NAME (elt);
+             ++idx;
+           }
          else
            elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
        }
@@ -1697,11 +1703,13 @@ or from one of the possible completions.  */)
                tem = Fcommandp (elt, Qnil);
              else if (HASH_TABLE_P (collection))
                {
-                 const Lisp_Object value = HASH_VALUE (XHASH_TABLE 
(collection), idx - 1);
                  if (symbol_table_p)
-                   tem = call1 (predicate, value);
+                   tem = call1 (predicate, elt);
                  else
-                   tem = call2 (predicate, elt, value);
+                   {
+                     const Lisp_Object value = HASH_VALUE (XHASH_TABLE 
(collection), idx - 1);
+                     tem = call2 (predicate, elt, value);
+                   }
                }
              else
                tem = call1 (predicate, elt);
@@ -1893,6 +1901,11 @@ with a space are ignored unless STRING itself starts 
with a space.  */)
            idx++;
          if (idx >= HASH_TABLE_SIZE (XHASH_TABLE (collection)))
            break;
+         else if (symbol_table_p)
+           {
+             elt = HASH_KEY (XHASH_TABLE (collection), idx++);
+             eltstring = SYMBOL_NAME (elt);
+           }
          else
            elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
        }
@@ -1931,11 +1944,13 @@ with a space are ignored unless STRING itself starts 
with a space.  */)
                tem = Fcommandp (elt, Qnil);
              else if (HASH_TABLE_P (collection))
                {
-                 const Lisp_Object value = HASH_VALUE (XHASH_TABLE 
(collection), idx - 1);
                  if (symbol_table_p)
-                   tem = call1 (predicate, value);
+                   tem = call1 (predicate, elt);
                  else
-                   tem = call2 (predicate, elt, value);
+                   {
+                     const Lisp_Object value = HASH_VALUE (XHASH_TABLE 
(collection), idx - 1);
+                     tem = call2 (predicate, elt, value);
+                   }
                }
              else
                tem = call1 (predicate, elt);
@@ -2086,9 +2101,12 @@ the values STRING, PREDICATE and `lambda'.  */)
 
   if (HASH_TABLE_P (collection))
     {
-      const Lisp_Object value = HASH_VALUE (XHASH_TABLE (collection), i);
       if (symbol_table_p)
-       return call1 (predicate, value);
+       {
+         Lisp_Object sym = HASH_KEY (XHASH_TABLE (collection), i);
+         return call1 (predicate, sym);
+       }
+      const Lisp_Object value = HASH_VALUE (XHASH_TABLE (collection), i);
       return call2 (predicate, tem, value);
     }
 



reply via email to

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