2002-08-21 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-util.el (elmo-warning): Define as a macro which uses
+ `display-warning' if it is defined as a function.
+
+ * elmo-split.el (elmo-split-fetch-decoded-field): New function.
+ (elmo-split-equal): Use it.
+ (elmo-split-match): Ditto.
+ (elmo-split-message-entity): New buffer-local variable.
+ (elmo-split-subr): Set it.
+
* elmo-version.el (elmo-version): Up to 2.9.15.
2002-08-18 Kenichi OKADA <okada@opaopa.org>
(defvar elmo-split-match-string-internal nil
"Internal variable for string matching. Don't touch this variable by hand.")
+(defvar elmo-split-message-entity nil
+ "Buffer local variable to store mime-entity.")
+(make-variable-buffer-local 'elmo-split-message-entity)
+
;;;
(defun elmo-split-or (buffer &rest args)
(catch 'done
(setq addrs (cdr addrs)))
result)))
+(defun elmo-split-fetch-decoded-field (entity field-name)
+ (let ((sym (intern (capitalize field-name)))
+ (field-body (mime-entity-fetch-field entity field-name)))
+ (when field-body
+ (mime-decode-field-body field-body sym 'plain))))
+
(defun elmo-split-equal (buffer field value)
(with-current-buffer buffer
- (let ((field-value (std11-field-body (symbol-name field))))
+ (let ((field-value (and
+ elmo-split-message-entity
+ (elmo-split-fetch-decoded-field
+ elmo-split-message-entity
+ (symbol-name field)))))
(equal field-value value))))
(defun elmo-split-match (buffer field value)
(with-current-buffer buffer
- (let ((field-value (std11-field-body (symbol-name field))))
+ (let ((field-value (and elmo-split-message-entity
+ (elmo-split-fetch-decoded-field
+ elmo-split-message-entity
+ (symbol-name field)))))
(and field-value
(when (string-match value field-value)
(setq elmo-split-match-string-internal field-value))))))
(elmo-message-fetch folder msg
(elmo-make-fetch-strategy 'entire)
nil (current-buffer) 'unread))
+ (setq elmo-split-message-entity (mime-parse-buffer))
(catch 'terminate
(dolist (rule elmo-split-rule)
(setq elmo-split-match-string-internal nil)
;;;
;; Warnings.
-(defconst elmo-warning-buffer-name "*elmo warning*")
-
-(defun elmo-warning (&rest args)
- "Display a warning, making warning message by passing all args to `insert'."
- (with-current-buffer (get-buffer-create elmo-warning-buffer-name)
- (goto-char (point-max))
- (apply 'insert (append args '("\n")))
- (ignore-errors (recenter 1))
- (display-buffer elmo-warning-buffer-name)))
+(static-if (fboundp 'display-warning)
+ (defmacro elmo-warning (&rest args)
+ "Display a warning with `elmo' group."
+ `(display-warning 'elmo (format ,@args)))
+ (defconst elmo-warning-buffer-name "*elmo warning*")
+ (defun elmo-warning (&rest args)
+ "Display a warning. ARGS are passed to `format'."
+ (with-current-buffer (get-buffer-create elmo-warning-buffer-name)
+ (goto-char (point-max))
+ (funcall 'insert (apply 'format (append args '("\n"))))
+ (ignore-errors (recenter 1))
+ (display-buffer elmo-warning-buffer-name))))
(defvar elmo-obsolete-variable-alist nil)
(defvaralias var obsolete)
(set var (symbol-value obsolete)))
(if elmo-obsolete-variable-show-warnings
- (elmo-warning (format "%s is obsolete. Use %s instead."
- (symbol-name obsolete)
- (symbol-name var))))))
+ (elmo-warning "%s is obsolete. Use %s instead."
+ (symbol-name obsolete)
+ (symbol-name var)))))
(defun elmo-resque-obsolete-variables (&optional alist)
"Resque obsolete variables in ALIST.
2002-08-21 Yuuichi Teranishi <teranisi@gohome.org>
+ * wl-vars.el (wl-message-buffer-name): New user option.
+
+ * wl-summary.el (wl-summary-read-folder): Use wl-folder-entity-hashtb
+ directly instead of making alist dinamically.
+
+ * wl-message.el (wl-message-buffer-cache-name): Abolish.
+ (wl-message-buffer-create): Use wl-message-buffer-name instead of
+ wl-message-buffer-cache-name.
+ (wl-message-buffer-cache-clean-up): Ditto.
+
+ * wl-folder.el (wl-folder-set-entity-info): Use elmo-string.
+
* Version number is increased to 2.9.15.
2002-08-06 Yuuichi Teranishi <teranisi@gohome.org>
(defun wl-message-wheel-up (event)
(interactive "e")
- (if (string-match (regexp-quote wl-message-buffer-cache-name)
+ (if (string-match (regexp-quote wl-message-buffer-name)
(regexp-quote (buffer-name)))
(wl-message-next-page)
(let ((cur-buf (current-buffer))
(defun wl-message-wheel-down (event)
(interactive "e")
- (if (string-match (regexp-quote wl-message-buffer-cache-name)
+ (if (string-match (regexp-quote wl-message-buffer-name)
(regexp-quote (buffer-name)))
(wl-message-prev-page)
(let ((cur-buf (current-buffer))
(defmacro wl-folder-set-entity-info (entity value &optional hashtb)
(` (let* ((hashtb (or (, hashtb) wl-folder-entity-hashtb))
(info (wl-folder-get-entity-info (, entity) hashtb)))
- (elmo-set-hash-val (, entity)
+ (elmo-set-hash-val (elmo-string (, entity))
(if (< (length (, value)) 4)
(append (, value) (list (nth 3 info)))
(, value))
; (setcdr pointer (list entry))
; (setq wl-message-buffer-cache (cdr top))))
-(defconst wl-message-buffer-cache-name " *WL:Message*")
(defconst wl-original-message-buffer-name " *Original*")
(defun wl-original-message-mode ()
(defun wl-message-buffer-create ()
"Create a new message buffer."
- (let* ((buffer (generate-new-buffer wl-message-buffer-cache-name))
+ (let* ((buffer (generate-new-buffer wl-message-buffer-name))
(name (buffer-name buffer)))
(with-current-buffer buffer
(setq wl-message-buffer-original-buffer
wl-message-buffer
(get-buffer-window wl-message-buffer))
(delete-window (get-buffer-window wl-message-buffer)))
- (wl-kill-buffers (regexp-quote wl-message-buffer-cache-name))
+ (wl-kill-buffers (regexp-quote wl-message-buffer-name))
(setq wl-message-buffer-cache nil))
;;; Message buffer handling from summary buffer.
(or wl-folder-completion-function
(if (memq 'read-folder wl-use-folder-petname)
(wl-folder-get-entity-with-petname)
- (let (alist)
- (mapatoms
- (lambda (atom)
- (setq alist
- (cons (list (elmo-string
- (symbol-name atom))) alist)))
- wl-folder-entity-hashtb)
- alist)))
+ wl-folder-entity-hashtb))
nil nil (or init wl-default-spec)
'wl-read-folder-hist)))
(if (or (string= fld wl-default-spec)
:group 'wl-pref
:group 'wl-setting)
+(defcustom wl-message-buffer-name " *WL:Message*"
+ "*Buffer name for message buffers."
+ :group 'wl-pref
+ :group 'wl-setting)
+
(defcustom wl-message-buffer-prefetch-folder-type-list t
"*All folder types that match this list prefetch next message,
and reserved buffer cache."