From 0f01f02fe70b3ca67a5119acfc5357fe79b290e2 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 8 Jul 2013 20:51:55 +0900 Subject: [PATCH] decoder-tests.el (decoder-tests-prefer-utf-8-read): Use with-ccoding-priority to avoid side-effect (Bug#14781). --- test/ChangeLog | 5 +++++ test/automated/decoder-tests.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index aded5473304..458d4df1f39 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2013-07-08 Kenichi Handa + + * automated/decoder-tests.el (decoder-tests-prefer-utf-8-read): + Use with-ccoding-priority to avoid side-effect (Bug#14781). + 2013-07-05 Michael Albinus * automated/file-notify-tests.el diff --git a/test/automated/decoder-tests.el b/test/automated/decoder-tests.el index e1b05faf3c0..2e99fd7f115 100644 --- a/test/automated/decoder-tests.el +++ b/test/automated/decoder-tests.el @@ -213,10 +213,9 @@ ;; PREFER is non-nil, prefer that coding system before reading. (defun decoder-tests-prefer-utf-8-read (file detect prefer) - (if prefer - (prefer-coding-system prefer)) (with-temp-buffer - (insert-file-contents file) + (with-coding-priority (if prefer (list prefer)) + (insert-file-contents file)) (if (eq buffer-file-coding-system detect) nil (format "Invalid detection: %s" buffer-file-coding-system)))) -- 2.39.2