Subject: Re: 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:12:07 -0400

On 5/16/20 9:32 PM, Dmitry Gutov wrote:
> On 17.05.2020 04:16, Ryan C. Thompson wrote:
>> Hmm, that's not the behavior I see, even in emacs -Q.
>
> That's odd.
>
> I get it in 'M-x describe-function', at least.
Ok, I figured out the difference between t and `lazy', and I determined 
that the lazy setting is not meaningful for ido, since ido already 
eagerly shows completions at all times. Hence, the attached patch 
teaches ido how to respect `completion-auto-help' being set to nil but 
doesn't make any special allowance for `lazy'. The existing behavior of 
ido is already correct when `completion-auto-help' is non-nil.
From 6272b4910033c8bc6095da4e2f030dcf79504b52 Mon Sep 17 00:00:00 2001
From: "Ryan C. Thompson" <[email-masked]>
Date: Wed, 20 May 2020 10:03:32 -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'. However, note that in addition to t and nil,
`completion-auto-help' can also be set to `lazy', but `lazy' doesn't
make sense for ido, in which available completions are already eagerly
shown in the minibuffer. So ido just treats `lazy' identically to t.
---
 lisp/ido.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 81883402ad..1ee93a14c3 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2517,7 +2517,7 @@ If cursor is not at the end of the user input, move to end of input."
       (exit-minibuffer))
 
      ((not ido-matches)
-      (when ido-completion-buffer
+      (when (and ido-completion-buffer completion-auto-help)
 	(call-interactively (setq this-command ido-cannot-complete-command))))
 
      ((and (= 1 (length ido-matches))
@@ -2543,7 +2543,8 @@ If cursor is not at the end of the user input, move to end of input."
 	    (delete-region (minibuffer-prompt-end) (point))
 	    (insert res))
 	;; else nothing to complete
-	(call-interactively (setq this-command ido-cannot-complete-command))
+	(when completion-auto-help
+          (call-interactively (setq this-command ido-cannot-complete-command)))
 	)))))
 
 (defun ido-complete-space ()
-- 
2.26.2