2006-12-31 Daiki Ueno <ueno@unixuser.org>
+ * epa.el (epa-mail-modes): New user option.
+ (epa--mail-mode-p): New function.
+ (epa-sign): Use it.
+ (epa-encrypt): Use it.
+
+2006-12-31 Daiki Ueno <ueno@unixuser.org>
+
* epa.el (epa--derived-mode-p): New alias.
(epa-sign): Use it.
(epa-encrypt): Use it.
:type 'integer
:group 'epa)
+(defcustom epa-mail-modes '(mail-mode message-mode)
+ "List of major-modes to compose mails."
+ :type 'list
+ :group 'epa)
+
(defgroup epa-faces nil
"Faces for epa-mode."
:group 'epa)
(setq parent (get parent 'derived-mode-parent))))
parent)))
+(defun epa--mail-mode-p ()
+ (let ((pointer epa-mail-modes))
+ (while (and pointer
+ (epa--derived-mode-p (car pointer)))
+ (setq pointer (cdr pointer)))
+ pointer))
+
;;;###autoload
(defun epa-sign (start end signers mode)
"Sign the current buffer.
(interactive
(save-excursion
(goto-char (point-min))
- (if (and (epa--derived-mode-p 'mail-mode)
+ (if (and (epa--mail-mode-p)
(search-forward mail-header-separator nil t))
(forward-line))
(setq epa-last-coding-system-specified
(save-excursion
(let (recipients)
(goto-char (point-min))
- (when (epa--derived-mode-p 'mail-mode)
+ (when (epa--mail-mode-p)
(save-restriction
(narrow-to-region (point)
(progn
(mail-fetch-field "bcc" nil nil t))
","))))
(if recipients
- (setq recipients (delete "" (split-string recipients "[ \t\n]+"))))
+ (setq recipients (delete ""
+ (split-string recipients "[ \t\n]+"))))
(goto-char (point-min))
(if (search-forward mail-header-separator nil t)
(forward-line)))