changeset 103016:15551118906e

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.
author Daiki Ueno <ueno@unixuser.org>
date Sat, 18 Apr 2009 04:55:50 +0000
parents 5c993497b6ee
children db34dcb5a6f5
files lisp/ChangeLog lisp/epa-file.el
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Apr 18 03:44:57 2009 +0000
+++ b/lisp/ChangeLog	Sat Apr 18 04:55:50 2009 +0000
@@ -1,3 +1,9 @@
+2009-04-18  ARISAWA Akihiro  <ari@mbf.ocn.ne.jp>
+
+	* epa-file.el (epa-file-decode-and-insert): Use
+	string-to-multibyte instead of set-buffer-multibyte.
+	<http://sourceforge.jp/ticket/browse.php?group_id=2267&tid=15259>
+
 2009-04-18  Yann Hodique  <yann.hodique@gmail.com>  (tiny change)
 
 	* net/rcirc.el (rcirc): Use correct property names (Bug#3037).
--- a/lisp/epa-file.el	Sat Apr 18 03:44:57 2009 +0000
+++ b/lisp/epa-file.el	Sat Apr 18 04:55:50 2009 +0000
@@ -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)))))