Juri Linkov <juri@HIDDEN>
to control <at> debbugs.gnu.org.
Full text available.Received: (at 79819) by debbugs.gnu.org; 14 Nov 2025 07:31:28 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 14 02:31:27 2025 Received: from localhost ([127.0.0.1]:59800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJoHH-0005aE-L9 for submit <at> debbugs.gnu.org; Fri, 14 Nov 2025 02:31:27 -0500 Received: from mout-p-102.mailbox.org ([80.241.56.152]:59732) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1vJoHF-0005Wr-3X; Fri, 14 Nov 2025 02:31:25 -0500 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4d782Y2mYLz9twF; Fri, 14 Nov 2025 08:31:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1763105477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4jvPlBJaTXZUMkrJPAo+hu8/zeykOCbTb5ncYkX31Rg=; b=byZ5jGihcaaEqKalQKw/2LoEd4kVgWfUeS5Zct5PLY6W42MDHPIVYZHwujn6CdJj88bzJW YgzPRwO5+TAy0zoxa5dHzZFNA2DzA0V611dY23RM1YCP7to1tthWZZAb1cQGRCp/s5xnn4 ospg11cvLiLBJr8+c6+kIdMpbIFlrQkwDjUMmKH64VywK8TKS0N0vXWvKP3Z1Hdusx1iUX UJmhXTqMkQkTm4OvwbKAECgC9LMuJ47XVvhLoIFkx9FjE8ai8ELBYRCaKFhdKTHwLJavyg Sc/FvT1FJfJuvSCrZPZcMFDKNUtq+5APnarzO1rLMcK9yaApxtKO9fv3m6DyBw== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=juri@HIDDEN From: Juri Linkov <juri@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <ierms4pyeuu.fsf@HIDDEN> Organization: LINKOV.NET References: <iero6p86ojz.fsf@HIDDEN> <87a50rk6sp.fsf@HIDDEN> <ierldkb6j00.fsf@HIDDEN> <87v7jfylyc.fsf@HIDDEN> <ierseehyim0.fsf@HIDDEN> <871pm1hmlr.fsf@HIDDEN> <ierms4pyeuu.fsf@HIDDEN> Date: Fri, 14 Nov 2025 09:29:51 +0200 Message-ID: <87a50pqdg0.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 4d782Y2mYLz9twF X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79819 Cc: Daniel Mendler <mail@HIDDEN>, 79819 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) close 79819 31.0.50 thanks >> Thanks. Sounds good! > > If the patch looks good to you, can you (or someone else reading this) > install it? I don't have commit privileges. So now your patch is pushed, thanks.
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.Received: (at 79819) by debbugs.gnu.org; 13 Nov 2025 18:20:04 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 13 13:20:03 2025 Received: from localhost ([127.0.0.1]:56320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJbvP-0004OT-9I for submit <at> debbugs.gnu.org; Thu, 13 Nov 2025 13:20:03 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:42973) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1vJbvM-0004O0-J2 for 79819 <at> debbugs.gnu.org; Thu, 13 Nov 2025 13:20:01 -0500 From: Spencer Baugh <sbaugh@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <871pm1hmlr.fsf@HIDDEN> (Daniel Mendler's message of "Thu, 13 Nov 2025 18:24:32 +0100") References: <iero6p86ojz.fsf@HIDDEN> <87a50rk6sp.fsf@HIDDEN> <ierldkb6j00.fsf@HIDDEN> <87v7jfylyc.fsf@HIDDEN> <ierseehyim0.fsf@HIDDEN> <871pm1hmlr.fsf@HIDDEN> Date: Thu, 13 Nov 2025 13:19:53 -0500 Message-ID: <ierms4pyeuu.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1763057994; bh=WL2Zw/qGlJSbIBCAt72ZBN88qyuQ6lpRMWf3puWDeY4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=HJ6Lhw9IxWSl9nRADM5yACMl+S993YVbhRixssT5iv8n1h4EeDf0UvuCdnRk0U8R1 6XFsem0S3CkpThaPnT0OAmRSfPLntDSAbdDfN0yLl+hB1bts4RczeVJ7toaQehTNps +1/Fz+UPtBPmQDsxTWhSJptqmC3oqnMo6oIo0/NFr4B2pjraAN1cLTnRpbvyi3imZE c/VsMkIcY87RINtrXgLlUdcOc53gJeKQ/dha3/FCrRRzqgOM41Vr0rnvc9apz4Gnn9 FDy0YXpan7fu0DkYWfK8d71WX0j0Lm0oZA0a1ZLNZ+CQSuIofI2jsbNq3ynF2VwnzR YfZKTZ5btsQ6g== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79819 Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Daniel Mendler <mail@HIDDEN> writes: > Spencer Baugh <sbaugh@HIDDEN> writes: > >> Daniel Mendler <mail@HIDDEN> writes: >> >>> Spencer Baugh <sbaugh@HIDDEN> writes: >>> >>>> Daniel Mendler <mail@HIDDEN> writes: >>>> >>>>> Spencer Baugh <sbaugh@HIDDEN> writes: >>>>> >>>>>> Tags: patch >>>>>> >>>>>> Don't block user input while rendering the *Completions* buffer >>>>>> due to eager-display. This allows eager-display to be used with >>>>>> larger and slower completion tables without interfering with the >>>>>> user. >>>>>> >>>>>> Like eager-update, we use while-no-input and non-essential to ensure >>>>>> that eager-display happens without blocking the user. >>>>> >>>>> This patch goes a bit against the intention of eager-display, which was >>>>> introduced as an exact replacement for tmm and ffap which had displayed >>>>> *Completions* immediately in the past, without a timer. But I do see the >>>>> point of the patch and your implementation looks good. >>>> >>>> Right. I figured that if we ever want to add this while-no-input >>>> functionality (and I suggest that we do) then we should probably do it >>>> now, while eager-display isn't yet in a released Emacs version, since >>>> it's not impossible that it could break something if we added it later. >>>> >>>>> eager-display also supports returning a function, but now I don't see >>>>> great use cases for this. The idea was to give control to the completion >>>>> table to eagerly display something. In your patch you also defer this >>>>> function, which may not be desired. If the completion table is in >>>>> control it can also defer itself depending on its known performance >>>>> characteristics or depending on its special display. Maybe we should >>>>> reconsider the functionp metadata value of eager-display and remove >>>>> this, instead of introducing this feature with questionable >>>>> functionality. eager-display is still unreleased, so it can still be >>>>> changed. >>>> >>>> Ah, I was wondering what the use case was for returning a function from >>>> eager-display. >>>> >>>> I'm inclined to remove that ability if you're okay with that. >>> >>> I've checked the Emacs code base and an `eager-display' function is used >>> by `tmm-add-prompt'. Can you please check if this function works well >>> this works with your patch? Given that, I would leave the ability in >>> place. >> >> Ah, thanks for checking. >> >> I looked into the eager-display function used by tmm-add-prompt. It's >> used to change the text in *Completions* in a few ways. But there's >> actually a bug with this usage: if completion-eager-display is nil, or >> if the *Completions* buffer is dismissed and reopened, the changes to the >> text won't happen. >> >> To fix this, tmm should be using a completion-setup-hook instead. But >> when I changed it to do that, it didn't need to return a function from >> eager-display anymore. So I think we actually should still drop the >> ability to return a function from eager-display, at least until some >> other use case occurs to us. > > Thanks. Sounds good! If the patch looks good to you, can you (or someone else reading this) install it? I don't have commit privileges.
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.Received: (at 79819) by debbugs.gnu.org; 13 Nov 2025 17:24:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 13 12:24:44 2025 Received: from localhost ([127.0.0.1]:55980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJb3r-0001wR-PM for submit <at> debbugs.gnu.org; Thu, 13 Nov 2025 12:24:44 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:39191 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1vJb3p-0001vw-B4 for 79819 <at> debbugs.gnu.org; Thu, 13 Nov 2025 12:24:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PJzaGdEUYRtmjXmmMQ3/sYhDfsQ7fiffVpgUv5OZ0qs=; b=HZ4G0vh5tnCnZdRkaA61LjAOHg 1lMsLcGREL79FI8Gzy+JMP6tnF3+ZMpj+XVnqKnEwoOKWFBr7k9r8++k16sWrxELGb2vQHO9hVlnT TGgg4Lg8vXUpOWi7DrlCUDcQjxVqViKkY358zki+acXz7Yj3WZT9M7ClmL25EQsiIZ8I=; From: Daniel Mendler <mail@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <ierseehyim0.fsf@HIDDEN> References: <iero6p86ojz.fsf@HIDDEN> <87a50rk6sp.fsf@HIDDEN> <ierldkb6j00.fsf@HIDDEN> <87v7jfylyc.fsf@HIDDEN> <ierseehyim0.fsf@HIDDEN> Date: Thu, 13 Nov 2025 18:24:32 +0100 Message-ID: <871pm1hmlr.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 79819 Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Spencer Baugh <sbaugh@HIDDEN> writes: > Daniel Mendler <mail@HIDDEN> writes: > >> Spencer Baugh <sbaugh@HIDDEN> writes: >> >>> Daniel Mendler <mail@HIDDEN> writes: >>> >>>> Spencer Baugh <sbaugh@HIDDEN> writes: >>>> >>>>> Tags: patch >>>>> >>>>> Don't block user input while rendering the *Completions* buffer >>>>> due to eager-display. This allows eager-display to be used with >>>>> larger and slower completion tables without interfering with the >>>>> user. >>>>> >>>>> Like eager-update, we use while-no-input and non-essential to ensure >>>>> that eager-display happens without blocking the user. >>>> >>>> This patch goes a bit against the intention of eager-display, which was >>>> introduced as an exact replacement for tmm and ffap which had displayed >>>> *Completions* immediately in the past, without a timer. But I do see the >>>> point of the patch and your implementation looks good. >>> >>> Right. I figured that if we ever want to add this while-no-input >>> functionality (and I suggest that we do) then we should probably do it >>> now, while eager-display isn't yet in a released Emacs version, since >>> it's not impossible that it could break something if we added it later. >>> >>>> eager-display also supports returning a function, but now I don't see >>>> great use cases for this. The idea was to give control to the completion >>>> table to eagerly display something. In your patch you also defer this >>>> function, which may not be desired. If the completion table is in >>>> control it can also defer itself depending on its known performance >>>> characteristics or depending on its special display. Maybe we should >>>> reconsider the functionp metadata value of eager-display and remove >>>> this, instead of introducing this feature with questionable >>>> functionality. eager-display is still unreleased, so it can still be >>>> changed. >>> >>> Ah, I was wondering what the use case was for returning a function from >>> eager-display. >>> >>> I'm inclined to remove that ability if you're okay with that. >> >> I've checked the Emacs code base and an `eager-display' function is used >> by `tmm-add-prompt'. Can you please check if this function works well >> this works with your patch? Given that, I would leave the ability in >> place. > > Ah, thanks for checking. > > I looked into the eager-display function used by tmm-add-prompt. It's > used to change the text in *Completions* in a few ways. But there's > actually a bug with this usage: if completion-eager-display is nil, or > if the *Completions* buffer is dismissed and reopened, the changes to the > text won't happen. > > To fix this, tmm should be using a completion-setup-hook instead. But > when I changed it to do that, it didn't need to return a function from > eager-display anymore. So I think we actually should still drop the > ability to return a function from eager-display, at least until some > other use case occurs to us. Thanks. Sounds good! Daniel
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.
Received: (at 79819) by debbugs.gnu.org; 13 Nov 2025 16:58:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 13 11:58:57 2025
Received: from localhost ([127.0.0.1]:55810 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1vJaeu-0006fy-Dy
for submit <at> debbugs.gnu.org; Thu, 13 Nov 2025 11:58:57 -0500
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:43847)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
id 1vJaer-0006fo-51
for 79819 <at> debbugs.gnu.org; Thu, 13 Nov 2025 11:58:54 -0500
From: Spencer Baugh <sbaugh@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle
In-Reply-To: <87v7jfylyc.fsf@HIDDEN> (Daniel Mendler's message of
"Wed, 12 Nov 2025 22:34:19 +0100")
References: <iero6p86ojz.fsf@HIDDEN>
<87a50rk6sp.fsf@HIDDEN> <ierldkb6j00.fsf@HIDDEN>
<87v7jfylyc.fsf@HIDDEN>
Date: Thu, 13 Nov 2025 11:58:47 -0500
Message-ID: <ierseehyim0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
s=waixah; t=1763053127;
bh=o0A8hZ4nzTijhKRHDuvBcKIc7z12uAiJfaCseAm3csk=;
h=From:To:Cc:Subject:In-Reply-To:References:Date;
b=KH9DWw8A204IpOxgiOcQvFJFznAwpAnc9PUU7KpeO7qYE44vR9cQ6zbah6a8142L4
mboLhXCf4jQo497Gc/YANNX9N5LXdz73wqnlAqyC9aMuaivQo/OKYvpZoxTmu3o3/N
WJjGYoErWK2J/sxRFO3zuLQ1KZbQyvBROhMTjflr7twcBLd18KAxsyBsqwRaMlzodu
uJr+y6vurCrTQZIrQ+h98rReD9k987/pOg0wIzL71KZtbgm8rxFlk7LdKy4nHn+Awa
zsSvbhf/uitU8LeW4c4QmoVUspsV2buxCa7a9fioU8jUXzMymPHHMmvUUYXINyQy3x
FB2yM/6m2Ei2Q==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 79819
Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
--=-=-=
Content-Type: text/plain
Daniel Mendler <mail@HIDDEN> writes:
> Spencer Baugh <sbaugh@HIDDEN> writes:
>
>> Daniel Mendler <mail@HIDDEN> writes:
>>
>>> Spencer Baugh <sbaugh@HIDDEN> writes:
>>>
>>>> Tags: patch
>>>>
>>>> Don't block user input while rendering the *Completions* buffer
>>>> due to eager-display. This allows eager-display to be used with
>>>> larger and slower completion tables without interfering with the
>>>> user.
>>>>
>>>> Like eager-update, we use while-no-input and non-essential to ensure
>>>> that eager-display happens without blocking the user.
>>>
>>> This patch goes a bit against the intention of eager-display, which was
>>> introduced as an exact replacement for tmm and ffap which had displayed
>>> *Completions* immediately in the past, without a timer. But I do see the
>>> point of the patch and your implementation looks good.
>>
>> Right. I figured that if we ever want to add this while-no-input
>> functionality (and I suggest that we do) then we should probably do it
>> now, while eager-display isn't yet in a released Emacs version, since
>> it's not impossible that it could break something if we added it later.
>>
>>> eager-display also supports returning a function, but now I don't see
>>> great use cases for this. The idea was to give control to the completion
>>> table to eagerly display something. In your patch you also defer this
>>> function, which may not be desired. If the completion table is in
>>> control it can also defer itself depending on its known performance
>>> characteristics or depending on its special display. Maybe we should
>>> reconsider the functionp metadata value of eager-display and remove
>>> this, instead of introducing this feature with questionable
>>> functionality. eager-display is still unreleased, so it can still be
>>> changed.
>>
>> Ah, I was wondering what the use case was for returning a function from
>> eager-display.
>>
>> I'm inclined to remove that ability if you're okay with that.
>
> I've checked the Emacs code base and an `eager-display' function is used
> by `tmm-add-prompt'. Can you please check if this function works well
> this works with your patch? Given that, I would leave the ability in
> place.
Ah, thanks for checking.
I looked into the eager-display function used by tmm-add-prompt. It's
used to change the text in *Completions* in a few ways. But there's
actually a bug with this usage: if completion-eager-display is nil, or
if the *Completions* buffer is dismissed and reopened, the changes to the
text won't happen.
To fix this, tmm should be using a completion-setup-hook instead. But
when I changed it to do that, it didn't need to return a function from
eager-display anymore. So I think we actually should still drop the
ability to return a function from eager-display, at least until some
other use case occurs to us.
Also, interestingly, my change to do the eager-display in a timer
surprising was required to change tmm to use completion-setup-hook:
- Without my change, setting completion-setup-hook in
minibuffer-with-setup-hook doesn't work, because *Completions* is
eager-displayed before the minibuffer is opened.
- With my change, setting completion-setup-hook in
minibuffer-with-setup-hook does work, because *Completions* is displayed
after the current command is complete, which is after the minibuffer is
opened.
So that makes this timer change to eager-display seem even nicer.
--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
filename=0001-Do-eager-display-of-Completions-while-idle.patch
From c4f8d2d04c6001f036f48234b988263c17eb50e6 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Tue, 11 Nov 2025 20:11:20 -0500
Subject: [PATCH] Do eager display of *Completions* while idle
Don't block user input while rendering the *Completions* buffer
due to eager-display. This allows eager-display to be used with
larger and slower completion tables without interfering with the
user. Like in eager-update, we use while-no-input and
non-essential to ensure that eager-display happens without
blocking the user.
To support this, we remove the ability to set eager-display to a
function. The only user was tmm.el, which nows sets
eager-display to t and adds a completion-setup-hook instead.
(This also fixes a bug in tmm where dismissing and redisplaying
the *Completions* buffer would not have the special help text)
* lisp/minibuffer.el (completion-eager-display--timer)
(completions--eager-display, completions--start-eager-display):
Add. (bug#79819)
(completing-read-default): Call
completions--start-eager-display, stop supporting functionp
eager-display.
* lisp/tmm.el (tmm-add-prompt): Delete.
(tmm--completion-setup-hook): Add.
(tmm-add-prompt): Add completion-setup-hook, set eager-display
to t.
(tmm-goto-completions): Call minibuffer-completion-help instead
of tmm-add-prompt.
---
lisp/minibuffer.el | 37 +++++++++++++++++++++++++++----------
lisp/tmm.el | 20 +++++++++-----------
2 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index e4108267287..0ebef1c1394 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -141,8 +141,7 @@ completion-metadata
- `cycle-sort-function': function to sort entries when cycling.
Works like `display-sort-function'.
- `eager-display': non-nil to request eager display of the
- completion candidates. Can also be a function which is invoked
- after minibuffer setup.
+ completion candidates.
The metadata of a completion table should be constant between two boundaries."
(let ((metadata (if (functionp table)
(funcall table string pred 'metadata))))
@@ -1278,7 +1277,7 @@ completion-category-defaults
- `group-function': function for grouping the completion candidates.
- `annotation-function': function to add annotations in *Completions*.
- `affixation-function': function to prepend/append a prefix/suffix.
-- `eager-display': function to show *Completions* eagerly.
+- `eager-display': non-nil to show *Completions* eagerly.
Categories are symbols such as `buffer' and `file', used when
completing buffer and file names, respectively.
@@ -1300,7 +1299,7 @@ completion-category-overrides
- `group-function': function for grouping the completion candidates.
- `annotation-function': function to add annotations in *Completions*.
- `affixation-function': function to prepend/append a prefix/suffix.
-- `eager-display': function to show *Completions* eagerly.
+- `eager-display': non-nil to show *Completions* eagerly.
See more description of metadata in `completion-metadata'.
Categories are symbols such as `buffer' and `file', used when
@@ -2754,6 +2753,24 @@ completions--background-update
((completion--eager-update-p (minibuffer-prompt-end))
(minibuffer-completion-help))))))
+(defvar completion-eager-display--timer nil)
+
+(defun completions--eager-display ()
+ "Try to display *Completions* without blocking input."
+ ;; If the user has left the minibuffer, give up on eager display of
+ ;; *Completions*.
+ (when (minibufferp nil t)
+ (when (while-no-input
+ (let ((non-essential t))
+ (minibuffer-completion-help)))
+ ;; If we got interrupted, try again the next time the user is idle.
+ (completions--start-eager-display))))
+
+(defun completions--start-eager-display ()
+ "Display the *Completions* buffer when the user is next idle."
+ (setq completion-eager-display--timer
+ (run-with-idle-timer 0 nil #'completions--eager-display)))
+
(defun completions--post-command-update ()
"Update displayed *Completions* buffer after command, once."
(remove-hook 'post-command-hook #'completions--post-command-update)
@@ -5143,14 +5160,14 @@ completing-read-default
;; `completion-eager-display' is t or if eager display
;; has been requested by the completion table.
(when completion-eager-display
- (let* ((md (completion-metadata
+ (when (or (eq completion-eager-display t)
+ (completion-metadata-get
+ (completion-metadata
(buffer-substring-no-properties
(minibuffer-prompt-end) (point))
- collection predicate))
- (fun (completion-metadata-get md 'eager-display)))
- (when (or fun (eq completion-eager-display t))
- (funcall (if (functionp fun)
- fun #'minibuffer-completion-help))))))
+ collection predicate)
+ 'eager-display))
+ (completions--start-eager-display))))
(read-from-minibuffer prompt initial-input keymap
nil hist def inherit-input-method))))
(when (and (equal result "") def)
diff --git a/lisp/tmm.el b/lisp/tmm.el
index f893df2cb7a..c86aafc200d 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -218,7 +218,9 @@ tmm-prompt
(car (nth index-of-default tmm-km-list))
(minibuffer-with-setup-hook
(lambda ()
- (setq tmm-old-mb-map (tmm-define-keys t)))
+ (setq tmm-old-mb-map (tmm-define-keys t))
+ (add-hook 'completion-setup-hook
+ #'tmm--completion-setup-hook 'append 'local))
;; tmm-km-list is reversed, because history
;; needs it in LIFO order. But default list
;; needs it in non-reverse order, so that the
@@ -231,7 +233,7 @@ tmm-prompt
" (up/down to change, PgUp to menu): ")
(completion-table-with-metadata
tmm-km-list '((category . tmm)
- (eager-display . tmm-add-prompt)
+ (eager-display . t)
(display-sort-function . identity)
(cycle-sort-function . identity)))
nil t nil
@@ -416,20 +418,16 @@ tmm-remove-inactive-mouse-face
(goto-char next)))
(set-buffer-modified-p nil)))
-(defun tmm-add-prompt ()
+(defun tmm--completion-setup-hook ()
(unless tmm-c-prompt
(error "No active menu entries"))
(or tmm-completion-prompt
- (add-hook 'completion-setup-hook
- #'tmm-completion-delete-prompt 'append))
- (unwind-protect
- (minibuffer-completion-help)
- (remove-hook 'completion-setup-hook #'tmm-completion-delete-prompt))
- (with-current-buffer "*Completions*"
+ (tmm-completion-delete-prompt))
+ (with-current-buffer standard-output
(tmm-remove-inactive-mouse-face)
(when tmm-completion-prompt
(let ((inhibit-read-only t)
- (window (get-buffer-window "*Completions*")))
+ (window (get-buffer-window)))
(goto-char (point-min))
(insert
(if tmm-shortcut-inside-entry
@@ -474,7 +472,7 @@ tmm-shortcut
(defun tmm-goto-completions ()
"Jump to the completions buffer."
(interactive)
- (tmm-add-prompt)
+ (minibuffer-completion-help)
(setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max)))
;; Clear minibuffer old contents before using *Completions* buffer for
;; selection.
--
2.43.7
--=-=-=--
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.Received: (at 79819) by debbugs.gnu.org; 12 Nov 2025 21:34:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 12 16:34:32 2025 Received: from localhost ([127.0.0.1]:51640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJIU4-0002PX-0Y for submit <at> debbugs.gnu.org; Wed, 12 Nov 2025 16:34:32 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:53717 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1vJIU0-0002PP-Qb for 79819 <at> debbugs.gnu.org; Wed, 12 Nov 2025 16:34:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0EeQk8v8yMe5U3Tv1LSEkj6mO8rrvj1GFYAThYnksLo=; b=ReqNbnG6ull6vrxmkz1kS8ZPEn QhfHHgUZ9ffYoDrigftvWiJiHtkVLeq5K3obRMyo6E+E2tBSMRf6VEOFlZloJBfxMfznGFz5gYn7U dGdCzlAzv73ekl4xFE82rq890U04Cz4/dE/OwJwpBVvInEETwRFPDPxus2ahNJsVMvCo=; From: Daniel Mendler <mail@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <ierldkb6j00.fsf@HIDDEN> References: <iero6p86ojz.fsf@HIDDEN> <87a50rk6sp.fsf@HIDDEN> <ierldkb6j00.fsf@HIDDEN> Date: Wed, 12 Nov 2025 22:34:19 +0100 Message-ID: <87v7jfylyc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 79819 Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Spencer Baugh <sbaugh@HIDDEN> writes: > Daniel Mendler <mail@HIDDEN> writes: > >> Spencer Baugh <sbaugh@HIDDEN> writes: >> >>> Tags: patch >>> >>> Don't block user input while rendering the *Completions* buffer >>> due to eager-display. This allows eager-display to be used with >>> larger and slower completion tables without interfering with the >>> user. >>> >>> Like eager-update, we use while-no-input and non-essential to ensure >>> that eager-display happens without blocking the user. >> >> This patch goes a bit against the intention of eager-display, which was >> introduced as an exact replacement for tmm and ffap which had displayed >> *Completions* immediately in the past, without a timer. But I do see the >> point of the patch and your implementation looks good. > > Right. I figured that if we ever want to add this while-no-input > functionality (and I suggest that we do) then we should probably do it > now, while eager-display isn't yet in a released Emacs version, since > it's not impossible that it could break something if we added it later. > >> eager-display also supports returning a function, but now I don't see >> great use cases for this. The idea was to give control to the completion >> table to eagerly display something. In your patch you also defer this >> function, which may not be desired. If the completion table is in >> control it can also defer itself depending on its known performance >> characteristics or depending on its special display. Maybe we should >> reconsider the functionp metadata value of eager-display and remove >> this, instead of introducing this feature with questionable >> functionality. eager-display is still unreleased, so it can still be >> changed. > > Ah, I was wondering what the use case was for returning a function from > eager-display. > > I'm inclined to remove that ability if you're okay with that. I've checked the Emacs code base and an `eager-display' function is used by `tmm-add-prompt'. Can you please check if this function works well this works with your patch? Given that, I would leave the ability in place. Daniel
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.Received: (at 79819) by debbugs.gnu.org; 12 Nov 2025 21:25:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 12 16:25:44 2025 Received: from localhost ([127.0.0.1]:51602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJILX-000244-Oo for submit <at> debbugs.gnu.org; Wed, 12 Nov 2025 16:25:44 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:59091) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>) id 1vJILU-00023o-MA for 79819 <at> debbugs.gnu.org; Wed, 12 Nov 2025 16:25:42 -0500 From: Spencer Baugh <sbaugh@HIDDEN> To: Daniel Mendler <mail@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <87a50rk6sp.fsf@HIDDEN> (Daniel Mendler's message of "Wed, 12 Nov 2025 09:13:10 +0100") References: <iero6p86ojz.fsf@HIDDEN> <87a50rk6sp.fsf@HIDDEN> Date: Wed, 12 Nov 2025 16:25:35 -0500 Message-ID: <ierldkb6j00.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1762982735; bh=OXMdahl3juS+KZoKej4+NU7YWn9nP/Hk9r2frJ7U/uw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=K8u3LIxwrK3taCnITVgaprx2xs36CWVRsEK6glOb+Ae3xosEJ89ILzncUP691d4KV Ys/o+r3B/J/ECAJfD1KBAWU4CZOX6bfyP64p5hqM5hbQakXzTC5arB5GpApa9arNqw j7hFt6tkzc+5QCrB1OxLSwvAj1TS6qnL8bGTTZQewuYVPG1C3Oo21MmbDf45QrmS5Y HUV/W/byVP3+6RWj0edc9FFxVbNvWPc8VDAD/TjTQpDUhP7d9qklq0FGbACIfnawtH z5nm9InK4DggtI0yN9JObSNmi7jIhKPlCcRiVUBKVeFkNYkrsffi0ZyAf6i1TOZb/l dP/g6RQnVH6mw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79819 Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Daniel Mendler <mail@HIDDEN> writes: > Spencer Baugh <sbaugh@HIDDEN> writes: > >> Tags: patch >> >> Don't block user input while rendering the *Completions* buffer >> due to eager-display. This allows eager-display to be used with >> larger and slower completion tables without interfering with the >> user. >> >> Like eager-update, we use while-no-input and non-essential to ensure >> that eager-display happens without blocking the user. > > This patch goes a bit against the intention of eager-display, which was > introduced as an exact replacement for tmm and ffap which had displayed > *Completions* immediately in the past, without a timer. But I do see the > point of the patch and your implementation looks good. Right. I figured that if we ever want to add this while-no-input functionality (and I suggest that we do) then we should probably do it now, while eager-display isn't yet in a released Emacs version, since it's not impossible that it could break something if we added it later. > eager-display also supports returning a function, but now I don't see > great use cases for this. The idea was to give control to the completion > table to eagerly display something. In your patch you also defer this > function, which may not be desired. If the completion table is in > control it can also defer itself depending on its known performance > characteristics or depending on its special display. Maybe we should > reconsider the functionp metadata value of eager-display and remove > this, instead of introducing this feature with questionable > functionality. eager-display is still unreleased, so it can still be > changed. Ah, I was wondering what the use case was for returning a function from eager-display. I'm inclined to remove that ability if you're okay with that.
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.Received: (at 79819) by debbugs.gnu.org; 12 Nov 2025 08:13:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 12 03:13:26 2025 Received: from localhost ([127.0.0.1]:48440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1vJ5yo-0006t2-G9 for submit <at> debbugs.gnu.org; Wed, 12 Nov 2025 03:13:26 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:45801 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1vJ5yj-0006sl-0W for 79819 <at> debbugs.gnu.org; Wed, 12 Nov 2025 03:13:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1B7vFMYqwbHJ4fYji6ObzFJrusVB+RDrr/x0xMYWsPM=; b=cZy0WsMx38snoh/PEu77zpe10g aW0GuRlfFDKgizDM3dICUSFaPT1wR2CgK3ILQWHcgK/JlfovWVQf5mrFkC1TgDIYLmaYnyO2ZcxN6 kO1rZ3/Q34qNys8JCsRQhKlg238DtMzH6PZjOe8vAv+nd8XK2YOXExCqfeH5x009fzGU=; From: Daniel Mendler <mail@HIDDEN> To: Spencer Baugh <sbaugh@HIDDEN> Subject: Re: bug#79819: [PATCH] Do eager display of *Completions* while idle In-Reply-To: <iero6p86ojz.fsf@HIDDEN> References: <iero6p86ojz.fsf@HIDDEN> Date: Wed, 12 Nov 2025 09:13:10 +0100 Message-ID: <87a50rk6sp.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 79819 Cc: 79819 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Spencer Baugh <sbaugh@HIDDEN> writes: > Tags: patch > > Don't block user input while rendering the *Completions* buffer > due to eager-display. This allows eager-display to be used with > larger and slower completion tables without interfering with the > user. > > Like eager-update, we use while-no-input and non-essential to ensure > that eager-display happens without blocking the user. This patch goes a bit against the intention of eager-display, which was introduced as an exact replacement for tmm and ffap which had displayed *Completions* immediately in the past, without a timer. But I do see the point of the patch and your implementation looks good. eager-display also supports returning a function, but now I don't see great use cases for this. The idea was to give control to the completion table to eagerly display something. In your patch you also defer this function, which may not be desired. If the completion table is in control it can also defer itself depending on its known performance characteristics or depending on its special display. Maybe we should reconsider the functionp metadata value of eager-display and remove this, instead of introducing this feature with questionable functionality. eager-display is still unreleased, so it can still be changed. > In GNU Emacs 30.1.90 (build 78, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.15.12, Xaw scroll bars) of 2025-11-04 built on > igm-qws-u22796a > Repository revision: 835dea1902d82826d77a620744c5c82902369ec4 > Repository branch: emacs-30 > Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 > System Description: Rocky Linux 8.10 (Green Obsidian) > > Configured using: > 'configure --with-x-toolkit=lucid --without-gpm --without-gconf > --without-selinux --without-imagemagick --with-modules --with-gif=no > --with-cairo --with-rsvg --without-compress-install --with-tree-sitter > --with-native-compilation=aot > PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'
bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.
Received: (at submit) by debbugs.gnu.org; 12 Nov 2025 01:13:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 11 20:13:39 2025
Received: from localhost ([127.0.0.1]:47502 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1vIzQY-0006G6-LF
for submit <at> debbugs.gnu.org; Tue, 11 Nov 2025 20:13:39 -0500
Received: from lists.gnu.org ([2001:470:142::17]:53048)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
id 1vIzQV-0006Fy-HC
for submit <at> debbugs.gnu.org; Tue, 11 Nov 2025 20:13:37 -0500
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 <sbaugh@HIDDEN>)
id 1vIzQM-0007Gv-Bc
for bug-gnu-emacs@HIDDEN; Tue, 11 Nov 2025 20:13:26 -0500
Received: from mxout5.mail.janestreet.com ([64.215.233.18])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
id 1vIzQJ-0001dL-5N
for bug-gnu-emacs@HIDDEN; Tue, 11 Nov 2025 20:13:25 -0500
From: Spencer Baugh <sbaugh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Do eager display of *Completions* while idle
X-Debbugs-Cc: Daniel Mendler <mail@HIDDEN>, Juri Linkov
<juri@HIDDEN>
Date: Tue, 11 Nov 2025 20:13:20 -0500
Message-ID: <iero6p86ojz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
s=waixah; t=1762910000;
bh=2SKYVBdvGOfNp3xLb9faOOCufae5IVeQHAn6Npyx15o=;
h=From:To:Subject:Date;
b=WBeZcrXKRgFR2nFOkx2EojgQg7FFpzcz1fuaakGKEz0cfWb0kbHmIM/0f4Dnx9Npa
bushQZpNNydlqHgA3/M37Dc25UH57mFqYWyZCd8Ha+uAWKHniY6ALGX5LDvPvbAtC+
03m5gNmKogS5DmSTRcIq+I7d9P+NcNOQ8zU2JvCAuxXMVLUNCJq+AnJu85RpxWebc2
hm4YtGEAW2X/rUER/u0mo9+BZMWY0GvenRNDI9azViGY5UZvEpaP4URp3Thp8fW+kA
/7IdzwThdJv8HjXGw/Zn0o6Erm7QPMoJkEJiFFtk786nrP6+B4xI6iiI5N6sQ6CWtv
QmMF2J+uxFkcQ==
Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN;
helo=mxout5.mail.janestreet.com
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 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,
RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)
--=-=-=
Content-Type: text/plain
Tags: patch
Don't block user input while rendering the *Completions* buffer
due to eager-display. This allows eager-display to be used with
larger and slower completion tables without interfering with the
user.
Like eager-update, we use while-no-input and non-essential to ensure
that eager-display happens without blocking the user.
In GNU Emacs 30.1.90 (build 78, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.15.12, Xaw scroll bars) of 2025-11-04 built on
igm-qws-u22796a
Repository revision: 835dea1902d82826d77a620744c5c82902369ec4
Repository branch: emacs-30
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.10 (Green Obsidian)
Configured using:
'configure --with-x-toolkit=lucid --without-gpm --without-gconf
--without-selinux --without-imagemagick --with-modules --with-gif=no
--with-cairo --with-rsvg --without-compress-install --with-tree-sitter
--with-native-compilation=aot
PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'
--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
filename=0001-Do-eager-display-of-Completions-while-idle.patch
From 0fae322f2339783d1dcb883fbfd9ca901d7c6952 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Tue, 11 Nov 2025 20:11:20 -0500
Subject: [PATCH] Do eager display of *Completions* while idle
Don't block user input while rendering the *Completions* buffer
due to eager-display. This allows eager-display to be used with
larger and slower completion tables without interfering with the
user.
Like eager-update, we use while-no-input and non-essential to
ensure that eager-display happens without blocking the user.
* lisp/minibuffer.el (completion-eager-display--timer)
(completions--eager-display, completions--start-eager-display):
Add.
(completing-read-default): Call
completions--start-eager-display.
---
lisp/minibuffer.el | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index e4108267287..6f154462fdd 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2754,6 +2754,25 @@ completions--background-update
((completion--eager-update-p (minibuffer-prompt-end))
(minibuffer-completion-help))))))
+(defvar completion-eager-display--timer nil)
+
+(defun completions--eager-display (fun)
+ "Try to display *Completions* without blocking input."
+ ;; If the user has left the minibuffer, give up on eager display of
+ ;; *Completions*.
+ (when (minibufferp nil t)
+ (when (while-no-input
+ (let ((non-essential t))
+ (if (functionp fun) (funcall fun)
+ (minibuffer-completion-help))))
+ ;; If we got interrupted, try again the next time the user is idle.
+ (completions--start-eager-display fun))))
+
+(defun completions--start-eager-display (fun)
+ "Display the *Completions* buffer when the user is next idle."
+ (setq completion-eager-display--timer
+ (run-with-idle-timer 0 nil #'completions--eager-display fun)))
+
(defun completions--post-command-update ()
"Update displayed *Completions* buffer after command, once."
(remove-hook 'post-command-hook #'completions--post-command-update)
@@ -5149,8 +5168,7 @@ completing-read-default
collection predicate))
(fun (completion-metadata-get md 'eager-display)))
(when (or fun (eq completion-eager-display t))
- (funcall (if (functionp fun)
- fun #'minibuffer-completion-help))))))
+ (completions--start-eager-display fun)))))
(read-from-minibuffer prompt initial-input keymap
nil hist def inherit-input-method))))
(when (and (equal result "") def)
--
2.43.7
--=-=-=--
Spencer Baugh <sbaugh@HIDDEN>:mail@HIDDEN, juri@HIDDEN, bug-gnu-emacs@HIDDEN.
Full text available.mail@HIDDEN, juri@HIDDEN, bug-gnu-emacs@HIDDEN:bug#79819; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.