Function: auto-encryption-mode

auto-encryption-mode is an interactive and byte-compiled function defined in epa-hook.el.gz.

Signature

(auto-encryption-mode &optional ARG)

Documentation

Toggle automatic file encryption/decryption (Auto Encryption mode).

This is a global minor mode. If called interactively, toggle the Auto-Encryption mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate (default-value \=auto-encryption-mode)'.

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/epa-hook.el.gz
(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"
  ;; At the point where the defcustom is evaluated,
  ;; the corresponding function isn't defined yet, so
  ;; custom-initialize-set would signal an error.
  :initialize #'custom-initialize-after-file-load
  (setq file-name-handler-alist
	(delq epa-file-handler file-name-handler-alist))
  (remove-hook 'find-file-hook 'epa-file-find-file-hook)
  (setq auto-mode-alist (delq epa-file-auto-mode-alist-entry
			      auto-mode-alist))
  (when auto-encryption-mode
    (setq file-name-handler-alist
	  (cons epa-file-handler file-name-handler-alist))
    (add-hook 'find-file-hook 'epa-file-find-file-hook)
    (setq auto-mode-alist (cons epa-file-auto-mode-alist-entry
				auto-mode-alist))))