]> code.delx.au - gnu-emacs/blobdiff - src/fns.c
Merge from emacs--devo--0
[gnu-emacs] / src / fns.c
index dd496f4c253f6c40cd4db7d10b25b19109918f58..3b4b3e5149bdec0cb0c0d0e88c41ebd84b151770 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -48,8 +48,12 @@ Boston, MA 02110-1301, USA.  */
 #include "frame.h"
 #include "window.h"
 #include "blockinput.h"
-#if defined (HAVE_MENUS) && defined (HAVE_X_WINDOWS)
+#ifdef HAVE_MENUS
+#if defined (HAVE_X_WINDOWS)
 #include "xterm.h"
+#elif defined (MAC_OS)
+#include "macterm.h"
+#endif
 #endif
 
 #ifndef NULL
@@ -1520,6 +1524,22 @@ The value is actually the first element of LIST whose car equals KEY.  */)
   return result;
 }
 
+/* Like Fassoc but never report an error and do not allow quits.
+   Use only on lists known never to be circular.  */
+
+Lisp_Object
+assoc_no_quit (key, list)
+     Lisp_Object key, list;
+{
+  while (CONSP (list)
+        && (!CONSP (XCAR (list))
+            || (!EQ (XCAR (XCAR (list)), key)
+                && NILP (Fequal (XCAR (XCAR (list)), key)))))
+    list = XCDR (list);
+
+  return CONSP (list) ? XCAR (list) : Qnil;
+}
+
 DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
        doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
 The value is actually the first element of LIST whose cdr is KEY.  */)
@@ -2778,7 +2798,7 @@ is nil, and `use-dialog-box' is non-nil.  */)
     {
       ans = Fdowncase (Fread_from_minibuffer (prompt, Qnil, Qnil, Qnil,
                                              Qyes_or_no_p_history, Qnil,
-                                             Qnil, Qnil));
+                                             Qnil));
       if (SCHARS (ans) == 3 && !strcmp (SDATA (ans), "yes"))
        {
          UNGCPRO;
@@ -4473,6 +4493,12 @@ sxhash_list (list, depth)
        hash = SXHASH_COMBINE (hash, hash2);
       }
 
+  if (!NILP (list))
+    {
+      unsigned hash2 = sxhash (list, depth + 1);
+      hash = SXHASH_COMBINE (hash, hash2);
+    }
+
   return hash;
 }