From: Gregory Heytings <gregory@heytings.org>
To: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Cc: 45474@debbugs.gnu.org
Subject: bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’t
Date: Thu, 15 Apr 2021 17:40:04 +0000 [thread overview]
Message-ID: <3ed97a9c53e0a5d4fef8@heytings.org> (raw)
In-Reply-To: <fv2zojtus7b0tz.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
>
> How to reproduce from emacs -Q:
>
> (setq enable-recursive-minibuffers t)
> (setq icomplete-show-matches-on-no-input t)
> M-x icomplete-mode RET
> C-x C-f
> [Icomplete now exhibits some filenames in the minibuffer]
> M-:
> [Icomplete shouldn’t exhibit anything here but it still
> exhibits the filenames from the previous step and even
> allows you to complete them with C-j]
>
> You can replace C-x C-f with other similar commands, e.g., C-x b or M-x.
> I’m not sure if this bug comes from how Icomplete configures itself or
> the implementation of recursive minibuffers. It appears that
> icomplete-simple-completing-p returns t when the M-: is happening in a
> recursive minibuffer, even though it should return nil so that Icomplete
> doesn’t configure itself.
>
> If the M-: is not in a recursive minibuffer, everything is OK since
> icomplete-simple-completing-p returns nil.
>
Indeed; patch attached. Ideally this should be done inside
icomplete-minibuffer-setup, but if we did this (by checking
minibuffer-completing-symbol), it would prevent icomplete-mode from being
active in the opposite situation: M-: followed by C-x C-f.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=Disable-icomplete-mode-when-reading-an-Emacs-Lisp-ex.patch, Size: 1237 bytes --]
From e4cb07276724486bf01875c2463debf81784d59f Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Thu, 15 Apr 2021 17:33:37 +0000
Subject: [PATCH] Disable icomplete-mode when reading an Emacs Lisp expression
* lisp/simple.el (read--expression): Disable icomplete-mode when
entering a recursive minibuffer to read an Emacs Lisp expression
(bug#45474).
---
lisp/simple.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 999755a642..8f9d7a197c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1754,7 +1754,9 @@ read--expression
(set-syntax-table emacs-lisp-mode-syntax-table)
(add-hook 'completion-at-point-functions
#'elisp-completion-at-point nil t)
- (run-hooks 'eval-expression-minibuffer-setup-hook))
+ (run-hooks 'eval-expression-minibuffer-setup-hook)
+ ;; if we enter a recursive minibuffer, disable icomplete (bug#45474)
+ (setq-local icomplete-mode nil))
(read-from-minibuffer prompt initial-contents
read-expression-map t
'read-expression-history))))
--
2.30.2
next prev parent reply other threads:[~2021-04-15 17:40 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-27 17:44 bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’t Dario Gjorgjevski
2021-04-15 17:40 ` Gregory Heytings [this message]
2021-04-15 21:11 ` Juri Linkov
2021-04-15 22:34 ` Gregory Heytings
2021-04-16 0:03 ` Gregory Heytings
2021-04-16 16:34 ` Juri Linkov
2021-04-16 16:55 ` Gregory Heytings
2021-04-17 20:49 ` Juri Linkov
2021-04-17 21:35 ` Gregory Heytings
2021-04-17 21:58 ` Stefan Monnier
2021-04-17 22:16 ` Gregory Heytings
2021-04-18 14:44 ` Stefan Monnier
2021-04-18 22:23 ` Gregory Heytings
2021-04-19 1:26 ` Stefan Monnier
2021-04-19 12:14 ` Gregory Heytings
2021-04-19 15:57 ` Stefan Monnier
2021-04-19 20:20 ` Gregory Heytings
2021-04-17 23:21 ` bug#45474: [External] : " Drew Adams
2021-04-18 3:59 ` Stefan Monnier
2021-04-18 4:04 ` Drew Adams
2021-04-18 5:08 ` Stefan Monnier
2021-04-18 15:42 ` Drew Adams
2021-04-18 18:35 ` Stefan Monnier
2021-04-18 20:11 ` Drew Adams
2021-04-18 20:53 ` Stefan Monnier
2021-04-18 23:46 ` Drew Adams
2021-04-22 15:03 ` Stefan Monnier
2021-04-19 18:16 ` Juri Linkov
2021-04-19 21:42 ` Stefan Monnier
2021-04-20 19:00 ` Gregory Heytings
2021-04-22 13:56 ` Stefan Monnier
2021-04-22 14:08 ` Gregory Heytings
2021-04-20 19:01 ` Juri Linkov
2021-04-22 13:54 ` Stefan Monnier
2021-04-22 14:13 ` Stefan Monnier
2021-04-22 14:18 ` Gregory Heytings
2021-04-22 15:18 ` Gregory Heytings
2021-04-22 18:36 ` Stefan Monnier
2021-04-22 19:04 ` Gregory Heytings
2021-04-22 19:59 ` Gregory Heytings
2021-04-22 20:57 ` Gregory Heytings
2021-04-22 23:24 ` Stefan Monnier
2021-04-23 6:06 ` Eli Zaretskii
2021-04-23 13:12 ` Stefan Monnier
2021-04-23 13:19 ` Eli Zaretskii
2021-04-23 15:18 ` Stefan Monnier
2021-04-23 17:37 ` Eli Zaretskii
2021-04-23 6:59 ` Gregory Heytings
2021-04-23 13:21 ` Stefan Monnier
2021-04-23 13:45 ` Gregory Heytings
2021-04-23 15:35 ` Stefan Monnier
2021-04-23 15:58 ` Gregory Heytings
2021-04-23 16:36 ` Juri Linkov
2021-04-23 16:55 ` Stefan Monnier
2021-04-23 18:13 ` Gregory Heytings
2021-04-23 20:24 ` Stefan Monnier
2021-04-23 21:36 ` Gregory Heytings
2021-04-23 21:54 ` Stefan Monnier
2021-04-24 8:44 ` Gregory Heytings
2021-05-01 19:34 ` Stefan Monnier
2021-05-03 8:40 ` Gregory Heytings
2022-06-07 12:04 ` Lars Ingebrigtsen
2021-04-22 21:57 ` Juri Linkov
2021-04-23 15:53 ` Stefan Monnier
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=3ed97a9c53e0a5d4fef8@heytings.org \
--to=gregory@heytings.org \
--cc=45474@debbugs.gnu.org \
--cc=dario.gjorgjevski@gmail.com \
/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).