From 6c2edf3a3015a13d672ac820ad13fa4a1daf72c1 Mon Sep 17 00:00:00 2001 From: keiichi Date: Wed, 24 Feb 1999 07:09:16 +0000 Subject: [PATCH] (message-locale-detect): Fix, save restriction. --- lisp/message.el | 60 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) 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) -- 1.7.10.4