(defvar epa-file-handler
(cons epa-file-name-regexp 'epa-file-handler))
+(defvar epa-file-auto-mode-alist-entry
+ (list epa-file-name-regexp nil 'epa-file))
+
(defvar epa-file-passphrase-alist nil)
(eval-and-compile
(if (and visit (or beg end))
(error "Attempt to visit less than an entire file"))
(setq file (expand-file-name file))
- (let* ((local-copy (epa-file-run-real-handler #'file-local-copy (list file)))
+ (let* ((local-copy
+ (condition-case inl
+ (epa-file-run-real-handler #'file-local-copy (list file))
+ (error)))
(local-file (or local-copy file))
(context (epg-make-context))
string length entry)
(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))
(message "`epa-file' enabled")))
;;;###autoload
(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))
(message "`epa-file' disabled"))
(message "`epa-file' already disabled")))