[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100747: Prevent find-file from openi
From: |
Daiki Ueno |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100747: Prevent find-file from opening empty buffer when decryptin failed (bug#6568). |
Date: |
Thu, 08 Jul 2010 10:02:24 +0900 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100747
committer: Daiki Ueno <address@hidden>
branch nick: trunk
timestamp: Thu 2010-07-08 10:02:24 +0900
message:
Prevent find-file from opening empty buffer when decryptin failed (bug#6568).
* epa-file.el (epa-file-error, epa-file--find-file-not-found-function)
(epa-file-insert-file-contents): Hack to prevent
find-file from opening empty buffer when decryptin failed
(bug#6568).
modified:
lisp/ChangeLog
lisp/epa-file.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-07-07 10:30:57 +0000
+++ b/lisp/ChangeLog 2010-07-08 01:02:24 +0000
@@ -1,3 +1,10 @@
+2010-07-08 Daiki Ueno <address@hidden>
+
+ * epa-file.el (epa-file-error, epa-file--find-file-not-found-function)
+ (epa-file-insert-file-contents): Hack to prevent
+ find-file from opening empty buffer when decryptin failed
+ (bug#6568).
+
2010-07-07 Agustín Martín <address@hidden>
* ispell.el (ispell-alternate-dictionary): Use file-readable-p.
=== modified file 'lisp/epa-file.el'
--- a/lisp/epa-file.el 2010-01-13 08:35:10 +0000
+++ b/lisp/epa-file.el 2010-07-08 01:02:24 +0000
@@ -101,6 +101,14 @@
(insert (epa-file--decode-coding-string string (or coding-system-for-read
'undecided)))))
+(defvar epa-file-error nil)
+(defun epa-file--find-file-not-found-function ()
+ (let ((error epa-file-error))
+ (save-window-excursion
+ (kill-buffer))
+ (signal 'file-error
+ (cons "Opening input file" (cdr error)))))
+
(defvar last-coding-system-used)
(defun epa-file-insert-file-contents (file &optional visit beg end replace)
(barf-if-buffer-read-only)
@@ -131,6 +139,15 @@
(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)
(signal 'file-error
(cons "Opening input file" (cdr error)))))
(make-local-variable 'epa-file-encrypt-to)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100747: Prevent find-file from opening empty buffer when decryptin failed (bug#6568).,
Daiki Ueno <=
- Prev by Date:
[Emacs-diffs] /srv/bzr/emacs/trunk r100746: Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
- Next by Date:
[Emacs-diffs] /srv/bzr/emacs/trunk r100748: * configure.in (UNEXEC_OBJ): Add comment about values for MSDOS
- Previous by thread:
[Emacs-diffs] /srv/bzr/emacs/trunk r100746: Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
- Next by thread:
[Emacs-diffs] /srv/bzr/emacs/trunk r100748: * configure.in (UNEXEC_OBJ): Add comment about values for MSDOS
- Index(es):