Subject: Re: bug#47832: 28.0.50; define-fringe-bitmap and emacs --daemon

From: Gregory Heytings <[email-masked]>
Date: Sat, 17 Apr 2021 09:49:46 +0000

>
> However, if this used to work,
>

This used to work indeed; it worked on GNU/Linux with default (non-Cairo) 
builds for Emacs 24 to 27.

>
> it would be good to understand which change broke it.
>

Got it! :-)  The commit I identified is indeed the culprit.  With 
USE_CAIRO, gui_init_fringe() is called in x_initialize(); without 
USE_CAIRO it isn't.  And gui_init_fringe() had a bug, which should now be 
fixed on Windows, too.  Patch attached.

From 4d5a18bbb18496eb02e949b993cc3f9bca7c4d91 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <[email-masked]>
Date: Sat, 17 Apr 2021 09:37:21 +0000
Subject: [PATCH] Consider all user-defined bitmaps in gui_init_fringe()

* src/fringe.c (gui_init_fringe): Also consider user-defined bitmaps that
override default ones (Bug#47832).
---
 src/fringe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fringe.c b/src/fringe.c
index 65c9a84ac9..f2b60b5c8e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1783,7 +1783,7 @@ gui_init_fringe (struct redisplay_interface *rif)
      before the frame of this kind was initialized.  This can happen
      if Emacs is started as a daemon and the init files define fringe
      bitmaps.  */
-  for ( ; bt < max_used_fringe_bitmap; bt++)
+  for (bt = NO_FRINGE_BITMAP + 1; bt < max_used_fringe_bitmap; bt++)
     {
       struct fringe_bitmap *fb = fringe_bitmaps[bt];
       if (fb)
-- 
2.30.2