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 | 1cee56f47a9bf92f00fc08c9dbdea68b6868b025 (patch) | |
tree | 43075d507575eae80535e6f4b1ab127a2b502354 | |
parent | 397dbe73e1f071af86ca278ea2bbc002a1ce45d6 (diff) | |
download | txr-1cee56f47a9bf92f00fc08c9dbdea68b6868b025.tar.gz txr-1cee56f47a9bf92f00fc08c9dbdea68b6868b025.tar.bz2 txr-1cee56f47a9bf92f00fc08c9dbdea68b6868b025.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; } |