From: shuhei-k Date: Fri, 28 Aug 1998 09:17:24 +0000 (+0000) Subject: (gnus-set-summary-default-charset): Match "real" newsgroup name; X-Git-Tag: shuhei-k-199811302358~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9532a9e35a8bbefb6661f1651e138cf32c9a11a2;p=elisp%2Fgnus.git- (gnus-set-summary-default-charset): Match "real" newsgroup name; strip "backend+server" prefix. --- diff --git a/lisp/gnus-i18n.el b/lisp/gnus-i18n.el index 78eeb03..105130f 100644 --- a/lisp/gnus-i18n.el +++ b/lisp/gnus-i18n.el @@ -25,6 +25,9 @@ ;;; Code: +(require 'gnus-sum) +(require 'gnus-util) + ;;; @ newsgroup default charset ;;; @@ -44,14 +47,12 @@ newsgroup name. SYMBOL is MIME charset or coding-system.") (defun gnus-set-newsgroup-default-charset (newsgroup charset) "Set CHARSET for the NEWSGROUP as default MIME charset." (let* ((ng-regexp (concat "^" (regexp-quote newsgroup) "\\($\\|\\.\\)")) - (pair (assoc ng-regexp gnus-newsgroup-default-charset-alist)) - ) + (pair (assoc ng-regexp gnus-newsgroup-default-charset-alist))) (if pair (setcdr pair charset) (setq gnus-newsgroup-default-charset-alist (cons (cons ng-regexp charset) - gnus-newsgroup-default-charset-alist)) - ))) + gnus-newsgroup-default-charset-alist))))) ;;; @ localization @@ -62,28 +63,24 @@ newsgroup name. SYMBOL is MIME charset or coding-system.") It is specified by variable `gnus-newsgroup-default-charset-alist' \(cf. function `gnus-set-newsgroup-default-charset')." (if (buffer-live-p gnus-summary-buffer) - (let ((charset - (catch 'found - (let ((group - (save-excursion - (set-buffer gnus-summary-buffer) - gnus-newsgroup-name)) - (alist gnus-newsgroup-default-charset-alist)) - (while alist - (let ((pair (car alist))) - (if (string-match (car pair) group) - (throw 'found (cdr pair)) - )) - (setq alist (cdr alist))) - )))) + (let* ((group (save-excursion + (set-buffer gnus-summary-buffer) + (gnus-group-real-name gnus-newsgroup-name))) + (alist gnus-newsgroup-default-charset-alist) + (charset (catch 'found + (let (pair) + (while (setq pair (car alist)) + (if (string-match (car pair) group) + (throw 'found (cdr pair))) + (setq alist (cdr alist))))))) (if charset - (progn - (save-excursion - (set-buffer gnus-summary-buffer) - (make-local-variable 'default-mime-charset) - (setq default-mime-charset charset)) - (make-local-variable 'default-mime-charset) - (setq default-mime-charset charset)) + (progn + (save-excursion + (set-buffer gnus-summary-buffer) + (make-local-variable 'default-mime-charset) + (setq default-mime-charset charset)) + (make-local-variable 'default-mime-charset) + (setq default-mime-charset charset)) (kill-local-variable 'default-mime-charset)))))