From: Gerd Möllmann Date: Thu, 20 Oct 2022 17:04:11 +0000 (+0200) Subject: Handle keywords in image specs X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d4690f8cfff826af19c881578c435f7d19f6a28;p=emacs.git Handle keywords in image specs * src/image.c (parse_image_spec): Don't assume that keywords have a ':' in their symbol name. --- diff --git a/src/image.c b/src/image.c index f6209149313..4f548da76c3 100644 --- a/src/image.c +++ b/src/image.c @@ -1226,7 +1226,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords, /* First element of a pair must be a symbol. */ key = XCAR (plist); plist = XCDR (plist); - if (!SYMBOLP (key)) + if (!SYMBOLP (key) || !SYMBOL_KEYWORD_P (key)) return false; /* There must follow a value. */ @@ -1234,9 +1234,11 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords, return false; value = XCAR (plist); - /* Find key in KEYWORDS. Error if not found. */ + /* Find key in KEYWORDS. Error if not found. The keywords in + keywords have a ':' in their name, which we ignore, because + the keyword names have no ':'. */ for (i = 0; i < nkeywords; ++i) - if (strcmp (keywords[i].name, SSDATA (SYMBOL_NAME (key))) == 0) + if (strcmp (keywords[i].name + 1, SSDATA (SYMBOL_NAME (key))) == 0) break; if (i == nkeywords)