* wl-nemacs.el (wl-draft-overload-functions): Set
authorueno <ueno>
Mon, 28 Aug 2000 23:00:24 +0000 (23:00 +0000)
committerueno <ueno>
Mon, 28 Aug 2000 23:00:24 +0000 (23:00 +0000)
`mode-line-buffer-identification' instead of using
`wl-make-modeline'.

* wl.el (wl-plugged-mode): Set `mode-line-buffer-identification'
instead of using `wl-make-modeline'.

* wl-xmas.el (wl-plugged-init-icons): Set up
`wl-plug-state-indicator-on' and `wl-plug-state-indicator-off'.
(wl-make-modeline): Abolish.
(wl-draft-overload-functions): Set
`mode-line-buffer-identification' instead of using
`wl-make-modeline'.

* wl-util.el (wl-make-modeline-subr): Abolish.
(wl-mode-line-buffer-identification): New alias.

* wl-summary.el (wl-summary-buffer-folder-indicator): New.
(wl-summary-make-modeline): Abolish.
(wl-summary-buffer-set-folder): Set
`wl-summary-buffer-folder-indicator'.
(wl-summary-mode): Set `mode-line-buffer-identification' instead
of using `wl-make-modeline'.
(wl-summary-switch-to-clone-buffer): Don't set
`mode-line-buffer-identification'.
(wl-summary-goto-folder-subr): Ditto.

* wl-mule.el (wl-draft-overload-functions): Set
`mode-line-buffer-identification' instead of using
`wl-make-modeline'.

* wl-folder.el (wl-folder-mode): Set
`mode-line-buffer-identification' instead of using
`wl-make-modeline'.
(wl-folder): Don't set `mode-line-buffer-identification'.

wl/ChangeLog
wl/wl-folder.el
wl/wl-mule.el
wl/wl-nemacs.el
wl/wl-summary.el
wl/wl-util.el
wl/wl-xmas.el
wl/wl.el

