diff options
| author | Juri Linkov | 2023-11-15 19:52:10 +0200 |
|---|---|---|
| committer | Juri Linkov | 2023-11-15 19:52:10 +0200 |
| commit | ff1f82cbe3fa9aee354581f2798faaae7163ea44 (patch) | |
| tree | 3e8ff885e3be2168cae9bc630e281869d8683c53 | |
| parent | 94763aa52112b4fc72ba5dfda2df558d6034fac8 (diff) | |
| download | emacs-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.el | 14 |
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. |
| 2991 | This function is used to add all elements of the completion table to | 2991 | This function is used to add all elements of the completion table to |
| 2992 | the end of the list of defaults just after the default value." | 2992 | the end of the list of defaults just after the default value. |
| 2993 | When you don't want to add initial completions to the default value, | ||
| 2994 | you can use either `minibuffer-setup-hook' or `minibuffer-with-setup-hook' | ||
| 2995 | to 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))))) |