2006-04-17 Daiki Ueno <ueno@unixuser.org>
* epa-file.el: Rewritten with file-name-handler.
+ (epa-file-handler): New variable.
+ (epa-file-enable): New command.
+ (epa-file-disable): New command.
+ * epa-setup.el: Call epa-file-enable.
2006-04-17 Daiki Ueno <ueno@unixuser.org>
"Regexp which matches filenames to be encrypted with GnuPG."
:type 'regexp
:group 'epa-file)
+
+(defvar epa-file-handler
+ (cons epa-file-name-regexp 'epa-file-handler))
(defvar epa-file-passphrase-alist nil)
(message "Wrote %s" buffer-file-name))))
(put 'write-region 'epa-file 'epa-file-write-region)
+;;;###autoload
+(defun epa-file-enable ()
+ (interactive)
+ (if (memq epa-file-handler file-name-handler-alist)
+ (message "`epa-file' already enabled")
+ (setq file-name-handler-alist
+ (cons epa-file-handler file-name-handler-alist))
+ (message "`epa-file' enabled")))
+
+;;;###autoload
+(defun epa-file-disable ()
+ (interactive)
+ (if (memq epa-file-handler file-name-handler-alist)
+ (progn
+ (setq file-name-handler-alist
+ (delq epa-file-handler file-name-handler-alist))
+ (message "`epa-file' disabled"))
+ (message "`epa-file' already disabled")))
+
(provide 'epa-file)
;;; epa-file.el ends here
(add-hook 'dired-mode-hook 'epa-dired-mode-hook)
(require 'epa-file)
-(unless (rassq 'epa-file-handler file-name-handler-alist)
- (setq file-name-handler-alist
- (cons (cons epa-file-name-regexp 'epa-file-handler)
- file-name-handler-alist)))
+(epa-file-enable)
(provide 'epa-setup)