diff lisp/alist.el @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents 6719134a07c2
children 697ef44129c6
line wrap: on
line diff
--- a/lisp/alist.el	Mon Aug 13 11:15:00 2007 +0200
+++ b/lisp/alist.el	Mon Aug 13 11:16:07 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)