]> git.eshelyaron.com Git - emacs.git/commitdiff
epa-file: fix garble with decode-coding-inserted-region
authorDaiki Ueno <ueno@unixuser.org>
Sat, 18 Apr 2009 04:55:50 +0000 (04:55 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Sat, 18 Apr 2009 04:55:50 +0000 (04:55 +0000)
* epa-file.el (epa-file-decode-and-insert): Use string-to-multibyte
instead of set-buffer-multibyte.

lisp/ChangeLog
lisp/epa-file.el

index d23d65de93ed05a23172179ff354eaccd6674085..8367d64871be3158e6a46203042146595e00878d 100644 (file)
@@ -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).
index c35aa01fac6c1c3215d3f0dc12350e046b018187..fc753df312c71c9cc9a389a7dfe6ee9b67f919d4 100644 (file)
   (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)))))