From 60da808baa0b50605c9b3ccffc5686908b755d75 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 19 Oct 2000 23:57:05 +0000 Subject: [PATCH] * 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. --- wl/ChangeLog | 9 ++++++++ wl/wl-demo.el | 42 ++++++++++++++++++++++++----------- wl/wl-e21.el | 68 ++++++++++++++++++++++++++++++--------------------------- 3 files changed, 74 insertions(+), 45 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index f37ba9b..e43fbe0 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,12 @@ +2000-10-19 Katsumi Yamaoka + + * 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 * wl.el (wl-save-status, wl-init): Remove last period in diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 7be3a8b..5415de9 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -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)) diff --git a/wl/wl-e21.el b/wl/wl-e21.el index 896bd1f..649f498 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -453,21 +453,23 @@ 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 @@ -478,23 +480,25 @@ 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")) -- 1.7.10.4