2

I'm trying to load an xpm image file looking like the following:

/* XPM */
static char *_0[] = {
/* columns rows colors chars-per-pixel */
"15 16 3 1 ",
"w c white",
"b c black",
"  c None",
/* pixels */
"               ",
"               ",
"               ",
"     wwwbbb    ",
"    wwwwbbbb   ",
"   wwwwwbbbbb  ",
"   wwwwwbbbbb  ",
"  wwwwwwbbbbbb ",
"  wwwwwwbbbbbb ",
"   wwwwbbbbbb  ",
"   wwwbbbbbbb  ",
"    wbbbbbbb   ",
"     bbbbbb    ",
"               ",
"               ",
"               "
};

Here's the elisp I use to load it:

(insert-image (create-image "path/to/file.xpm"
                            'xpm
                            nil
                            :color-symbols '(("black" . "blue"))))

However, when I run that sexp, I get the file as-is, without the blacks substituted for blues. What am I doing wrong here?

  • This exact code does work for me (v25.1.1). In org-mode the image is not displayed if the code is run from a SRC block. – JeanPierre Dec 27 '16 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.