From: ueno Date: Fri, 2 Feb 2007 09:51:18 +0000 (+0000) Subject: * epa-file.el (epa-file-write-region): Set a dummy filename X-Git-Tag: plaintext-branchpoint~17 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=97bc3878bde310e3418d1e0b398df9a5312eacbf;p=elisp%2Fepg.git * epa-file.el (epa-file-write-region): Set a dummy filename for buffer-file-name when calling select-safe-coding-system. --- diff --git a/ChangeLog b/ChangeLog index 7de5ecc..cc7a34a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-02 Daiki Ueno + + * epa-file.el (epa-file-write-region): Set a dummy filename + for buffer-file-name when calling select-safe-coding-system. + 2007-01-30 Daiki Ueno * epg.el (epg-last-status): New variable. diff --git a/epa-file.el b/epa-file.el index 1f939c1..0e40924 100644 --- a/epa-file.el +++ b/epa-file.el @@ -165,8 +165,13 @@ May either be a string or a list of strings.") (setq file (expand-file-name file)) (let* ((coding-system (or coding-system-for-write (if (fboundp 'select-safe-coding-system) - (select-safe-coding-system - (point-min) (point-max)) + ;; This is needed since Emacs 22 has + ;; no-conversion setting for *.gpg in + ;; `auto-coding-alist'. + (let ((buffer-file-name + (file-name-sans-extension file))) + (select-safe-coding-system + (point-min) (point-max))) buffer-file-coding-system))) (context (epg-make-context)) (coding-system-for-write 'binary)