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: Michael W. Olson
Subject: [Emacs-diffs] Changes to emacs/lisp/epa-file.el,v
Date: Sun, 10 Feb 2008 20:57:49 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael W. Olson <mwolson>      08/02/10 20:57:47

Index: lisp/epa-file.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/epa-file.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- lisp/epa-file.el    9 Feb 2008 21:59:33 -0000       1.3
+++ lisp/epa-file.el    10 Feb 2008 20:57:46 -0000      1.4
@@ -314,6 +314,24 @@
        (message "`epa-file' disabled"))
     (message "`epa-file' already disabled")))
 
+;;;###autoload
+(define-minor-mode epa-file-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"
+  (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
+    (setq file-name-handler-alist
+         (cons epa-file-handler file-name-handler-alist))
+    (add-hook 'find-file-hooks 'epa-file-find-file-hook)
+    (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
+                               auto-mode-alist))))
+
 (provide 'epa-file)
 
 ;; arch-tag: 5715152f-0eb1-4dbc-9008-07098775314d




reply via email to

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