;;; Code:
(defconst wl-demo-copyright-notice
- "Copyright (C) 1998-2001 Yuuichi Teranishi <teranisi@gohome.org>"
+ "Copyright (C) 1998-2003 Yuuichi Teranishi <teranisi@gohome.org>"
"A declaration of the copyright on Wanderlust.")
(eval-when-compile
(defconst wl-demo-icon-name
(concat "wl-" (wl-version-status)
- (if (string-match "^... Dec \\([ 1][0-9]\\|2[0-4]\\)"
+ (if (string-match "^... Dec \\([ 01][0-9]\\|2[0-5]\\)"
(current-time-string))
"-xmas-logo"
"-logo"))
(module-installed-p 'bitmap)
(setq wl-demo-bitmap-mule-available-p t))))
'("bitmap" . bitmap))))
- (if wl-on-emacs21
+ (if (and wl-on-emacs21
+ (image-type-available-p 'xbm))
;; Prefer xbm rather than bitmap on Emacs 21.
(delq nil (list xpm xbm bitmap '("ascii")))
(delq nil (list xpm bitmap xbm '("ascii")))))
(when (boundp 'default-gutter-visible-p)
(set-specifier (symbol-value 'default-gutter-visible-p)
nil (current-buffer)))
- (set-specifier (symbol-value 'scrollbar-height) 0 (current-buffer))
- (set-specifier (symbol-value 'scrollbar-width) 0 (current-buffer)))
+ (when (featurep 'scrollbar)
+ (set-specifier (symbol-value 'scrollbar-height) 0 (current-buffer))
+ (set-specifier (symbol-value 'scrollbar-width) 0 (current-buffer))))
(if (and file
(if (and wl-icon-directory
(file-directory-p wl-icon-directory))
(insert "\n")
(/ (+ (* 2 (glyph-height image) (window-height)) height)
(* 2 height)))
- ((eq 'bitmap image-type)
- (require 'bitmap)
- (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)
- (current-column)))
- 2)))
- (put-text-property (point-min) (point-max)
- 'face 'wl-highlight-logo-face)
- (count-lines (point-min) (goto-char (point-max))))
- ((>= emacs-major-version 21)
+ ((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)
(insert-image image)
(insert "\n")
(round height))
+ ((eq 'bitmap image-type)
+ ;; Use ready-composed bitmap image.
+ (require 'bitmap)
+ (let ((coding-system-for-read 'iso-2022-7bit)
+ (input-coding-system '*iso-2022-jp*))
+ (insert-file-contents file))
+ (goto-char (point-max))
+ (unless (bolp)
+ (insert "\n"))
+ (setq width 0)
+ (while (progn
+ (end-of-line 0)
+ (not (bobp)))
+ (setq width (max width (current-column))))
+ ;; Emacs 21.1 would fail to decode composite chars
+ ;; if it has been built without fixing coding.c.
+ (when (and wl-on-emacs21
+ (>= width 80))
+ (erase-buffer)
+ (let ((coding-system-for-read 'raw-text))
+ (insert-file-contents file))
+ (goto-char (point-max))
+ (unless (bolp)
+ (insert "\n"))
+ (setq width 0)
+ (while (progn
+ (end-of-line 0)
+ (not (bobp)))
+ ;; Decode bitmap data line by line.
+ (decode-coding-region (line-beginning-position)
+ (point)
+ 'iso-2022-7bit)
+ (setq width (max width (current-column)))))
+ (indent-rigidly (point-min) (point-max)
+ (max 0 (/ (1+ (- (window-width) width)) 2)))
+ (put-text-property (point-min) (point-max)
+ 'face 'wl-highlight-logo-face)
+ (count-lines (point-min) (goto-char (point-max))))
((eq 'xbm image-type)
(message "Composing a bitmap image...")
(require 'bitmap)
(get-buffer-create "*WL Demo*"))))
(switch-to-buffer buffer)
(setq buffer-read-only nil)
+ (buffer-disable-undo)
(erase-buffer)
(setq truncate-lines t
tab-width 8)