emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/epa-file.el,v


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/epa-file.el,v
Date: Sun, 27 Apr 2008 19:49:17 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/04/27 19:49:16

Index: epa-file.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/epa-file.el,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- epa-file.el 16 Mar 2008 04:04:15 -0000      1.5
+++ epa-file.el 27 Apr 2008 19:49:15 -0000      1.6
@@ -126,7 +126,10 @@
 (defun epa-file-handler (operation &rest args)
   (save-match-data
     (let ((op (get operation 'epa-file)))
-      (if op
+      (if (and op
+              (if (and (eq operation 'insert-file-contents)
+                       
+                       (y-or-n-p ""
          (apply op args)
        (epa-file-run-real-handler operation args)))))
 
@@ -300,7 +303,7 @@
       (message "`epa-file' already enabled")
     (setq file-name-handler-alist
          (cons epa-file-handler file-name-handler-alist))
-    (add-hook 'find-file-hooks 'epa-file-find-file-hook)
+    (add-hook 'find-file-hook 'epa-file-find-file-hook)
     (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry 
auto-mode-alist))
     (message "`epa-file' enabled")))
 
@@ -311,30 +314,35 @@
       (progn
        (setq file-name-handler-alist
              (delq epa-file-handler file-name-handler-alist))
-       (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
+       (remove-hook 'find-file-hook 'epa-file-find-file-hook)
        (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
                                    auto-mode-alist))
        (message "`epa-file' disabled"))
     (message "`epa-file' already disabled")))
 
 ;;;###autoload
-(define-minor-mode epa-file-mode
+(define-minor-mode auto-encryption-mode
   "Toggle automatic file encryption and decryption.
 With prefix argument ARG, turn auto encryption on if positive, else off.
 Return the new status of auto encryption (non-nil means on)."
-  :global t :init-value nil :group 'epa-file :version "23.1"
+  :global t :init-value t :group 'epa-file :version "23.1"
   (setq file-name-handler-alist
        (delq epa-file-handler file-name-handler-alist))
   (remove-hook 'find-file-hooks 'epa-file-find-file-hook)
   (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
                              auto-mode-alist))
-  (when epa-file-mode
+  (when auto-encryption-mode
     (setq file-name-handler-alist
          (cons epa-file-handler file-name-handler-alist))
-    (add-hook 'find-file-hooks 'epa-file-find-file-hook)
+    (add-hook 'find-file-hook 'epa-file-find-file-hook)
+    (add-hook 'find-file-not-found-functions
+             'epa-file-find-file-not-found-functions)
     (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
                                auto-mode-alist))))
 
+(put 'epa-file-handler 'safe-magic t)
+(put 'epa-file-handler 'operations '(write-region insert-file-contents))
+
 (provide 'epa-file)
 
 ;; arch-tag: 5715152f-0eb1-4dbc-9008-07098775314d




reply via email to

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