Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
349c034d
Commit
349c034d
authored
Apr 26, 2000
by
Gerd Moellmann
Browse files
(find-image): New function.
(defimage): Rewritten to find image at load time.
parent
d7d47268
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
lisp/image.el
lisp/image.el
+27
-9
No files found.
lisp/image.el
View file @
349c034d
...
...
@@ -176,8 +176,8 @@ BUFFER nil or omitted means use the current buffer."
;;;###autoload
(
def
macro
defimage
(
symbol
specs
&optional
doc
)
"
Define SYMBOL as an image
.
(
def
un
find-image
(
specs
)
"
Find an image, choosing one of a list of image specifications
.
SPECS is a list of image specifications. DOC is an optional
documentation string.
...
...
@@ -189,12 +189,7 @@ least contain the properties `:type TYPE' and either `:file FILE' or
e.g. `xbm', FILE is the file to load the image from, and DATA is a
string containing the actual image data. The first image
specification whose TYPE is supported, and FILE exists, is used to
define SYMBOL.
Example:
(defimage test-image ((:type xpm :file \"~/test1.xpm\")
(:type xbm :file \"~/test1.xbm\")))"
define SYMBOL."
(
let
(
image
)
(
while
(
and
specs
(
null
image
))
(
let*
((
spec
(
car
specs
))
...
...
@@ -216,7 +211,30 @@ Example:
((
not
(
null
data
))
(
setq
image
(
cons
'image
spec
)))))
(
setq
specs
(
cdr
specs
))))
`
(
defvar
,
symbol
',image
,
doc
)))
image
))
;;;###autoload
(
defmacro
defimage
(
symbol
specs
&optional
doc
)
"Define SYMBOL as an image.
SPECS is a list of image specifications. DOC is an optional
documentation string.
Each image specification in SPECS is a property list. The contents of
a specification are image type dependent. All specifications must at
least contain the properties `:type TYPE' and either `:file FILE' or
`:data DATA', where TYPE is a symbol specifying the image type,
e.g. `xbm', FILE is the file to load the image from, and DATA is a
string containing the actual image data. The first image
specification whose TYPE is supported, and FILE exists, is used to
define SYMBOL.
Example:
(defimage test-image ((:type xpm :file \"~/test1.xpm\")
(:type xbm :file \"~/test1.xbm\")))"
`
(
defvar
,
symbol
(
find-image
',specs
)
,
doc
))
(
provide
'image
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment