From 37ed3d15f38339400eba67647c87fad85de3a384 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 2 Jul 2023 09:16:58 +0300 Subject: Avoid errors in completion due to 'completion-regexp-list' * doc/lispref/minibuf.texi (Basic Completion): * src/minibuf.c (syms_of_minibuf) : Document that global non-nil settings of 'completion-regexp-list' are not safe. * lisp/minibuffer.el (completion-pcm--merge-completions): Avoid errors in 'try-completion' when PREFIX is nil. (Bug#64351) --- src/minibuf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/minibuf.c') diff --git a/src/minibuf.c b/src/minibuf.c index 6e54d8c3ba5..58adde1bf66 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2471,7 +2471,12 @@ The basic completion functions only consider a completion acceptable if it matches all regular expressions in this list, with `case-fold-search' bound to the value of `completion-ignore-case'. See Info node `(elisp)Basic Completion', for a description of these -functions. */); +functions. + +Do not set this variable to a non-nil value globally, as that is not +safe and will probably cause errors in completion commands. This +variable should be only let-bound to non-nil values around calls to +basic completion functions like `try-completion' and `all-completions'. */); Vcompletion_regexp_list = Qnil; DEFVAR_BOOL ("minibuffer-allow-text-properties", -- cgit v1.2.3