From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Select completions from the minibuffer Date: Fri, 18 Mar 2022 13:33:20 +0200 Message-ID: <835yobh4vz.fsf@gnu.org> References: <87ee3714li.fsf@gnus.org> <86r1773sb4.fsf@mail.linkov.net> <87pmmquew4.fsf@gnus.org> <86ee357wob.fsf@mail.linkov.net> <20220314090826.gyc42227jpvh4efa@Ergus> <86zglsiazs.fsf@mail.linkov.net> <20220317184701.ani7k3clp3impqwn@Ergus> <865yoc47d2.fsf@mail.linkov.net> <20220317231027.65clapwxz5qtnpm4@Ergus> <83bky3hizx.fsf@gnu.org> <20220318111608.r54ospmr65ui7yoy@Ergus> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10481"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, juri@linkov.net, emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 18 12:35:03 2022 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 1nVAso-0002Mb-Bj for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Mar 2022 12:35:02 +0100 Original-Received: from localhost ([::1]:50926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVAsn-0000bH-3n for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Mar 2022 07:35:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVArg-0007JW-Pv for emacs-devel@gnu.org; Fri, 18 Mar 2022 07:33:53 -0400 Original-Received: from [2001:470:142:3::e] (port=36974 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVArN-0007pc-UQ; Fri, 18 Mar 2022 07:33:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AC652em6Xurahz4G81rnxSEQHfpGJCjLeX57NcdWDnk=; b=a0rt4sCWc+m0 GIhMgRxt9BDx2p5MqcRZg48HoRTD7AQLwb4dUDPvWoKiHe7mD3zYq2K62k/qwPccH7fDT4lqyhnmd 3C5GRkv7kbRrBfVJtiyfUDl4JyfY8Lr9jSUb1ZBWfBcQRrQ+5JN6fdajDm5SFHVFfrOYR/ti1bHB2 dWgKGDHqbGCgWHqaf33xiXQZhaUm+Cb1kMcyRRa4tMejiFdkkOZeTBsQYKzXPRIUKHngYggaaMQ8+ hXrKkitlO5xuhCrk0rPx6XtzD07wHquSeBrnQSOjuD9nsz0Wrpla9chiKArMaoWxRh4OR477QAsVD ctJGv0S0QSmq3aDV55ugYQ==; Original-Received: from [87.69.77.57] (port=3115 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVArB-0008Iu-Td; Fri, 18 Mar 2022 07:33:32 -0400 In-Reply-To: <20220318111608.r54ospmr65ui7yoy@Ergus> (message from Ergus on Fri, 18 Mar 2022 12:16:08 +0100) 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" Xref: news.gmane.io gmane.emacs.devel:287275 Archived-At: > Date: Fri, 18 Mar 2022 12:16:08 +0100 > From: Ergus > Cc: larsi@gnus.org, emacs-devel@gnu.org, juri@linkov.net > > When moving point redisplay--pre-redisplay-functions is called BUT > receives nil in the list of windows to update, so it goes in the first > part of the if and runs the hooks for the selected-window > only. And this is incorrect, i.e. the actual window to be redisplayed is NOT the selected window? > (actually this code looks like a workaround for that situation) > > (if (null windows) > (with-current-buffer (window-buffer (selected-window)) > (run-hook-with-args 'pre-redisplay-functions (selected-window))) > (dolist (win (if (listp windows) windows (window-list-1 nil nil t))) > (with-current-buffer (window-buffer win) > (run-hook-with-args 'pre-redisplay-functions win)))) Why is it a workaround? The doc string of pre-redisplay-function says that if the argument is nil, it stands for the selected-window. > In Juri's code it is moving the point in completions while in the > minibuffer so *Completions* never becomes the active window and it is > never passed to redisplay--pre-redisplay-functions. I'd appreciate a test case for this, preferably independent of the completion framework, so that I could look at what happens there. It sounds like you are saying that a window gets redrawn by the display engine (because its point moved), but pre-redisplay-functions aren't called for that window, which would be a bug, I think.