From d96c4da402f1f157f57a52284be39290ad095a06 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 12 Dec 2001 04:50:10 +0000 Subject: [PATCH] * wl-demo.el (wl-demo-insert-image): Make Emacs 21 use BITMAP-MULE for xbm if the new redisplay engine is not available. --- wl/ChangeLog | 5 +++++ wl/wl-demo.el | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 60124d1..331297b 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,10 @@ 2001-12-12 Katsumi Yamaoka + * wl-demo.el (wl-demo-insert-image): Make Emacs 21 use BITMAP-MULE + for xbm if the new redisplay engine is not available. + +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). diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 10c36ba..2db1cb1 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -172,7 +172,32 @@ Return a number of lines that an image occupies in the buffer." (insert "\n") (/ (+ (* 2 (glyph-height image) (window-height)) height) (* 2 height))) + ((and wl-on-emacs21 + (or (eq 'xpm image-type) + (and (eq 'xbm image-type) + (image-type-available-p 'xbm)))) + ;; Use the new redisplay engine on Emacs 21. + (setq image (create-image file image-type) + width (image-size image) + height (cdr width) + width (car width)) + (when (eq 'xbm image-type) + (let ((bg (face-background 'wl-highlight-logo-face)) + (fg (face-foreground 'wl-highlight-logo-face))) + (when (stringp bg) + (plist-put (cdr image) ':background bg)) + (when (stringp fg) + (plist-put (cdr image) ':foreground fg)))) + (insert (propertize " " 'display + (list 'space ':align-to + (max 0 (round (- (window-width) + width) + 2))))) + (insert-image image) + (insert "\n") + (round height)) ((eq 'bitmap image-type) + ;; Use ready-composed bitmap image. (require 'bitmap) (if wl-on-emacs21 (progn @@ -196,26 +221,6 @@ Return a number of lines that an image occupies in the buffer." (put-text-property (point-min) (point-max) 'face 'wl-highlight-logo-face) (count-lines (point-min) (goto-char (point-max)))) - ((>= emacs-major-version 21) - (setq image (create-image file image-type) - width (image-size image) - height (cdr width) - width (car width)) - (when (eq 'xbm image-type) - (let ((bg (face-background 'wl-highlight-logo-face)) - (fg (face-foreground 'wl-highlight-logo-face))) - (when (stringp bg) - (plist-put (cdr image) ':background bg)) - (when (stringp fg) - (plist-put (cdr image) ':foreground fg)))) - (insert (propertize " " 'display - (list 'space ':align-to - (max 0 (round (- (window-width) - width) - 2))))) - (insert-image image) - (insert "\n") - (round height)) ((eq 'xbm image-type) (message "Composing a bitmap image...") (require 'bitmap) -- 1.7.10.4