unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 74615@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#74615: 30.0.92; js-find-symbol automatically activates ido-mode
Date: Sat, 30 Nov 2024 07:37:27 +0100	[thread overview]
Message-ID: <87bjxxw7ko.fsf@daniel-mendler.de> (raw)

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

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-progmodes-js-Use-completing-read-instead-of-ido-comp.patch --]
[-- Type: text/x-diff, Size: 1271 bytes --]

From 3b4ccb677a16fc4934d62fed7e1f01b52399e633 Mon Sep 17 00:00:00 2001
From: Daniel Mendler <mail@daniel-mendler.de>
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


             reply	other threads:[~2024-11-30  6:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30  6:37 Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-11-30  8:02 ` bug#74615: 30.0.92; js-find-symbol automatically activates ido-mode Eli Zaretskii
2024-11-30 16:18   ` Daniel Colascione
2024-11-30 17:05   ` Dmitry Gutov
2024-11-30 19:05   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87bjxxw7ko.fsf@daniel-mendler.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74615@debbugs.gnu.org \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    /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).