diff lisp/alist.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 023b83f4e54b
line wrap: on
line diff
--- a/lisp/alist.el	Mon Aug 13 11:33:40 2007 +0200
+++ b/lisp/alist.el	Mon Aug 13 11:35:02 2007 +0200
@@ -22,7 +22,18 @@
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;;; Code:
+
+;;;###autoload
+(defun vassoc (key valist)
+  "Search VALIST for a vector whose first element is equal to KEY.
+See also `assoc'."
+  ;; by Stig@hackvan.com
+  (let (el)
+    (catch 'done
+      (while (setq el (pop valist))
+	(and (equal key (aref el 0))
+	     (throw 'done el))))))
+
 
 ;;;###autoload
 (defun put-alist (item value alist)