From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: Updating *Completions* as you type Date: Sun, 15 Oct 2023 22:31:02 +0200 Message-ID: References: <87bkd3z9bi.fsf@catern.com> <86cyxjyr1y.fsf@mail.linkov.net> <86r0lxm7um.fsf@mail.linkov.net> <87sf6dx954.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11774"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: sbaugh@catern.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 15 22:32:13 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qs7mX-0002q5-NU for ged-emacs-devel@m.gmane-mx.org; Sun, 15 Oct 2023 22:32:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qs7lY-0001Pf-53; Sun, 15 Oct 2023 16:31:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qs7lV-0001PF-2N for emacs-devel@gnu.org; Sun, 15 Oct 2023 16:31:09 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qs7lR-000398-Md for emacs-devel@gnu.org; Sun, 15 Oct 2023 16:31:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1697401864; bh=am4tFqZkeQvnTxUW4sXb1Z4ZscLppLIBrElhxHri2p0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FNfBieHunl6fJxuZ+dtlkDKP4tr0JuvUgqePi2RonMqC2KmXt57zgrWocOY+/UOFg fR4EKbi/BANXHMAiXFX0ugJG/zdTkWrwvJ9ext6mTeEpZUT2X0w7fOlkrnBQvrNRnh CpigIuKaQjYRXAItPDXo8Js81YdiHTCjlPMBatUrvKSTAq8ffbzh2YIvDx8UrycYXY CKJP8wBrQP0UjHF4WU6jNYIj01EAi2+E+4vPAKplvIy5BrJDRlE9ndfpNj0nZBBLvB 2XwLGO9m5toT3g2+r+Rzz50PnlL37D1tfVsZOtUkE9ItpcyQ5FNcP+2wRDoUBODrcA x5ZexrLa+u8sA== In-Reply-To: <87sf6dx954.fsf@catern.com> (sbaugh@catern.com's message of "Sat, 14 Oct 2023 16:05:11 -0400") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311501 Archived-At: Hi, sbaugh@catern.com writes: > Taking inspiration from zcomplete, I wrote this patch to > provide just this feature, thoughts? > > From fef547ece1d5cd3eebbc2fb7f51e51f15cfc2b4a Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Sat, 14 Oct 2023 14:27:23 -0400 > Subject: [PATCH] Add completions-auto-update > > It can be useful for the *Completions* buffer to automatically update > as you type. That way you can see immediately what the next > completion operation will do, even if you've changed text in the > buffer since triggering completion. > > * lisp/minibuffer.el (completions-auto-update): Add. > (completions-no-auto-update-commands): Add. > (completions--post-command): Add. > (minibuffer-completion-help): Add completions--post-command to > post-command-hook. I tried this out, and I came across a certain issue: say you do `C-h o foo TAB`, and then looking at the completion candidates you realize you actually wanted something with `bar`, so you type `M-DEL` to delete `foo` from the minibuffer to make room for `bar`. But now `post-command-hook` runs with an empty minibuffer before you start typing `bar`, so it updates the completions buffer with a very large list of symbols, causing Emacs to briefly stall. I think that the completions buffer possibly shouldn't be updated when the minibuffer is empty. Perhaps there could be a minimum minibuffer contents size for updating the completions buffer, or some other heuristic to avoid auto-displaying excessively large sets of candidates. Another option is to update the completions buffer on `post-self-insert-hook` instead of `post-command-hook`, that way you only update the completions buffer when the user actually inserts input in the minibuffer, and you don't need to keep a `completions-no-auto-update-commands` list. Best, Eshel