From: Daiki Ueno Date: Wed, 4 Apr 2007 09:20:46 +0000 (+0000) Subject: * epa-file.el (epa-file--file-name-regexp-set): New Custom :set X-Git-Url: http://git.osdn.net/view?p=epg%2Fepg.git;a=commitdiff_plain;h=db721584d565e59910f573570908c89cec2c60ec * 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" --- diff --git a/ChangeLog b/ChangeLog index 6075199..b81242a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2007-04-04 Daiki Ueno + * 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 + * 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 diff --git a/epa-file.el b/epa-file.el index 18e28be..5c3d1a5 100644 --- a/epa-file.el +++ b/epa-file.el @@ -29,10 +29,21 @@ "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." @@ -73,6 +84,11 @@ May either be a string or a list of strings.") (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))