diff options
author | Kenichi Handa <handa@m17n.org> | 2006-06-06 03:51:12 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2006-06-06 03:51:12 +0000 |
commit | 86840809690d05eac124c0ebdbb8f85eff9f711d (patch) | |
tree | 9da45d55fc4ad7832f571c6768abf0c7c9fa2032 /src/fns.c | |
parent | d53f587beec6dd9c0456a0d654b21703a114c19e (diff) | |
download | emacs-86840809690d05eac124c0ebdbb8f85eff9f711d.tar.gz |
(assoc_no_quit): New function.
Diffstat (limited to 'src/fns.c')
-rw-r--r-- | src/fns.c | 16 |
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. */) 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. */) |