unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* defimage
@ 2002-07-10 22:04 Nick Roberts
  2002-07-12 11:13 ` defimage Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Roberts @ 2002-07-10 22:04 UTC (permalink / raw)


I think defimage is incorrectly defined in image.el. 
Its given as :

(defmacro defimage (symbol specs &optional doc)
  `(defvar ,symbol (find-image ',specs) ,doc))

but I think it should be :

(defmacro defimage (symbol specs &optional doc)
  `(defvar ,symbol (find-image ,specs) ,doc))

Then if I have :

(defconst breakpoint-xpm-data "/* XPM */
static char *magick[] = {
/* columns rows colors chars-per-pixel */
\"12 12 2 1\",
\"  c red\",
\"+ c None\",
/* pixels */
\"+++++  +++++\",
\"+++      +++\",
\"++        ++\",
\"+          +\",
\"+          +\",
\"            \",
\"            \",
\"+          +\",
\"+          +\",
\"++        ++\",
\"+++      +++\",
\"+++++  +++++\"
};"
"XPM file used for breakpoint icon")

I can do :

(defimage breakpoint-disabled-icon 
  `((:type xpm :data ,breakpoint-xpm-data :conversion laplace)))

(defimage breakpoint-enabled-icon 
  `((:type xpm :data ,breakpoint-xpm-data)))

As it stands I can't use a variable for my data as it won't get
evaluated.

With this change, the example in the documentation for defimage
would read :

(defimage test-image '((:type xpm :file \"~/test1.xpm\")
                       (:type xbm :file \"~/test1.xbm\")))

which seems more natural.


Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: defimage
  2002-07-10 22:04 defimage Nick Roberts
@ 2002-07-12 11:13 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2002-07-12 11:13 UTC (permalink / raw)
  Cc: emacs-devel

I think the idea of defimage is for defining images in a fixed way.
When you want to use a variable object for the specs,
it is easy enough to use find-image.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-12 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10 22:04 defimage Nick Roberts
2002-07-12 11:13 ` defimage Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).