Don't use this command in Lisp programs!"
(interactive
- (progn
+ (save-excursion
(goto-char (point-min))
(if (and (or (eq major-mode 'mail-mode)
(eq (derived-mode-class major-mode) 'mail-mode))
Don't use this command in Lisp programs!"
(interactive
- (let (recipients)
- (goto-char (point-min))
- (when (or (eq major-mode 'mail-mode)
- (eq (derived-mode-class major-mode) 'mail-mode))
- (save-restriction
- (narrow-to-region (point)
- (progn
- (search-forward mail-header-separator nil 0)
- (match-beginning 0)))
- (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]+"))))
+ (save-excursion
+ (let (recipients)
(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.
+ (when (or (eq major-mode 'mail-mode)
+ (eq (derived-mode-class major-mode) 'mail-mode))
+ (save-restriction
+ (narrow-to-region (point)
+ (progn
+ (search-forward mail-header-separator nil 0)
+ (match-beginning 0)))
+ (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))))))))
+ recipients)
+ (if recipients
+ (delq nil
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (epg-list-keys
+ (epg-make-context epa-protocol)
+ (concat "<" recipient ">")))
+ recipients)))))))))
(epa-encrypt-region start end recipients))
;;;###autoload