[Mew-dist 2997] 1.92.4
Kazu Yamamoto
Kazu at example.com
1997年 11月 18日 (火) 13:17:50 JST
I received a message which told me that PGP verification failed if
signed with Mew 1.92.x. I'm now stuck in a hotel at Fukuoka city but I
tried to investigate the cause. I found that the bug appears only on
*pure* Emacs 19.x. The following is a patch to fix this. I hope that
this message will be delivered to you through a very slow link...
--Kazu
Index: mew/mew-decode.el
diff -c mew/mew-decode.el:1.1.1.1 mew/mew-decode.el:1.1.1.1.2.1
*** mew/mew-decode.el:1.1.1.1 Tue Oct 28 13:08:43 1997
--- mew/mew-decode.el Tue Nov 18 13:12:00 1997
***************
*** 649,655 ****
(forward-line) ;; the beginning of the key part
(setq start2 (point))
;;
! (setq file1 (mew-save-signature-form (point-min) end1))
;; xxx make use of micalg?
;; xxx protocol check?
(if (not (re-search-forward eregex))
--- 649,658 ----
(forward-line) ;; the beginning of the key part
(setq start2 (point))
;;
! (save-excursion
! (save-restriction
! (narrow-to-region (point-min) end1)
! (setq file1 (mew-save-transfer-form (point-min) end1 'retain))))
;; xxx make use of micalg?
;; xxx protocol check?
(if (not (re-search-forward eregex))
Index: mew/mew-encode.el
diff -c mew/mew-encode.el:1.1.1.1 mew/mew-encode.el:1.1.1.1.2.1
*** mew/mew-encode.el:1.1.1.1 Tue Oct 28 13:08:43 1997
--- mew/mew-encode.el Tue Nov 18 13:12:01 1997
***************
*** 471,477 ****
file1 file2 file3 cte2 cte3 fc error)
(setq decrypters (mew-encode-decrypters-list decrypters))
;; Write the part converting line breaks.
! (setq file1 (mew-save-transfer-form (point-min) (point-max)))
;; The narrowed region stores nothing
;; Call the protocol function
(setq fc (funcall func file1 decrypters))
--- 471,477 ----
file1 file2 file3 cte2 cte3 fc error)
(setq decrypters (mew-encode-decrypters-list decrypters))
;; Write the part converting line breaks.
! (setq file1 (mew-save-transfer-form (point-min) (point-max) nil))
;; The narrowed region stores nothing
;; Call the protocol function
(setq fc (funcall func file1 decrypters))
***************
*** 508,514 ****
(switch mew-encode-multipart-signed-switch);; save length
(func (cdr (mew-assoc-case-equal protocol switch 0)))
file1 file2 micalg cte2 fmc error)
! (setq file1 (mew-save-signature-form (point-min) (point-max)))
;; The narrowed region still the ORIGINAL part (i.e. line breaks are LF)
;; Call the protocol function
(setq fmc (funcall func file1))
--- 508,514 ----
(switch mew-encode-multipart-signed-switch);; save length
(func (cdr (mew-assoc-case-equal protocol switch 0)))
file1 file2 micalg cte2 fmc error)
! (setq file1 (mew-save-transfer-form (point-min) (point-max) 'retain))
;; The narrowed region still the ORIGINAL part (i.e. line breaks are LF)
;; Call the protocol function
(setq fmc (funcall func file1))
***************
*** 539,583 ****
)
))
! (defun mew-save-transfer-form (beg end)
;; called in the narrowed region
! (mew-frwlet
! mew-cs-noconv mew-cs-7bit-crlf
! (let (file)
! (if mew-cs-7bit-crlf
! ()
! (goto-char (point-min)) ;; just in case
! (while (search-forward "\n" nil t) (replace-match "\r\n" nil t))
! (setq end (point-max))
! )
! (if (not (file-exists-p mew-temp-dir))
! (mew-make-directory mew-temp-dir)) ;; just in case
! (setq file (make-temp-name mew-temp-file))
! (write-region beg end file nil 'no-msg)
! (delete-region beg end)
! file ;; return value
! )
! ))
!
! (defun mew-save-signature-form (beg end)
! (let (file1)
! (save-excursion
! (save-restriction
! (narrow-to-region beg end)
! ;; NEVER use call-process-region for privary reasons
! (if (not (file-exists-p mew-temp-dir))
! (mew-make-directory mew-temp-dir)) ;; just in case
! (setq file1 (make-temp-name mew-temp-file))
! (mew-frwlet
! mew-cs-noconv mew-cs-7bit-crlf
! (write-region (point-min) (point-max) file1 nil 'no-msg)
! file1 ;; return value
! ;;; this is experimental...
! ; (setq file2 (make-temp-name mew-temp-file))
! ; (call-process mew-prog-mime-encode file1 nil nil "-s" "-" file2)
! ; (if (file-exists-p file1) (delete-file file1))
! ; file2 ;; return value
! )))))
(defun mew-encode-decrypters-list (string)
(let ((list))
--- 539,569 ----
)
))
! (defun mew-save-transfer-form (beg end retain)
;; called in the narrowed region
! (let ((sbeg beg) (send end) (draft-buf (current-buffer)) file)
! (if retain
! (progn
! (mew-set-buffer-tmp)
! ;; tmp buffer
! (insert-buffer-substring draft-buf beg end)
! (setq sbeg (point-min) send (point-max))))
! (if mew-cs-7bit-crlf
! ()
! (goto-char sbeg) ;; just in case
! (while (search-forward "\n" nil t) (replace-match "\r\n" nil t))
! (setq send (point-max)))
! (if (not (file-exists-p mew-temp-dir))
! (mew-make-directory mew-temp-dir)) ;; just in case
! (setq file (make-temp-name mew-temp-file))
! (mew-frwlet mew-cs-noconv mew-cs-7bit-crlf
! (write-region sbeg send file nil 'no-msg))
! (if retain
! (mew-erase-buffer)
! (delete-region sbeg send))
! (set-buffer draft-buf)
! file ;; return value
! ))
(defun mew-encode-decrypters-list (string)
(let ((list))
Index: mew/mew.el
diff -c mew/mew.el:1.1.1.1.2.3 mew/mew.el:1.1.1.1.2.4
*** mew/mew.el:1.1.1.1.2.3 Fri Nov 7 09:43:04 1997
--- mew/mew.el Tue Nov 18 13:12:02 1997
***************
*** 7,13 ****
;;;
;;; Author: Kazu Yamamoto <Kazu at example.com>
;;; Created: Mar 22, 1994
! ;;; Revised: Nov 7, 1997
;;;
;;; The updated version is available from:
;;; ftp://ftp.aist-nara.ac.jp/pub/elisp/Mew/mew-current.tar.gz
--- 7,13 ----
;;;
;;; Author: Kazu Yamamoto <Kazu at example.com>
;;; Created: Mar 22, 1994
! ;;; Revised: Nov 16, 1997
;;;
;;; The updated version is available from:
;;; ftp://ftp.aist-nara.ac.jp/pub/elisp/Mew/mew-current.tar.gz
***************
*** 24,30 ****
;;; Mew version
;;;
! (defconst mew-version "Mew version 1.92.3")
(provide 'mew)
(require 'mew-env)
(require 'mew-func)
--- 24,30 ----
;;; Mew version
;;;
! (defconst mew-version "Mew version 1.92.4")
(provide 'mew)
(require 'mew-env)
(require 'mew-func)
Mew-dist メーリングリストの案内