From f8502abf4866e19e1b6bfc690c43e54c5538465f Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 20 Apr 2002 14:10:43 +0000 Subject: [PATCH] * gnus-sum.el: Don't autoload gnus-set-summary-default-charset. (gnus-summary-inherit-default-charset): New function. (gnus-parse-headers-hook): Use it. (gnus-summary-setup-default-charset): Set default-mime-charset here. --- lisp/gnus-sum.el | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 024e8f4..9cfd3a7 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -51,7 +51,6 @@ (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) (autoload 'gnus-cache-write-active "gnus-cache") -(autoload 'gnus-set-summary-default-charset "gnus-i18n" nil t) (autoload 'gnus-mailing-list-insinuate "gnus-ml" nil t) (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" nil t) (autoload 'mm-uu-dissect "mm-uu") @@ -816,7 +815,7 @@ is not run if `gnus-visual' is nil." :group 'gnus-summary-visual :type 'hook) -(defcustom gnus-parse-headers-hook '(gnus-set-summary-default-charset) +(defcustom gnus-parse-headers-hook '(gnus-summary-inherit-default-charset) "*A hook called before parsing the headers." :group 'gnus-various :type 'hook) @@ -11004,20 +11003,38 @@ UNREAD is a sorted list." ;;; @ end ;;; +(defun gnus-summary-inherit-default-charset () + "Import `default-mime-charset' from summary buffer." + (if (buffer-live-p gnus-summary-buffer) + (if (local-variable-p 'default-mime-charset gnus-summary-buffer) + (progn + (make-local-variable 'default-mime-charset) + (setq default-mime-charset + (with-current-buffer gnus-summary-buffer + default-mime-charset))) + (kill-local-variable 'default-mime-charset)))) + (defun gnus-summary-setup-default-charset () "Setup newsgroup default charset." (if (equal gnus-newsgroup-name "nndraft:drafts") - (setq gnus-newsgroup-charset nil) - (let* ((ignored-charsets - (or gnus-newsgroup-ephemeral-ignored-charsets - (append - (and gnus-newsgroup-name - (gnus-parameter-ignored-charsets gnus-newsgroup-name)) - gnus-newsgroup-ignored-charsets)))) + (progn + (setq gnus-newsgroup-charset nil) + (make-local-variable 'default-mime-charset) + (setq default-mime-charset nil)) + (let ((ignored-charsets + (or gnus-newsgroup-ephemeral-ignored-charsets + (append + (and gnus-newsgroup-name + (gnus-parameter-ignored-charsets gnus-newsgroup-name)) + gnus-newsgroup-ignored-charsets))) + charset) (setq gnus-newsgroup-charset (or gnus-newsgroup-ephemeral-charset - (and gnus-newsgroup-name - (gnus-parameter-charset gnus-newsgroup-name)) + (when (and gnus-newsgroup-name + (setq charset (gnus-parameter-charset + gnus-newsgroup-name))) + (make-local-variable 'default-mime-charset) + (setq default-mime-charset charset)) gnus-default-charset)) (set (make-local-variable 'gnus-newsgroup-ignored-charsets) ignored-charsets)))) -- 1.7.10.4