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.bugs Subject: bug#74876: 31.0.50; Force fringe refresh / force-window-update not affecting fringes Date: Sat, 14 Dec 2024 22:28:07 +0200 Message-ID: <86zfkyrovc.fsf@gnu.org> References: <7yl87cc0algqh3xvlrywg2z8@mina86.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27974"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74876@debbugs.gnu.org To: Michal Nazarewicz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 14 21:29:26 2024 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 1tMYlR-00078U-8n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Dec 2024 21:29:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMYl8-0007Ks-Dv; Sat, 14 Dec 2024 15:29:07 -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 1tMYl5-0007Ke-G3 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 15:29:03 -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 1tMYl5-0004I7-7n for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 15:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=ttDU3PKCigL69o7L7WfEEM583D+QTcNY4i7u9amF4UU=; b=unHAE6y/NLOCJsXagmXAbf/oL4IT68QOGWfYQckjzTQmxGlZffPnQAo9ylKaezNC8j5ecCUjxJXYLbRFjPrdwehIh4PAVMFznrSud7Yxf/nQUKn3IUcIJb7fXPi0Xs1QyLw0SVPxYXyH2rqicjErCfc3ytL1hcumN98+rYDjSy1GMSJQ3sHygF/xYd0TQkfVyir9D6kHDetRpM0v3RSvsJLIpWn47lwFkaFhlKSILN62GR4AlGLiK1lGDjsxAjrK3+iYeMIGZzJHV5E0qgl3SwJdifV52IMhL5FwSZN3YzzBsfixOqIXQp/saoURnn7kyCfnWdI4ez3GKCtL4c4KXg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMYl4-0005xV-5J for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 15:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 20:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74876 X-GNU-PR-Package: emacs Original-Received: via spool by 74876-submit@debbugs.gnu.org id=B74876.173420810422819 (code B ref 74876); Sat, 14 Dec 2024 20:29:02 +0000 Original-Received: (at 74876) by debbugs.gnu.org; 14 Dec 2024 20:28:24 +0000 Original-Received: from localhost ([127.0.0.1]:48505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMYkO-0005vw-TL for submit@debbugs.gnu.org; Sat, 14 Dec 2024 15:28:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMYkK-0005vf-RZ for 74876@debbugs.gnu.org; Sat, 14 Dec 2024 15:28:18 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMYkE-0004Fe-3q; Sat, 14 Dec 2024 15:28:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ttDU3PKCigL69o7L7WfEEM583D+QTcNY4i7u9amF4UU=; b=AA9R5dmItMjJjn1svnaM +W/O6e7T2YImmViUtDoxYHdifozN+F2VB+brog3AZE8SQTI5RWOOuTtFQJWQKCtfTF0FDa00VIlSS D9SzvOTpkpBzJ9tNoKH0uqImaPwtZYwHaWSeLmz0DQZYYDJnBI/oZIoDzhKQ7ulvti6pq9Gti+IzI Ec5L3Xuykd6pvEqkLh5qZyF+A0Al1ZMBMfknX/yKoSoybnUG0rAgpmAlsmG/HtWc1PgIgHO+ql8jE cUiGpn0zvLCvTb16GIjEIx8/ftzznc6W0XtZ3FGlcBgm5qF8sYh7/h65z1fjkiqc3+j3dpM/euxI3 beE4woTpK1NepA==; In-Reply-To: <7yl87cc0algqh3xvlrywg2z8@mina86.com> (message from Michal Nazarewicz on Sat, 14 Dec 2024 20:31:00 +0100) 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:297075 Archived-At: > From: Michal Nazarewicz > Date: Sat, 14 Dec 2024 20:31:00 +0100 > > I’m implementing fringe dimming in non-selected windows as an extension > of the NonGNU ELPA auto-dim-other-buffers package (see > ). > > is > a test code which tries to achieve it. The expected behaviour is that > after enabling auto-dim-other-buffers-mode defined there, as you switch > between windows, the fringes of non-selected windows will be red. > > Alas, it appears that fringes are redrawn lazily such that changing > window does not refresh the fringes. Yes, because redrawing the fringes is expensive, especially in large frames. So I'm not surprised that you see what you see, since no one expected the fringe face to be changed frequently during the session. > For a bit more context, the package uses face-remap-add-relative and > :filtered faces, i.e. something like: > > (face-remap-add-relative > 'fringe > '(:filtered (:window adob--dim t) auto-dim-other-buffers-fringe-face)) > > I’ve tried toggling fringe-mode when forcing window update with the > below code, but it did not do the trick. > > (defun adob--force-window-update (object) > (force-window-update object) > ;; Force fringes to be updated > (when fringe-mode > (dolist (wnd (if (windowp object) > (list object) > (get-buffer-window-list object nil t))) > (let* ((frame (window-frame wnd)) > (params (frame-parameters frame)) > (left (alist-get 'left-fringe params)) > (right (alist-get 'right-fringe params))) > (when (and left right) > (modify-frame-parameters > frame '((left-fringe nil) (right-fringe nil))) > (modify-frame-parameters > frame `((left-fringe . ,left) (right-fringe . ,right)))))))) > > I think what I’d like is for force-window-update to force full fringe > redraw? Honestly, I haven’t yet dug through all of the window and > fringe code so I’m not entirely sure where the main issue lays. Can you show a simple Lisp which could be used to investigate the behavior and perhaps see how what you want could be enabled? It is not easy to do that by having the code of the whole package. Presumably, what the package does to dynamically change the face of the fringe can be done by a short Lisp function, which could then be used from "emacs -Q" to see what prevents the fringe face from being updated immediately.