X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-image.el;h=3f88dcdb9bff0aa058dfe84e80d80f897f554ca3;hb=9c03df890fe5ad3d1bb1a53db557bfc532fd8ffc;hp=469b12614b2f41b0578e48167c12981909097845;hpb=409a9cd46b2403c5581c5f607afe821233aba8e7;p=elisp%2Fsemi.git diff --git a/mime-image.el b/mime-image.el index 469b126..3f88dcd 100644 --- a/mime-image.el +++ b/mime-image.el @@ -56,7 +56,7 @@ (vector type (if data-p :data :file) file-or-data) file-or-data) nil nil 'noerror))) - (if (eq 'nothing (image-instance-type instance)) nil + (if (nothing-image-instance-p instance) nil (make-glyph instance)))) (defun mime-image-insert (image string &optional area) @@ -168,9 +168,11 @@ (let ((format (cdr (assq 'image-format situation))) (image-file (make-temp-name (expand-file-name "tm" temporary-file-directory))) + (orig-mode (default-file-modes)) image) (unwind-protect (progn + (set-default-file-modes 448) (mime-write-entity-content entity image-file) (if (null (setq image (mime-image-create image-file format))) (message "Invalid glyph!") @@ -181,6 +183,7 @@ (set-window-buffer (selected-window)(current-buffer)) (sit-for 0)) (message "Decoding image... done")))) + (set-default-file-modes orig-mode) (condition-case nil (delete-file image-file) (error nil)))))