From: keiichi Date: Wed, 24 Feb 1999 07:09:16 +0000 (+0000) Subject: (message-locale-detect): Fix, save restriction. X-Git-Tag: nana-gnus-6_12_4~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c2edf3a3015a13d672ac820ad13fa4a1daf72c1;p=elisp%2Fgnus.git- (message-locale-detect): Fix, save restriction. --- diff --git a/lisp/message.el b/lisp/message.el index b092b02..eb98ff0 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -4589,35 +4589,37 @@ when could not found legal MIME charset for sending message." (when (or message-locale-detect-for-news message-locale-detect-for-mail) (save-excursion - (message-narrow-to-head) - (let (lc dest) - (when message-locale-detect-for-news - (setq lc (mapcar - (lambda (newsgroup) - (funcall message-locale-detect-for-news - (and (string-match "[^ \t]+" newsgroup) - (match-string 0 newsgroup)))) - (message-tokenize-header - (message-fetch-field "newsgroups"))))) - (when message-locale-detect-for-mail - (let ((field-list '("to" "cc" "bcc"))) - (while (car field-list) - (setq lc (append - lc - (mapcar - (lambda (address) - (funcall message-locale-detect-for-mail - (car (cdr (std11-extract-address-components - address))))) - (message-tokenize-header - (message-fetch-field (pop field-list))))))))) - (setq lc (delq nil lc)) - (while lc - (setq dest (cons (car lc) dest) - lc (delq (car lc) lc))) - (or dest - (list message-locale-default)) - )))) + (save-restriction + (message-narrow-to-head) + (let (lc dest) + (when message-locale-detect-for-news + (setq lc (mapcar + (lambda (newsgroup) + (funcall message-locale-detect-for-news + (and (string-match "[^ \t]+" newsgroup) + (match-string 0 newsgroup)))) + (message-tokenize-header + (message-fetch-field "newsgroups"))))) + (when message-locale-detect-for-mail + (let ((field-list '("to" "cc" "bcc"))) + (while (car field-list) + (setq lc (append + lc + (mapcar + (lambda (address) + (funcall message-locale-detect-for-mail + (car + (cdr (std11-extract-address-components + address))))) + (message-tokenize-header + (message-fetch-field (pop field-list))))))))) + (setq lc (delq nil lc)) + (while lc + (setq dest (cons (car lc) dest) + lc (delq (car lc) lc))) + (or dest + (list message-locale-default)) + ))))) (defvar message-locale-newsgroup-alist '(("^fj\\." . fj)