-(defun epa-encrypt (start end recipients sign)
- "Encrypt the current buffer.
-
-Don't use this command in Lisp programs!"
- (interactive
- (save-excursion
- (let (recipients)
- (goto-char (point-min))
- (when (epa--mail-mode-p)
- (save-restriction
- (narrow-to-region (point)
- (if (search-forward mail-header-separator nil 0)
- (match-beginning 0)
- (point)))
- (setq recipients
- (mail-strip-quoted-names
- (mapconcat #'identity
- (nconc (mail-fetch-field "to" nil nil t)
- (mail-fetch-field "cc" nil nil t)
- (mail-fetch-field "bcc" nil nil t))
- ","))))
- (if recipients
- (setq recipients (delete ""
- (split-string recipients "[ \t\n]+"))))
- (goto-char (point-min))
- (if (search-forward mail-header-separator nil t)
- (forward-line)))
- (setq epa-last-coding-system-specified
- (or coding-system-for-write
- (epa--select-safe-coding-system (point) (point-max))))
- (list (point) (point-max)
- (if current-prefix-arg
- (epa-select-keys
- (epg-make-context epa-protocol)
- "Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients)
- (if recipients
- (delq nil
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (epg-list-keys
- (epg-make-context epa-protocol)
- (concat "<" recipient ">")))
- recipients)))))
- (if current-prefix-arg
- (y-or-n-p "Sign? "))))))
- (epa-encrypt-region start end recipients sign))
-
-;;;###autoload