From 97bc3878bde310e3418d1e0b398df9a5312eacbf Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 2 Feb 2007 09:51:18 +0000 Subject: [PATCH] * epa-file.el (epa-file-write-region): Set a dummy filename for buffer-file-name when calling select-safe-coding-system. --- ChangeLog | 5 +++++ epa-file.el | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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) -- 1.7.10.4