From: morioka Date: Thu, 27 Mar 1997 21:17:25 +0000 (+0000) Subject: (mime-article/check-pgp-signature): Use `insert-buffer-substring'. X-Git-Tag: Hokutetsu-Ishikawa-new~31 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d1211454a5500c6646f18c99eca24487b9ece11b;p=elisp%2Fsemi.git (mime-article/check-pgp-signature): Use `insert-buffer-substring'. --- diff --git a/mime-pgp.el b/mime-pgp.el index 234ed3c..e705df1 100644 --- a/mime-pgp.el +++ b/mime-pgp.el @@ -5,7 +5,7 @@ ;; Author: MORIOKA Tomohiko ;; Created: 1995/12/7 ;; Renamed: 1997/2/27 from tm-pgp.el -;; Version: $Id: mime-pgp.el,v 0.17 1997-03-27 20:59:00 morioka Exp $ +;; Version: $Id: mime-pgp.el,v 0.18 1997-03-27 21:17:25 morioka Exp $ ;; Keywords: PGP, security, MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -160,6 +160,7 @@ It should be ISO 639 2 letter language code such as en, ja, ...") )))) (defun mime-article/check-pgp-signature (beg end cal) + "Internal method to check PGP/MIME signature." (let* ((encoding (cdr (assq 'encoding cal))) (cnum (mime-article/point-content-number beg)) (rcnum (reverse cnum)) @@ -168,20 +169,21 @@ It should be ISO 639 2 letter language code such as en, ja, ...") (onum (if (> knum 0) (1- knum) (1+ knum))) + (raw-buf (current-buffer)) (oinfo (mime-article/rcnum-to-cinfo (cons onum rmcnum) mime::article/content-info)) - str kbuf + kbuf (basename (expand-file-name "tm" mime-temp-directory)) (orig-file (make-temp-name basename)) (sig-file (concat orig-file ".sig")) ) (save-excursion - (setq str (buffer-substring - (mime::content-info/point-min oinfo) - (mime::content-info/point-max oinfo) - )) - (set-buffer (get-buffer-create mime/temp-buffer-name)) - (insert str) + (let ((p-min (mime::content-info/point-min oinfo)) + (p-max (mime::content-info/point-max oinfo)) + ) + (set-buffer (get-buffer-create mime/temp-buffer-name)) + (insert-buffer-substring raw-buf p-min p-max) + ) (goto-char (point-min)) (while (re-search-forward "\n" nil t) (replace-match "\r\n") @@ -189,16 +191,16 @@ It should be ISO 639 2 letter language code such as en, ja, ...") (as-binary-output-file (write-file orig-file)) (kill-buffer (current-buffer)) ) + (save-excursion (mime-show-echo-buffer)) (save-excursion - (mime-show-echo-buffer) - (setq str (buffer-substring - (save-excursion - (goto-char beg) - (and (search-forward "\n\n") - (match-end 0))) - end)) - (set-buffer (setq kbuf (get-buffer-create mime/temp-buffer-name))) - (insert str) + (let ((p-min (save-excursion + (goto-char beg) + (and (search-forward "\n\n") + (match-end 0)) + ))) + (set-buffer (setq kbuf (get-buffer-create mime/temp-buffer-name))) + (insert-buffer-substring raw-buf p-min end) + ) (mime-decode-region (point-min)(point-max) encoding) (as-binary-output-file (write-file sig-file)) (or (mime::article/call-pgp-to-check-signature