aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/minibuf.texi6
-rw-r--r--lisp/minibuffer.el3
-rw-r--r--src/minibuf.c7
3 files changed, 14 insertions, 2 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 52eea3b9535..7fbdd9eb6e2 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1052,6 +1052,12 @@ This is a list of regular expressions. The completion functions only
1052consider a completion acceptable if it matches all regular expressions 1052consider a completion acceptable if it matches all regular expressions
1053in this list, with @code{case-fold-search} (@pxref{Searching and Case}) 1053in this list, with @code{case-fold-search} (@pxref{Searching and Case})
1054bound to the value of @code{completion-ignore-case}. 1054bound to the value of @code{completion-ignore-case}.
1055
1056Do not set this variable to a non-@code{nil} value globally, as that
1057is not safe and will probably cause errors in completion commands.
1058This variable should be only let-bound to non-@code{nil} values around
1059calls to basic completion functions: @code{try-completion},
1060@code{test-completion}, and @code{all-completions}.
1055@end defvar 1061@end defvar
1056 1062
1057@defmac lazy-completion-table var fun 1063@defmac lazy-completion-table var fun
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 4aa1ab3e890..3e30b68d5e9 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -4027,7 +4027,8 @@ the same set of elements."
4027 (setq ccs (nreverse ccs)) 4027 (setq ccs (nreverse ccs))
4028 (let* ((prefix (try-completion fixed comps)) 4028 (let* ((prefix (try-completion fixed comps))
4029 (unique (or (and (eq prefix t) (setq prefix fixed)) 4029 (unique (or (and (eq prefix t) (setq prefix fixed))
4030 (eq t (try-completion prefix comps))))) 4030 (and (stringp prefix)
4031 (eq t (try-completion prefix comps))))))
4031 (unless (or (eq elem 'prefix) 4032 (unless (or (eq elem 'prefix)
4032 (equal prefix "")) 4033 (equal prefix ""))
4033 (push prefix res)) 4034 (push prefix res))
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
2471if it matches all regular expressions in this list, with 2471if it matches all regular expressions in this list, with
2472`case-fold-search' bound to the value of `completion-ignore-case'. 2472`case-fold-search' bound to the value of `completion-ignore-case'.
2473See Info node `(elisp)Basic Completion', for a description of these 2473See Info node `(elisp)Basic Completion', for a description of these
2474functions. */); 2474functions.
2475
2476Do not set this variable to a non-nil value globally, as that is not
2477safe and will probably cause errors in completion commands. This
2478variable should be only let-bound to non-nil values around calls to
2479basic completion functions like `try-completion' and `all-completions'. */);
2475 Vcompletion_regexp_list = Qnil; 2480 Vcompletion_regexp_list = Qnil;
2476 2481
2477 DEFVAR_BOOL ("minibuffer-allow-text-properties", 2482 DEFVAR_BOOL ("minibuffer-allow-text-properties",