From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Select completions from the minibuffer Date: Fri, 18 Mar 2022 22:31:12 +0100 Message-ID: <20220318213112.7vfzpsxqvd2md4jt@Ergus> 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> <86y217d2j3.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25934"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 18 22:32:38 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 1nVKD8-0006ZB-E1 for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Mar 2022 22:32:38 +0100 Original-Received: from localhost ([::1]:55120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVKD7-0005fc-0m for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Mar 2022 17:32:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVKCX-0004zr-Be for emacs-devel@gnu.org; Fri, 18 Mar 2022 17:32:01 -0400 Original-Received: from sonic313-14.consmr.mail.bf2.yahoo.com ([74.6.133.124]:38526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nVKCU-00064p-Kn for emacs-devel@gnu.org; Fri, 18 Mar 2022 17:32:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1647639116; bh=5PdTyxKpXsN+0r9U+nOCTvvm3JZ6jpts1yIlpK/X5aI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=NBE+/kuxMDCZ/21bzo5dZra1CIHRVY9Kz7aDdGzSlx2P62cn4R+ogRGtOHacBSippjCuxJkBqPcQDE5NvQ73pEZ7sxKTQ6ka2gE/6aGPtD/D/fCdbT8un16HYc1Wa+NxPMA7RhAt7ky7nbG1fieYslpKt0KPWbMB48W7p5Bob9WPetiEZigHMX0KZeJpoL1MsUYv42GZ7IjNCdQsAtX+NmDQQToKMQ3l26h/okkwgzZiqmbCSszSPzeLQl9g5lqX47MJgqQd+zVDisxARq6tQlsJPTW0Hb1YvUBiSPbnZxrf1csZXPu3MTxfIUB0SrMnNYeZihuZvmvbN/aC4DWFMg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1647639116; bh=bHcioy63wbWNNB7Q9e1SW+WytHi3sfpPkXRb5FvtBz4=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=jsoTRAR81xVI4ZuI+S5KrDJA2TrxkhrQp764CVmmLiZkpI0pbK1uaT+Su8D5zM2XjPr5h9emZjIOaLJJQPHn+unomIaXnm7Yv6GQre7AUJ7W6LkgoFPqaTLf1k7Mfnu7cWoE2thFUJrXfBjNGy8yXsokz8q4xw+EC4UxqFHNjIGwQFgg08WzP4lYY+RTOBP9vXOZHz0tG9hK2JBOrIZ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.consmr.mail.bf2.yahoo.com with HTTP; Fri, 18 Mar 2022 21:31:56 +0000 Original-Received: by kubenode510.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 727e5aa24dc02cca31ad129cd218efdc; Fri, 18 Mar 2022 21:31:53 +0000 (UTC) Content-Disposition: inline In-Reply-To: <86y217d2j3.fsf@mail.linkov.net> X-Mailer: WebService/1.1.19894 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.133.124; envelope-from=spacibba@aol.com; helo=sonic313-14.consmr.mail.bf2.yahoo.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:287300 Archived-At: On Fri, Mar 18, 2022 at 11:27:52AM +0200, Juri Linkov wrote: >> Looking at the last line in `deactivate-mark` it seems like it is a >> known issue and changing such optimization in the display engine may be >> probably undesirable (Eli will confirm soon hopefully), so in your case >> maybe is better to force the update on demand like in deactivate-mark: >> >> ``` >> (defmacro with-minibuffer-completions-window (&rest body) >> "Execute the forms in BODY from the minibuffer in its completions window. >> When used in a minibuffer window, select the window with completions, >> and execute the forms." >> (declare (indent 0) (debug t)) >> `(let ((window (or (get-buffer-window "*Completions*" 0) >> ;; Make sure we have a completions window. >> (progn (minibuffer-completion-help) >> (get-buffer-window "*Completions*" 0))))) >> (when window >> (with-selected-window window >> ,@body >> (redisplay--update-cursor-face-highlight window))))) >> ``` >> >> This seems to work. >> >> Is it enough? > >Thanks, I confirm such forcing the update fixes highlighting. > >But still when cursor-face-highlight-nonselected-window is nil by default, >let-binding it to t has no effect: > >``` >(defun minibuffer-next-completion (&optional n) > "Run `next-completion' from the minibuffer in its completions window." > (interactive "p") > (with-minibuffer-completions-window > (let ((cursor-face-highlight-nonselected-window t)) > (next-completion n)))) >``` > Hi Juri: Eli just fixed the real issue in the display engine. So now your code does not need to force the update. BUT it still needs to set the (setq-local cursor-face-highlight-nonselected-window t) in completion-setup-function... I can do it for you unless you prefer to add your own function to completion-setup-hook.