-;;; wl-score.el -- Scoring in Wanderlust.
+;;; wl-score.el --- Scoring in Wanderlust.
;; Copyright (C) 1998,1999,2000 Masahiro MURATA <muse@ba2.so-net.ne.jp>
;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
;; Original codes are gnus-score.el and score-mode.el
;;; Code:
-;;
+;;
(require 'wl-vars)
(defun wl-score-string-index< (a1 a2)
(string-lessp (wl-score-ov-entity-get-by-index (car a1) wl-score-index)
- (wl-score-ov-entity-get-by-index (car a2) wl-score-index)))
+ (wl-score-ov-entity-get-by-index (car a2) wl-score-index)))
(defun wl-score-string-func< (a1 a2)
(string-lessp (funcall wl-score-index (car a1))
(or (and (string-match
(concat "^" (regexp-quote
(expand-file-name
- wl-score-files-dir)))
+ wl-score-files-directory)))
(expand-file-name file))
file)
(expand-file-name
file
- (file-name-as-directory wl-score-files-dir)))))
+ (file-name-as-directory wl-score-files-directory)))))
(cached (assoc file wl-score-cache))
alist)
(if cached
(let ((files (wl-get-assoc-list-value
score-alist folder
(if (not wl-score-folder-alist-matchone) 'all-list)))
- fl f)
+ fl f)
(while (setq f (wl-pop files))
(wl-append
fl
(defun wl-score-change-score-file (file)
"Change current score alist."
(interactive
- (list (read-file-name "Change to score file: " wl-score-files-dir)))
+ (list (read-file-name "Change to score file: " wl-score-files-directory)))
(wl-score-load-file file))
(defun wl-score-default (level)
(setq format (concat "%c: %-" (int-to-string pad) "s"))
(insert (format format (caar alist) (nth idx (car alist))))
(setq alist (cdr alist))
- (setq i (1+ i))
- (set-buffer-modified-p nil)))
- (when (and (get-buffer wl-message-buffer)
- (setq mes-win (get-buffer-window
- (get-buffer wl-message-buffer))))
- (select-window mes-win)
- (unless (eq (next-window) cur-win)
- (delete-window (next-window))))
- (split-window)
- (pop-to-buffer "*Score Help*")
- (let ((window-min-height 1))
- (shrink-window-if-larger-than-buffer))
- (select-window cur-win))))
+ (setq i (1+ i)))
+ (set-buffer-modified-p nil)))
+ (when (and wl-message-buffer
+ (get-buffer wl-message-buffer)
+ (setq mes-win (get-buffer-window
+ (get-buffer wl-message-buffer))))
+ (select-window mes-win)
+ (unless (eq (next-window) cur-win)
+ (delete-window (next-window))))
+ (split-window)
+ (pop-to-buffer "*Score Help*")
+ (let ((window-min-height 1))
+ (shrink-window-if-larger-than-buffer))
+ (select-window cur-win)))
(defun wl-score-get-header-entry (&optional match-func increase)
(let (hchar tchar pchar
;; read the score.
(unless (or score increase)
- (setq score (string-to-int (read-string "Set score: "))))
- (message "")))
+ (setq score (string-to-int (read-string "Set score: ")))))
+ (message "")
+ (wl-score-kill-help-buffer))
(let* ((match-header (or (nth 2 hentry) header))
(match (if match-func
(count (length alist))
(i 0)
(update-unread nil)
+ wl-summary-unread-message-hook
num score dels visible score-mark mark-alist)
(save-excursion
(message "Updating score...")
;; Update Folder mode
(wl-folder-set-folder-updated (wl-summary-buffer-folder-name)
(list 0
- (wl-summary-count-unread
- mark-alist)
+ (let ((pair
+ (wl-summary-count-unread
+ mark-alist)))
+ (+ (car pair) (cdr pair)))
(length num-db)))
(wl-summary-update-modeline)))
(message "Updating score...done")
(defun wl-score-edit-file (file)
"Edit a score FILE."
(interactive
- (list (read-file-name "Edit score file: " wl-score-files-dir)))
+ (list (read-file-name "Edit score file: " wl-score-files-directory)))
(when (wl-collect-summary)
(wl-score-save))
(let ((winconf (current-window-configuration))
wl-score-edit-header-char))
(error "Invalid match type")))
(message "")
+ (wl-score-kill-help-buffer)
(let* ((header (nth 1 entry))
(value (wl-score-edit-get-header header)))
(and value (prin1 value (current-buffer)))))))