From: yamaoka Date: Wed, 12 Dec 2001 01:48:36 +0000 (+0000) Subject: * wl/wl-demo.el (wl-demo-image-type-alist): Add bitmap for Emacs 21. X-Git-Tag: wl-2_8-root~33 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=cbb96e16fce1a19bfbf5c617570ec3b9852f9d65;p=elisp%2Fwanderlust.git * wl/wl-demo.el (wl-demo-image-type-alist): Add bitmap for Emacs 21. (wl-demo-insert-image): Decode bitmap data line by line when Emacs 21 is running (cf. mule-ja:08245). * WL-MK (install-wl-icons): Install *.img files for Emacs 21. --- diff --git a/ChangeLog b/ChangeLog index d3c55f7..1a3d003 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-12-12 Katsumi Yamaoka + + * WL-MK (install-wl-icons): Install *.img files for Emacs 21. + 2001-12-11 Yuuichi Teranishi * NEWS.ja: Added description about xxx-directory, elmo-cache-dirname. diff --git a/WL-MK b/WL-MK index ee68a7f..e6462bf 100644 --- a/WL-MK +++ b/WL-MK @@ -207,10 +207,11 @@ (make-directory PIXMAPDIR t)) (let* ((case-fold-search t) (icons (directory-files ICONDIR t - (cond ((or (featurep 'xemacs) - (and (boundp 'emacs-major-version) - (>= emacs-major-version 21))) + (cond ((featurep 'xemacs) "\\.x[bp]m$") + ((and (boundp 'emacs-major-version) + (>= emacs-major-version 21)) + "\\.img$\\|\\.x[bp]m$") ((featurep 'mule) "\\.img$\\|\\.xbm$")))) icon dest) diff --git a/wl/ChangeLog b/wl/ChangeLog index 1065154..60124d1 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,9 @@ +2001-12-12 Katsumi Yamaoka + + * wl-demo.el (wl-demo-image-type-alist): Add bitmap for Emacs 21. + (wl-demo-insert-image): Decode bitmap data line by line when Emacs + 21 is running (cf. mule-ja:08245). + 2001-12-11 Yuuichi Teranishi * wl-folder.el (wl-folder-init-hook): New hook. diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 078ca16..10c36ba 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -98,31 +98,34 @@ Yet Another Message Interface On Emacsen" (if (or (and (featurep 'xemacs) (device-on-window-system-p)) window-system) - (append - (when (or (and (featurep 'xemacs) - (featurep 'xpm)) - (and wl-on-emacs21 - (display-images-p) - (image-type-available-p 'xpm))) - '(("xpm" . xpm))) - (when (and (not (or (featurep 'xemacs) - ;; *.img files won't fit for Emacs 21. - wl-on-emacs21)) - (or (eq t wl-demo-bitmap-mule-available-p) - (and (eq 'unknown wl-demo-bitmap-mule-available-p) - (module-installed-p 'bitmap) - (setq wl-demo-bitmap-mule-available-p t)))) - '(("bitmap" . bitmap))) - (when (or (featurep 'xemacs) - (and wl-on-emacs21 - (display-images-p) - (image-type-available-p 'xbm)) - (eq t wl-demo-bitmap-mule-available-p) - (and (eq 'unknown wl-demo-bitmap-mule-available-p) - (module-installed-p 'bitmap) - (setq wl-demo-bitmap-mule-available-p t))) - '(("xbm" . xbm))) - '(("ascii"))) + (let ((xpm + (when (or (and (featurep 'xemacs) + (featurep 'xpm)) + (and wl-on-emacs21 + (display-images-p) + (image-type-available-p 'xpm))) + '("xpm" . xpm))) + (xbm + (when (or (featurep 'xemacs) + (and wl-on-emacs21 + (display-images-p) + (image-type-available-p 'xbm)) + (eq t wl-demo-bitmap-mule-available-p) + (and (eq 'unknown wl-demo-bitmap-mule-available-p) + (module-installed-p 'bitmap) + (setq wl-demo-bitmap-mule-available-p t))) + '("xbm" . xbm))) + (bitmap + (when (and (not (featurep 'xemacs)) + (or (eq t wl-demo-bitmap-mule-available-p) + (and (eq 'unknown wl-demo-bitmap-mule-available-p) + (module-installed-p 'bitmap) + (setq wl-demo-bitmap-mule-available-p t)))) + '("bitmap" . bitmap)))) + (if wl-on-emacs21 + ;; Prefer xbm rather than bitmap on Emacs 21. + (delq nil (list xpm xbm bitmap '("ascii"))) + (delq nil (list xpm bitmap xbm '("ascii"))))) '(("ascii")))) (defun wl-demo-insert-image (image-type) @@ -171,9 +174,20 @@ Return a number of lines that an image occupies in the buffer." (* 2 height))) ((eq 'bitmap image-type) (require 'bitmap) - (let ((coding-system-for-read 'iso-2022-7bit) - (input-coding-system '*iso-2022-jp*)) - (insert-file-contents file)) + (if wl-on-emacs21 + (progn + ;; Decode bitmap data line by line. + (let ((coding-system-for-read 'raw-text)) + (insert-file-contents file)) + (set-buffer-multibyte t) + (while (not (eobp)) + (decode-coding-region (point) (line-end-position) + 'iso-2022-7bit) + (forward-line 1)) + (goto-char (point-min))) + (let ((coding-system-for-read 'iso-2022-7bit) + (input-coding-system '*iso-2022-jp*)) + (insert-file-contents file))) (end-of-line) (indent-rigidly (point-min) (point-max) (max 0 (/ (1+ (- (window-width)