From a6dbf22b20cb2bab2be8ef11efcc7bb6bcf84063 Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 21 Aug 1999 14:16:01 +0000 Subject: [PATCH] (rassoc): Just ignore elements of LIST that are not conse cell and add doc string according to its features. --- poe.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- 1.7.10.4