From: Kim F. Storm Date: Wed, 21 Feb 2007 13:55:27 +0000 (+0000) Subject: (Fassoc_string): Doc fix. Allow symbol for KEY too. X-Git-Tag: emacs-pretest-22.0.94~49 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3fc66fb32818da0871c8cd88cf0d67ecafeedeb;p=emacs.git (Fassoc_string): Doc fix. Allow symbol for KEY too. --- diff --git a/src/minibuf.c b/src/minibuf.c index cc6859bfb1b..667799bf170 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2073,9 +2073,10 @@ do_completion () /* 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 @@ string rather than a cons cell whose car is a string. */) { 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;