From: Daiki Ueno Date: Wed, 17 Dec 2008 02:33:12 +0000 (+0000) Subject: * epa-file.el (epa-file-insert-file-contents): Set X-Git-Tag: emacs-pretest-23.0.90~1063 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2cb35a563b87760f90e593c7d54b5b1d72d954a4;p=emacs.git * epa-file.el (epa-file-insert-file-contents): Set buffer-file-name before decrypting a file. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38514d0b0a3..3a3657b4b84 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-12-17 Daiki Ueno + + * epa-file.el (epa-file-insert-file-contents): Set + buffer-file-name before decrypting a file. + 2008-12-16 Juanma Barranquero * server.el (server-start): If unable to start the server, diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 968b22cc52b..93b6e5bb767 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -110,6 +110,8 @@ (local-file (or local-copy file)) (context (epg-make-context)) string length entry) + (if visit + (setq buffer-file-name file)) (epg-context-set-passphrase-callback context (cons #'epa-file-passphrase-callback-function @@ -139,9 +141,8 @@ (setq length (- (point-max) (point-min)))) (if replace (delete-region (point) (point-max))) - (when visit - (setq buffer-file-name file) - (set-visited-file-modtime)))) + (if visit + (set-visited-file-modtime)))) (if (and local-copy (file-exists-p local-copy)) (delete-file local-copy)))