unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74876@debbugs.gnu.org
Subject: bug#74876: 31.0.50; Force fringe refresh / force-window-update not affecting fringes
Date: Sat, 14 Dec 2024 22:39:19 +0100	[thread overview]
Message-ID: <40wpfj26bxd5k4i38c92e0sr@mina86.com> (raw)
In-Reply-To: <86zfkyrovc.fsf@gnu.org>

On Sat, Dec 14 2024, Eli Zaretskii wrote:
> Can you show a simple Lisp which could be used to investigate the
> behavior and perhaps see how what you want could be enabled?

---- >% ----------------------------------------------------------------

(defvar-local adob-remapping nil)
(put 'adob-remapping 'permanent-local nil)

(defface adob-test '((t :background "red")) "Test")

(defun adob-test-for-each-window (func)
  (save-current-buffer
    (dolist (frame (frame-list))
      (dolist (wnd (window-list frame))
        (set-buffer (window-buffer wnd))
        (when (funcall func wnd)
          (force-window-update wnd))))))

(defun adob-test-update ()
  (let ((face '(:filtered (:window adob-test t) adob-test))
        (selected-window (selected-window)))
    (adob-test-for-each-window
     (lambda (wnd)
       (let ((val (eq wnd selected-window)) update)
         (unless adob-remapping
           (setq adob-remapping (face-remap-add-relative 'fringe face)
                 update t))
         (unless (eq val (window-parameter wnd 'adob-test))
           (set-window-parameter wnd 'adob-test val)
           (setq update t))
         update)))))

(defun adob-test-on ()
  (interactive)
  (adob-test-update)
  (add-hook 'post-command-hook #'adob-test-update))

(defun adob-test-off ()
  (interactive)
  (remove-hook 'post-command-hook #'adob-test-update)
  (adob-test-for-each-window
   (lambda (wnd)
     (when adob-remapping
       (face-remap-remove-relative adob-remapping)
       (setq adob-remapping nil)
       t))))

; (adob-test-on) to enable
; (adob-test-off) to disable

---- %< ----------------------------------------------------------------

1. Open two windows with two long buffers.
2. M-x adob-test-on RET
3. Scroll current window with M-v.
4. Switch to the other window with C-x o.
4. Scroll other window with C-M-v.

Expected: at all times, the fringes of the selected window are red while
fringes of the other window are grey.

Observed: Fringes are updated only when window is scrolled and new lines
are shown.

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»





      reply	other threads:[~2024-12-14 21:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-14 19:31 bug#74876: 31.0.50; Force fringe refresh / force-window-update not affecting fringes Michal Nazarewicz
2024-12-14 20:28 ` Eli Zaretskii
2024-12-14 21:39   ` Michal Nazarewicz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40wpfj26bxd5k4i38c92e0sr@mina86.com \
    --to=mina86@mina86.com \
    --cc=74876@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).