unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52389: 29.0.50; Imenu does not pop up the Completions eagerly
@ 2021-12-09 13:32 Protesilaos Stavrou
  2021-12-10 11:51 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 14+ messages in thread
From: Protesilaos Stavrou @ 2021-12-09 13:32 UTC (permalink / raw)
  To: 52389

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

Dear maintainers,

I think the current behaviour of 'imenu-eager-completion-buffer' is
counter-intuitive.  Its default value is non-nil, while its doc string
tells us that:

    If non-nil, eagerly popup the completion buffer.

This, however, is not what actually happens.  With 'emacs -Q':

+ Include a demo function in the scratch buffer: (defun test-fn ())
+ M-x imenu
+ Here we expect the Completions' buffer to eagerly pop up, yet it does
  not.
+ M-: (setq imenu-eager-completion-buffer nil)
+ M-x imenu
+ The Completions' buffer now pops up automatically.

Do you agree that this is counter-intuitive?  If so, please find
attached a patch that should fix the issue.  I was not sure this was
NEWSworthy, but I included an entry regardless.

All the best,
Protesilaos

-- 
Protesilaos Stavrou
https://protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-semantics-of-imenu-eager-completion-buffer.patch --]
[-- Type: text/x-patch, Size: 2379 bytes --]

From b4625110cb5b40f079c134a73e9be8240818fa33 Mon Sep 17 00:00:00 2001
Message-Id: <b4625110cb5b40f079c134a73e9be8240818fa33.1639055998.git.info@protesilaos.com>
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Thu, 9 Dec 2021 15:19:48 +0200
Subject: [PATCH] Fix semantics of imenu-eager-completion-buffer

* etc/NEWS: Document the change.
* lisp/imenu.el (imenu-eager-completion-buffer): Set the default value
to nil, as that was the intended one.
(imenu--completion-buffer): Update the condition to check for a
non-nil value to 'imenu-eager-completion-buffer'.
---
 etc/NEWS      | 7 +++++++
 lisp/imenu.el | 6 +++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b9134d850e..a83f2d2a86 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -706,6 +706,13 @@ the Netscape web browser was released in February, 2008.
 This support has been obsolete since Emacs 25.1.  The final version of
 the Galeon web browser was released in September, 2008.
 
+** Imenu
+The default value of 'imenu-eager-completion-buffer' is set to nil to
+better convey the intended semantics of optionally popping up the
+Completions' buffer automatically after invoking M-x imenu (with the
+default settings from previous versions, the Completions would not pop
+up automatically and the same is true now).
+
 \f
 * New Modes and Packages in Emacs 29.1
 
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 22412d5f88..bf12e110e5 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -99,10 +99,10 @@ (defcustom imenu-use-popup-menu 'on-mouse
 		 (const :tag "Never" nil)
                  (other :tag "Always" t)))
 
-(defcustom imenu-eager-completion-buffer t
+(defcustom imenu-eager-completion-buffer nil
   "If non-nil, eagerly popup the completion buffer."
   :type 'boolean
-  :version "22.1")
+  :version "29.1")
 
 (defcustom imenu-after-jump-hook nil
   "Hooks called after jumping to a place in the buffer.
@@ -727,7 +727,7 @@ (defun imenu--completion-buffer (index-alist &optional prompt)
                          name))))
     (let ((minibuffer-setup-hook minibuffer-setup-hook))
       ;; Display the completion buffer.
-      (if (not imenu-eager-completion-buffer)
+      (when imenu-eager-completion-buffer
 	  (add-hook 'minibuffer-setup-hook 'minibuffer-completion-help))
       (setq name (completing-read prompt
 				  prepared-index-alist
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-12-18  7:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 13:32 bug#52389: 29.0.50; Imenu does not pop up the Completions eagerly Protesilaos Stavrou
2021-12-10 11:51 ` Lars Ingebrigtsen
2021-12-10 15:16   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-11  3:25     ` Lars Ingebrigtsen
2021-12-11 20:16       ` Juri Linkov
2021-12-12  4:58         ` Lars Ingebrigtsen
2021-12-12  6:09         ` Protesilaos Stavrou
2021-12-12 17:36           ` Juri Linkov
2021-12-13  7:20             ` Protesilaos Stavrou
2021-12-13  8:53               ` Juri Linkov
2021-12-17 11:57                 ` Protesilaos Stavrou
2021-12-17 12:34                   ` André A. Gomes
2021-12-17 12:55                   ` Eli Zaretskii
2021-12-18  7:44                     ` Lars Ingebrigtsen

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).