(wl-plugged-init): Don't use `force-mode-line-update'.
* wl-xmas.el (wl-draft-overload-functions): Use revised
`wl-mode-line-buffer-identification'.
(wl-setup-summary): Renamed from `wl-xmas-setup-summary'.
(wl-setup-folder): Renamed from `wl-xmas-setup-folder'.
(TopLevel): Add `wl-setup-summary' to `wl-summary-mode-hook';
add `wl-plugged-init-icons' and `wl-biff-init-icons' to `wl-make-plugged-hook';
add `wl-folder-init-icons' and `wl-setup-folder' to `wl-folder-mode-hook'.
* wl-vars.el (wl-use-highlight-mouse-line): Activate it for Emacs 19 as well.
(wl-mode-line-display-priority-list): New user option.
(wl-biff-state-indicator-off, wl-biff-state-indicator-on): Defcustomized.
(wl-make-plugged-hook, wl-summary-mode-hook, wl-folder-mode-hook): Add docs.
* wl-util.el (wl-biff-start): Call `wl-biff-check-folders' at the start.
(wl-mode-line-buffer-identification): Revised as a function.
* wl-summary.el (wl-summary-mode): Use revised
`wl-mode-line-buffer-identification'; don't call `wl-e21-setup-summary' nor
`wl-xmas-setup-summary' directly.
(TopLevel): Don't bind `wl-e21-setup-summary' nor `wl-xmas-setup-summary'.
* wl-nemacs.el (wl-draft-overload-functions): Use revised
`wl-mode-line-buffer-identification'.
* wl-mule.el (wl-draft-overload-functions): Use revised
`wl-mode-line-buffer-identification'.
* wl-folder.el (wl-make-plugged-alist): Don't call `wl-biff-init-icons' nor
`wl-plugged-init-icons' directly.
(wl-folder): Don't call `wl-folder-init-icons' directly.
(wl-folder-mode): Don't call `wl-e21-setup-folder' nor `wl-xmas-setup-folder'
directly; use revised `wl-mode-line-buffer-identification'.
(TopLevel): Don't bind `wl-biff-init-icons', `wl-plugged-init-icons',
`wl-folder-init-icons', `wl-e21-setup-folder' nor `wl-xmas-setup-folder'.
* wl-e21.el (wl-draft-overload-functions): Use revised
`wl-mode-line-buffer-identification'.
(wl-setup-summary): Renamed from `wl-e21-setup-summary'.
(wl-setup-folder): Renamed from `wl-e21-setup-folder'.
(TopLevel): Add `wl-setup-summary' to `wl-summary-mode-hook';
add `wl-plugged-init-icons' and `wl-biff-init-icons' to `wl-make-plugged-hook';
add `wl-folder-init-icons' and `wl-setup-folder' to `wl-folder-mode-hook'.
+2000-09-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * wl.el (wl-plugged-mode): Use revised
+ `wl-mode-line-buffer-identification'.
+ (wl-plugged-init): Don't use `force-mode-line-update'.
+
+ * wl-xmas.el (wl-draft-overload-functions): Use revised
+ `wl-mode-line-buffer-identification'.
+ (wl-setup-summary): Renamed from `wl-xmas-setup-summary'.
+ (wl-setup-folder): Renamed from `wl-xmas-setup-folder'.
+ (TopLevel): Add `wl-setup-summary' to `wl-summary-mode-hook';
+ add `wl-plugged-init-icons' and `wl-biff-init-icons' to
+ `wl-make-plugged-hook';
+ add `wl-folder-init-icons' and `wl-setup-folder' to
+ `wl-folder-mode-hook'.
+
+ * wl-vars.el (wl-use-highlight-mouse-line): Activate it for Emacs
+ 19 as well.
+ (wl-mode-line-display-priority-list): New user option.
+ (wl-biff-state-indicator-off, wl-biff-state-indicator-on):
+ Defcustomized.
+ (wl-make-plugged-hook, wl-summary-mode-hook, wl-folder-mode-hook):
+ Add docs.
+
+ * wl-util.el (wl-biff-start): Call `wl-biff-check-folders' at the
+ start.
+ (wl-mode-line-buffer-identification): Revised as a function.
+
+ * wl-summary.el (wl-summary-mode): Use revised
+ `wl-mode-line-buffer-identification'; don't call
+ `wl-e21-setup-summary' nor `wl-xmas-setup-summary' directly.
+ (TopLevel): Don't bind `wl-e21-setup-summary' nor
+ `wl-xmas-setup-summary'.
+
+ * wl-nemacs.el (wl-draft-overload-functions): Use revised
+ `wl-mode-line-buffer-identification'.
+
+ * wl-mule.el (wl-draft-overload-functions): Use revised
+ `wl-mode-line-buffer-identification'.
+
+ * wl-folder.el (wl-make-plugged-alist): Don't call
+ `wl-biff-init-icons' nor `wl-plugged-init-icons' directly.
+ (wl-folder): Don't call `wl-folder-init-icons' directly.
+ (wl-folder-mode): Don't call `wl-e21-setup-folder' nor
+ `wl-xmas-setup-folder' directly;
+ use revised `wl-mode-line-buffer-identification'.
+ (TopLevel): Don't bind `wl-biff-init-icons',
+ `wl-plugged-init-icons', `wl-folder-init-icons',
+ `wl-e21-setup-folder' nor `wl-xmas-setup-folder'.
+
+ * wl-e21.el (wl-draft-overload-functions): Use revised
+ `wl-mode-line-buffer-identification'.
+ (wl-setup-summary): Renamed from `wl-e21-setup-summary'.
+ (wl-setup-folder): Renamed from `wl-e21-setup-folder'.
+ (TopLevel): Add `wl-setup-summary' to `wl-summary-mode-hook';
+ add `wl-plugged-init-icons' and `wl-biff-init-icons' to
+ `wl-make-plugged-hook';
+ add `wl-folder-init-icons' and `wl-setup-folder' to
+ `wl-folder-mode-hook'.
+
2000-09-18 A. SAGATA <sagata@nttvdt.hil.ntt.co.jp>
Katsumi Yamaoka <yamaoka@jpl.org>
* wl.el (wl): Call `wl-biff-start'.
(wl-exit): Call `wl-biff-stop'.
(wl-plugged-mode): Show biff in modeline.
- (wl-unplugged-glyph, wl-unplugged-glyph): Removed.
+ (wl-unplugged-glyph, wl-plugged-glyph): Removed.
* wl-xmas.el (wl-draft-overload-functions): Show biff in modeline.
(wl-biff-init-icons): New function.
(defvar-maybe wl-folder-mode-map (make-sparse-keymap))
(defvar-maybe wl-draft-mode-map (make-sparse-keymap)))
+(add-hook 'wl-folder-mode-hook 'wl-setup-folder)
+(add-hook 'wl-folder-mode-hook 'wl-folder-init-icons)
+
+(add-hook 'wl-make-plugged-hook 'wl-biff-init-icons)
+(add-hook 'wl-make-plugged-hook 'wl-plugged-init-icons)
+
+(add-hook 'wl-summary-mode-hook 'wl-setup-summary)
+
(defvar wl-use-toolbar (and (display-graphic-p)
(image-type-available-p 'xpm)))
(defvar wl-plugged-image nil)
(defun wl-make-date-string ()
(format-time-string "%a, %d %b %Y %T %z"))
-(defalias 'wl-e21-setup-folder 'wl-e21-setup-folder-toolbar)
+(defalias 'wl-setup-folder 'wl-e21-setup-folder-toolbar)
-(defalias 'wl-e21-setup-summary 'wl-e21-setup-summary-toolbar)
+(defalias 'wl-setup-summary 'wl-e21-setup-summary-toolbar)
(defun wl-message-overload-functions ()
(wl-e21-setup-message-toolbar)
(define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer))
(defun wl-draft-overload-functions ()
- (let ((id '("Wanderlust: %12b")))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification)
(local-set-key "\C-c\C-s" 'wl-draft-send);; override
(wl-e21-setup-draft-toolbar)
(wl-draft-overload-menubar))
(message "No more unread folder")
nil)))
-;; Avoid byte-compile warning.
-(eval-when-compile
- (unless wl-on-xemacs
- (defalias 'wl-xmas-setup-folder 'ignore))
- (unless wl-on-emacs21
- (defalias 'wl-e21-setup-folder 'ignore)))
-
(defun wl-folder-mode ()
"Major mode for Wanderlust Folder.
See info under Wanderlust for full documentation.
(setq wl-folder-buffer-cur-entity-id nil
wl-folder-buffer-cur-path nil
wl-folder-buffer-cur-point nil)
- (let ((id '("Wanderlust: %12b")))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification)
(easy-menu-add wl-folder-mode-menu)
- (cond (wl-on-xemacs
- (wl-xmas-setup-folder))
- (wl-on-emacs21
- (wl-e21-setup-folder)))
+ ;; This hook may contain the functions `wl-folder-init-icons' and
+ ;; `wl-setup-folder' for reasons of system internal to accord
+ ;; facilities for the Emacs variants.
(run-hooks 'wl-folder-mode-hook))
(defun wl-folder-append-petname (realname petname)
(wl-append wl-folder-petname-alist
(list (cons realname petname)))))
-(eval-and-compile
- (unless (or wl-on-xemacs wl-on-emacs21)
- (defalias 'wl-folder-init-icons 'ignore)))
-
(defun wl-folder (&optional arg)
(interactive "P")
(let (initialize)
(switch-to-buffer (get-buffer-create wl-folder-buffer-name))
(wl-folder-mode)
(wl-folder-init)
- (wl-folder-init-icons)
(set-buffer wl-folder-buffer-name)
(let ((inhibit-read-only t)
(buffer-read-only nil))
wl-score-cache nil
))
-(eval-and-compile
- (unless (or wl-on-xemacs wl-on-emacs21)
- (defalias 'wl-plugged-init-icons 'ignore)
- (defalias 'wl-biff-init-icons 'ignore)))
-
(defun wl-make-plugged-alist ()
(let ((entity-list (wl-folder-get-entity-list wl-folder-entity))
(add (not wl-reset-plugged-alist)))
wl-nntp-posting-server
elmo-default-nntp-port
nil nil "nntp" add))
- (wl-plugged-init-icons)
- (wl-biff-init-icons)
- ;; user setting
+ ;; This hook may contain the functions `wl-plugged-init-icons' and
+ ;; `wl-biff-init-icons' for reasons of system internal to accord
+ ;; facilities for the Emacs variants.
(run-hooks 'wl-make-plugged-hook)))
(defvar wl-folder-init-func 'wl-local-folder-init)
'("FCC" . wl-draft-fcc)))
(defun wl-draft-overload-functions ()
- (let ((id '("Wanderlust: %12b")))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
- (local-set-key "\C-c\C-s" 'wl-draft-send) ; override
+ (wl-mode-line-buffer-identification)
+ (local-set-key "\C-c\C-s" 'wl-draft-send);; override
(wl-draft-overload-menubar))
;; for "ja-mule-canna-2.3.mini" on PocketBSD
(list (cons t (mime-charset-to-coding-system default-mime-charset))))
(defun wl-draft-overload-functions ()
- (let ((id '("Wanderlust: %12b")))
- (if wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (if wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (if (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification)
(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)
(regexp-quote wl-thread-space-str-internal)))
(run-hooks 'wl-summary-buffer-set-folder-hook))
-;; Avoid byte-compile warning.
-(eval-when-compile
- (unless wl-on-xemacs
- (defalias 'wl-xmas-setup-summary 'ignore))
- (unless wl-on-emacs21
- (defalias 'wl-e21-setup-summary 'ignore)))
-
(defun wl-summary-mode ()
"Major mode for reading threaded messages.
The keys that are defined for this mode are:\\<wl-summary-mode-map>
;; (setq default-directory (or wl-tmp-dir (expand-file-name "~/")))
(setq buffer-read-only t)
(setq truncate-lines t)
-; (make-local-variable 'tab-width)
-; (setq tab-width 1)
+;; (make-local-variable 'tab-width)
+;; (setq tab-width 1)
(buffer-disable-undo (current-buffer))
(if wl-use-semi
(setq wl-summary-buffer-message-redisplay-func
'wl-mmelmo-message-redisplay)
(setq wl-summary-buffer-message-redisplay-func
'wl-normal-message-redisplay))
- ;; setup toolbar, dnd, etc.
- (cond (wl-on-xemacs
- (wl-xmas-setup-summary))
- (wl-on-emacs21
- (wl-e21-setup-summary)))
- (let ((id '("Wanderlust: "
- wl-summary-buffer-folder-indicator
- wl-summary-buffer-unread-status)))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (or wl-show-plug-status-on-modeline wl-biff-check-folder-list)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification '("Wanderlust: "
+ wl-summary-buffer-folder-indicator
+ wl-summary-buffer-unread-status))
(easy-menu-add wl-summary-mode-menu)
+ ;; This hook may contain the function `wl-setup-summary' for reasons
+ ;; of system internal to accord facilities for the Emacs variants.
(run-hooks 'wl-summary-mode-hook))
(defun wl-summary-overview-entity-compare-by-date (x y)
(concat "User-Agent: " wl-appname "/" wl-version " (" wl-codename ") "
(wl-extended-emacs-version3 "/" t))))))
-(defalias 'wl-mode-line-buffer-identification 'identity)
+(defun wl-mode-line-buffer-identification (&optional id)
+ (let ((priorities '(biff plug title)))
+ (let ((items (reverse wl-mode-line-display-priority-list))
+ item)
+ (while items
+ (setq item (car items)
+ items (cdr items))
+ (unless (memq item '(biff plug))
+ (setq item 'title))
+ (setq priorities (cons item (delq item priorities)))))
+ (let (priority result)
+ (while priorities
+ (setq priority (car priorities)
+ priorities (cdr priorities))
+ (cond ((and wl-biff-check-folder-list (eq 'biff priority))
+ (setq result (append result '(wl-biff-state-indicator))))
+ ((and wl-show-plug-status-on-modeline (eq 'plug priority))
+ (setq result (append result '(wl-plug-state-indicator))))
+ (t
+ (setq result (append result (or id '("Wanderlust: %12b")))))))
+ (prog1
+ (setq mode-line-buffer-identification (if (stringp (car result))
+ result
+ (cons "" result)))
+ (force-mode-line-update t)))))
+
(defalias 'wl-display-error 'elmo-display-error)
(make-obsolete 'wl-display-error 'elmo-display-error)
(defun wl-biff-start ()
(wl-biff-stop)
(when wl-biff-check-folder-list
- (start-itimer "wl-biff" 'wl-biff-check-folders
+ (wl-biff-check-folders)
+ (start-itimer wl-biff-timer-name 'wl-biff-check-folders
wl-biff-check-interval wl-biff-check-interval))))
((condition-case nil (require 'timer) (error nil));; FSFmacs 19+
(defun wl-biff-start ()
(when wl-biff-check-folder-list
+ (wl-biff-check-folders)
(put 'wl-biff 'timer (run-at-time t wl-biff-check-interval
'wl-biff-event-handler))))
;;;; Hooks
(defvar wl-folder-mode-hook nil
- "A hook called when wanderlust folder mode is started.")
+ "A hook called when wanderlust folder mode is started. This hook may
+contain the functions `wl-folder-init-icons' and `wl-setup-folder' for
+reasons of system internal to accord facilities for the Emacs variants.")
(defvar wl-summary-toggle-disp-on-hook nil
"A hook called when message is toggled.")
(defvar wl-summary-toggle-disp-off-hook nil
(defvar wl-summary-toggle-disp-folder-message-resumed-hook nil
"A hook called when message window is resumed when folder is toggled.")
(defvar wl-summary-mode-hook nil
- "A hook called when summary mode is started.")
+ "A hook called when summary mode is started. This hook may contain
+the function `wl-setup-summary' for reasons of system internal to
+accord facilities for the Emacs variants.")
+
(defvar wl-summary-prepared-pre-hook nil
"A hook called before the summary buffer has been generated.")
(defvar wl-summary-prepared-hook nil
(defvar wl-score-mode-hook nil
"A hook called when score mode is started.")
(defvar wl-make-plugged-hook nil
- "A hook called when make plugged alist.")
+ "A hook called when make plugged alist. This hook may contain the
+functions `wl-plugged-init-icons' and `wl-biff-init-icons' for reasons
+of system internal to accord facilities for the Emacs variants.")
+
(defvar wl-plugged-exit-hook nil
"A hook called when exit plugged mode.")
:type 'integer
:group 'wl-folder)
+(defcustom wl-biff-state-indicator-on "[\e$B")\e(B]"
+ "String used to show biff status ON."
+ :type 'string
+ :group 'wl-folder)
+
+(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)
+
+(defcustom wl-mode-line-display-priority-list '(biff plug title)
+ "Displaying order of items to be shown in modeline. The first item will
+be placed in the leftmost. The significant items are `biff' and `plug';
+otherwise, e.g. `title', corresponds to the things except for the biff
+staus nor the plugged status. The default order is '(biff plug title)
+even if the value of this option is set to nil. Here are some samples:
+
+;; Plugged status first:
+\(setq wl-mode-line-display-priority-list '(plug))
+
+;; Biff status, Title of Wanderlust, Plugged status:
+\(setq wl-mode-line-display-priority-list '(biff title plug))
+
+"
+ :type '(repeat (radio (const :format "%v " biff)
+ (const :format "%v " plug)
+ (sexp :tag "Other" :value title)))
+ :group 'wl-highlight)
+
(defcustom wl-interactive-send nil
"*If non-nil, require your confirmation when sending draft message."
:type 'boolean
This is to prevent us from wasting time trying to fontify things like
uuencoded files and large digests. If this is nil, all messages will
be highlighted."
- :type 'integer
- :group 'wl-highlight)
+ :type 'integer
+ :group 'wl-highlight)
;; highilght about signature (of draft and message)
(defcustom wl-highlight-signature-separator
:group 'wl-highlight)
;; highilght about mouse
-(defcustom wl-use-highlight-mouse-line (and (or wl-on-xemacs wl-on-emacs21)
- window-system)
+(defcustom wl-use-highlight-mouse-line (and window-system
+ (>= emacs-major-version 19))
"*Highlight mouse line, if non nil."
:type 'boolean
:group 'wl-highlight)
(defvar wl-plug-state-indicator-off " [--] ")
(defvar wl-plug-state-indicator 'wl-plug-state-indicator-on)
-(defvar wl-biff-state-indicator-on "(M@il)")
-(defvar wl-biff-state-indicator-off "(-)")
-(defvar wl-biff-state-indicator wl-biff-state-indicator-off)
-
(defvar wl-show-plug-status-on-modeline t)
;; Advanced thread view.
(require 'wl-highlight)
(defvar-maybe wl-draft-mode-map (make-sparse-keymap)))
+(add-hook 'wl-folder-mode-hook 'wl-setup-folder)
+(add-hook 'wl-folder-mode-hook 'wl-folder-init-icons)
+
+(add-hook 'wl-make-plugged-hook 'wl-biff-init-icons)
+(add-hook 'wl-make-plugged-hook 'wl-plugged-init-icons)
+
+(add-hook 'wl-summary-mode-hook 'wl-setup-summary)
+
(defvar wl-use-toolbar (if (featurep 'toolbar) 'default-toolbar nil))
(defvar wl-plugged-glyph nil)
(defvar wl-unplugged-glyph nil)
(concat (wl-match-string 1 s) ", "
(timezone-make-date-arpa-standard s (current-time-zone)))))
-
-(defun wl-xmas-setup-folder ()
+(defun wl-setup-folder ()
(and (featurep 'scrollbar)
(set-specifier scrollbar-height (cons (current-buffer) 0)))
(wl-xmas-setup-folder-toolbar))
-(defun wl-xmas-setup-summary ()
+(defun wl-setup-summary ()
(make-local-variable 'dragdrop-drop-functions)
(setq dragdrop-drop-functions '((wl-dnd-default-drop-message t t)))
(and (featurep 'scrollbar)
(define-key wl-draft-mode-map "\C-xk" 'wl-draft-mimic-kill-buffer))
(defun wl-draft-overload-functions ()
- (let ((id '("Wanderlust: %12b")))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification)
(local-set-key "\C-c\C-s" 'wl-draft-send);; override
(wl-xmas-setup-draft-toolbar)
(wl-draft-overload-menubar))
'wl-plug-state-indicator-on
'wl-plug-state-indicator-off))
(if wl-plugged
- (wl-toggle-plugged t 'flush))
- (force-mode-line-update t))
+ (wl-toggle-plugged t 'flush)))
(defun wl-toggle-plugged (&optional arg queue-flush-only)
(interactive)
(setq major-mode 'wl-plugged-mode)
(setq mode-name "Plugged")
(easy-menu-add wl-plugged-mode-menu)
- (let ((id '("Wanderlust: %12b")))
- (when wl-show-plug-status-on-modeline
- (wl-push 'wl-plug-state-indicator id))
- (when wl-biff-check-folder-list
- (wl-push 'wl-biff-state-indicator id))
- (when (cdr id)
- (wl-push "" id))
- (setq mode-line-buffer-identification
- (wl-mode-line-buffer-identification id)))
+ (wl-mode-line-buffer-identification)
(setq wl-plugged-switch wl-plugged)
(setq wl-plugged-alist-modified nil)
(setq buffer-read-only t)