diff options
| author | Kenichi Handa | 2006-06-06 03:51:12 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2006-06-06 03:51:12 +0000 |
| commit | 86840809690d05eac124c0ebdbb8f85eff9f711d (patch) | |
| tree | 9da45d55fc4ad7832f571c6768abf0c7c9fa2032 /src | |
| parent | d53f587beec6dd9c0456a0d654b21703a114c19e (diff) | |
| download | emacs-86840809690d05eac124c0ebdbb8f85eff9f711d.tar.gz emacs-86840809690d05eac124c0ebdbb8f85eff9f711d.zip | |
(assoc_no_quit): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 16 |
1 files changed, 16 insertions, 0 deletions
| @@ -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 | |||
| 1530 | Lisp_Object | ||
| 1531 | assoc_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 | |||
| 1527 | DEFUN ("rassq", Frassq, Srassq, 2, 2, 0, | 1543 | DEFUN ("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. |
| 1529 | The value is actually the first element of LIST whose cdr is KEY. */) | 1545 | The value is actually the first element of LIST whose cdr is KEY. */) |