diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 () | |||
| 2073 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ | 2073 | /* Like assoc but assumes KEY is a string, and ignores case if appropriate. */ |
| 2074 | 2074 | ||
| 2075 | DEFUN ("assoc-string", Fassoc_string, Sassoc_string, 2, 3, 0, | 2075 | DEFUN ("assoc-string", Fassoc_string, Sassoc_string, 2, 3, 0, |
| 2076 | doc: /* Like `assoc' but specifically for strings. | 2076 | doc: /* Like `assoc' but specifically for strings (and symbols). |
| 2077 | Unibyte strings are converted to multibyte for comparison. | 2077 | Symbols are converted to strings, and unibyte strings are converted to |
| 2078 | And case is ignored if CASE-FOLD is non-nil. | 2078 | multibyte for comparison. |
| 2079 | Case is ignored if optional arg CASE-FOLD is non-nil. | ||
| 2079 | As opposed to `assoc', it will also match an entry consisting of a single | 2080 | As opposed to `assoc', it will also match an entry consisting of a single |
| 2080 | string rather than a cons cell whose car is a string. */) | 2081 | string rather than a cons cell whose car is a string. */) |
| 2081 | (key, list, case_fold) | 2082 | (key, list, case_fold) |
| @@ -2084,6 +2085,9 @@ string rather than a cons cell whose car is a string. */) | |||
| 2084 | { | 2085 | { |
| 2085 | register Lisp_Object tail; | 2086 | register Lisp_Object tail; |
| 2086 | 2087 | ||
| 2088 | if (SYMBOLP (key)) | ||
| 2089 | key = Fsymbol_name (key); | ||
| 2090 | |||
| 2087 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) | 2091 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 2088 | { | 2092 | { |
| 2089 | register Lisp_Object elt, tem, thiscar; | 2093 | register Lisp_Object elt, tem, thiscar; |