Subject: bug#22060: 25.1.50; Fringe faces or not honored in 25.1.50.1 on OSX 10.11 installed via homebrew --use-git-head --cocoa

From: Henrik Nyman <[email-masked]>
Date: Sun, 23 Apr 2017 19:40:17 +0000

Referred to this issue at:

  https://github.com/flycheck/flycheck/issues/811#issuecomment-296476404

I hope this helps with creating a proper fix.

In short:

  - Discovered this one is caused by:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=67a878f78f879ce534232408c34dd11f42dd802b

  - Was able to temporarily fix this issue with (applied on tag emacs-25.2,

    see below). This fixes the behaviour with flycheck  but may have some

    other undesired effects (there probably was a reason to save the

    foreground color in a member variable in the first place).

diff --git src/nsimage.m src/nsimage.m

index 3f49fc046b..ff7ccef0bf 100644

--- src/nsimage.m

+++ src/nsimage.m

@@ -270,7 +270,6 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)

         }

   }

-  xbm_fg = fg;

   [self addRepresentation: bmRep];

   return self;

}

@@ -298,18 +297,14 @@ ns_set_alpha (void *img, int x, int y, unsigned char
a)

   {

     int i, len = s.width*s.height;

     int rr = r * 0xff, gg = g * 0xff, bb = b * 0xff;

-    unsigned char fgr = (xbm_fg >> 16) & 0xff;

-    unsigned char fgg = (xbm_fg >> 8) & 0xff;

-    unsigned char fgb = xbm_fg & 0xff;

     for (i = 0; i < len; ++i)

-      if (planes[0][i] == fgr && planes[1][i] == fgg && planes[2][i] ==
fgb)

+      if (planes[3][i] != 0)

         {

           planes[0][i] = rr;

           planes[1][i] = gg;

           planes[2][i] = bb;

         }

-    xbm_fg = ((rr << 16) & 0xff) + ((gg << 8) & 0xff) + (bb & 0xff);

   }

   return self;

diff --git src/nsterm.h src/nsterm.h

index 5d2513aea7..9de7d94be4 100644

--- src/nsterm.h

+++ src/nsterm.h

@@ -643,7 +643,6 @@ char const * nstrace_fullscreen_type_name (int);

   NSBitmapImageRep *bmRep; /* used for accessing pixel data */

   unsigned char *pixmapData[5]; /* shortcut to access pixel data */

   NSColor *stippleMask;

-  unsigned long xbm_fg;

}

+ allocInitFromFile: (Lisp_Object)file;

- (void)dealloc;

Tested with Emacs 25.2 @3a34412caa, macOS Sierra 10.12.2