2007-04-04 Daiki Ueno <ueno@unixuser.org>
+ * epa-file.el (epa-file--file-name-regexp-set): New Custom :set
+ function.
+ (epa-file-name-regexp): Use it.
+ (epa-file-name-regexp-update): New command.
+ Reported by "[ #10192 ] customizing epa-file-name-regexp fails"
+
+2007-04-04 Daiki Ueno <ueno@unixuser.org>
+
* epa-file.el (epa-file-find-file-hook): New function.
(epa-file-enable): Add epa-file-find-file-hook to find-file-hooks.
(epa-file-disable): Remove epa-file-find-file-hook from
"The EasyPG Assistant hooks for transparent file encryption"
:group 'epa)
+(defun epa-file--file-name-regexp-set (variable value)
+ (set-default variable value)
+ (if (fboundp 'epa-file-name-regexp-update)
+ (epa-file-name-regexp-update)))
+
(defcustom epa-file-name-regexp "\\.gpg\\'"
- "Regexp which matches filenames to be encrypted with GnuPG."
+ "Regexp which matches filenames to be encrypted with GnuPG.
+
+If you set this outside Custom while epa-file is already enabled, you
+have to call `epa-file-name-regexp-update' after setting it to
+properly update file-name-handler-alist. Setting this through Custom
+does that automatically."
:type 'regexp
- :group 'epa-file)
+ :group 'epa-file
+ :set 'epa-file--file-name-regexp-set)
(defcustom epa-file-cache-passphrase-for-symmetric-encryption nil
"If non-nil, cache passphrase for symmetric encryption."
(defalias 'epa-file--decode-coding-string 'decode-coding-string)
(defalias 'epa-file--decode-coding-string 'identity))
+(defun epa-file-name-regexp-update ()
+ (interactive)
+ (unless (equal (car epa-file-handler) epa-file-name-regexp)
+ (setcar epa-file-handler epa-file-name-regexp)))
+
(defun epa-file-passphrase-callback-function (context key-id file)
(if (and epa-file-cache-passphrase-for-symmetric-encryption
(eq key-id 'SYM))