From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#45474: Icomplete exhibiting in recursive minibuffer when it =?UTF-8?Q?shouldn=E2=80=99t?= Date: Thu, 22 Apr 2021 19:04:04 +0000 Message-ID: References: <3ed97a9c53e0a5d4fef8@heytings.org> <87fszrz21d.fsf@mail.linkov.net> <3ed97a9c530093aca93d@heytings.org> <7dee3f4235d331cab291@heytings.org> <87r1jatd34.fsf@mail.linkov.net> <7dee3f423551aaf318cb@heytings.org> <87im4kzlfm.fsf@mail.linkov.net> <1869622e16546eafd9df@heytings.org> <871rb6np5j.fsf@mail.linkov.net> <87lf9cepqw.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dario Gjorgjevski , 45474@debbugs.gnu.org, Juri Linkov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 22 21:05:29 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZedk-000AN2-Ih for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Apr 2021 21:05:28 +0200 Original-Received: from localhost ([::1]:33570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZedi-0003B3-Fg for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Apr 2021 15:05:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZedK-0003AB-VC for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 15:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZedK-00029E-JO for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 15:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZedK-0003Da-Cp for bug-gnu-emacs@gnu.org; Thu, 22 Apr 2021 15:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Apr 2021 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45474 X-GNU-PR-Package: emacs Original-Received: via spool by 45474-submit@debbugs.gnu.org id=B45474.161911824912305 (code B ref 45474); Thu, 22 Apr 2021 19:05:02 +0000 Original-Received: (at 45474) by debbugs.gnu.org; 22 Apr 2021 19:04:09 +0000 Original-Received: from localhost ([127.0.0.1]:35550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZecT-0003CP-IF for submit@debbugs.gnu.org; Thu, 22 Apr 2021 15:04:09 -0400 Original-Received: from heytings.org ([95.142.160.155]:49206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZecP-0003CF-Ts for 45474@debbugs.gnu.org; Thu, 22 Apr 2021 15:04:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1619118244; bh=jg0N043ZyzNz+OFj4EmaW6oowK7f1BIa4wf1XXNtDks=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=IrsE8sxNZ6s1Mv1AFJ5dYHAPN6CvejCy2daPKNqrQmSm7pSVnTrmfYWEjXN19pZnC R5i734SS569kaxf57/9o4h0TqFxKKGSFPFx1U/ngoThFvCHtU5aaOiHrBKt1T46gTp yb9GNh0RwnNC0c1u6r5TMP8Kenx5CjdWSw+jr1caLtAb1U9KAp3LEEVFzCSHztltJ3 TKMjQ511rBqzywlxOvgruAumuP47EEahtwsiNQXu5hfJn3ap92vjD/aUQYyvkEjI1x RN7leFmGBF5+tkN6j+Odt+Mk3RM2pcOK7VxL2M+fVpq7EKrfXyLDOYgBSoCt5f8WE0 0IAyBTU66Lbig== In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204710 Archived-At: > > 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"...