diff options
| author | Ryan C. Thompson | 2020-05-21 02:21:12 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2020-05-21 02:22:26 +0300 |
| commit | cdec3139b9125d2360223fcd1fb0fe1a52595cb7 (patch) | |
| tree | 1f67864fe535832ee88f36b2bda1e7e4ee10e117 | |
| parent | 0bfee4b18be9455e33899178fe4ccf2743ea179b (diff) | |
| download | emacs-cdec3139b9125d2360223fcd1fb0fe1a52595cb7.tar.gz emacs-cdec3139b9125d2360223fcd1fb0fe1a52595cb7.zip | |
lisp/ido.el: Respect completion-auto-help setting
This commit makes ido completion respect the user's setting for
`completion-auto-help' by default. It does this by defining a wrapper
function `ido-completion-auto-help', which calls `ido-completion-help'
only when `completion-auto-help' is non-nil.
* lisp/ido.el (ido-completion-auto-help): New function.
(ido-cannot-complete-command):
Use it as the new default (bug#41340).
| -rw-r--r-- | lisp/ido.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 81883402add..15144f131ba 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -499,11 +499,13 @@ This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuff | |||
| 499 | even when there is only one unique completion." | 499 | even when there is only one unique completion." |
| 500 | :type 'boolean) | 500 | :type 'boolean) |
| 501 | 501 | ||
| 502 | (defcustom ido-cannot-complete-command 'ido-completion-help | 502 | (defcustom ido-cannot-complete-command 'ido-completion-auto-help |
| 503 | "Command run when `ido-complete' can't complete any more. | 503 | "Command run when `ido-complete' can't complete any more. |
| 504 | The most useful values are `ido-completion-help', which pops up a | 504 | The most useful values are `ido-completion-help', which pops up a |
| 505 | window with completion alternatives, or `ido-next-match' or | 505 | window with completion alternatives; `ido-completion-auto-help', |
| 506 | `ido-prev-match', which cycle the buffer list." | 506 | which does the same but respects the value of |
| 507 | `completion-auto-help'; or `ido-next-match' or `ido-prev-match', | ||
| 508 | which cycle the buffer list." | ||
| 507 | :type 'function) | 509 | :type 'function) |
| 508 | 510 | ||
| 509 | 511 | ||
| @@ -3926,6 +3928,14 @@ If `ido-change-word-sub' cannot be found in WORD, return nil." | |||
| 3926 | (when (bobp) | 3928 | (when (bobp) |
| 3927 | (next-completion 1))))) | 3929 | (next-completion 1))))) |
| 3928 | 3930 | ||
| 3931 | (defun ido-completion-auto-help () | ||
| 3932 | "Call `ido-completion-help' if `completion-auto-help' is non-nil." | ||
| 3933 | (interactive) | ||
| 3934 | ;; Note: `completion-auto-help' could also be `lazy', but this value | ||
| 3935 | ;; is irrelevant to ido, which is fundamentally eager, so it is | ||
| 3936 | ;; treated the same as t. | ||
| 3937 | (when completion-auto-help | ||
| 3938 | (ido-completion-help))) | ||
| 3929 | 3939 | ||
| 3930 | (defun ido-completion-help () | 3940 | (defun ido-completion-help () |
| 3931 | "Show possible completions in the `ido-completion-buffer'." | 3941 | "Show possible completions in the `ido-completion-buffer'." |