Mercurial > emacs
changeset 27075:893ec72bd6b1
(create-image, defimage): Don't assume image data is a
string.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sat, 01 Jan 2000 16:42:20 +0000 |
parents | 3ddce8cdf615 |
children | 40c18bc759e9 |
files | lisp/image.el |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/image.el Sat Jan 01 16:33:32 2000 +0000 +++ b/lisp/image.el Sat Jan 01 16:42:20 2000 +0000 @@ -87,8 +87,8 @@ Optional PROPS are additional image attributes to assign to the image, like, e.g. `:heuristic-mask t'. Value is the image created, or nil if images of type TYPE are not supported." - (unless (stringp file-or-data) - (error "Invalid image file name or data `%s'" file-or-data)) + (when (and (not data-p) (not (stringp file-or-data))) + (error "Invalid image file name `%s'" file-or-data)) (cond ((null data-p) ;; FILE-OR-DATA is a file name. (unless (or type @@ -206,7 +206,7 @@ (setq file (expand-file-name file data-directory)) (when (file-readable-p file) (setq image (cons 'image (plist-put spec :file file))))) - ((stringp data) + ((not (null data)) (setq image (cons 'image spec))))) (setq specs (cdr specs)))) `(defvar ,symbol ',image ,doc)))