* wl.el (wl-plugged-toggle-all): Set the value of `wl-modeline-plug-status'
authoryamaoka <yamaoka>
Fri, 22 Sep 2000 09:45:12 +0000 (09:45 +0000)
committeryamaoka <yamaoka>
Fri, 22 Sep 2000 09:45:12 +0000 (09:45 +0000)
instead of `wl-plug-state-indicator'.
(wl-plugged-toggle): Ditto.
(wl-toggle-plugged): Ditto.
(wl-plugged-init): Ditto.

* wl-xmas.el (wl-biff-init-icons): Set icons data to
`wl-modeline-biff-state-off' and `wl-modeline-biff-state-on' instead of
`wl-biff-state-indicator-off' and `wl-biff-state-indicator-on';
don't modify the value and the type of `wl-biff-state-indicator-off' and
`wl-biff-state-indicator-on'.
(wl-plugged-init-icons): Set icons data to `wl-modeline-plug-state-off' and
`wl-modeline-plug-state-on' instead of `wl-plug-state-indicator-off' and
`wl-plug-state-indicator-on';
don't modify the value and the type of `wl-plug-state-indicator-off' and
`wl-plug-state-indicator-on'.

* wl-vars.el (wl-modeline-biff-state-off, wl-modeline-biff-state-on,
wl-modeline-biff-status, wl-modeline-plug-state-off, wl-modeline-plug-state-on,
wl-modeline-plug-status): New internal variables.
(wl-biff-state-indicator-off, wl-biff-state-indicator-on,
wl-biff-check-interval, wl-biff-check-folder-list): Change customization group
from `wl-folder' to `wl-highlight'.
(wl-plug-state-indicator-off, wl-plug-state-indicator-on,
wl-show-plug-status-on-modeline): Defcustomized.

* wl-util.el (wl-biff-check-folders): Set the value of the flag
`wl-modeline-biff-status' instead of `wl-biff-state-indicator'.
(wl-mode-line-buffer-identification): Set both ON and OFF data with a flag to
`mode-line-buffer-identification'.

* wl-e21.el (wl-biff-init-icons): Set icons data to
`wl-modeline-biff-state-off' and `wl-modeline-biff-state-on' instead of
`wl-biff-state-indicator-off' and `wl-biff-state-indicator-on'.
(wl-plugged-init-icons): Set icons data to `wl-modeline-plug-state-off' and
`wl-modeline-plug-state-on' instead of `wl-plug-state-indicator-off' and
`wl-plug-state-indicator-on'.

wl/ChangeLog
wl/wl-e21.el
wl/wl-util.el
wl/wl-vars.el
wl/wl-xmas.el
wl/wl.el

index 2eaeeac..e2635b6 100644 (file)
@@ -1,3 +1,46 @@
+2000-09-22  Katsumi Yamaoka    <yamaoka@jpl.org>
+
+       * wl.el (wl-plugged-toggle-all): Set the value of
+       `wl-modeline-plug-status' instead of `wl-plug-state-indicator'.
+       (wl-plugged-toggle): Ditto.
+       (wl-toggle-plugged): Ditto.
+       (wl-plugged-init): Ditto.
+
+       * wl-xmas.el (wl-biff-init-icons): Set icons data to
+       `wl-modeline-biff-state-off' and `wl-modeline-biff-state-on'
+       instead of `wl-biff-state-indicator-off' and
+       `wl-biff-state-indicator-on'; don't modify the value and the type
+       of `wl-biff-state-indicator-off' and `wl-biff-state-indicator-on'.
+       (wl-plugged-init-icons): Set icons data to
+       `wl-modeline-plug-state-off' and `wl-modeline-plug-state-on'
+       instead of `wl-plug-state-indicator-off' and
+       `wl-plug-state-indicator-on'; don't modify the value and the type
+       of `wl-plug-state-indicator-off' and `wl-plug-state-indicator-on'.
+
+       * wl-vars.el (wl-modeline-biff-state-off,
+       wl-modeline-biff-state-on, wl-modeline-biff-status,
+       wl-modeline-plug-state-off, wl-modeline-plug-state-on,
+       wl-modeline-plug-status): New internal variables.
+       (wl-biff-state-indicator-off, wl-biff-state-indicator-on,
+       wl-biff-check-interval, wl-biff-check-folder-list): Change
+       customization group from `wl-folder' to `wl-highlight'.
+       (wl-plug-state-indicator-off, wl-plug-state-indicator-on,
+       wl-show-plug-status-on-modeline): Defcustomized.
+
+       * wl-util.el (wl-biff-check-folders): Set the value of the flag
+       `wl-modeline-biff-status' instead of `wl-biff-state-indicator'.
+       (wl-mode-line-buffer-identification): Set both ON and OFF data with
+       a flag to `mode-line-buffer-identification'.
+
+       * wl-e21.el (wl-biff-init-icons): Set icons data to
+       `wl-modeline-biff-state-off' and `wl-modeline-biff-state-on'
+       instead of `wl-biff-state-indicator-off' and
+       `wl-biff-state-indicator-on'.
+       (wl-plugged-init-icons): Set icons data to
+       `wl-modeline-plug-state-off' and `wl-modeline-plug-state-on'
+       instead of `wl-plug-state-indicator-off' and
+       `wl-plug-state-indicator-on'.
+
 2000-09-20  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-util.el (wl-mode-line-buffer-identification): Don't breed
