From 15496bac5416036ea8b6d79195fba9ae50aea67e Mon Sep 17 00:00:00 2001 From: Maciej Lapinski Date: Fri, 6 Jan 2023 12:31:25 +0100 Subject: [PATCH] Fix #557: Copy the returned all-completions list Copy the returned all-completions list so that it could be later destructively modified by the completion UI. --- lib/sly-completion.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sly-completion.el b/lib/sly-completion.el index 5839ed453..84a834e3e 100644 --- a/lib/sly-completion.el +++ b/lib/sly-completion.el @@ -262,12 +262,13 @@ ANNOTATION) describing each completion possibility." (display-sort-function . identity) (category . sly-completion))) ;; all completions - (`t (car (all))) + (`t (copy-sequence (car (all)))) ;; try completion (`nil (try)) (`(try-completion . ,point) (cons 'try-completion (cons string point))) - (`(all-completions . ,_point) (cons 'all-completions (car (all)))) + (`(all-completions . ,_point) (cons 'all-completions + (copy-sequence (car (all))))) (`(boundaries . ,thing) (completion-boundaries string (all) pred thing))