From: ueno Date: Sat, 21 Aug 1999 14:16:01 +0000 (+0000) Subject: (rassoc): Just ignore elements of LIST that are not conse cell and add X-Git-Tag: of-tm-8_3~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a6dbf22b20cb2bab2be8ef11efcc7bb6bcf84063;p=elisp%2Fapel.git (rassoc): Just ignore elements of LIST that are not conse cell and add doc string according to its features. --- diff --git a/poe.el b/poe.el index b65246f..2a1b19c 100644 --- a/poe.el +++ b/poe.el @@ -287,12 +287,14 @@ See `read-from-minibuffer' for details of HISTORY argument." (defun-maybe rassoc (key list) "Return non-nil if KEY is `equal' to the cdr of an element of LIST. The value is actually the element of LIST whose cdr equals KEY. +Elements of LIST that are not conses are ignored. \[Emacs 19.29 emulating function]" (catch 'found (while list - (if (equal (cdr (car list)) key) - (throw 'found (car list))) - (setq list (cdr list))))) + (cond ((not (consp (car list)))) + ((equal (cdr (car list)) key) + (throw 'found (car list)) )) + (setq list (cdr list)) ))) ;; imported from emacs-19.34/lisp/files.el. (defun-maybe file-name-sans-extension (filename)