Subject: Re: bug#33126: 26.1; xpm2 broken in MacOSX

From: Alan Third <[email-masked]>
Date: Thu, 25 Oct 2018 11:04:52 +0100

On Wed, Oct 24, 2018 at 06:06:13PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 24 Oct 2018 12:17:36 +0100
> > From: Alan Third <[email-masked]>
> > Cc: [email-masked]
> > 
> > Confirmed. I found this in image.c:
> > 
> > /* XPM support functions for NS where libxpm is not available.
> >    Only XPM version 3 (without any extensions) is supported.  */
> > 
> > I suppose to get xpm2 support you’ll have to find a version of libxpm
> > somewhere.
> > 
> > There is an error logged in *Messages*, perhaps it should specify XPM3
> > per the attached patch.
> 
> Yes.  In addition, I'd add an entry about this in PROBLEMS.

Done. I created a subsection for macOS, although I’m not sure if this
is actually a macOS specific issue, or general to systems lacking X11
libraries (MS Windows?).
-- 
Alan Third
>From d0ecdda6b173d125547bd2efca347279c70f6eda Mon Sep 17 00:00:00 2001
From: Alan Third <[email-masked]>
Date: Wed, 24 Oct 2018 12:15:16 +0100
Subject: [PATCH] Improve XPM load failure message (bug#33126)

* src/image.c (xpm_load_image): Only XPM3 is supported, so make that
explicit.
---
 etc/PROBLEMS | 7 +++++++
 src/image.c  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 7dfafe04de..45370512ca 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2616,6 +2616,13 @@ please call support for your X-server and see if you can get a fix.
 If you do, please send it to [email-masked] so we can list it here.

+* Runtime problems specific to macOS
+
+** macOS doesn't come with libxmp, so only XPM3 is supported.
+
+Libxpm is available for macOS as part of the XQuartz project.
+
+
 * Build-time problems
 
 ** Configuration
diff --git a/src/image.c b/src/image.c
index 767979e63b..a6b2d9060b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4308,7 +4308,7 @@ xpm_load_image (struct frame *f,
   return 1;
 
  failure:
-  image_error ("Invalid XPM file (%s)", img->spec);
+  image_error ("Invalid XPM3 file (%s)", img->spec);
   x_destroy_x_image (ximg);
   x_destroy_x_image (mask_img);
   x_clear_image (f, img);
-- 
2.18.0