index 087919b..59af044 100644 (file)
                              :file ,name :ascent center))))))))))
 
 (defun wl-plugged-init-icons ()
-  (let ((props (unless (or wl-plugged-image wl-unplugged-image)
-                (list 'local-map (purecopy (make-mode-line-mouse2-map
+  (unless wl-plugged-image
+    (setq wl-plugged-image (wl-e21-make-icon-image
+                           wl-plug-state-indicator-on wl-plugged-icon)
+         wl-unplugged-image (wl-e21-make-icon-image
+                             wl-plug-state-indicator-off wl-unplugged-icon))
+    (let ((props (list 'local-map (purecopy (make-mode-line-mouse2-map
                                             #'wl-toggle-plugged))
-                      'help-echo "mouse-2 toggles plugged status"))))
-    (unless wl-plugged-image
-      (setq wl-plug-state-indicator-on (concat "[" wl-plugged-plug-on "]")
-           wl-plugged-image (wl-e21-make-icon-image
-                             wl-plug-state-indicator-on
-                             wl-plugged-icon))
-      (add-text-properties 0 (length wl-plug-state-indicator-on)
+                      'help-echo "mouse-2 toggles plugged status")))
+      (setq wl-modeline-plug-state-on (copy-sequence
+                                      wl-plug-state-indicator-on)
+           wl-modeline-plug-state-off (copy-sequence
+                                       wl-plug-state-indicator-off))
+      (add-text-properties 0 (length wl-modeline-plug-state-on)
                           (nconc props (unless (stringp wl-plugged-image)
                                          (list 'display wl-plugged-image)))
-                          wl-plug-state-indicator-on))
-    (unless wl-unplugged-image
-      (setq wl-plug-state-indicator-off (concat "[" wl-plugged-plug-off "]")
-           wl-unplugged-image (wl-e21-make-icon-image
-                               wl-plug-state-indicator-off
-                               wl-unplugged-icon))
-      (add-text-properties 0 (length wl-plug-state-indicator-off)
+                          wl-modeline-plug-state-on)
+      (add-text-properties 0 (length wl-modeline-plug-state-off)
                           (nconc props (unless (stringp wl-unplugged-image)
                                          (list 'display wl-unplugged-image)))
-                          wl-plug-state-indicator-off))))
+                          wl-modeline-plug-state-off))))
 
 (defun wl-biff-init-icons ()
-  (let ((props (unless (or wl-biff-mail-image wl-biff-nomail-image)
-                (list 'local-map (purecopy
-                                  (make-mode-line-mouse2-map
-                                   (lambda nil
-                                     (call-interactively
-                                      'wl-biff-check-folders))))
-                      'help-echo "mouse-2 checks new mails"))))
-    (unless wl-biff-mail-image
-      (setq wl-biff-mail-image (wl-e21-make-icon-image
-                               wl-biff-state-indicator-on
-                               wl-biff-mail-icon))
-      (add-text-properties 0 (length wl-biff-state-indicator-on)
+  (unless wl-biff-mail-image
+    (setq wl-biff-mail-image (wl-e21-make-icon-image
+                             wl-biff-state-indicator-on
+                             wl-biff-mail-icon)
+         wl-biff-nomail-image (wl-e21-make-icon-image
+                               wl-biff-state-indicator-off
+                               wl-biff-nomail-icon))
+    (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")))
+      (setq wl-modeline-biff-state-on (copy-sequence
+                                      wl-biff-state-indicator-on)
+           wl-modeline-biff-state-off (copy-sequence
+                                       wl-biff-state-indicator-off))
+      (add-text-properties 0 (length wl-modeline-biff-state-on)
                           (nconc props (unless (stringp wl-biff-mail-image)
-                                         (list 'display wl-biff-mail-image)))
-                          wl-biff-state-indicator-on))
-    (unless wl-biff-nomail-image
-      (setq wl-biff-nomail-image (wl-e21-make-icon-image
-                                 wl-biff-state-indicator-off
-                                 wl-biff-nomail-icon))
-      (add-text-properties 0 (length wl-biff-state-indicator-off)
+                                         (list 'display
+                                               wl-biff-mail-image)))
+                          wl-modeline-biff-state-on)
+      (add-text-properties 0 (length wl-modeline-biff-state-off)
                           (nconc props (unless (stringp wl-biff-nomail-image)
                                          (list 'display
                                                wl-biff-nomail-image)))
-                          wl-biff-state-indicator-off))))
+                          wl-modeline-biff-state-off))))
 
 (defun wl-make-date-string ()
   (format-time-string "%a, %d %b %Y %T %z"))
index 7d46e10..2e7a708 100644 (file)
@@ -413,14 +413,19 @@ Insert User-Agent field instead of X-Mailer field."
       (while priorities
        (setq priority (car priorities)
              priorities (cdr priorities))
-       (cond ((eq 'biff priority)
-              (when wl-biff-check-folder-list
-                (setq result (append result '(wl-biff-state-indicator)))))
-             ((eq 'plug priority)
-              (when wl-show-plug-status-on-modeline
-                (setq result (append result '(wl-plug-state-indicator)))))
-             (t
-              (setq result (append result (or id '("Wanderlust: %12b")))))))
+       (cond
+        ((eq 'biff priority)
+         (when wl-biff-check-folder-list
+           (setq result (append result '((wl-modeline-biff-status
+                                          wl-modeline-biff-state-on
+                                          wl-modeline-biff-state-off))))))
+        ((eq 'plug priority)
+         (when wl-show-plug-status-on-modeline
+           (setq result (append result '((wl-modeline-plug-status
+                                          wl-modeline-plug-state-on
+                                          wl-modeline-plug-state-off))))))
+        (t
+         (setq result (append result (or id '("Wanderlust: %12b")))))))
       (prog1
          (setq mode-line-buffer-identification (if (stringp (car result))
                                                    result
@@ -485,7 +490,7 @@ Insert User-Agent field instead of X-Mailer field."
 
 (defun wl-parse-newsgroups (string &optional subscribe-only)
   (let* ((nglist (wl-parse string "[ \t\f\r\n,]*\\([^ \t\f\r\n,]+\\)"))
-        spec ret-val)
+        ret-val)
     (if (not subscribe-only)
        nglist
       (while nglist
@@ -984,9 +989,7 @@ This function is imported from Emacs 20.7."
       (when (elmo-folder-plugged-p folder)
        (setq new-mails (+ new-mails
                           (nth 0 (wl-folder-check-one-entity folder))))))
-    (setq wl-biff-state-indicator (if (zerop new-mails)
-                                     'wl-biff-state-indicator-off
-                                   'wl-biff-state-indicator-on))
+    (setq wl-modeline-biff-status (> new-mails 0))
     (force-mode-line-update t)
     (when (interactive-p)
       (cond ((zerop new-mails) (message "No mail."))
index bb667cc..f464b17 100644 (file)
@@ -1325,28 +1325,41 @@ Each elements are regexp of folder name."
   :type '(repeat (regexp :tag "Folder Regexp"))
   :group 'wl-folder)
 
+(defcustom wl-show-plug-status-on-modeline t
+  "If it is non-nil, show plugged status in modeline."
+  :type 'boolean
+  :group 'wl-highlight)
+
+(defcustom wl-plug-state-indicator-on  " [ON] "
+  "String used to show plugged status ON."
+  :type 'string
+  :group 'wl-highlight)
+
+(defcustom wl-plug-state-indicator-off " [--] "
+  "String used to show plugged status OFF."
+  :type 'string
+  :group 'wl-highlight)
+
 (defcustom wl-biff-check-folder-list nil
   "All folders that match this list are automatically checked
 every intervals specified by wl-biff-check-interval. "
   :type '(repeat (regexp :tag "Folder Regexp"))
-  :group 'wl-folder)
+  :group 'wl-highlight)
 
 (defcustom wl-biff-check-interval 40
   "Number of seconds between updates of new mails in the mode line."
   :type 'integer
-  :group 'wl-folder)
+  :group 'wl-highlight)
 
 (defcustom wl-biff-state-indicator-on "[\e$B")\e(B]"
   "String used to show biff status ON."
   :type 'string
-  :group 'wl-folder)
+  :group 'wl-highlight)
 
 (defcustom wl-biff-state-indicator-off "[\e$B!>\e(B]"
   "String used to show biff status OFF."
   :type 'string
-  :group 'wl-folder)
-
-(defvar wl-biff-state-indicator wl-biff-state-indicator-off)
+  :group 'wl-highlight)
 
 (defcustom wl-mode-line-display-priority-list '(biff plug title)
   "Displaying order of items to be shown in modeline.  The first item will
@@ -2012,11 +2025,13 @@ a symbol `xbm' to limit the image format to XBM even if XPM can be shown."
 (defvar wl-unplugged-hook nil)
 (defvar wl-plugged t)
 
-(defvar wl-plug-state-indicator-on  " [ON] ")
-(defvar wl-plug-state-indicator-off " [--] ")
-(defvar wl-plug-state-indicator 'wl-plug-state-indicator-on)
-
-(defvar wl-show-plug-status-on-modeline t)
+;; Internal variables used to modeline identifiers.
+(defvar wl-modeline-plug-status nil)
+(defvar wl-modeline-plug-state-on wl-plug-state-indicator-on)
+(defvar wl-modeline-plug-state-off wl-plug-state-indicator-off)
+(defvar wl-modeline-biff-status nil)
+(defvar wl-modeline-biff-state-on wl-biff-state-indicator-on)
+(defvar wl-modeline-biff-state-off wl-biff-state-indicator-off)
 
 ;; Advanced thread view.
 (defvar wl-thread-indent-level 1
@@ -2097,8 +2112,6 @@ a symbol `xbm' to limit the image format to XBM even if XPM can be shown."
 (defvar wl-summary-temp-above wl-summary-target-above)
 (make-obsolete-variable 'wl-summary-temp-above 'wl-summary-target-above)
 
-
-
 ;; plug
 (defvar wl-plugged-plug-on "ON")
 (defvar wl-plugged-plug-off "--")
index fe586ff..d7be9eb 100644 (file)
   (interactive)
   (save-excursion
     (beginning-of-line)
-    (let (fld-name extent)
+    (let (fld-name)
       (cond
        (;; opened folder group
        (looking-at wl-highlight-folder-opened-regexp)
    wl-folder-internal-icon-list))
 
 (defun wl-plugged-init-icons ()
-  (let (extent)
-    (unless (or wl-plugged-glyph wl-unplugged-glyph)
-      (setq extent (make-extent nil nil))
-      (let ((toggle-keymap (make-sparse-keymap)))
-       (define-key toggle-keymap 'button2
+  (unless wl-plugged-glyph
+    (setq wl-plugged-glyph (wl-xmas-make-icon-glyph
+                           wl-plug-state-indicator-on wl-plugged-icon)
+         wl-unplugged-glyph (wl-xmas-make-icon-glyph
+                             wl-plug-state-indicator-off wl-unplugged-icon))
+    (let ((extent (make-extent nil nil)))
+      (let ((keymap (make-sparse-keymap)))
+       (define-key keymap 'button2
          (make-modeline-command-wrapper 'wl-toggle-plugged))
-       (set-extent-keymap extent toggle-keymap))
-      (set-extent-property extent 'help-echo "button2 toggles plugged status"))
-    (unless wl-plugged-glyph
-      (setq wl-plugged-glyph (wl-xmas-make-icon-glyph
-                             (concat "[" wl-plugged-plug-on "]")
-                             wl-plugged-icon)
-           wl-plug-state-indicator-on (cons extent wl-plugged-glyph)))
-    (unless wl-unplugged-glyph
-      (setq wl-unplugged-glyph (wl-xmas-make-icon-glyph
-                               (concat "[" wl-plugged-plug-off "]")
-                               wl-unplugged-icon)
-           wl-plug-state-indicator-off (cons extent wl-unplugged-glyph)))))
+       (set-extent-keymap extent keymap)
+       (set-extent-property extent 'help-echo
+                            "button2 toggles plugged status"))
+      (setq wl-modeline-plug-state-on (cons extent wl-plugged-glyph)
+           wl-modeline-plug-state-off (cons extent wl-unplugged-glyph)))))
 
 (defun wl-biff-init-icons ()
-  (let (extent)
-    (unless (or wl-biff-mail-glyph wl-biff-nomail-glyph)
-      (setq extent (make-extent nil nil))
+  (unless wl-biff-mail-glyph
+    (setq wl-biff-mail-glyph (wl-xmas-make-icon-glyph
+                             wl-biff-state-indicator-on
+                             wl-biff-mail-icon)
+         wl-biff-nomail-glyph (wl-xmas-make-icon-glyph
+                               wl-biff-state-indicator-off
+                               wl-biff-nomail-icon))
+    (let ((extent (make-extent nil nil)))
       (let ((keymap (make-sparse-keymap)))
        (define-key keymap 'button2
          (make-modeline-command-wrapper 'wl-biff-check-folders))
-       (set-extent-keymap extent keymap))
-      (set-extent-property extent 'help-echo "button2 checks new mails"))
-    (unless wl-biff-mail-glyph
-      (setq wl-biff-mail-glyph (wl-xmas-make-icon-glyph
-                               wl-biff-state-indicator-on
-                               wl-biff-mail-icon)
-           wl-biff-state-indicator-on (cons extent wl-biff-mail-glyph)))
-    (unless wl-biff-nomail-glyph
-      (setq wl-biff-nomail-glyph (wl-xmas-make-icon-glyph
-                                 wl-biff-state-indicator-off
-                                 wl-biff-nomail-icon)
-           wl-biff-state-indicator-off (cons extent wl-biff-nomail-glyph)))))
+       (set-extent-keymap extent keymap)
+       (set-extent-property extent 'help-echo "button2 checks new mails"))
+      (setq wl-modeline-biff-state-on (cons extent wl-biff-mail-glyph)
+           wl-modeline-biff-state-off (cons extent wl-biff-nomail-glyph)))))
 
 (defun wl-make-date-string ()
   (let ((s (current-time-string)))
        (set-specifier scrollbar-height (cons (current-buffer) 0)))
   (wl-xmas-setup-folder-toolbar))
 
+(defvar dragdrop-drop-functions)
+
 (defun wl-setup-summary ()
   (make-local-variable 'dragdrop-drop-functions)
   (setq dragdrop-drop-functions '((wl-dnd-default-drop-message t t)))
index 9038829..c079192 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
   (when make-alist
     (wl-make-plugged-alist))
   ;; Plug status.
-  (setq elmo-plugged (setq wl-plugged (elmo-plugged-p)))
-  (setq wl-plug-state-indicator
-       (if wl-plugged
-           'wl-plug-state-indicator-on
-         'wl-plug-state-indicator-off))
+  (setq elmo-plugged (setq wl-plugged (elmo-plugged-p))
+       wl-modeline-plug-status wl-plugged)
   (if wl-plugged
       (wl-toggle-plugged t 'flush)))
 
@@ -99,7 +96,8 @@
       (setq wl-plugged nil))
      (t (setq wl-plugged (null wl-plugged))))
     (elmo-set-plugged wl-plugged))
-  (setq elmo-plugged wl-plugged)
+  (setq elmo-plugged wl-plugged
+       wl-modeline-plug-status wl-plugged)
   (save-excursion
     (mapcar
      (function
   (if wl-plugged
       (progn
        ;; flush queue!!
-       (setq wl-plug-state-indicator 'wl-plug-state-indicator-on)
        (elmo-dop-queue-flush)
        (if (and wl-draft-enable-queuing
                 wl-auto-flush-queue)
                  (wl-summary-flush-pending-append-operations seen-list))
            (elmo-msgdb-seen-save msgdb-dir seen-list)))
        (run-hooks 'wl-plugged-hook))
-    (setq wl-plug-state-indicator 'wl-plug-state-indicator-off)
     (run-hooks 'wl-unplugged-hook))
   (force-mode-line-update t))
 
@@ -512,13 +508,10 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
            (elmo-set-plugged plugged nil nil nil alist)))
          ;; redraw
          (wl-plugged-redrawing wl-plugged-alist)
-         ;; change wl-plug-state-indicator
+         ;; show plugged status in modeline
          (let ((elmo-plugged wl-plugged-switch))
-           (setq wl-plugged-switch (elmo-plugged-p))
-           (setq wl-plug-state-indicator
-                 (if wl-plugged-switch
-                     'wl-plug-state-indicator-on
-                   'wl-plug-state-indicator-off))
+           (setq wl-plugged-switch (elmo-plugged-p)
+                 wl-modeline-plug-status wl-plugged-switch)
            (force-mode-line-update t))))))
     (setq wl-plugged-alist-modified t)
     (goto-char cur-point)))
@@ -536,11 +529,8 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
     (wl-plugged-redrawing wl-plugged-alist)
     (goto-char cur-point)
     (setq wl-plugged-alist-modified t)
-    ;; change wl-plug-state-indicator
-    (setq wl-plug-state-indicator
-         (if wl-plugged-switch
-             'wl-plug-state-indicator-on
-           'wl-plug-state-indicator-off))
+    ;; show plugged status in modeline
+    (setq wl-modeline-plug-status wl-plugged-switch)
     (force-mode-line-update t)))
 
 (defun wl-plugged-exit ()