diff options
| author | Stefan Monnier | 2013-04-09 16:10:47 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-04-09 16:10:47 -0400 |
| commit | a8036e4076f6d43537905e3aaf400992fdef38e4 (patch) | |
| tree | 54a65a27a643cc8908cf12f059bc70c0820939a1 /src | |
| parent | 79e04e9e20aa0e1f0652d96cdb6d124aed7f2bf4 (diff) | |
| download | emacs-a8036e4076f6d43537905e3aaf400992fdef38e4.tar.gz emacs-a8036e4076f6d43537905e3aaf400992fdef38e4.zip | |
* src/minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
tables.
Fixes: debbugs:14054
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/minibuf.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 04dcee7b6eb..402792b5460 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash | ||
| 4 | tables (bug#14054). | ||
| 5 | |||
| 1 | 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * window.c (select_window): Don't record_buffer while the invariant is | 8 | * window.c (select_window): Don't record_buffer while the invariant is |
diff --git a/src/minibuf.c b/src/minibuf.c index 68c39310f01..4cc1f8d435a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1800,17 +1800,21 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1800 | { | 1800 | { |
| 1801 | struct Lisp_Hash_Table *h = XHASH_TABLE (collection); | 1801 | struct Lisp_Hash_Table *h = XHASH_TABLE (collection); |
| 1802 | i = hash_lookup (h, string, NULL); | 1802 | i = hash_lookup (h, string, NULL); |
| 1803 | Lisp_Object key = Qnil; | ||
| 1803 | if (i >= 0) | 1804 | if (i >= 0) |
| 1804 | tem = HASH_KEY (h, i); | 1805 | tem = HASH_KEY (h, i); |
| 1805 | else | 1806 | else |
| 1806 | for (i = 0; i < HASH_TABLE_SIZE (h); ++i) | 1807 | for (i = 0; i < HASH_TABLE_SIZE (h); ++i) |
| 1807 | if (!NILP (HASH_HASH (h, i)) | 1808 | if (!NILP (HASH_HASH (h, i)) |
| 1809 | && (key = HASH_KEY (h, i), | ||
| 1810 | SYMBOLP (key) ? key = Fsymbol_name (key) : key, | ||
| 1811 | STRINGP (key)) | ||
| 1808 | && EQ (Fcompare_strings (string, make_number (0), Qnil, | 1812 | && EQ (Fcompare_strings (string, make_number (0), Qnil, |
| 1809 | HASH_KEY (h, i), make_number (0) , Qnil, | 1813 | key, make_number (0) , Qnil, |
| 1810 | completion_ignore_case ? Qt : Qnil), | 1814 | completion_ignore_case ? Qt : Qnil), |
| 1811 | Qt)) | 1815 | Qt)) |
| 1812 | { | 1816 | { |
| 1813 | tem = HASH_KEY (h, i); | 1817 | tem = key; |
| 1814 | break; | 1818 | break; |
| 1815 | } | 1819 | } |
| 1816 | if (!STRINGP (tem)) | 1820 | if (!STRINGP (tem)) |