Alright cool. I'll have a look at your changes for comparison. Thanks for the explanation. On Tue, Aug 13, 2019, 11:00 Eli Zaretskii, wrote: > > From: Liam Quinlan > > Date: Mon, 12 Aug 2019 22:52:31 -0400 > > Cc: emacs-devel@gnu.org > > > > Update: i think I've found the actual proper solution. Alternative > patch on offer below; this time by checking for > > dynamic bitmaps already in place after finishing the static ones in > x_cr_init_fringe. Note that that function also > > defines w32_init_fringe if HAVE_NTGUI, so windows is covered. > > Yes, the idea is correct, but the implementation needed some tweaking, > in particular due to w32 doing things a bit differently during > startup. See commit c90975f on the master branch. > > > Trying to be minimal so this example doesn't iterate to over > fringe_bitmaps looking for sparse elements, just > > begin checking fringe_bitmaps for existing elements at the index > following the standard bitmaps leaves off and > > continue until the first null. I'm not sure if it's too bold to trust > that holes haven't had a chance to arise though. > > (perhaps if the server is initially used in console mode and packages > get unloaded before a gui client > > connects...?). > > No, we cannot assume there are no holes, you can clearly see in > destroy_fringe_bitmap that it leaves holes if the destroyed bitmap is > not the last one in the array. So we need to initialize all the > user-defined bitmaps whose pointer is not NULL. > > Btw, there's a simple way of reproducing the problem without any init > files and extra packages: > > emacs -Q -daemon > emacsclient SOME-VERSIONED-FILE-UNDER-GIT > M-x set variable RET diff-font-lock-prettify RET t RET > [modify the file and then save it] > C-x v = > > Before the change I pushed the above would fail to display the vc-diff > bitmaps on the fringe (I presume the Cairo build will crash). After > the change, the bitmaps are displayed correctly. This happens because > diff-mode is loaded before the GUI frame is created, and thus the > fringe bitmaps defined by diff-mode during loading are not completely > initialized. > > Thanks. >