From: Ryan C. Thompson Date: Wed, 20 May 2020 23:21:12 +0000 (+0300) Subject: lisp/ido.el: Respect completion-auto-help setting X-Git-Tag: emacs-28.0.90~7307 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cdec3139b9125d2360223fcd1fb0fe1a52595cb7;p=emacs.git 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). --- 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 even when there is only one unique completion." :type 'boolean) -(defcustom ido-cannot-complete-command 'ido-completion-help +(defcustom ido-cannot-complete-command 'ido-completion-auto-help "Command run when `ido-complete' can't complete any more. The most useful values are `ido-completion-help', which pops up a -window with completion alternatives, or `ido-next-match' or -`ido-prev-match', which cycle the buffer list." +window with completion alternatives; `ido-completion-auto-help', +which does the same but respects the value of +`completion-auto-help'; or `ido-next-match' or `ido-prev-match', +which cycle the buffer list." :type 'function) @@ -3926,6 +3928,14 @@ If `ido-change-word-sub' cannot be found in WORD, return nil." (when (bobp) (next-completion 1))))) +(defun ido-completion-auto-help () + "Call `ido-completion-help' if `completion-auto-help' is non-nil." + (interactive) + ;; Note: `completion-auto-help' could also be `lazy', but this value + ;; is irrelevant to ido, which is fundamentally eager, so it is + ;; treated the same as t. + (when completion-auto-help + (ido-completion-help))) (defun ido-completion-help () "Show possible completions in the `ido-completion-buffer'."