From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67650: [PATCH] ; Hide completion preview when switching windows Date: Wed, 06 Dec 2023 19:29:32 +0100 Message-ID: References: <83r0jz4jvd.fsf@gnu.org> <837clr46y9.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34620"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67650@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 06 19:31:09 2023 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 1rAwft-0008pu-I9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Dec 2023 19:31:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAwff-0007Lt-Lw; Wed, 06 Dec 2023 13:30:55 -0500 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 1rAwfa-0007Kh-He for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 13:30:51 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAwfa-0008Lf-9H for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 13:30:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAwfm-00069G-4G for bug-gnu-emacs@gnu.org; Wed, 06 Dec 2023 13:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Dec 2023 18:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67650-submit@debbugs.gnu.org id=B67650.170188740223461 (code B ref 67650); Wed, 06 Dec 2023 18:31:02 +0000 Original-Received: (at 67650) by debbugs.gnu.org; 6 Dec 2023 18:30:02 +0000 Original-Received: from localhost ([127.0.0.1]:40426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAwem-00065e-AA for submit@debbugs.gnu.org; Wed, 06 Dec 2023 13:30:02 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:50936 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAweZ-00065J-Vn for 67650@debbugs.gnu.org; Wed, 06 Dec 2023 13:29:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1701887375; bh=HH5dXItNU4MpEatgReYJ54T9N2ac7+TW1BkDSzj4tRc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TJFew9ERqVXCUPWSCsuhp0BZNYwZdm6luxt57eKDHYIedl4oh49N1oBxKErF9VuEp kumfhZkAmU5+4NM1F8Cd8CwmmhOuBADHVcG7EfeHRjec2YBH83W8xFOoPiQ+wvEBI/ hRdDzL6hWtrR4IhTPTEm+hRhCS3cMvuyYPNYhc00NHlYJ4gnMSqYFS55QYg9gfIfpm 21ekbtshjq0ifH+6OUNSnawKwXd9T17947vOYE5ZUkSj/b2P9TyubNeBWlpNKxspgB 49xX3UeSRkufM8HAW/x8pzqah23AmrR+ZPCklugHJz9TAtr3O9RISHF7U+8381sC7O H9pLFPvfW35+g== In-Reply-To: <837clr46y9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Dec 2023 18:43:58 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275615 Archived-At: Eli Zaretskii writes: > OK, I understand. However, it means that now we will not only slow > down every command in the buffer that has the completion-preview mode > turned on, but we will also slow down every redisplay cycle, even if > the buffer was not switched. How so? The docstring of `window-selection-change-functions` says: Functions specified buffer-locally are called for each window showing the corresponding buffer if and only if that window has been selected or deselected since the last redisplay. And indeed I see that the function this patch adds to that hook is only called in those circumstances. What performance impact do you envision for other redisplay cycles? > I think we should find a better way of doing this. I was also a bit uneasy with extending another hook at first, so I appreciate your scrutiny, and I'd love to consider different ways to achieve what we want here. But so far this is the best way I came up with, and after testing it and examining the specifics of the case I feel that it's not such a bad solution. > How about that idle timer idea we discussed earlier? I'm not sure I see how that would solve this issue, because we want to dismiss the preview as soon as you switch windows, and I imagine that an ideal timer would instead be less prompt to react to such a change. What do you have in mind? I also feel that we shouldn't underrate the ability of the current approach to display the preview immediately. In fact, one user said that Completion Preview mode "seems more smooth and efficient" then the package he was using before, which I attribute to this exact property of showing the preview without delay. > I'm beginning to like it more and more, and I have a reason to believe > this is not the end of more and more hooks you'd need to add if we > stay with this design. I share the concern that you're expressing towards excessive use of hooks, but I can't currently think of further cases in which we'll /need/ any hook but `post-command-hook` for showing/hiding the preview, and I think that we're still in the safe zone with this patch. Perhaps we should wait a few days to see if other suggestions come up? Thanks, Eshel