summaryrefslogtreecommitdiff
path: root/lisp/epa-hook.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-09-19 09:42:28 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-09-19 09:43:05 +0200
commita53781470935fc0b7c7e576c3d02ed723c9587c4 (patch)
tree76d7f07acdfd0b045d4fb26460e890ac2d0adf62 /lisp/epa-hook.el
parent3fd2b00a4b20afa827afe0eee2b7ba5f08e4cce6 (diff)
downloademacs-a53781470935fc0b7c7e576c3d02ed723c9587c4.tar.gz
Don't save bookmark context from encrypted files
* doc/emacs/regs.texi (Bookmarks): Mention this. * lisp/bookmark.el (bookmark-make-record): Don't include context in encrypted files (bug#57856). * lisp/epa-hook.el (epa-file-name-p): New function.
Diffstat (limited to 'lisp/epa-hook.el')
-rw-r--r--lisp/epa-hook.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el
index 18e47c682e8..70c30308819 100644
--- a/lisp/epa-hook.el
+++ b/lisp/epa-hook.el
@@ -88,6 +88,10 @@ interface, update `file-name-handler-alist'."
epa-file-inhibit-auto-save)
(auto-save-mode 0)))
+(defun epa-file-name-p (file)
+ "Say whether FILE is handled by `epa-file'."
+ (and auto-encryption-mode (string-match-p epa-file-name-regexp file)))
+
(define-minor-mode auto-encryption-mode
"Toggle automatic file encryption/decryption (Auto Encryption mode)."
:global t :init-value t :group 'epa-file :version "23.1"