diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-18 06:37:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-18 06:37:30 -0700 |
commit | cade5f33b12edce9b707a6038bf630d459f78212 (patch) | |
tree | 43075d507575eae80535e6f4b1ab127a2b502354 | |
parent | 6ccad80f7b91a329f4543e4a6661955e756ce1de (diff) | |
download | txr-cade5f33b12edce9b707a6038bf630d459f78212.tar.gz txr-cade5f33b12edce9b707a6038bf630d459f78212.tar.bz2 txr-cade5f33b12edce9b707a6038bf630d459f78212.zip |
listener: don't complete on unbound symbols
This patch prevents Tab-completing on interned symbols that
have no binding.
The current behavior is, for instance:
1> 'hamsandwich
hamsandwich
2> 'ham[Tab]
2> 'hamsandwich ;; completes
The new behavior will not complete hamsandwich, because it has
no binding as a function or variable.
* parser.c (find_matching_syms): Treat the default case the
same as after '[': a function or variable binding is required,
or the symbol is not listed. Use fboundp instead of
lookup_fun. They are the same, except in TXR 127 compat mode,
which includes macros under fboundp.
-rw-r--r-- | parser.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -957,14 +957,13 @@ static void find_matching_syms(lino_completions_t *cpl, if (!fboundp(sym) && !mboundp(sym) && !special_operator_p(sym)) continue; break; - case '[': - if (!boundp(sym) && !lookup_fun(nil, sym)) - continue; - break; case 'M': case 'S': break; + case '[': default: + if (!fboundp(sym) && !boundp(sym)) + continue; break; } |