Subject: bug#41340: 26.3; ido-completing-read doesn't respect completion-auto-help

From: "Ryan C. Thompson" <[email-masked]>
Date: Wed, 20 May 2020 10:34:06 -0400

On 5/20/20 10:20 AM, Ryan C. Thompson wrote:
> Perhaps an better approach would be to define an auxiliary wrapper 
> function that only calls `ido-completion-help' if 
> `completion-auto-help' is non-nil, and set that as the default for 
> `ido-cannot-complete-command'.

Here is a patch to implement the suggestion above.

From 101c03fbee9e1554704e470ce51ee099766b5284 Mon Sep 17 00:00:00 2001
From: "Ryan C. Thompson" <[email-masked]>
Date: Wed, 20 May 2020 10:26:08 -0400
Subject: [PATCH] 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.

Note that `completion-auto-help' can also be `lazy', but this is
irrelevant to ido, which already shows completions eagerly at all
times. So `lazy' is just treated like t.
---
 lisp/ido.el | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 81883402ad..15144f131b 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'."
-- 
2.26.2