1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

epa-file: suppress file-locking question on M-x revert-buffer

* epa-file.el (epa-file-insert-file-contents): If visiting, bind
buffer-file-name to avoid file-locking.  (Bug#7026)
This commit is contained in:
Daiki Ueno 2010-09-13 19:44:07 +09:00
parent ed9a2f6896
commit c5fe4acb5f
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2010-09-13 Daiki Ueno <ueno@unixuser.org>
* epa-file.el (epa-file-insert-file-contents): If visiting, bind
buffer-file-name to avoid file-locking. (Bug#7026)
2010-09-13 Julien Danjou <julien@danjou.info>
* notifications.el (notifications-notify): Add support for

View File

@ -158,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