;; Returns list of absolute file name and number of characters inserted.
(list expanded-filename length)))
-
-(put 'epg-file-handler 'safe-magic t)
-(let (epg-file-operations)
- (mapc
- (lambda (operation)
- (let ((epg-file-operation (intern (format "epg-file-%s" operation))))
- (setq epg-file-operation (cons operation epg-file-operations))
- (put operation 'epg-file epg-file-operation)))
- '(access-file add-name-to-file byte-compiler-base-file-name copy-file
- delete-directory delete-file diff-latest-backup-file directory-file-name
- directory-files directory-files-and-attributes dired-call-process
- dired-compress-file dired-uncache expand-file-name
- file-accessible-directory-p file-attributes file-directory-p
- file-executable-p file-exists-p file-local-copy file-remote-p file-modes
- file-name-all-completions file-name-as-directory file-name-completion
- file-name-directory file-name-nondirectory file-name-sans-versions
- file-newer-than-file-p file-ownership-preserved-p file-readable-p
- file-regular-p file-symlink-p file-truename file-writable-p
- find-backup-file-name find-file-noselect get-file-buffer
- insert-directory insert-file-contents load make-directory
- make-directory-internal make-symbolic-link rename-file set-file-modes
- set-visited-file-modtime shell-command substitute-in-file-name
- unhandled-file-name-directory vc-registered verify-visited-file-modtime
- write-region))
- (put 'epg-file-handler 'operations epg-file-operations))
+
+(put 'write-region 'epg-file 'epg-file-write-region)
+(put 'insert-file-contents 'epg-file 'epg-file-insert-file-contents)
(unless (assoc epg-file-name-regexp file-name-handler-alist)
(setq file-name-handler-alist