;;; It is based on RFC 2015 (PGP/MIME).
(defun mime-add-application/pgp-keys (entity situation)
- (let* ((start (mime-entity-header-start-point entity))
- (end (mime-entity-body-end-point entity))
- (entity-number (mime-entity-number entity))
- (new-name (format "%s-%s" (buffer-name) entity-number))
- (encoding (cdr (assq 'encoding situation)))
- str)
- (setq str (buffer-substring start end))
- (switch-to-buffer new-name)
- (setq buffer-read-only nil)
- (erase-buffer)
- (insert str)
- (goto-char (point-min))
- (if (re-search-forward "^\n" nil t)
- (delete-region (point-min) (match-end 0))
- )
- (mime-decode-region (point-min)(point-max) encoding)
- (funcall (pgp-function 'snarf-keys)
- (point-min)(point-max))
- (kill-buffer (current-buffer))
- ))
+ (save-excursion (mime-show-echo-buffer))
+ (with-temp-buffer
+ (mime-insert-entity-content entity)
+ (mime-decode-region (point-min) (point-max)
+ (cdr (assq 'encoding situation)))
+ (let ((pgg-output-buffer mime-echo-buffer-name))
+ (funcall (pgp-function 'snarf-keys)
+ (point-min)(point-max)))))
;;; @ end