Subject: bug#74615: closed (Re: bug#74615: 30.0.92; js-find-symbol automatically activates ido-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 07 Dec 2024 12:55:03 +0000

Your bug report

#74615: 30.0.92; js-find-symbol automatically activates ido-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74615: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74615
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74615: 30.0.92; js-find-symbol automatically activates ido-mode
From: Eli Zaretskii <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 07 Dec 2024 14:54:09 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Stefan Monnier <[email-masked]>
> Cc: Daniel Mendler <[email-masked]>,  Daniel Colascione
>  <[email-masked]>,  [email-masked]
> Date: Sat, 30 Nov 2024 14:05:14 -0500
> 
> > This code is there since the day js.el was added, so I don't think
> > removing the activation of ido-mode is something we can do, because
> > users might expect that by now.
> 
> User backward-compatibility is nice but not important enough to imply
> "cannot do".  I think in this case, IDO has lost enough popularity by
> now that more users will be happy rather than annoyed by the change.
> 
> > Maybe we could make that optional or something.
> 
> Users can enable IDO already, and if really some users like IDO for this
> command but not elsewhere (which seems highly unlikely to me), we can
> add a small ELisp snippet in NEWS using `advice-add`, for them to copy
> to their init file.

Sounds like there's consensus to make this change, so I've now
installed it on the master branch, and I'm therefore closing this bug.

Subject: 30.0.92; js-find-symbol automatically activates ido-mode
From: Daniel Mendler <[email-masked]>
To: [email-masked]
Date: Sat, 30 Nov 2024 07:37:27 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

js-find-symbol/js--read-symbol reads a symbol via ido-completing-read
and automatically activates ido-mode. For users of other completion
systems (default completion, Icomplete/Fido, Vertico, Helm, ...) this is
not desired. Icomplete/Fido/Vertico/etc. replace Ido and provide similar
behavior for general completing-read.

Patch attached.

>From 3b4ccb677a16fc4934d62fed7e1f01b52399e633 Mon Sep 17 00:00:00 2001
From: Daniel Mendler <[email-masked]>
Date: Wed, 1 Mar 2023 19:27:38 +0100
Subject: [PATCH] progmodes/js: Use completing-read instead of
 ido-completing-read

---
 lisp/progmodes/js.el | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f74b8ab1c46..29566d38109 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -58,11 +58,8 @@
 
 (eval-when-compile
   (require 'cl-lib)
-  (require 'ido)
   (require 'rx))
 
-(defvar ido-cur-list)
-(declare-function ido-mode "ido" (&optional arg))
 (declare-function treesit-parser-create "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
 (declare-function treesit-search-subtree "treesit.c")
@@ -3288,11 +3285,7 @@ js--read-symbol
 initial input INITIAL-INPUT.  Return a cons of (SYMBOL-NAME
 . LOCATION), where SYMBOL-NAME is a string and LOCATION is a
 marker."
-  (unless ido-mode
-    (ido-mode 1)
-    (ido-mode -1))
-
-  (let ((choice (ido-completing-read
+  (let ((choice (completing-read
                  prompt
                  (cl-loop for key being the hash-keys of symbols-table
                           collect key)
-- 
2.45.2