X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl-demo.el;h=9e852637a4cd2c2b2abdc85ae382d561b3b13958;hb=abd7d9a4229a516f87cf46345ed6e5bb34ae41df;hp=72bdb9fa4c754a9a8c9d89133bb36038f353b220;hpb=c0c12587c1879d2dcd28e7f7b5fcf5017634fe98;p=elisp%2Fwanderlust.git diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 72bdb9f..9e85263 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -29,7 +29,7 @@ ;;; Code: (defconst wl-demo-copyright-notice - "Copyright (C) 1998-2001 Yuuichi Teranishi " + "Copyright (C) 1998-2003 Yuuichi Teranishi " "A declaration of the copyright on Wanderlust.") (eval-when-compile @@ -41,7 +41,7 @@ (defconst wl-demo-icon-name (concat "wl-" (wl-version-status) - (if (string-match "^... Dec \\([ 1][0-9]\\|2[0-5]\\)" + (if (string-match "^... Dec \\([ 01][0-9]\\|2[0-5]\\)" (current-time-string)) "-xmas-logo" "-logo")) @@ -144,8 +144,9 @@ Return a number of lines that an image occupies in the buffer." (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)) @@ -200,24 +201,38 @@ Return a number of lines that an image occupies in the buffer." ((eq 'bitmap image-type) ;; Use ready-composed bitmap image. (require 'bitmap) - (if wl-on-emacs21 - (progn - ;; Decode bitmap data line by line. - (let ((coding-system-for-read 'raw-text)) - (insert-file-contents file)) - (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) + (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) - (current-column))) - 2))) + (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)))) @@ -301,6 +316,7 @@ argument." (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)