From: teranisi Date: Tue, 25 Sep 2001 07:26:24 +0000 (+0000) Subject: * wl-mime.el (wl-mime-display-text/plain): New function. X-Git-Tag: wl-2_7_5~49 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f8df269dd48534955d4dd2ddd7e1f7902011d23;p=elisp%2Fwanderlust.git * wl-mime.el (wl-mime-display-text/plain): New function. (wl-mime-display-header): Ditto. (wl-mime-setup): Register `wl-mime-display-text/plain' as a body-presentation-method for text/plain; Register `wl-mime-display-header' as a header-presentation-method; Don't set up `elmo-message-text-content-inserted-hook' and `elmo-message-header-inserted-hook'. * wl-message.el (wl-message-buffer-all-header-flag): New buffer local variable. (wl-message-display-internal): Set `wl-message-buffer-all-header-flag' as t if flag is 'all-header; Don't bind `elmo-message-ignored-field-list', `elmo-message-visible-field-list' and `elmo-message-sorted-field-list'. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index bc780e0..033e853 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,20 @@ +2001-09-25 Yuuichi Teranishi + + * wl-mime.el (wl-mime-display-text/plain): New function. + (wl-mime-display-header): Ditto. + (wl-mime-setup): Register `wl-mime-display-text/plain' as a + body-presentation-method for text/plain; + Register `wl-mime-display-header' as a header-presentation-method; + Don't set up `elmo-message-text-content-inserted-hook' and + `elmo-message-header-inserted-hook'. + + * wl-message.el (wl-message-buffer-all-header-flag): New buffer local + variable. + (wl-message-display-internal): Set `wl-message-buffer-all-header-flag' + as t if flag is 'all-header; + Don't bind `elmo-message-ignored-field-list', + `elmo-message-visible-field-list' and `elmo-message-sorted-field-list'. + 2001-09-24 Katsumi Yamaoka * wl-vars.el: (wl-biff-state-indicator-off): Changed default value diff --git a/wl/wl-message.el b/wl/wl-message.el index 5aceb01..5c4093f 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -59,12 +59,14 @@ (defvar wl-message-buffer-cur-flag nil) (defvar wl-message-buffer-cur-summary-buffer nil) (defvar wl-message-buffer-original-buffer nil) ; original buffer. +(defvar wl-message-buffer-all-header-flag nil) (make-variable-buffer-local 'wl-message-buffer-cur-folder) (make-variable-buffer-local 'wl-message-buffer-cur-number) (make-variable-buffer-local 'wl-message-buffer-cur-flag) (make-variable-buffer-local 'wl-message-buffer-cur-summary-buffer) (make-variable-buffer-local 'wl-message-buffer-original-buffer) +(make-variable-buffer-local 'wl-message-buffer-all-header-flag) (defvar wl-fixed-window-configuration nil) @@ -455,13 +457,8 @@ Returns non-nil if bottom of message." (defun wl-message-display-internal (folder number flag &optional force-reload unread) - (let ((elmo-message-ignored-field-list - (if (eq flag 'all-header) - nil - wl-message-ignored-field-list)) - (elmo-message-visible-field-list wl-message-visible-field-list) - (elmo-message-sorted-field-list wl-message-sort-field-list) - (elmo-message-fetch-threshold wl-fetch-confirm-threshold)) + (let ((elmo-message-fetch-threshold wl-fetch-confirm-threshold)) + (setq wl-message-buffer-all-header-flag (eq flag 'all-header)) (prog1 (if (eq flag 'as-is) (let (wl-highlight-x-face-function) diff --git a/wl/wl-mime.el b/wl/wl-mime.el index ff96772..ff97691 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -283,6 +283,21 @@ By setting following-method as yank-content." (setq overviews (cdr overviews))) (message "Not all partials found."))))) +(defun wl-mime-display-text/plain (entity situation) + (let ((beg (point))) + (mime-display-text/plain entity situation) + (wl-highlight-message beg (point-max) t t))) + +(defun wl-mime-display-header (entity situation) + (let ((elmo-message-ignored-field-list + (if wl-message-buffer-all-header-flag + nil + wl-message-ignored-field-list)) + (elmo-message-visible-field-list wl-message-visible-field-list) + (elmo-message-sorted-field-list wl-message-sort-field-list)) + (elmo-mime-insert-header entity situation) + (wl-highlight-headers))) + ;;; Setup methods. (defun wl-mime-setup () (set-alist 'mime-preview-quitting-method-alist @@ -299,11 +314,19 @@ By setting following-method as yank-content." (add-hook 'wl-message-exit-hook 'wl-message-delete-mime-out-buf) (ctree-set-calist-strictly + 'mime-preview-condition + '((type . text) (subtype . plain) + (body . visible) + (body-presentation-method . wl-mime-display-text/plain) + (major-mode . wl-original-message-mode))) + + (ctree-set-calist-strictly 'mime-acting-condition '((type . message) (subtype . partial) (method . wl-mime-combine-message/partial-pieces) (request-partial-message-method . wl-message-request-partial) (major-mode . wl-original-message-mode))) + (ctree-set-calist-strictly 'mime-acting-condition '((mode . "extract") @@ -333,15 +356,13 @@ By setting following-method as yank-content." mime-view-visible-field-list)) (set-alist 'mime-header-presentation-method-alist 'wl-original-message-mode - (function elmo-mime-insert-header)) + 'wl-mime-display-header) ;; To avoid overriding wl-draft-mode-map. (when (boundp 'mime-setup-signature-key-alist) (unless (assq 'wl-draft-mode mime-setup-signature-key-alist) (setq mime-setup-signature-key-alist (cons '(wl-draft-mode . "\C-c\C-w") - mime-setup-signature-key-alist)))) - (add-hook 'elmo-message-text-content-inserted-hook 'wl-highlight-body-all) - (add-hook 'elmo-message-header-inserted-hook 'wl-highlight-headers)) + mime-setup-signature-key-alist))))) (require 'product) (product-provide (provide 'wl-mime) (require 'wl-version))