aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2023-11-15 19:52:10 +0200
committerJuri Linkov2023-11-15 19:52:10 +0200
commitff1f82cbe3fa9aee354581f2798faaae7163ea44 (patch)
tree3e8ff885e3be2168cae9bc630e281869d8683c53
parent94763aa52112b4fc72ba5dfda2df558d6034fac8 (diff)
downloademacs-ff1f82cbe3fa9aee354581f2798faaae7163ea44.tar.gz
emacs-ff1f82cbe3fa9aee354581f2798faaae7163ea44.zip
* lisp/simple.el (minibuffer-default-add-completions): Improve (bug#64656).
Return nil for some popular completions with undefined order that include obarray. Extend the docstring to explain how to disable this feature.
-rw-r--r--lisp/simple.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index f86b3f9e208..02005e3b4f9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2989,11 +2989,17 @@ this by calling a function defined by `minibuffer-default-add-function'.")
2989(defun minibuffer-default-add-completions () 2989(defun minibuffer-default-add-completions ()
2990 "Return a list of all completions without the default value. 2990 "Return a list of all completions without the default value.
2991This function is used to add all elements of the completion table to 2991This function is used to add all elements of the completion table to
2992the end of the list of defaults just after the default value." 2992the end of the list of defaults just after the default value.
2993When you don't want to add initial completions to the default value,
2994you can use either `minibuffer-setup-hook' or `minibuffer-with-setup-hook'
2995to set the value of `minibuffer-default-add-function' to nil."
2993 (let ((def minibuffer-default) 2996 (let ((def minibuffer-default)
2994 (all (all-completions "" 2997 ;; Avoid some popular completions with undefined order
2995 minibuffer-completion-table 2998 (all (unless (memq minibuffer-completion-table
2996 minibuffer-completion-predicate))) 2999 `(help--symbol-completion-table ,obarray))
3000 (all-completions ""
3001 minibuffer-completion-table
3002 minibuffer-completion-predicate))))
2997 (if (listp def) 3003 (if (listp def)
2998 (append def all) 3004 (append def all)
2999 (cons def (delete def all))))) 3005 (cons def (delete def all)))))