bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’


From: Gregory Heytings
Subject: bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’t
Date: Thu, 22 Apr 2021 19:04:04 +0000



I have the impression that I suffer from NIH syndrome with respect to your patch, so I'll refrain from commenting on it by and large


I'm not sure I understand what you mean here.

It uses a nice trick (intermediate variables) to provide a backward-compatible behavior for read-from-minibuffer that would last for one major Emacs release (to avoid breaking external packages), while providing the needed feature (buffer-local completion tables) for code those that want to use it. Doesn't that fit the bill?

diff --git a/src/minibuf.c b/src/minibuf.c
index 1a637c86ad..fd780bd5c1 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -865,6 +865,16 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, 
Lisp_Object prompt,
   if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method)))
     call1 (Qactivate_input_method, input_method);

+  if (! EQ (Vminibuffer_local_completion, Qnil)) {
+    Fmake_local_variable (Qminibuffer_completion_table);
+    Fset (Qminibuffer_completion_table, Vminibuffer_local_completion_table);
+    Fmake_local_variable (Qminibuffer_completion_predicate);
+    Fset (Qminibuffer_completion_predicate, 
Vminibuffer_local_completion_predicate);
+    Fmake_local_variable (Qminibuffer_completion_confirm);
+    Fset (Qminibuffer_completion_confirm, 
Vminibuffer_local_completion_confirm);
+    specbind (Qminibuffer_local_completion, Qnil);
+  }

I really don't like adding knowledge of those variables to this function, which so far is completely oblivious to whether the minibuffer is used with completion or not.


Hmmm... That's not true, see the occurrences of minibuffer_completing_file_name. And that would be temporary anyway, in Emacs 29 this code could be removed from read_minibuf() I think.

   run_hook (Qminibuffer_setup_hook);

As in my patch, you could use this hook to do the completion-specific part of the setup.


Indeed, but you said that 'minibuffer-with-setup-hook' is "fundamentally broken and messy"...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]