(nth 3 entry) (match-string (nth 4 entry))))
(goto-char end)))))))
+;; display-type object definition.
+(defun wl-message-make-display-type (mime header)
+ (let (symbol)
+ (prog1
+ (setq symbol (intern (format "%s-%s-header" mime header)))
+ (put symbol
+ 'wl-message-display-type
+ (list :mime mime :header header)))))
+
+(defun wl-message-display-type-property (display-type prop)
+ (plist-get (get display-type 'wl-message-display-type) prop))
+
+(defun wl-message-mime-analysis-p (display-type &optional header-or-body)
+ (let ((mode (wl-message-display-type-property display-type :mime)))
+ (case header-or-body
+ (header
+ (memq mode '(mime header-only)))
+ (t
+ (eq mode 'mime)))))
+
+(defun wl-message-display-all-header-p (display-type)
+ (eq (wl-message-display-type-property display-type :header) 'all))
+
+(defun wl-message-buffer-display-type (&optional message-buffer)
+ (if message-buffer
+ (with-current-buffer message-buffer
+ wl-message-buffer-cur-display-type)
+ wl-message-buffer-cur-display-type))
+
(defun wl-message-redisplay (folder number display-type &optional force-reload)
(let* ((default-mime-charset wl-mime-charset)
(buffer-read-only nil)
(wl-message-add-buttons-to-header (point-min) (point))
(wl-message-add-buttons-to-body (point) (point-max)))
(when (and wl-message-use-header-narrowing
- (not (memq display-type '(all-header as-is))))
+ (not (wl-message-display-all-header-p display-type)))
(wl-message-header-narrowing))
(goto-char (point-min))
(ignore-errors (run-hooks 'wl-message-redisplay-hook))
&optional force-reload unread)
(let ((default-mime-charset wl-mime-charset)
(elmo-mime-charset wl-mime-charset))
- (setq wl-message-buffer-require-all-header (eq display-type
- 'all-header))
+ (setq wl-message-buffer-require-all-header
+ (wl-message-display-all-header-p display-type))
(prog1
- (if (eq display-type 'as-is)
- (let (wl-highlight-x-face-function)
- (prog1 (elmo-mime-display-as-is folder number
- (current-buffer)
- (wl-message-get-original-buffer)
- 'wl-original-message-mode
- force-reload
- unread
- (wl-message-define-keymap))
- (let (buffer-read-only)
- (wl-highlight-message (point-min) (point-max) t))))
- (elmo-mime-message-display folder number
- (current-buffer)
- (wl-message-get-original-buffer)
- 'wl-original-message-mode
- force-reload
- unread
- (wl-message-define-keymap)))
+ (if (wl-message-mime-analysis-p display-type)
+ (elmo-mime-message-display folder number
+ (current-buffer)
+ (wl-message-get-original-buffer)
+ 'wl-original-message-mode
+ force-reload
+ unread
+ (wl-message-define-keymap))
+ (let* ((elmo-mime-display-header-analysis
+ (wl-message-mime-analysis-p display-type 'header))
+ (wl-highlight-x-face-function
+ (and elmo-mime-display-header-analysis
+ wl-highlight-x-face-function)))
+ (prog1 (elmo-mime-display-as-is folder number
+ (current-buffer)
+ (wl-message-get-original-buffer)
+ 'wl-original-message-mode
+ force-reload
+ unread
+ (wl-message-define-keymap))
+ (let (buffer-read-only)
+ (wl-highlight-message (point-min) (point-max) t)))))
(run-hooks 'wl-message-display-internal-hook)
(setq buffer-read-only t))))
(key (list (elmo-folder-name-internal folder)
number message-id))
(hit (wl-message-buffer-cache-hit key))
+ (display-type (wl-message-make-display-type
+ wl-summary-buffer-display-mime-mode
+ wl-summary-buffer-display-header-mode))
result time1 time2 sec micro)
(when wl-message-buffer-prefetch-debug
(message "%d: count %d, hit %s" number count (buffer-name hit)))
(setq time1 (current-time))
(message "Prefetching %d..." number))
(setq result (wl-message-buffer-display
- folder number 'mime nil 'unread))
+ folder number display-type nil 'unread))
(when wl-message-buffer-prefetch-debug
(setq time2 (current-time))
(setq sec (- (nth 1 time2)(nth 1 time1)))