+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'
(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))
(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)
(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))
(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.
(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"
(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)))
(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))
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)
(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))
(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)
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)))
(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)
(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)