diff options
| author | Noam Postavsky | 2016-11-27 10:04:48 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2016-12-06 22:20:23 -0500 |
| commit | 60fe63015165a03a765852f60367e548c1617f89 (patch) | |
| tree | ef14b3f84206cf0ebb499d81b4bec0c5c33fd9e2 /src | |
| parent | 58e418d2ceb82501f03d9c3316fd0a46faf7f0eb (diff) | |
| download | emacs-60fe63015165a03a765852f60367e548c1617f89.tar.gz emacs-60fe63015165a03a765852f60367e548c1617f89.zip | |
Give test-completion's PREDICATE full alist entry
Since 2016-06-26 "Fix test-completion with completion-regexp-list", when
calling test-completion with an alist collection, the predicate was
recieving the string value instead of the alist entry (Bug#24966).
* src/minibuf.c (Ftest_completion): Don't modify the found element, just
test STRING against `completion-regexp-list'.
* test/src/minibuf-tests.el: New tests for `try-completion',
`all-completions', and `test-completion'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 57eea05b0fc..6c694cb3123 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1686,8 +1686,6 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1686 | tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil); | 1686 | tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil); |
| 1687 | if (NILP (tem)) | 1687 | if (NILP (tem)) |
| 1688 | return Qnil; | 1688 | return Qnil; |
| 1689 | else if (CONSP (tem)) | ||
| 1690 | tem = XCAR (tem); | ||
| 1691 | } | 1689 | } |
| 1692 | else if (VECTORP (collection)) | 1690 | else if (VECTORP (collection)) |
| 1693 | { | 1691 | { |
| @@ -1770,9 +1768,9 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1770 | for (regexps = Vcompletion_regexp_list; CONSP (regexps); | 1768 | for (regexps = Vcompletion_regexp_list; CONSP (regexps); |
| 1771 | regexps = XCDR (regexps)) | 1769 | regexps = XCDR (regexps)) |
| 1772 | { | 1770 | { |
| 1773 | if (NILP (Fstring_match (XCAR (regexps), | 1771 | /* We can test against STRING, because if we got here, then |
| 1774 | SYMBOLP (tem) ? string : tem, | 1772 | the element is equivalent to it. */ |
| 1775 | Qnil))) | 1773 | if (NILP (Fstring_match (XCAR (regexps), string, Qnil))) |
| 1776 | return unbind_to (count, Qnil); | 1774 | return unbind_to (count, Qnil); |
| 1777 | } | 1775 | } |
| 1778 | unbind_to (count, Qnil); | 1776 | unbind_to (count, Qnil); |