emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r100895: Fix *.gpg file creation (bug


From: Daiki Ueno
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100895: Fix *.gpg file creation (bug#6723).
Date: Sun, 25 Jul 2010 20:23:43 +0900
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100895
committer: Daiki Ueno <address@hidden>
branch nick: trunk
timestamp: Sun 2010-07-25 20:23:43 +0900
message:
  Fix *.gpg file creation (bug#6723).
  
  * epa-file.el (epa-file-insert-file-contents): Check if LOCAL-FILE
  exists before passing an error to find-file-not-found-functions (bug#6723).
modified:
  lisp/ChangeLog
  lisp/epa-file.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-07-24 11:53:19 +0000
+++ b/lisp/ChangeLog    2010-07-25 11:23:43 +0000
@@ -1,3 +1,9 @@
+2010-07-25  Daiki Ueno  <address@hidden>
+
+       * epa-file.el (epa-file-insert-file-contents): Check if LOCAL-FILE
+       exists before passing an error to find-file-not-found-functions
+       (bug#6723).
+
 2010-07-23  Lukas Huonker  <address@hidden>
 
        * play/tetris.el (tetris-tty-colors, tetris-x-colors, tetris-blank):

=== modified file 'lisp/epa-file.el'
--- a/lisp/epa-file.el  2010-07-08 01:02:24 +0000
+++ b/lisp/epa-file.el  2010-07-25 11:23:43 +0000
@@ -139,15 +139,16 @@
            (error
             (if (setq entry (assoc file epa-file-passphrase-alist))
                 (setcdr entry nil))
-            ;; Hack to prevent find-file from opening empty buffer
-            ;; when decryption failed (bug#6568).  See the place
-            ;; where `find-file-not-found-functions' are called in
-            ;; `find-file-noselect-1'.
-            (make-local-variable 'epa-file-error)
-            (setq epa-file-error error)
-            (add-hook 'find-file-not-found-functions
-                      'epa-file--find-file-not-found-function
-                      nil t)
+            (when (file-exists-p local-file)
+              ;; Hack to prevent find-file from opening empty buffer
+              ;; when decryption failed (bug#6568).  See the place
+              ;; where `find-file-not-found-functions' are called in
+              ;; `find-file-noselect-1'.
+              (make-local-variable 'epa-file-error)
+              (setq epa-file-error error)
+              (add-hook 'find-file-not-found-functions
+                        'epa-file--find-file-not-found-function
+                        nil t))
             (signal 'file-error
                     (cons "Opening input file" (cdr error)))))
          (make-local-variable 'epa-file-encrypt-to)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]