# HG changeset patch # User Kim F. Storm # Date 1172066127 0 # Node ID c76aa2fa987a4cc30911b63b24fd209c113c7064 # Parent 457dc583fa985588aa526b5beae131b6a94fa172 (Fassoc_string): Doc fix. Allow symbol for KEY too. diff -r 457dc583fa98 -r c76aa2fa987a src/minibuf.c --- a/src/minibuf.c Wed Feb 21 13:55:10 2007 +0000 +++ b/src/minibuf.c Wed Feb 21 13:55:27 2007 +0000 @@ -2073,9 +2073,10 @@ /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ DEFUN ("assoc-string", Fassoc_string, Sassoc_string, 2, 3, 0, - doc: /* Like `assoc' but specifically for strings. -Unibyte strings are converted to multibyte for comparison. -And case is ignored if CASE-FOLD is non-nil. + doc: /* Like `assoc' but specifically for strings (and symbols). +Symbols are converted to strings, and unibyte strings are converted to +multibyte for comparison. +Case is ignored if optional arg CASE-FOLD is non-nil. As opposed to `assoc', it will also match an entry consisting of a single string rather than a cons cell whose car is a string. */) (key, list, case_fold) @@ -2084,6 +2085,9 @@ { register Lisp_Object tail; + if (SYMBOLP (key)) + key = Fsymbol_name (key); + for (tail = list; !NILP (tail); tail = Fcdr (tail)) { register Lisp_Object elt, tem, thiscar;