aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fns.c b/src/fns.c
index 2d4c49fbaa2..545b4d7b0ea 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1524,6 +1524,22 @@ The value is actually the first element of LIST whose car equals KEY. */)
1524 return result; 1524 return result;
1525} 1525}
1526 1526
1527/* Like Fassoc but never report an error and do not allow quits.
1528 Use only on lists known never to be circular. */
1529
1530Lisp_Object
1531assoc_no_quit (key, list)
1532 Lisp_Object key, list;
1533{
1534 while (CONSP (list)
1535 && (!CONSP (XCAR (list))
1536 || (!EQ (XCAR (XCAR (list)), key)
1537 && NILP (Fequal (XCAR (XCAR (list)), key)))))
1538 list = XCDR (list);
1539
1540 return CONSP (list) ? XCAR (list) : Qnil;
1541}
1542
1527DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, 1543DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
1528 doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST. 1544 doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
1529The value is actually the first element of LIST whose cdr is KEY. */) 1545The value is actually the first element of LIST whose cdr is KEY. */)