* wl-demo.el (wl-demo): Use `fancy-splash-insert' for inserting a title text,
authoryamaoka <yamaoka>
Thu, 19 Oct 2000 23:57:05 +0000 (23:57 +0000)
committeryamaoka <yamaoka>
Thu, 19 Oct 2000 23:57:05 +0000 (23:57 +0000)
use `display' property for left margin under Emacs 21.
* wl-e21.el (wl-biff-init-icons): Don't use `propertize' without properties.
(wl-plugged-init-icons): Ditto.

wl/ChangeLog
wl/wl-demo.el
wl/wl-e21.el

index f37ba9b..e43fbe0 100644 (file)
@@ -1,3 +1,12 @@
+2000-10-19  Katsumi Yamaoka    <yamaoka@jpl.org>
+
+       * wl-demo.el (wl-demo): Use `fancy-splash-insert' for inserting a
+       title text, use `display' property for left margin under Emacs 21.
+
+       * wl-e21.el (wl-biff-init-icons): Don't use `propertize' without
+       properties.
+       (wl-plugged-init-icons): Ditto.
+
 2000-10-19  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl.el (wl-save-status, wl-init): Remove last period in
index 7be3a8b..5415de9 100644 (file)
@@ -49,6 +49,7 @@
   (defalias-maybe 'create-image 'ignore)
   (defalias-maybe 'device-on-window-system-p 'ignore)
   (defalias-maybe 'display-graphic-p 'ignore)
+  (defalias-maybe 'fancy-splash-insert 'ignore)
   (defalias-maybe 'frame-char-height 'ignore)
   (defalias-maybe 'frame-char-width 'ignore)
   (defalias-maybe 'frame-parameter 'ignore)
@@ -56,6 +57,7 @@
   (defalias-maybe 'insert-image 'ignore)
   (defalias-maybe 'make-extent 'ignore)
   (defalias-maybe 'make-glyph 'ignore)
+  (defalias-maybe 'propertize 'ignore)
   (defalias-maybe 'set-extent-end-glyph 'ignore)
   (defalias-maybe 'set-glyph-face 'ignore)
   (defalias-maybe 'set-specifier 'ignore)
@@ -284,8 +286,11 @@ Optional IMAGE-TYPE overrides the variable `wl-demo-display-logo'."
                        (plist-put (cdr image) ':foreground fg))))
              (setq rest (/ (- (* wh (frame-char-height)) lh 1)
                            (frame-char-height)))
-             (insert-char ?\  (max 0 (/ (- (* (frame-char-width) (1+ ww)) lw)
-                                        2 (frame-char-width))))
+             (insert (propertize " " 'display
+                                 (list 'space ':align-to
+                                       (max 0 (/ (- (* (frame-char-width)
+                                                       (1+ ww)) lw)
+                                                 2 (frame-char-width))))))
              (insert-image image))
             (t
              (insert image)
@@ -307,17 +312,28 @@ Optional IMAGE-TYPE overrides the variable `wl-demo-display-logo'."
       (insert-char ?\n (max 0 (/ (- rest 4) 2)))
       (goto-char (point-max))
       (insert "\n")
