From: Daiki Ueno Date: Sat, 18 Apr 2009 04:55:50 +0000 (+0000) Subject: epa-file: fix garble with decode-coding-inserted-region X-Git-Tag: emacs-pretest-23.0.93~97 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68a0d892316627969e393d7674d51993b3e0b111;p=emacs.git epa-file: fix garble with decode-coding-inserted-region * epa-file.el (epa-file-decode-and-insert): Use string-to-multibyte instead of set-buffer-multibyte. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d23d65de93e..8367d64871b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-04-18 ARISAWA Akihiro + + * epa-file.el (epa-file-decode-and-insert): Use + string-to-multibyte instead of set-buffer-multibyte. + + 2009-04-18 Yann Hodique (tiny change) * net/rcirc.el (rcirc): Use correct property names (Bug#3037). diff --git a/lisp/epa-file.el b/lisp/epa-file.el index c35aa01fac6..fc753df312c 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -86,14 +86,13 @@ (if (fboundp 'decode-coding-inserted-region) (save-restriction (narrow-to-region (point) (point)) - (let ((multibyte enable-multibyte-characters)) - (set-buffer-multibyte nil) - (insert string) - (set-buffer-multibyte multibyte) + (insert (if enable-multibyte-characters + (string-to-multibyte string) + string)) (decode-coding-inserted-region (point-min) (point-max) (substring file 0 (string-match epa-file-name-regexp file)) - visit beg end replace))) + visit beg end replace)) (insert (epa-file--decode-coding-string string (or coding-system-for-read 'undecided)))))