[Mew-dist 13659] a patch for b47

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
2000年 7月 17日 (月) 11:06:57 JST


時間がないのでパッチの形にします。以下のパッチを当ると draft の 
coding-system 問題が直ると思います。テストして下さい。

なお、歌代さんが指摘した、"0" から始まるメール問題ですが、正規表現を厳
密にして、"0" から始まるメールは引っ掛からないようにしました。

--かず
-------------- next part --------------
Index: mew-config.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-config.el,v
retrieving revision 1.40
retrieving revision 1.41
diff -c -r1.40 -r1.41
*** mew-config.el	2000/07/13 13:05:58	1.40
--- mew-config.el	2000/07/14 13:56:50	1.41
***************
*** 256,262 ****
  	 (mew-header-alist mew-draft-buffer-config))
  	(mew-highlight-header)
  	(if (null mew-header-message) (mew-draft-header-keymap)))
!       (mew-draft-save-buffer))))
  
  (defun mew-draft-set-config-by-guess ()
    (let ((cfgs (mew-refile-guess-by-alist1 mew-config-guess-alist)))
--- 256,262 ----
  	 (mew-header-alist mew-draft-buffer-config))
  	(mew-highlight-header)
  	(if (null mew-header-message) (mew-draft-header-keymap)))
!       (save-buffer))))
  
  (defun mew-draft-set-config-by-guess ()
    (let ((cfgs (mew-refile-guess-by-alist1 mew-config-guess-alist)))
Index: mew-const.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-const.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -c -r1.9 -r1.10
*** mew-const.el	2000/06/27 03:09:02	1.9
--- mew-const.el	2000/07/14 13:56:50	1.10
***************
*** 180,186 ****
  ;;;
  
  (defconst mew-regex-files "^[^.]\\|^.[^.]")
! (defconst mew-regex-message-files "^[0-9]+$")
  (defconst mew-regex-mark "\\([^ 0-9]\\)")
  
  (defconst mew-regex-msg      "^ *\\([0-9]+\\)")
--- 180,186 ----
  ;;;
  
  (defconst mew-regex-files "^[^.]\\|^.[^.]")
! (defconst mew-regex-message-files "^[1-9][0-9]*$")
  (defconst mew-regex-mark "\\([^ 0-9]\\)")
  
  (defconst mew-regex-msg      "^ *\\([0-9]+\\)")
Index: mew-draft.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-draft.el,v
retrieving revision 1.204
retrieving revision 1.205
diff -c -r1.204 -r1.205
*** mew-draft.el	2000/07/05 09:24:28	1.204
--- mew-draft.el	2000/07/14 13:56:50	1.205
***************
*** 133,140 ****
      (define-key (symbol-value symmap) "\C-c\C-r" 'mew-pgp-encrypt-sign-message)
      (define-key (symbol-value symmap) "\C-c\C-p\C-a" 'mew-draft-toggle-privacy-always)
      (define-key (symbol-value symmap) "\C-c\C-p\C-e" 'mew-draft-toggle-privacy-encrypted)
!     (define-key (symbol-value symmap) "\C-c\C-p\C-d" 'mew-draft-set-privacy-type)
!     (define-key (symbol-value symmap) "\C-x\C-s" 'mew-draft-save-buffer))
    (if mew-draft-body-map
        ()
      (setq mew-draft-body-map (make-sparse-keymap))
--- 133,139 ----
      (define-key (symbol-value symmap) "\C-c\C-r" 'mew-pgp-encrypt-sign-message)
      (define-key (symbol-value symmap) "\C-c\C-p\C-a" 'mew-draft-toggle-privacy-always)
      (define-key (symbol-value symmap) "\C-c\C-p\C-e" 'mew-draft-toggle-privacy-encrypted)
!     (define-key (symbol-value symmap) "\C-c\C-p\C-d" 'mew-draft-set-privacy-type))
    (if mew-draft-body-map
        ()
      (setq mew-draft-body-map (make-sparse-keymap))
***************
*** 268,274 ****
      (define-key mew-draft-mode-map "\C-c\C-f\C-n" 'mew-fib-next-item)
      (define-key mew-draft-mode-map "\C-c\C-f\C-p" 'mew-fib-previous-item)
      (define-key mew-draft-mode-map "\C-c\C-f\C-z" 'mew-fib-flush-input)
-     (define-key mew-draft-mode-map "\C-x\C-s" 'mew-draft-save-buffer)
      )))
  
  (if mew-xemacs-p
--- 267,272 ----
***************
*** 516,525 ****
  	(setq switch-func (function switch-to-buffer)))
         ((eq switch-func t)
  	(setq switch-func (function switch-to-buffer-other-window))))
!       (mew-frwlet
!        mew-cs-draft mew-cs-dummy
!        (funcall switch-func (find-file-noselect draft-path)))
        ;; draft buffer
        ;; copy config, first
        (setq mew-draft-buffer-config mew-config-output)
        (rename-buffer draftname))))
--- 514,522 ----
  	(setq switch-func (function switch-to-buffer)))
         ((eq switch-func t)
  	(setq switch-func (function switch-to-buffer-other-window))))
!       (funcall switch-func (find-file-noselect draft-path))
        ;; draft buffer
+       (mew-set-buffer-cs mew-cs-draft)
        ;; copy config, first
        (setq mew-draft-buffer-config mew-config-output)
        (rename-buffer draftname))))
***************
*** 906,919 ****
  ;;
  ;;
  ;;
- 
- (defun mew-draft-save-buffer ()
-   "Save this buffer with the mew-cs-draft coding-system"
-   (interactive)
-   (mew-frwlet
-    mew-cs-dummy mew-cs-draft
-    (save-buffer))
-   (mew-encode-make-backup 'syntax-only))
  
  (defun mew-draft-rehighlight ()
    "Highlight header and body again."
--- 903,908 ----
Index: mew-edit.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-edit.el,v
retrieving revision 1.82
retrieving revision 1.83
diff -c -r1.82 -r1.83
*** mew-edit.el	2000/07/07 05:35:46	1.82
--- mew-edit.el	2000/07/14 13:56:50	1.83
***************
*** 528,534 ****
  	       (progn
  		 (mew-encode-syntax-delete 'all)
  		 (mew-draft-prepare-attachments t)))))
!      (mew-draft-save-buffer)
       (run-hooks 'mew-draft-mode-reedit-draft-hook))))
  
  (defun mew-summary-reedit-for-queue (fld msg part)
--- 528,534 ----
  	       (progn
  		 (mew-encode-syntax-delete 'all)
  		 (mew-draft-prepare-attachments t)))))
!      (save-buffer)
       (run-hooks 'mew-draft-mode-reedit-draft-hook))))
  
  (defun mew-summary-reedit-for-queue (fld msg part)
***************
*** 554,560 ****
      (if mew-encode-syntax
  	(save-excursion
  	  (mew-draft-prepare-attachments t)))
!     (mew-draft-save-buffer)
      (run-hooks 'mew-draft-mode-reedit-hook)))
  
  (defun mew-summary-reedit-for-message (fld msg part)
--- 554,560 ----
      (if mew-encode-syntax
  	(save-excursion
  	  (mew-draft-prepare-attachments t)))
!     (save-buffer)
      (run-hooks 'mew-draft-mode-reedit-hook)))
  
  (defun mew-summary-reedit-for-message (fld msg part)
***************
*** 585,591 ****
        (if mew-encode-syntax
  	  (save-excursion
  	    (mew-draft-prepare-attachments t)))
!       (mew-draft-save-buffer)
        (run-hooks 'mew-draft-mode-reedit-hook))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- 585,591 ----
        (if mew-encode-syntax
  	  (save-excursion
  	    (mew-draft-prepare-attachments t)))
!       (save-buffer)
        (run-hooks 'mew-draft-mode-reedit-hook))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
***************
*** 637,643 ****
  	 (if mew-encode-syntax
  	     (save-excursion
  	       (mew-draft-prepare-attachments t)))
! 	 (mew-draft-save-buffer)
  	 (if (file-exists-p nfile) (delete-file nfile))
  	 (run-hooks 'mew-draft-mode-edit-again-hook))))))
  
--- 637,643 ----
  	 (if mew-encode-syntax
  	     (save-excursion
  	       (mew-draft-prepare-attachments t)))
! 	 (save-buffer)
  	 (if (file-exists-p nfile) (delete-file nfile))
  	 (run-hooks 'mew-draft-mode-edit-again-hook))))))
  
Index: mew-mule0.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-mule0.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -c -r1.34 -r1.35
*** mew-mule0.el	2000/07/05 09:24:29	1.34
--- mew-mule0.el	2000/07/14 13:56:51	1.35
***************
*** 84,89 ****
--- 84,91 ----
  
  (defmacro mew-set-process-cs (pro from-pro to-pro) nil)
  
+ (defmacro mew-set-buffer-cs (write) nil)
+ 
  (defmacro mew-plet (&rest body)
    (` (let ((call-process-hook nil))
         (,@ body))))
Index: mew-mule2.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-mule2.el,v
retrieving revision 1.50
retrieving revision 1.51
diff -c -r1.50 -r1.51
*** mew-mule2.el	2000/07/06 14:12:43	1.50
--- mew-mule2.el	2000/07/14 13:56:51	1.51
***************
*** 215,222 ****
  ;; Process environment
  ;;
  
! (defun mew-set-process-cs (pro from-pro to-pro)
!   (set-process-coding-system pro from-pro to-pro))
  
  (defmacro mew-plet (&rest body)
    (` (let ((call-process-hook nil)
--- 215,225 ----
  ;; Process environment
  ;;
  
! (defmacro mew-set-process-cs (pro from-pro to-pro)
!   (` (set-process-coding-system (, pro) (, from-pro) (, to-pro))))
! 
! (defmacro mew-set-buffer-cs (write)
!   (` (setq file-coding-system (, write))))
  
  (defmacro mew-plet (&rest body)
    (` (let ((call-process-hook nil)
Index: mew-mule3.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-mule3.el,v
retrieving revision 1.49
retrieving revision 1.50
diff -c -r1.49 -r1.50
*** mew-mule3.el	2000/07/05 09:24:29	1.49
--- mew-mule3.el	2000/07/14 13:56:51	1.50
***************
*** 150,157 ****
  ;; Process environment
  ;;
  
! (defun mew-set-process-cs (process read write)
!   (set-process-coding-system process read write))
  
  (defmacro mew-plet (&rest body)
    `(let ((call-process-hook nil)
--- 150,160 ----
  ;; Process environment
  ;;
  
! (defmacro mew-set-process-cs (process read write)
!   `(set-process-coding-system ,process ,read ,write))
! 
! (defmacro mew-set-buffer-cs (write)
!   `(setq buffer-file-coding-system ,write))
  
  (defmacro mew-plet (&rest body)
    `(let ((call-process-hook nil)
Index: mew-pgp.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-pgp.el,v
retrieving revision 1.129
retrieving revision 1.130
diff -c -r1.129 -r1.130
*** mew-pgp.el	2000/07/13 12:04:17	1.129
--- mew-pgp.el	2000/07/14 07:35:47	1.130
***************
*** 16,27 ****
  ;;;
  ;;; PGP 2.6.x is supported. 
  ;;; PGP 5.x is supported. But very ad-hoc.
! ;;; GNUPG 0.9.x is supported. But very ad-hoc.
  ;;; PGP 6.x is supported. But very ad-hoc.
  ;;;
  
  (defvar mew-pgp-ver nil
!   "Automatically set 0 if PGP version is 2. Set 1 if 5. Set 2 if 6. Set 3 if GNUPG.")
  
  (defconst mew-pgp-ver2 0)
  (defconst mew-pgp-ver5 1)
--- 16,28 ----
  ;;;
  ;;; PGP 2.6.x is supported. 
  ;;; PGP 5.x is supported. But very ad-hoc.
! ;;; GNUPG 1.2 is supported. 
  ;;; PGP 6.x is supported. But very ad-hoc.
  ;;;
  
  (defvar mew-pgp-ver nil
!   "Automatically set 0 if PGP version is 2. 
! Set 1 if 5. Set 2 if 6. Set 3 if GNUPG.")
  
  (defconst mew-pgp-ver2 0)
  (defconst mew-pgp-ver5 1)
***************
*** 56,71 ****
--- 57,75 ----
      ("-a" "+language=en" "+batchmode=on" "+armorlines=0")
      ("-ea" "+language=en" "+batchmode=on" "+armorlines=0")
      ("--encrypt" "--armor" "--batch")))
+ 
  (defconst mew-prog-pgpd-arg
    '(("+language=en" "+batchmode=off")
      ("+language=en" "+batchmode=off")
      ("+language=en" "+batchmode=off")
      ("--decrypt")))
+ 
  (defconst mew-prog-pgps-arg
    '(("-sba" "+language=en" "+batchmode=off")
      ("-ba" "+language=en" "+batchmode=off")
      ("-sba" "+language=en" "+batchmode=off")
      ("--detach-sign" "--armor")))
+ 
  (defconst mew-prog-pgpv-arg
    '(("+batchmode=on" "+language=en")
      ("+batchmode=on" "+language=en" "+force=on")
***************
*** 78,84 ****
  (defconst mew-prog-arg-ruserid '(nil "-r" nil "--remote-user"))
  
  (defconst mew-prog-pgpk-add-arg
!   '(("-ka" "+batchmode=on") ("-a" "+batchmode=on") ("-ka" "+batchmode=on") ("--import" "--batch")))
  (defconst mew-prog-pgpk-ext-arg
    '(("-kxfa") ("-xa") ("-kxfa") ("--export" "--armor" "--batch")))
  
--- 82,92 ----
  (defconst mew-prog-arg-ruserid '(nil "-r" nil "--remote-user"))
  
  (defconst mew-prog-pgpk-add-arg
!   '(("-ka" "+batchmode=on")
!     ("-a" "+batchmode=on")
!     ("-ka" "+batchmode=on")
!     ("--import" "--batch")))
! 
  (defconst mew-prog-pgpk-ext-arg
    '(("-kxfa") ("-xa") ("-kxfa") ("--export" "--armor" "--batch")))
  
***************
*** 93,129 ****
      ": \\(0x[0-9A-Za-z]+\\)"
      ": \\(0x[0-9A-Za-z]+\\)"
      "xxx"))
  (defconst mew-pgp-msg-bad-pass
!   '("No passphrase" "Cannot unlock private key\\|It can only be decrypted" "Bad pass phrase" "bad passphrase"))
  (defconst mew-pgp-msg-enter
    '("Enter" "Enter" "Enter" "xxx"))
  (defconst mew-pgp-msg-enter-pass 
!   '("Enter pass phrase: " "Enter pass phrase: " "Enter pass phrase: " "Enter passphrase: "))
  (defconst mew-pgp-msg-reenter-pass
!   '("Enter pass phrase: " "Enter pass phrase: " "Enter pass phrase: " "Enter passphrase: "))
  (defconst mew-pgp-msg-no-enckey
!   '("Key matching" "No encryption keys" "public key matching" "public key not found"))
  (defconst mew-pgp-msg-no-validkey
    '("DUMMY"
      "^WARNING:[ -9;-~\n]+belongs? to:"
      "^WARNING:[ -9;-~\n]+belongs? to:"
      "no info to calculate a trust probability")) ;;xxx
  (defconst mew-pgp-msg-no-vrfkey
    '("Key matching" "unknown keyid" "key does not meet" "public key not found"))
  (defconst mew-pgp-msg-no-keyring
    '("Keyring file" "Keyring file" "NO MESSAGE" "public key not found"))
  (defconst mew-pgp-msg-no-seckey-or-secring
    '("You do not have the secret key"
      "Cannot find a private key"
      "Signature error\\|You do not have the secret key"
      ": decryption failed: secret key not available"))
  (defconst mew-pgp-msg-unsupported
    '("Unsupported packet format" ;; including algorithms and packets
      "Unsupported packet format\\|None of the signatures were understood"
      "Unsupported packet format" ;; including algorithms and packets
      "xxx"))
  (defconst mew-pgp-verify-addr
!   '(".* \\(signature from user\\) " "\\(   \\)" ".* \\(signature from user\\) " "gpg: .* \\(from\\|aka\\) "))
  
  ;; 2: ASCII armor corrupted
  ;; 3:
--- 101,163 ----
      ": \\(0x[0-9A-Za-z]+\\)"
      ": \\(0x[0-9A-Za-z]+\\)"
      "xxx"))
+ 
  (defconst mew-pgp-msg-bad-pass
!   '("No passphrase"
!     "Cannot unlock private key\\|It can only be decrypted"
!     "Bad pass phrase"
!     "bad passphrase"))
! 
  (defconst mew-pgp-msg-enter
    '("Enter" "Enter" "Enter" "xxx"))
+ 
  (defconst mew-pgp-msg-enter-pass 
!   '("Enter pass phrase: "
!     "Enter pass phrase: "
!     "Enter pass phrase: "
!     "Enter passphrase: "))
! 
  (defconst mew-pgp-msg-reenter-pass
!   '("Enter pass phrase: "
!     "Enter pass phrase: "
!     "Enter pass phrase: "
!     "Enter passphrase: "))
! 
  (defconst mew-pgp-msg-no-enckey
!   '("Key matching"
!     "No encryption keys"
!     "public key matching"
!     "public key not found"))
! 
  (defconst mew-pgp-msg-no-validkey
    '("DUMMY"
      "^WARNING:[ -9;-~\n]+belongs? to:"
      "^WARNING:[ -9;-~\n]+belongs? to:"
      "no info to calculate a trust probability")) ;;xxx
+ 
  (defconst mew-pgp-msg-no-vrfkey
    '("Key matching" "unknown keyid" "key does not meet" "public key not found"))
+ 
  (defconst mew-pgp-msg-no-keyring
    '("Keyring file" "Keyring file" "NO MESSAGE" "public key not found"))
+ 
  (defconst mew-pgp-msg-no-seckey-or-secring
    '("You do not have the secret key"
      "Cannot find a private key"
      "Signature error\\|You do not have the secret key"
      ": decryption failed: secret key not available"))
+ 
  (defconst mew-pgp-msg-unsupported
    '("Unsupported packet format" ;; including algorithms and packets
      "Unsupported packet format\\|None of the signatures were understood"
      "Unsupported packet format" ;; including algorithms and packets
      "xxx"))
+ 
  (defconst mew-pgp-verify-addr
!   '(".* \\(signature from user\\) "
!     "\\(   \\)"
!     ".* \\(signature from user\\) "
!     "gpg: .* \\(from\\|aka\\) "))
  
  ;; 2: ASCII armor corrupted
  ;; 3:
Index: mew-pop.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-pop.el,v
retrieving revision 1.26
retrieving revision 1.27
diff -c -r1.26 -r1.27
*** mew-pop.el	2000/07/13 13:05:58	1.26
--- mew-pop.el	2000/07/14 07:35:48	1.27
***************
*** 443,449 ****
    (mew-pop-set-try pnm nil)
    (mew-pop-set-key pnm nil)
    (mew-pop-set-cnt pnm nil) ;; change 0 to nil
!   (message "APOP password is wrong!")
    (mew-passwd-set-passwd (mew-pop-passtag pnm) nil)) ;; xxx server disconnect?
  
  (defun mew-pop-command-list (pro pnm)
--- 443,454 ----
    (mew-pop-set-try pnm nil)
    (mew-pop-set-key pnm nil)
    (mew-pop-set-cnt pnm nil) ;; change 0 to nil
!   (let ((auth (mew-pop-get-auth pnm)))
!     (cond
!      ((or (eq auth 'pass) (eq auth 'user))
!       (message "POP password is wrong!"))
!      (t
!       (message "APOP password is wrong!"))))
    (mew-passwd-set-passwd (mew-pop-passtag pnm) nil)) ;; xxx server disconnect?
  
  (defun mew-pop-command-list (pro pnm)


Mew-dist メーリングリストの案内