unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ryan C. Thompson" <rct@thompsonclan.org>
To: Dmitry Gutov <dgutov@yandex.ru>, 41340@debbugs.gnu.org
Subject: bug#41340: 26.3; ido-completing-read doesn't respect completion-auto-help
Date: Wed, 20 May 2020 10:34:06 -0400	[thread overview]
Message-ID: <ca08253c-d3d5-4452-6b59-5f57c0bb6b36@thompsonclan.org> (raw)
In-Reply-To: <e28cb34b-0460-b57b-dd63-156862651fdd@thompsonclan.org>

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

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.


[-- Attachment #2: 0001-lisp-ido.el-Respect-completion-auto-help-setting.patch --]
[-- Type: text/plain, Size: 2213 bytes --]

From 101c03fbee9e1554704e470ce51ee099766b5284 Mon Sep 17 00:00:00 2001
From: "Ryan C. Thompson" <rct@thompsonclan.org>
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


  reply	other threads:[~2020-05-20 14:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16 23:46 bug#41340: 26.3; ido-completing-read doesn't respect completion-auto-help Ryan C. Thompson
2020-05-16 23:55 ` Dmitry Gutov
2020-05-17  0:12   ` Ryan C. Thompson
2020-05-17  0:57     ` Dmitry Gutov
2020-05-17  1:16       ` Ryan C. Thompson
2020-05-17  1:32         ` Dmitry Gutov
2020-05-20 14:12           ` Ryan C. Thompson
2020-05-20 14:20             ` Ryan C. Thompson
2020-05-20 14:34               ` Ryan C. Thompson [this message]
2020-05-20 23:26                 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca08253c-d3d5-4452-6b59-5f57c0bb6b36@thompsonclan.org \
    --to=rct@thompsonclan.org \
    --cc=41340@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).