From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Juri Linkov <juri@linkov.net>
Newsgroups: gmane.emacs.devel
Subject: Re: Updating *Completions* as you type
Date: Mon, 16 Oct 2023 19:54:33 +0300
Organization: LINKOV.NET
Message-ID: <86mswiegjy.fsf@mail.linkov.net>
References: <87bkd3z9bi.fsf@catern.com> <86cyxjyr1y.fsf@mail.linkov.net>
 <ier34ye4a3x.fsf@janestreet.com> <86r0lxm7um.fsf@mail.linkov.net>
 <87sf6dx954.fsf@catern.com> <m1fs2baard.fsf@eshelyaron.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="37977"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
Cc: sbaugh@catern.com,  emacs-devel@gnu.org
To: Eshel Yaron <me@eshelyaron.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 16 18:55:44 2023
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1qsQsa-0009cS-0Y
	for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Oct 2023 18:55:44 +0200
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces@gnu.org>)
	id 1qsQrw-0001vQ-CE; Mon, 16 Oct 2023 12:55:04 -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 <juri@linkov.net>) id 1qsQrs-0001vD-NI
 for emacs-devel@gnu.org; Mon, 16 Oct 2023 12:55:00 -0400
Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@linkov.net>) id 1qsQrq-0007VJ-0C
 for emacs-devel@gnu.org; Mon, 16 Oct 2023 12:55:00 -0400
Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1D480C0008;
 Mon, 16 Oct 2023 16:54:50 +0000 (UTC)
In-Reply-To: <m1fs2baard.fsf@eshelyaron.com> (Eshel Yaron's message of "Sun,
 15 Oct 2023 22:31:02 +0200")
X-GND-Sasl: juri@linkov.net
Received-SPF: pass client-ip=217.70.183.198; envelope-from=juri@linkov.net;
 helo=relay6-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=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:311524
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/311524>

> 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.

This looks like icomplete-show-matches-on-no-input.

> 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.

And this is like icomplete-max-delay-chars.

> 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.

Is `post-self-insert-hook` called for pasting a string?
Maybe better to replace blocklist with allowlist that contains
a list '(self-insert-command yank)' by default as discussed in
https://yhetil.org/emacs-devel/87eefp18q2.fsf@gnu.org/