Stephen J. Turnbull wrote:
 Mike Kupfer writes:
 
  >> First question: as described in issue778, the test-case glyph from MH-E
  >> is different depending on whether it was created using :data or :file.
  >> With:data, the specifier has tty and stream clauses that it lacks when
  >> created with :file.  Is that to be expected?
 
 I replied:
 
  > No.
 
 I'm sorry, I sent without reading carefully.  I'm not entirely sure
 without looking at the code more carefully, but I suspect the answer
 is "Yes, at least sometimes."  For example, if the :data were simply a
 string, then it would be displayable in all those cases, and the
 specifier code would try to instantiate.  I suppose the media type
 guessing code is invoked separately for each domain, maybe different
 code is involved. 
Okay.  Here's an example, based on the MH-E code.
-----8<-----8<-----
(let* ((load-path '("/home/kupfer/.xemacs/site-packages/etc/mh-e"))
       (data (mh-icon-image 'mh-logo)))
  (setq logo-data data))
logo-data
"/* XPM */
static char *mh-e[] = {
/* width height num_colors chars_per_pixel */
\"    18    13        2            1\",
/* colors */
\"# c #666699\",
\". c None s None\",
/* pixels */
\"........##........\",
\".......####.......\",
\"......######......\",
\"......######......\",
\"....#########.....\",
\"..##############..\",
\".##...######....#.\",
\"##...#.#.####...#.\",
\"....#..#.##.#...#.\",
\"...#..##.#.#.#....\",
\"...#..#..#..#.#...\",
\"...#..#.##..#.##..\",
\"...#..#.#..#....#.\"
};
"
;; Create glyph using :data:
(make-glyph `[xpm :data ,logo-data])
#<glyph (buffer) #<image-specifier global=(((x) . [xpm :color-symbols
(("foregroundToolBarColor" . #<color-specifier global=<unspecified>
fallback=#<color-specifier global=<unspecified> fallback=(((tty) . []) ((x) .
"black")) 0x50> 0x68>) ("backgroundToolBarColor" .
#<color-specifier global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "Gray80")) 0x51>
0x69>) ("background" . #<color-specifier global="#ffffe6"
fallback=(((tty) . []) ((x) . "gray80")) 0x45>) ("foreground" .
#<color-specifier global=<unspecified> fallback=(((tty) . []) ((x) .
"black")) 0x44>)) :data "/* XPM */
static char *mh-e[] = {
/* width height num_colors chars_per_pixel */
\"    18    13        2            1\",
/* colors */
\"# c #666699\",
\". c None s None\",
/* pixels */
\"........##........\",
\".......####.......\",
\"......######......\",
\"......######......\",
\"....#########.....\",
\"..##############..\",
\".##...######....#.\",
\"##...#.#.####...#.\",
\"....#..#.##.#...#.\",
\"...#..##.#.#.#....\",
\"...#..#..#..#.#...\",
\"...#..#.##..#.##..\",
\"...#..#.#..#....#.\"
};
"]) ((tty) . [xpm :color-symbols (("foregroundToolBarColor" .
#<color-specifier global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "black")) 0x50>
0x68>) ("backgroundToolBarColor" . #<color-specifier
global=<unspecified> fallback=#<color-specifier global=<unspecified>
fallback=(((tty) . []) ((x) . "Gray80")) 0x51> 0x69>)
("background" . #<color-specifier global="#ffffe6" fallback=(((tty)
. []) ((x) . "gray80")) 0x45>) ("foreground" . #<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "black")) 0x44>))
:data "/* XPM */
static char *mh-e[] = {
/* width height num_colors chars_per_pixel */
\"    18    13        2            1\",
/* colors */
\"# c #666699\",
\". c None s None\",
/* pixels */
\"........##........\",
\".......####.......\",
\"......######......\",
\"......######......\",
\"....#########.....\",
\"..##############..\",
\".##...######....#.\",
\"##...#.#.####...#.\",
\"....#..#.##.#...#.\",
\"...#..##.#.#.#....\",
\"...#..#..#..#.#...\",
\"...#..#.##..#.##..\",
\"...#..#.#..#....#.\"
};
"]) ((stream) . [xpm :color-symbols (("foregroundToolBarColor" .
#<color-specifier global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "black")) 0x50>
0x68>) ("backgroundToolBarColor" . #<color-specifier
global=<unspecified> fallback=#<color-specifier global=<unspecified>
fallback=(((tty) . []) ((x) . "Gray80")) 0x51> 0x69>)
("background" . #<color-specifier global="#ffffe6" fallback=(((tty)
. []) ((x) . "gray80")) 0x45>) ("foreground" . #<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "black")) 0x44>))
:data "/* XPM */
static char *mh-e[] = {
/* width height num_colors chars_per_pixel */
\"    18    13        2            1\",
/* colors */
\"# c #666699\",
\". c None s None\",
/* pixels */
\"........##........\",
\".......####.......\",
\"......######......\",
\"......######......\",
\"....#########.....\",
\"..##############..\",
\".##...######....#.\",
\"##...#.#.####...#.\",
\"....#..#.##.#...#.\",
\"...#..##.#.#.#....\",
\"...#..#..#..#.#...\",
\"...#..#.##..#.##..\",
\"...#..#.#..#....#.\"
};
"])) fallback=((nil . [nothing])) 0xd0f>0x17b>
;; Create glyph using :file:
(make-glyph `[xpm :file
"/home/kupfer/.xemacs/site-packages/etc/mh-e/mh-logo.xpm"])
#<glyph (buffer) #<image-specifier global=((x) . [xpm :color-symbols
(("foregroundToolBarColor" . #<color-specifier global=<unspecified>
fallback=#<color-specifier global=<unspecified> fallback=(((tty) . []) ((x) .
"black")) 0x50> 0x68>) ("backgroundToolBarColor" .
#<color-specifier global=<unspecified> fallback=#<color-specifier
global=<unspecified> fallback=(((tty) . []) ((x) . "Gray80")) 0x51>
0x69>) ("background" . #<color-specifier global="#ffffe6"
fallback=(((tty) . []) ((x) . "gray80")) 0x45>) ("foreground" .
#<color-specifier global=<unspecified> fallback=(((tty) . []) ((x) .
"black")) 0x44>)) :file
"/home/kupfer/.xemacs/site-packages/etc/mh-e/mh-logo.xpm" :data "/* XPM
*/static char *pixmap[] = {\"18 13 2 1\",\"#	c #666699\",\".	s
None	c
None\",\"........##........\",\".......####.......\",\"......######......\",\"......######......\",\"....#########.....\",\"..##############..\",\".##...######....#.\",\"##...#.#.####...#.\",\"....#..#.##.#...#.\",\"..!
.#..##.#.#.#....\",\"...#..#..#..#.#...\",\"...#..#.##..#.##..\",\"...#..#.#..#....#.\"};"])
fallback=((nil . [nothing])) 0xd12>0x17c>
----->8----->8-----
In both cases, the specifier includes the format (xpm).  So there
shouldn't be any need for XEmacs to guess the format, should there?
mike
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta