X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl-e21.el;h=e33d3fe27a2ecf8e4683a102cc71e707d4a97e79;hb=9e39553b80115a949a7f04ddced4459a7797f8bd;hp=796c2f57b209a82871d4bb37c5995bc2fb3ef671;hpb=909e8ca9546496b84a19637cebb99d70c7583b33;p=elisp%2Fwanderlust.git diff --git a/wl/wl-e21.el b/wl/wl-e21.el index 796c2f5..e33d3fe 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -1,4 +1,4 @@ -;;; wl-e21.el -- Wanderlust modules for Emacs 21. +;;; wl-e21.el --- Wanderlust modules for Emacs 21. ;; Copyright (C) 2000,2001 Katsumi Yamaoka ;; Copyright (C) 2000,2001 Yuuichi Teranishi @@ -33,7 +33,7 @@ ;;(let (image icon from to overlay) ;; ;; The function `find-image' will look for an image first on `load-path' ;; ;; and then in `data-directory'. -;; (let ((load-path (cons wl-icon-dir load-path))) +;; (let ((load-path (cons wl-icon-directory load-path))) ;; (setq image (find-image (list (list :type 'xpm :file wl-nntp-folder-icon ;; :ascent 'center))))) ;; ;; `propertize' is a convenient function in such a case. @@ -72,18 +72,6 @@ (defvar-maybe wl-folder-mode-map (make-sparse-keymap)) (defvar-maybe wl-draft-mode-map (make-sparse-keymap))) -;; For Emacs 21.0.104 or earlier -(defun-maybe make-mode-line-mouse-map (mouse function) "\ -Return a keymap with single entry for mouse key MOUSE on the mode line. -MOUSE is defined to run function FUNCTION with no args in the buffer -corresponding to the mode line clicked." - (let ((map (make-sparse-keymap))) - (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) @@ -92,6 +80,8 @@ corresponding to the mode line clicked." (add-hook 'wl-summary-mode-hook 'wl-setup-summary) +(add-hook 'wl-message-display-internal-hook 'wl-setup-message) + (defvar wl-use-toolbar (image-type-available-p 'xpm)) (defvar wl-plugged-image nil) (defvar wl-unplugged-image nil) @@ -186,12 +176,12 @@ corresponding to the mode line clicked." (defun wl-e21-setup-toolbar (bar) (when (and wl-use-toolbar (wl-e21-display-image-p)) - (let ((load-path (cons wl-icon-dir load-path)) + (let ((load-path (cons wl-icon-directory load-path)) (props '(:type xpm :ascent center :color-symbols (("backgroundToolBarColor" . "None")) :file)) (success t) - icon up down disabled name success) + icon up down disabled name) (while bar (setq icon (aref (pop bar) 0)) (unless (boundp icon) @@ -243,14 +233,14 @@ corresponding to the mode line clicked." (wl-e21-make-toolbar-buttons wl-summary-mode-map wl-summary-toolbar))) (eval-when-compile - (defsubst wl-e21-setup-message-toolbar (keymap) - (when (wl-e21-setup-toolbar wl-message-toolbar) - (wl-e21-make-toolbar-buttons keymap wl-message-toolbar))) - (defsubst wl-e21-setup-draft-toolbar () (when (wl-e21-setup-toolbar wl-draft-toolbar) (wl-e21-make-toolbar-buttons wl-draft-mode-map wl-draft-toolbar)))) +(defun wl-e21-setup-message-toolbar () + (when (wl-e21-setup-toolbar wl-message-toolbar) + (wl-e21-make-toolbar-buttons (current-local-map) wl-message-toolbar))) + (defvar wl-folder-toggle-icon-list '((wl-folder-opened-image . wl-opened-group-folder-icon) (wl-folder-closed-image . wl-closed-group-folder-icon))) @@ -270,7 +260,7 @@ corresponding to the mode line clicked." (unless image (let ((name (symbol-value (cdr (assq icon wl-folder-toggle-icon-list)))) - (load-path (cons wl-icon-dir load-path))) + (load-path (cons wl-icon-directory load-path))) (when (setq image (find-image `((:type xpm :file ,name :ascent center)))) (setq image (put icon 'image (propertize name @@ -290,7 +280,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 "[[:digit:]-]+/[[:digit:]-]+/[[:digit:]-]+" + (re-search-forward "[-[:digit:]]+/[-[:digit:]]+/[-[:digit:]]+" (line-end-position) t)) (let* ((unsync (nth 0 numbers)) (unread (nth 1 numbers)) @@ -342,7 +332,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 "[[:blank:]]+\\([^\t\n ]+\\)")) + (looking-at "[[:blank:]]+\\([^[:blank:]\n]+\\)")) (setq start (match-beginning 1) end (match-end 1)) (let (image) @@ -454,7 +444,7 @@ corresponding to the mode line clicked." (defun wl-folder-init-icons () (when (wl-e21-display-image-p) - (let ((load-path (cons wl-icon-dir load-path)) + (let ((load-path (cons wl-icon-directory load-path)) (icons wl-folder-internal-icon-list) icon name image) (while (setq icon (pop icons)) @@ -472,7 +462,7 @@ corresponding to the mode line clicked." (if (wl-e21-display-image-p) (progn (unless wl-plugged-image - (let ((load-path (cons wl-icon-dir load-path))) + (let ((load-path (cons wl-icon-directory load-path))) (setq wl-plugged-image (find-image `((:type xpm :file ,wl-plugged-icon @@ -503,7 +493,7 @@ corresponding to the mode line clicked." (if (wl-e21-display-image-p) (progn (unless wl-biff-mail-image - (let ((load-path (cons wl-icon-dir load-path))) + (let ((load-path (cons wl-icon-directory load-path))) (setq wl-biff-mail-image (find-image `((:type xpm :file ,wl-biff-mail-icon @@ -534,19 +524,19 @@ corresponding to the mode line clicked." (defalias 'wl-setup-summary 'wl-e21-setup-summary-toolbar) -(defun wl-message-overload-functions () - (let ((keymap (current-local-map))) - (when keymap - (wl-e21-setup-message-toolbar keymap) - (define-key keymap "l" 'wl-message-toggle-disp-summary) - (define-key keymap [mouse-2] 'wl-message-refer-article-or-url) - (define-key keymap [mouse-4] 'wl-message-wheel-down) - (define-key keymap [mouse-5] 'wl-message-wheel-up) - (define-key keymap [S-mouse-4] 'wl-message-wheel-down) - (define-key keymap [S-mouse-5] 'wl-message-wheel-up) - (set-keymap-parent wl-message-button-map keymap) - (define-key wl-message-button-map - [mouse-2] 'wl-message-button-dispatcher)))) +(defun wl-message-define-keymap () + (let ((keymap (make-sparse-keymap))) + (define-key keymap "l" 'wl-message-toggle-disp-summary) + (define-key keymap [mouse-4] 'wl-message-wheel-down) + (define-key keymap [mouse-5] 'wl-message-wheel-up) + (define-key keymap [S-mouse-4] 'wl-message-wheel-down) + (define-key keymap [S-mouse-5] 'wl-message-wheel-up) + (set-keymap-parent wl-message-button-map keymap) + (define-key wl-message-button-map + [mouse-2] 'wl-message-button-dispatcher) + keymap)) + +(defalias 'wl-setup-message 'wl-e21-setup-message-toolbar) (defun wl-message-wheel-up (event) (interactive "e")