aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/epa-file.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/epa-file.el')
-rw-r--r--lisp/epa-file.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index af016eb20b..3c6cf07ea1 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -3,6 +3,7 @@
;; Author: Daiki Ueno <[email protected]>
;; Keywords: PGP, GnuPG
+;; Package: epa
;; This file is part of GNU Emacs.
@@ -157,12 +158,17 @@ way."
(if (or beg end)
(setq string (substring string (or beg 0) end)))
(save-excursion
- (save-restriction
- (narrow-to-region (point) (point))
- (epa-file-decode-and-insert string file visit beg end replace)
- (setq length (- (point-max) (point-min))))
- (if replace
- (delete-region (point) (point-max)))
+ ;; If visiting, bind off buffer-file-name so that
+ ;; file-locking will not ask whether we should
+ ;; really edit the buffer.
+ (let ((buffer-file-name
+ (if visit nil buffer-file-name)))
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (epa-file-decode-and-insert string file visit beg end replace)
+ (setq length (- (point-max) (point-min))))
+ (if replace
+ (delete-region (point) (point-max))))
(if visit
(set-visited-file-modtime))))
(if (and local-copy