-      (let ((start (point)))
-       (insert (format (cond ((<= rest 2)
-                              "version %s - \"%s\"\n%s")
-                             ((eq rest 3)
-                              "version %s - \"%s\"\n\n%s")
-                             (t
-                              "\nversion %s - \"%s\"\n\n%s"))
-                       (product-version-string (product-find 'wl-version))
-                       (product-code-name (product-find 'wl-version))
-                       wl-demo-copyright-notice))
-       (put-text-property start (point) 'face 'wl-highlight-demo-face)
+      (let ((start (point))
+           (text (format (cond ((<= rest 2)
+                                "version %s - \"%s\"\n%s")
+                               ((eq rest 3)
+                                "version %s - \"%s\"\n\n%s")
+                               (t
+                                "\nversion %s - \"%s\"\n\n%s"))
+                         (product-version-string (product-find 'wl-version))
+                         (product-code-name (product-find 'wl-version))
+                         wl-demo-copyright-notice)))
+       (if wl-on-emacs21
+           (let ((bg (face-background 'wl-highlight-demo-face))
+                 (fg (face-foreground 'wl-highlight-demo-face))
+                 (face '(variable-pitch)))
+             (if (stringp bg)
+                 (setcdr face (list ':background bg)))
+             (if (stringp fg)
+                 (setq face (nconc face (list ':foreground fg))))
+             (let (fancy-splash-help-echo)
+               (fancy-splash-insert ':face face text)))
+         (insert text)
+         (put-text-property start (point) 'face 'wl-highlight-demo-face))
        (let ((fill-column ww))
          (center-region start (point))))
       (goto-char (point-min))
index 896bd1f..649f498 100644 (file)
            wl-unplugged-image (find-image `((:type xpm
                                                    :file ,wl-unplugged-icon
                                                    :ascent center))))))
-  (let ((props (when (display-mouse-p)
-                (list 'local-map (purecopy (make-mode-line-mouse2-map
-                                            #'wl-toggle-plugged))
-                      'help-echo "mouse-2 toggles plugged status"))))
-    (if (display-graphic-p)
-       (setq wl-modeline-plug-state-on
-             (apply 'propertize wl-plug-state-indicator-on
-                    `(,@props display ,wl-plugged-image))
-             wl-modeline-plug-state-off
-             (apply 'propertize wl-plug-state-indicator-off
-                    `(,@props display ,wl-unplugged-image)))
-      (setq wl-modeline-plug-state-on
-           (apply 'propertize wl-plug-state-indicator-on props)
-           wl-modeline-plug-state-off
-           (apply 'propertize wl-plug-state-indicator-off props)))))
+  (if (display-mouse-p)
+      (let ((props (list 'local-map (purecopy (make-mode-line-mouse2-map
+                                              #'wl-toggle-plugged))
+                        'help-echo "mouse-2 toggles plugged status")))
+       (if (display-graphic-p)
+           (setq wl-modeline-plug-state-on
+                 (apply 'propertize wl-plug-state-indicator-on
+                        `(display ,wl-plugged-image ,@props))
+                 wl-modeline-plug-state-off
+                 (apply 'propertize wl-plug-state-indicator-off
+                        `(display ,wl-unplugged-image ,@props)))
+         (setq wl-modeline-plug-state-on
+               (apply 'propertize wl-plug-state-indicator-on props)
+               wl-modeline-plug-state-off
+               (apply 'propertize wl-plug-state-indicator-off props))))
+    (setq wl-modeline-plug-state-on wl-plug-state-indicator-on
+         wl-modeline-plug-state-off wl-plug-state-indicator-off)))
 
 (defun wl-biff-init-icons ()
   (unless wl-biff-mail-image
            wl-biff-nomail-image (find-image
                                  `((:type xpm :file ,wl-biff-nomail-icon
                                           :ascent center))))))
-  (let ((props (when (display-mouse-p)
-                (list 'local-map (purecopy (make-mode-line-mouse2-map
-                                            (lambda nil
-                                              (call-interactively
-                                               'wl-biff-check-folders))))
-                      'help-echo "mouse-2 checks new mails"))))
-    (if (display-graphic-p)
-       (setq wl-modeline-biff-state-on
-             (apply 'propertize wl-biff-state-indicator-on
-                    `(,@props display ,wl-biff-mail-image))
-             wl-modeline-biff-state-off
-             (apply 'propertize wl-biff-state-indicator-off
-                    `(,@props display ,wl-biff-nomail-image)))
-      (setq wl-modeline-biff-state-on
-           (apply 'propertize wl-biff-state-indicator-on props)
-           wl-modeline-biff-state-off
-           (apply 'propertize wl-biff-state-indicator-off props)))))
+  (if (display-mouse-p)
+      (let ((props (list 'local-map (purecopy (make-mode-line-mouse2-map
+                                              (lambda nil
+                                                (call-interactively
+                                                 'wl-biff-check-folders))))
+                        'help-echo "mouse-2 checks new mails")))
+       (if (display-graphic-p)
+           (setq wl-modeline-biff-state-on
+                 (apply 'propertize wl-biff-state-indicator-on
+                        `(display ,wl-biff-mail-image ,@props))
+                 wl-modeline-biff-state-off
+                 (apply 'propertize wl-biff-state-indicator-off
+                        `(display ,wl-biff-nomail-image ,@props)))
+         (setq wl-modeline-biff-state-on
+               (apply 'propertize wl-biff-state-indicator-on props)
+               wl-modeline-biff-state-off
+               (apply 'propertize wl-biff-state-indicator-off props))))
+    (setq wl-modeline-biff-state-on wl-biff-state-indicator-on
+         wl-modeline-biff-state-off wl-biff-state-indicator-off)))
 
 (defun wl-make-date-string ()
   (format-time-string "%a, %d %b %Y %T %z"))