(item :tag "external" binhex-decode-region-external))
:group 'gnus-article-mime)
-(defvar mm-uu-pgp-begin-signature
+(defvar mm-uu-pgp-beginning-signature
"^-----BEGIN PGP SIGNATURE-----")
-(defvar mm-uu-begin-line nil)
+(defvar mm-uu-beginning-regexp nil)
(defvar mm-dissect-disposition "inline"
"The default disposition of uu parts.
"^-----BEGIN PGP PUBLIC KEY BLOCK-----"
"^-----END PGP PUBLIC KEY BLOCK-----"
mm-uu-pgp-key-extract
- nil
- mm-uu-pgp-key-test)))
+ mm-uu-gpg-key-skip-to-last
+ nil)))
(defcustom mm-uu-configure-list nil
"A list of mm-uu configuration.
(defsubst mm-uu-type (entry)
(car entry))
-(defsubst mm-uu-begin-regexp (entry)
+(defsubst mm-uu-beginning-regexp (entry)
(nth 1 entry))
(defsubst mm-uu-end-regexp (entry)
(defun mm-uu-configure (&optional symbol value)
(if symbol (set-default symbol value))
- (setq mm-uu-begin-line nil)
+ (setq mm-uu-beginning-regexp nil)
(mapcar (lambda (entry)
(if (mm-uu-configure-p (mm-uu-type entry) 'disabled)
nil
- (setq mm-uu-begin-line
- (concat mm-uu-begin-line
- (if mm-uu-begin-line "\\|")
- (mm-uu-begin-regexp entry)))))
+ (setq mm-uu-beginning-regexp
+ (concat mm-uu-beginning-regexp
+ (if mm-uu-beginning-regexp "\\|")
+ (mm-uu-beginning-regexp entry)))))
mm-uu-type-alist))
(mm-uu-configure)
(goto-char (point-min))
(if (search-forward "\n\n" nil t)
(delete-region (point-min) (point)))
- (if (re-search-forward mm-uu-pgp-begin-signature nil t)
+ (if (re-search-forward mm-uu-pgp-beginning-signature nil t)
(delete-region (match-beginning 0) (point-max))))
(mm-make-handle buf
'("text/plain" (charset . gnus-decoded)))))
(mm-make-handle buf
'("text/plain" (charset . gnus-decoded)))))
-(defun mm-uu-pgp-key-test ()
- (and
- mml2015-use
- (mml2015-clear-snarf-function)
- (cond
- ((eq mm-snarf-option 'never) nil)
- ((eq mm-snarf-option 'always) t)
- ((eq mm-snarf-option 'known) t)
- (t (y-or-n-p "Snarf pgp signed part?")))))
+(defun mm-uu-gpg-key-skip-to-last ()
+ (let ((point (point))
+ (end-regexp (mm-uu-end-regexp entry))
+ (beginning-regexp (mm-uu-beginning-regexp entry)))
+ (when (and end-regexp
+ (not (mm-uu-configure-p (mm-uu-type entry) 'disabled)))
+ (while (re-search-forward end-regexp nil t)
+ (skip-chars-forward " \t\n\r")
+ (if (looking-at beginning-regexp)
+ (setq point (match-end 0)))))
+ (goto-char point)))
(defun mm-uu-pgp-key-extract ()
(let ((buf (mm-uu-copy-to-buffer start-point end-point)))
- (with-current-buffer buf
- (funcall (mml2015-clear-snarf-function)))
(mm-make-handle buf
- '("application/x-pgp-key"))))
+ '("application/pgp-keys"))))
;;;### autoload
(defun mm-uu-dissect ()
;;; decoding.
(setq text-start (point)
text-plain-type '("text/plain" (charset . gnus-decoded)))
- (while (re-search-forward mm-uu-begin-line nil t)
+ (while (re-search-forward mm-uu-beginning-regexp nil t)
(setq start-point (match-beginning 0))
(let ((alist mm-uu-type-alist)
- (begin-line (match-string 0)))
+ (beginning-regexp (match-string 0)))
(while (not entry)
- (if (string-match (mm-uu-begin-regexp (car alist)) begin-line)
+ (if (string-match (mm-uu-beginning-regexp (car alist))
+ beginning-regexp)
(setq entry (car alist))
(pop alist))))
(if (setq func (mm-uu-function-1 entry))
(funcall func))
(forward-line);; in case of failure
(when (and (not (mm-uu-configure-p (mm-uu-type entry) 'disabled))
- (let ((end-line (mm-uu-end-regexp entry)))
- (if (not end-line)
+ (let ((end-regexp (mm-uu-end-regexp entry)))
+ (if (not end-regexp)
(or (setq end-point (point-max)) t)
(prog1
- (re-search-forward end-line nil t)
+ (re-search-forward end-regexp nil t)
(forward-line)
(setq end-point (point)))))
(or (not (setq func (mm-uu-function-2 entry)))
mml2015-mailcrypt-verify
mml2015-mailcrypt-decrypt
mml2015-mailcrypt-clear-verify
- mml2015-mailcrypt-clear-decrypt
- mml2015-mailcrypt-clear-snarf)
+ mml2015-mailcrypt-clear-decrypt)
(gpg mml2015-gpg-sign
mml2015-gpg-encrypt
mml2015-gpg-verify
mml2015-gpg-decrypt
nil
- mml2015-gpg-clear-decrypt
- nil))
+ mml2015-gpg-clear-decrypt))
"Alist of PGP/MIME functions.")
(defvar mml2015-result-buffer nil)
(autoload 'mc-pgp-always-sign "mailcrypt")
(autoload 'mc-encrypt-generic "mc-toplev")
(autoload 'mc-cleanup-recipient-headers "mc-toplev")
- (autoload 'mc-sign-generic "mc-toplev")
- (autoload 'mc-snarf-keys "mc-toplev"))
+ (autoload 'mc-sign-generic "mc-toplev"))
(eval-when-compile
(defvar mc-default-scheme)
(defvar mml2015-decrypt-function 'mailcrypt-decrypt)
(defvar mml2015-verify-function 'mailcrypt-verify)
-(defvar mml2015-snarf-function 'mc-snarf-keys)
(defun mml2015-mailcrypt-decrypt (handle ctl)
(let (child handles result)
(unless (funcall mml2015-verify-function)
(error "Verify error.")))
-(defun mml2015-mailcrypt-clear-snarf ()
- (funcall mml2015-snarf-function))
-
(defun mml2015-mailcrypt-sign (cont)
(mc-sign-generic (message-options-get 'message-sender)
nil nil nil nil)
(gnus-get-buffer-create "*MML2015 Result*"))
nil))
-(defsubst mml2015-clear-snarf-function ()
- (nth 7 (assq mml2015-use mml2015-function-alist)))
-
(defsubst mml2015-clear-decrypt-function ()
(nth 6 (assq mml2015-use mml2015-function-alist)))