From 1cee56f47a9bf92f00fc08c9dbdea68b6868b025 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 18 May 2021 06:37:30 -0700 Subject: 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. --- parser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/parser.c b/parser.c index ba416c70..b791d7d8 100644 --- a/parser.c +++ b/parser.c @@ -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; } -- cgit v1.2.3