Re: 添付ファイルの圧縮が 解かれる

Hiroya Murata <[email protected]> Tue, 30 May 2006 17:54:41 +0900
Newsgroups gmane.mail.emacs.mime.japanese
Message-ID <upshvuc32.wl%[email protected]>
In the message [emacs-mime-ja : No.02042]
   on Tue, 30 May 2006 14:38:02 +0900, Daiki Ueno wrote:

> > ;; ついでに, epa-file-handler が有効になっていると,
> > ;; (insert-file-contents-literally "test.gpg") とした時に, 復号化
> > ;; はともかくデコードされた内容が挿入されてしまいますね.

> うーん。こうでしょうかね。

はい, それで良いと思います. 同様に以下の変更も必要ではないでしょうか?

-- 
Hiroya Murata (村田 浩也) <[email protected]>
PGP fingerprint: 53B6 1B4A 8193 A2D4 1526  BC9E 9AEF 2F6D 249D 5F17
epa-file.el.patch (application/octet-stream, 830 B)
Index: epa-file.el
===================================================================
RCS file: /cvs/root/epg/epa-file.el,v
retrieving revision 1.25
diff -u -w -r1.25 epa-file.el
--- epa-file.el	11 May 2006 05:56:38 -0000	1.25
+++ epa-file.el	30 May 2006 08:47:20 -0000
@@ -116,11 +116,12 @@
   (if append
       (error "Can't append to the file."))
   (setq file (expand-file-name file))
-  (let* ((coding-system (if (boundp 'last-coding-system-used)
+  (let* ((coding-system (or coding-system-for-write
+			    (if (boundp 'last-coding-system-used)
 			    (condition-case nil
 				(write-region (point-min) (point-max) "/")
 			      (error last-coding-system-used))
-			  buffer-file-coding-system))
+			      buffer-file-coding-system)))
 	 (context (epg-make-context))
 	 (coding-system-for-write 'binary)
 	 string entry)