From 909e8ca9546496b84a19637cebb99d70c7583b33 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 5 Sep 2001 12:40:03 +0000 Subject: [PATCH] * wl-e21.el (wl-highlight-folder-current-line): Use Posix style character classes and Perl style shy-groups for regexp. (wl-highlight-plugged-current-line): Use Posix style character classes for regexp. (wl-e21-highlight-folder-by-numbers): Ditto. (wl-e21-display-image-p): Use `display-images-p' instead of `display-graphic-p'. (display-images-p): Make an alias to `display-graphic-p' if it is not available. It is for Emacs version prior to 21.0.105. * wl-demo.el (wl-demo): Use `display-images-p' instead of `display-graphic-p'. (wl-demo-image-type-alist): Ditto. (display-images-p): Make an alias to `display-graphic-p' if it is not available. It is for Emacs version prior to 21.0.105. --- wl/ChangeLog | 18 ++++++++++++++++++ wl/wl-demo.el | 16 +++++++++++----- wl/wl-e21.el | 13 ++++++++----- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 23e33d6..e69a7e5 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,21 @@ +2001-09-05 Katsumi Yamaoka + + * wl-e21.el (wl-highlight-folder-current-line): Use Posix style + character classes and Perl style shy-groups for regexp. + (wl-highlight-plugged-current-line): Use Posix style character + classes for regexp. + (wl-e21-highlight-folder-by-numbers): Ditto. + (wl-e21-display-image-p): Use `display-images-p' instead of + `display-graphic-p'. + (display-images-p): Make an alias to `display-graphic-p' if it is + not available. It is for Emacs version prior to 21.0.105. + + * wl-demo.el (wl-demo): Use `display-images-p' instead of + `display-graphic-p'. + (wl-demo-image-type-alist): Ditto. + (display-images-p): Make an alias to `display-graphic-p' if it is + not available. It is for Emacs version prior to 21.0.105. + 2001-09-04 TAKAHASHI Kaoru * wl-version.el (wl-generate-user-agent-string-1): Remove tm diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 6b79590..bb321d0 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -40,6 +40,11 @@ (defconst wl-demo-icon-name (concat "wl-" (wl-version-status) "-logo")) +(eval-and-compile + (if wl-on-emacs21 + ;; `display-images-p' has not been available prior to Emacs 21.0.105. + (defalias-maybe 'display-images-p 'display-graphic-p))) + ;; Avoid byte compile warnings. (eval-when-compile (defalias-maybe 'bitmap-compose 'ignore) @@ -48,7 +53,7 @@ (defalias-maybe 'bitmap-read-xbm-file 'ignore) (defalias-maybe 'create-image 'ignore) (defalias-maybe 'device-on-window-system-p 'ignore) - (defalias-maybe 'display-graphic-p 'ignore) + (defalias-maybe 'display-images-p 'ignore) (defalias-maybe 'frame-char-height 'ignore) (defalias-maybe 'frame-char-width 'ignore) (defalias-maybe 'frame-parameter 'ignore) @@ -67,7 +72,8 @@ ;; demo ;-) ;; -(defvar wl-logo-ascii " o$ oo$$$$$$ooo +(defvar wl-logo-ascii "\ + o$ oo$$$$$$ooo oo$$$ o$$ o$$$\"\"\"\"\"\"$$$$$o $$$$$$\" o$$$\" o$\"\" \"$$$ $$\" o$\"\" o$\" $$$ @@ -229,14 +235,14 @@ any conversions and evaluate FORMS there like `progn'." (featurep 'xpm) (device-on-window-system-p)) (and wl-on-emacs21 - (display-graphic-p) + (display-images-p) (image-type-available-p 'xpm)))) '(("xpm" . xpm))) (if (and (get 'wl-logo-xbm 'width) (or (and (featurep 'xemacs) (device-on-window-system-p)) (and wl-on-emacs21 - (display-graphic-p) + (display-images-p) (image-type-available-p 'xbm)))) '(("xbm" . xbm))) (if (and (get 'wl-logo-bitmap 'width) @@ -297,7 +303,7 @@ Optional IMAGE-TYPE overrides the variable `wl-demo-display-logo'." 2 (window-pixel-width)))) (set-extent-end-glyph (make-extent (point) (point)) image)) ((and wl-on-emacs21 - (display-graphic-p) + (display-images-p) (not (eq 'wl-logo-bitmap image-type))) (if (eq 'wl-logo-xbm image-type) (let ((bg (face-background 'wl-highlight-logo-face)) diff --git a/wl/wl-e21.el b/wl/wl-e21.el index a3db349..796c2f5 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -81,6 +81,9 @@ corresponding to the mode line clicked." (define-key map (vector 'mode-line mouse) function) map)) +;; `display-images-p' has not been available prior to Emacs 21.0.105. +(defalias-maybe 'display-images-p 'display-graphic-p) + (add-hook 'wl-folder-mode-hook 'wl-setup-folder) (add-hook 'wl-folder-mode-hook 'wl-folder-init-icons) @@ -177,7 +180,7 @@ corresponding to the mode line clicked." (eval-when-compile (defmacro wl-e21-display-image-p () - '(and (display-graphic-p) + '(and (display-images-p) (image-type-available-p 'xpm)))) (defun wl-e21-setup-toolbar (bar) @@ -287,7 +290,7 @@ corresponding to the mode line clicked." (let ((inhibit-read-only t)) (if (and wl-highlight-folder-by-numbers numbers (nth 0 numbers) (nth 1 numbers) - (re-search-forward "[0-9-]+/[0-9-]+/[0-9-]+" + (re-search-forward "[[:digit:]-]+/[[:digit:]-]+/[[:digit:]-]+" (line-end-position) t)) (let* ((unsync (nth 0 numbers)) (unread (nth 1 numbers)) @@ -339,7 +342,7 @@ corresponding to the mode line clicked." (;; basic folder (and (setq fld-name (wl-folder-get-folder-name-by-id (get-text-property (point) 'wl-folder-entity-id))) - (looking-at "[\t ]+\\([^\t\n ]+\\)")) + (looking-at "[[:blank:]]+\\([^\t\n ]+\\)")) (setq start (match-beginning 1) end (match-end 1)) (let (image) @@ -382,7 +385,7 @@ corresponding to the mode line clicked." (when (display-color-p) (wl-e21-highlight-folder-by-numbers start end - (if (looking-at (format "^[\t ]*\\(%s\\|%s\\)" + (if (looking-at (format "^[[:blank:]]*\\(?:%s\\|%s\\)" wl-folder-unsubscribe-mark wl-folder-removed-mark)) 'wl-highlight-folder-killed-face @@ -394,7 +397,7 @@ corresponding to the mode line clicked." (when (wl-e21-display-image-p) (save-excursion (beginning-of-line) - (when (looking-at "[\t ]*\\(\\[\\([^]]+\\)\\]\\)") + (when (looking-at "[[:blank:]]*\\(\\[\\([^]]+\\)\\]\\)") (let* ((start (match-beginning 1)) (end (match-end 1)) (status (match-string-no-properties 2)) -- 1.7.10.4