From: yamaoka Date: Thu, 29 Jun 2000 23:43:13 +0000 (+0000) Subject: (wl-demo-with-temp-file-buffer): New macro. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=298369eec67f2da001dcf14ce0de2a085828f4a8;p=elisp%2Fwanderlust.git (wl-demo-with-temp-file-buffer): New macro. (wl-logo-bitmap, wl-logo-xbm, wl-logo-xpm): Use it. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index efdee69..9284d16 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2000-06-29 Katsumi Yamaoka + + * wl-demo.el (wl-demo-with-temp-file-buffer): New macro. + (wl-logo-bitmap, wl-logo-xbm, wl-logo-xpm): Use it. + 2000-06-28 Yuuichi Teranishi * wl-summary.el (wl-summary-buffer-prev-folder-func): diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 70819e6..ab51def 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -4,7 +4,6 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <2000-06-23 12:33:18 yamaoka> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -70,12 +69,29 @@ $$$$\"\" \"$$oo$ o o$\" Yet Another Message Interface On Emacsen") (eval-when-compile + (defmacro wl-demo-with-temp-file-buffer (file &rest forms) + "Create a temporary buffer, insert FILE's contents without +any conversions and evaluate FORMS there like `progn'." + ( `(with-temp-buffer + (let ((coding-system-for-read 'binary) + (input-coding-system '*noconv*) + auto-mode-alist + file-name-handler-alist + format-alist + insert-file-contents-access-hook + insert-file-contents-post-hook + insert-file-contents-pre-hook + interpreter-mode-alist) + (insert-file-contents (, file)) + (,@ forms))))) + (put 'wl-demo-with-temp-file-buffer 'lisp-indent-function 1)) + +(eval-when-compile (defmacro wl-logo-xpm () ;; (WIDTH HEIGHT DATA) (let ((file (expand-file-name "wl-logo.xpm" wl-icon-dir))) (if (file-exists-p file) - (with-temp-buffer - (insert-file-contents file) + (wl-demo-with-temp-file-buffer file (re-search-forward (concat "\"[\t ]*\\([0-9]+\\)[\t ]+\\([0-9]+\\)" "[\t ]+[0-9]+[\t ]+[0-9]+[\t ]*\"")) @@ -87,8 +103,7 @@ Yet Another Message Interface On Emacsen") ;; (WIDTH HEIGHT DATA) (let ((file (expand-file-name "wl-logo.xbm" wl-icon-dir))) (if (file-exists-p file) - (with-temp-buffer - (insert-file-contents file) + (wl-demo-with-temp-file-buffer file (let ((case-fold-search t) width height) (search-forward "width") @@ -116,8 +131,7 @@ Yet Another Message Interface On Emacsen") (if (condition-case nil (require 'bitmap) (error nil)) (list 'cons t (bitmap-decode-xbm (bitmap-read-xbm-file file))) - (with-temp-buffer - (insert-file-contents file) + (wl-demo-with-temp-file-buffer file (list 'cons nil (buffer-string)))))))) (let ((xpm (wl-logo-xpm)))