index 3a52f7f..bf5cca4 100644 (file)
@@ -1,3 +1,41 @@
+2000-08-28   Daiki Ueno  <ueno@unixuser.org>
+
+       * wl-nemacs.el (wl-draft-overload-functions): Set
+       `mode-line-buffer-identification' instead of using
+       `wl-make-modeline'.
+
+       * wl.el (wl-plugged-mode): Set `mode-line-buffer-identification'
+       instead of using `wl-make-modeline'.
+
+       * wl-xmas.el (wl-plugged-init-icons): Set up
+       `wl-plug-state-indicator-on' and `wl-plug-state-indicator-off'.
+       (wl-make-modeline): Abolish.
+       (wl-draft-overload-functions): Set
+       `mode-line-buffer-identification' instead of using
+       `wl-make-modeline'.
+
+       * wl-util.el (wl-make-modeline-subr): Abolish.
+       (wl-mode-line-buffer-identification): New alias.
+
+       * wl-summary.el (wl-summary-buffer-folder-indicator): New.
+       (wl-summary-make-modeline): Abolish.
+       (wl-summary-buffer-set-folder): Set
+       `wl-summary-buffer-folder-indicator'.
+       (wl-summary-mode): Set `mode-line-buffer-identification' instead
+       of using `wl-make-modeline'.
+       (wl-summary-switch-to-clone-buffer): Don't set
+       `mode-line-buffer-identification'.
+       (wl-summary-goto-folder-subr): Ditto.
+
+       * wl-mule.el (wl-draft-overload-functions): Set
+       `mode-line-buffer-identification' instead of using
+       `wl-make-modeline'.
+
+       * wl-folder.el (wl-folder-mode): Set
+       `mode-line-buffer-identification' instead of using
+       `wl-make-modeline'.
+       (wl-folder): Don't set `mode-line-buffer-identification'.
+
 2000-08-28  OKAZAKI Tetsurou  <okazaki@be.to>
 
        * wl-refile.el (wl-refile-learn): Simplified.  Use `memq'
index 533ba8c..8e51f40 100644 (file)
@@ -1402,8 +1402,11 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'."
   (setq wl-folder-buffer-cur-entity-id nil
        wl-folder-buffer-cur-path nil
        wl-folder-buffer-cur-point nil)
-  (when wl-show-plug-status-on-modeline 
-    (setq mode-line-format (wl-make-modeline)))
+  (setq mode-line-buffer-identification
+       (wl-mode-line-buffer-identification
+        (if wl-show-plug-status-on-modeline
+            '("" wl-plug-state-indicator "Wanderlust: %12b")
+          '("Wanderlust: %12b"))))
   (easy-menu-add wl-folder-mode-menu)
   (wl-xmas-setup-folder)
   (run-hooks 'wl-folder-mode-hook))
@@ -1426,7 +1429,6 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'."
   (if (get-buffer wl-folder-buffer-name)
       (switch-to-buffer  wl-folder-buffer-name)
     (switch-to-buffer (get-buffer-create wl-folder-buffer-name))
-    (setq mode-line-buffer-identification '("Wanderlust: %12b"))
     (wl-folder-mode)
     (wl-folder-init)
     (wl-folder-init-icons)
index dc47d2a..71af151 100644 (file)
@@ -187,13 +187,12 @@ Special commands:
 
 (defun wl-draft-overload-functions ()
   (setq mode-line-buffer-identification
-       (format "Wanderlust: %s" (buffer-name)))
+       (wl-mode-line-buffer-identification
+        (if wl-show-plug-status-on-modeline
+            '("" wl-plug-state-indicator "Wanderlust: %12b")
+          '("Wanderlust: %12b"))))
   (local-set-key "\C-c\C-s" 'wl-draft-send)    ; override
-  (wl-draft-overload-menubar)
-  (when wl-show-plug-status-on-modeline
-    (setq mode-line-format (wl-make-modeline))))
-
-(defalias 'wl-make-modeline 'wl-make-modeline-subr)
+  (wl-draft-overload-menubar))
 
 ;; for "ja-mule-canna-2.3.mini" on PocketBSD
 (defun-maybe make-face (a))
index c76c9bc..016586a 100644 (file)
 
 (defun wl-draft-overload-functions ()
   (setq mode-line-buffer-identification
-       (format "Wanderlust: %s" (buffer-name)))
+       (wl-mode-line-buffer-identification
+        (if wl-show-plug-status-on-modeline
+            '("" wl-plug-state-indicator "Wanderlust: %12b")
+          '("Wanderlust: %12b"))))
   (local-set-key "\C-c\C-y" 'wl-draft-yank-original)
   (local-set-key "\C-c\C-s" 'wl-draft-send)
   (local-set-key "\C-c\C-a" 'wl-draft-insert-x-face-field)
   (local-set-key "\C-c\C-j" 'wl-template-select)
   (local-set-key "\C-c\C-p" 'wl-draft-preview-message)
   (local-set-key "\C-x\C-s" 'wl-draft-save)
-  (local-set-key "\C-xk"    'wl-draft-mimic-kill-buffer)
-  (when wl-show-plug-status-on-modeline
-    (set (make-variable-buffer-local 'mode-line-format) (wl-make-modeline))))
-
-(defalias 'wl-make-modeline 'wl-make-modeline-subr)
+  (local-set-key "\C-xk"    'wl-draft-mimic-kill-buffer))
 
 ;;; Emulations.
 
index a400397..fb8d72a 100644 (file)
@@ -69,6 +69,7 @@
 
 (defvar wl-summary-buffer-msgdb       nil)
 (defvar wl-summary-buffer-folder-name nil)
+(defvar wl-summary-buffer-folder-indicator nil)
 (defvar wl-summary-buffer-disp-msg    nil)
 (defvar wl-summary-buffer-disp-folder nil)
 (defvar wl-summary-buffer-refile-list nil) 
        'wl-summary-buffer-target-mark-list
        'wl-summary-buffer-delete-list
        'wl-summary-buffer-folder-name
+       'wl-summary-buffer-folder-indicator
        'wl-summary-buffer-last-displayed-msg
        'wl-summary-buffer-unread-status
        'wl-summary-buffer-unread-count
              wl-summary-buffer-unread-count unread))
     (+ new unread)))
 
-(defun wl-summary-make-modeline ()
-  "Create new modeline format for Wanderlust"
-  (let* ((duplicated (copy-sequence mode-line-format))
-        (cur-entry duplicated)
-        return-modeline)
-    (if (memq 'wl-plug-state-indicator mode-line-format)
-       duplicated
-      (catch 'done
-       (while cur-entry
-         (if (or (and (symbolp (car cur-entry))
-                      (eq 'mode-line-buffer-identification 
-                             (car cur-entry)))
-                 (and (consp (car cur-entry))
-                      (or 
-                       (eq 'modeline-buffer-identification 
-                              (car (car cur-entry)))
-                       (eq 'modeline-buffer-identification 
-                              (cdr (car cur-entry))))))
-             (progn
-               (setq return-modeline (append return-modeline
-                                             (list 
-                                              'wl-plug-state-indicator
-                                              (car cur-entry)
-                                              'wl-summary-buffer-unread-status)
-                                             (cdr cur-entry)))
-               (throw 'done return-modeline))
-           (setq return-modeline (append return-modeline
-                                         (list (car cur-entry)))))
-         (setq cur-entry (cdr cur-entry)))))))
-
 (defun wl-summary-reedit (&optional arg)
   "Re-edit current message.
 If optional argument is non-nil, Supersedes message"
@@ -732,6 +704,10 @@ Returns nil if selecting folder was in failure."
 
 (defun wl-summary-buffer-set-folder (folder)
   (setq wl-summary-buffer-folder-name folder)
+  (setq wl-summary-buffer-folder-indicator
+       (if (memq 'modeline wl-use-folder-petname)
+           (wl-folder-get-petname folder)
+         folder))
   (when (wl-summary-sticky-p)
     (make-local-variable 'wl-message-buf-name)
     (setq wl-message-buf-name (format "%s:%s" wl-message-buf-name folder)))
@@ -841,8 +817,14 @@ q  Goto folder mode.
     (setq wl-summary-buffer-message-redisplay-func
          'wl-normal-message-redisplay))
   (wl-xmas-setup-summary) ; setup toolbar, dnd, etc.
-  (when wl-show-plug-status-on-modeline 
-    (setq mode-line-format (wl-summary-make-modeline)))
+  (setq mode-line-buffer-identification
+       (wl-mode-line-buffer-identification
+        (append
+         (if wl-show-plug-status-on-modeline
+             '("" wl-plug-state-indicator))
+         '("Wanderlust: "
+           wl-summary-buffer-folder-indicator
+           wl-summary-buffer-unread-status))))
   (easy-menu-add wl-summary-mode-menu)
   (run-hooks 'wl-summary-mode-hook))
 
@@ -2660,11 +2642,6 @@ If optional argument is non-nil, checking is omitted."
      copy-variables)
     (switch-to-buffer buf)
     (kill-buffer cur-buf)
-    (setq mode-line-buffer-identification
-         (format "Wanderlust: %s" 
-                 (if (memq 'modeline wl-use-folder-petname)
-                     (wl-folder-get-petname folder)
-                   folder)))
     (wl-summary-count-unread 
      (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
     (wl-summary-update-modeline)
@@ -2752,12 +2729,7 @@ If optional argument is non-nil, checking is omitted."
                (inhibit-read-only t)
                (buffer-read-only nil))
            (erase-buffer)
-           (setq mode-line-buffer-identification
-                 (format "Wanderlust: %s" 
-                         (if (memq 'modeline wl-use-folder-petname)
-                             (wl-folder-get-petname fld)
-                           fld)))
-             ;; resume summary cache
+           ;; resume summary cache
            (if wl-summary-cache-use
                (let* ((dir (elmo-msgdb-expand-path fld))
                       (cache (expand-file-name wl-summary-cache-file dir))
index c4910aa..3968c6c 100644 (file)
@@ -399,32 +399,7 @@ Insert User-Agent field instead of X-Mailer field."
        (concat "User-Agent: " wl-appname "/" wl-version " (" wl-codename ") "
                (wl-extended-emacs-version3 "/" t))))))
 
-(defun wl-make-modeline-subr ()
-  (let* ((duplicated (copy-sequence mode-line-format))
-        (cur-entry duplicated)
-        return-modeline)
-    (if (memq 'wl-plug-state-indicator mode-line-format)
-       duplicated
-      (catch 'done
-       (while cur-entry
-         (if (or (and (symbolp (car cur-entry))
-                      (eq 'mode-line-buffer-identification 
-                             (car cur-entry)))
-                 (and (consp (car cur-entry))
-                      (or 
-                       (eq 'modeline-buffer-identification 
-                              (car (car cur-entry)))
-                       (eq 'modeline-buffer-identification 
-                              (cdr (car cur-entry))))))
-             (progn
-               (setq return-modeline (append return-modeline
-                                             (list 'wl-plug-state-indicator)
-                                             cur-entry))
-               (throw 'done return-modeline))
-           (setq return-modeline (append return-modeline
-                                         (list (car cur-entry)))))
-         (setq cur-entry (cdr cur-entry)))))))
-
+(defalias 'wl-mode-line-buffer-identification 'identity)
 (defalias 'wl-display-error 'elmo-display-error)
 (make-obsolete 'wl-display-error 'elmo-display-error)
 
index 49bcd0c..bc6196e 100644 (file)
    wl-folder-internal-icon-list))
 
 (defun wl-plugged-init-icons ()
-  (if (null wl-plugged-glyph)
-      (setq wl-plugged-glyph
-           (wl-xmas-make-icon-glyph
-            (concat "[" wl-plugged-plug-on "]")
-            wl-plugged-icon)))
-  (if (null wl-unplugged-glyph)
-      (setq wl-unplugged-glyph
-           (wl-xmas-make-icon-glyph
-            (concat "[" wl-plugged-plug-off "]")
-            wl-unplugged-icon))))
-
-(defun wl-make-modeline ()
-  "Make modeline for Wanderlust"
-  (wl-plugged-init-icons)
-  (let ((extent (make-extent nil nil))
-       (toggle-keymap (make-sparse-keymap)))
-    (define-key toggle-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")
-    (setq wl-plug-state-indicator-on (cons extent wl-plugged-glyph))
-    (setq wl-plug-state-indicator-off (cons extent wl-unplugged-glyph))
-    (setq wl-plug-state-indicator (if wl-plugged 
-                                     wl-plug-state-indicator-on
-                                   wl-plug-state-indicator-off)))
-  (wl-make-modeline-subr))
+  (unless wl-plugged-glyph
+    (setq wl-plugged-glyph
+         (wl-xmas-make-icon-glyph
+          (concat "[" wl-plugged-plug-on "]")
+          wl-plugged-icon))
+    (let ((extent (make-extent nil nil))
+         (toggle-keymap (make-sparse-keymap)))
+      (define-key toggle-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")
+      (setq 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))
+    (let ((extent (make-extent nil nil))
+         (toggle-keymap (make-sparse-keymap)))
+      (define-key toggle-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")
+      (setq wl-plug-state-indicator-off
+           (cons extent wl-unplugged-glyph)))))
 
 (defun wl-make-date-string ()
   (let ((s (current-time-string)))
@@ -451,12 +451,13 @@ Special commands:
 
 (defun wl-draft-overload-functions ()
   (setq mode-line-buffer-identification
-       (format "Wanderlust: %s" (buffer-name)))
+       (wl-mode-line-buffer-identification
+        (if wl-show-plug-status-on-modeline
+            '("" wl-plug-state-indicator "Wanderlust: %12b")
+          '("Wanderlust: %12b"))))
   (local-set-key "\C-c\C-s" 'wl-draft-send) ; override
   (wl-xmas-setup-draft-toolbar)
-  (wl-draft-overload-menubar)
-  (when wl-show-plug-status-on-modeline
-    (setq mode-line-format (wl-make-modeline))))
+  (wl-draft-overload-menubar))
 
 (defalias 'wl-defface 'defface)
 
index a6420a3..89cd70a 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -209,8 +209,11 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
   (setq major-mode 'wl-plugged-mode)
   (setq mode-name "Plugged")
   (easy-menu-add wl-plugged-mode-menu)
-  (when wl-show-plug-status-on-modeline 
-    (setq mode-line-format (wl-make-modeline)))
+  (setq mode-line-buffer-identification
+       (wl-mode-line-buffer-identification
+        (if wl-show-plug-status-on-modeline
+            '("" wl-plug-state-indicator "Wanderlust: %12b")
+          '("Wanderlust: %12b"))))
   (setq wl-plugged-switch wl-plugged)
   (setq wl-plugged-alist-modified nil)
   (setq buffer-read-only t)