[Mew-dist 13321] mew-summary-reply

Toru Yano ( 矢野 暢 ) toru at example.com
2000年 6月 19日 (月) 15:08:18 JST


矢野です。
  mew-summary-replyを少し改良してみました。
  改良の要点は、
  reply-to以外のheaderによる返信先の変更等です。

  mew-summary-reply-list を、
  (setq mew-summary-reply-list
  '(("Reply-To:" 
     (("Reply-To:") nil nil)
     (nil t))
    ("Followup-To:" 
     (nil nil t) 
     ("Followup-To:" nil))
    (t 
     (("From:")  ("To:" "Cc:" "Apparently-To:") nil) 
     ("Newsgroups:" nil))
    ))
  などと設定します。

  ようは、
  ((H1 (T1 C1 MF1) (N1 NF1))
   (H2 (T2 C2 MF2) (N2 NF2))
   (H3 (T3 C3 MF3) (N3 NF3)))
  で、
   H :メールヘッダ及び定数 (Reply-To: Mail-Reply-To: t等)
   T :To:に設定されるヘッダのリスト(nilもありえる。)
   C :Cc:に設定されるヘッダのリスト(nilもありえる。)
   MF:メール関連の継続処理を行うかのフラグ
   N :Newsgroups:に設定されるヘッダのリスト(nilもありえる。)
   NF:ニュース関連の継続処理を行うかのフラグ
  です。
  
  それに伴い加えて、
  mew-replyto-to-list
  mew-replyto-cc-list
  mew-noreplyto-to-list
  mew-noreplyto-cc-list
  を廃止し、
  mew-default-reply-to-list
  mew-default-reply-cc-list
  を新設しました。これは、toおよび、ccがnilだった場合の to
ccの作成に使います。

  また、mew-summary-reply-to を、C-caや、C-cAで呼び出した場
合に、全ての mew-summary-reply-list での設定を無視して、
mew-default-reply-to-list、mew-default-reply-cc-list、を使用
して、toとccを作成する機能を付けました。
---------+---------+---------+---------+---------+-----
矢野 暢 (Yano Toru)
   E-mail : toru at example.com
   Web    : http://www.maid.ne.jp/~toru/
-------------- next part --------------
*** mew-summary.el.orig	Mon Jun 19 14:05:17 2000
--- mew-summary.el	Mon Jun 19 15:02:21 2000
***************
*** 18,23 ****
--- 18,34 ----
  
  (defvar mew-summary-mode-map nil)
  
+ (defconst mew-default-reply-key: "\C-ca")
+ (defconst mew-default-reply-citation-key: "\C-cA")
+ 
+ (defun mew-default-reply-to-list 
+   (or (nth 0 (nth 1 (assoc t alist)))
+       (list mew-from: mew-reply-to:)))
+ 
+ (defun mew-default-reply-co-list 
+   (or (nth 1 (nth 1 (assoc t alist)))
+       (list mew-from: mew-reply-to:)))
+ 
  (defvar mew-summary-mode-menu-spec
    '("Mew"
      ["Show" mew-summary-show t]
***************
*** 101,106 ****
--- 112,119 ----
    (define-key mew-summary-mode-map "i"    'mew-summary-get)
    (define-key mew-summary-mode-map "a"    'mew-summary-reply)
    (define-key mew-summary-mode-map "A"    'mew-summary-reply-with-citation)
+   (define-key mew-summary-mode-map mew-default-reply-key: 'mew-summary-reply)
+   (define-key mew-summary-mode-map mew-default-reply-key: 'mew-summary-reply-with-citation)
    (define-key mew-summary-mode-map "D"    'mew-summary-clean-trash)
    (define-key mew-summary-mode-map "E"    'mew-summary-reedit)
    (define-key mew-summary-mode-map "\ee"  'mew-summary-edit-again)
***************
*** 1162,1168 ****
     (mew-current-set-window-config)
     (let ((buf (buffer-name))
  	 draft
! 	 from reply-to to cc newsgroups subject in-reply-to references
  	 cbuf encrypted fromme)
       (if (string= buf mew-draft-folder)
  	 (message "Cannot reply to draft message")
--- 1175,1184 ----
     (mew-current-set-window-config)
     (let ((buf (buffer-name))
  	 draft
! 	 (alist mew-summary-reply-list)
! 	 header tocc news
! 	 flug_n flug_m flug
! 	 from to cc newsgroups subject in-reply-to references
  	 cbuf encrypted fromme)
       (if (string= buf mew-draft-folder)
  	 (message "Cannot reply to draft message")
***************
*** 1187,1193 ****
  	  (widen)
  	  ;; now cache buffer
  	  (setq from (mew-header-parse-address mew-from:))
- 	  (setq reply-to (mew-header-parse-address mew-reply-to:))
  	  (cond 
  	   (onlytofrom (setq to from))
  	   ((mew-is-my-address (mew-get-my-address-regex-list) from)
--- 1203,1208 ----
***************
*** 1195,1211 ****
  	    (setq fromme t)
  	    (setq to (mew-header-parse-address-list2 mew-fromme-to-list))
  	    (setq cc (mew-header-parse-address-list2 mew-fromme-cc-list))
! 	    (if (null to) (setq to (or reply-to from)))) ;; don't use list
  	   (t
! 	    (cond 
! 	     (reply-to
! 	      (setq to (mew-header-parse-address-list2 mew-replyto-to-list))
! 	      (setq cc (mew-header-parse-address-list2 mew-replyto-cc-list)))
! 	     (t
! 	      (setq to (mew-header-parse-address-list2 mew-noreplyto-to-list))
! 	      (setq cc (mew-header-parse-address-list2 mew-noreplyto-cc-list))))))
! 	  (setq newsgroups (or (mew-header-get-value mew-followup-to:)
! 			       (mew-header-get-value mew-newsgroups:)))
  	  (if (and newsgroups (mew-case-equal newsgroups "poster"))
  	      (setq newsgroups nil))
  	  (setq subject (mew-header-get-value mew-subj:))
--- 1210,1252 ----
  	    (setq fromme t)
  	    (setq to (mew-header-parse-address-list2 mew-fromme-to-list))
  	    (setq cc (mew-header-parse-address-list2 mew-fromme-cc-list))
! 	    (if (null to) (setq to (or (mew-header-parse-address mew-reply-to:)
! 				       from)))) ;; don't use list
! 	   ((or (equal mew-default-reply-key: (this-command-keys))
! 		(equal mew-default-reply-citation-key: (this-command-keys)))
! 	    )
  	   (t
! 	    (setq flug_m t)
! 	    (setq flug_n t)
! 	    (while alist
! 	      (setq flug flug_m)
! 	      (setq header (nth 0 (car alist)))
! 	      (setq tocc (nth 1 (car alist)))
! 	      (setq news (nth 2 (car alist)))
! 	      (if (mew-header-parse-address header)
! 		  (progn
! 		    (if flug_m
! 			(progn
! 			  (setq to (append to (mew-header-parse-address-list2 (nth 0 tocc))))
! 			  (setq cc (append cc (mew-header-parse-address-list2 (nth 1 tocc))))
! 			  (if (null (nth 2 tocc))
! 			      (setq flug_m nil))))
! 		    (if flug_n
! 			(progn
! 			  (setq newsgroups (append newsgroups (mew-header-parse-address-list2 (nth 0 news))))
! 			  (if (null (nth 1 news))
! 			      (setq flug_m nil))))
! 		    (if (or flug_m flug_n)
! 			(setq alist (cdr alist))
! 		      (setq alist nil)))
! 		(setq alist (cdr alist))))))
! 	  (if (null to)
! 	      (if cc
! 		 (progn 
! 		   (setq to cc)
! 		   (setq cc nil))
! 		(setq to (mew-header-parse-address-list2 mew-default-reply-to-list))
! 		(setq to (mew-header-parse-address-list2 mew-default-reply-cc-list))))
  	  (if (and newsgroups (mew-case-equal newsgroups "poster"))
  	      (setq newsgroups nil))
  	  (setq subject (mew-header-get-value mew-subj:))
-------------- next part --------------
*** mew-vars.el.orig	Mon Jun 19 14:04:51 2000
--- mew-vars.el	Mon Jun 19 15:06:59 2000
***************
*** 800,822 ****
  ;;; Temporary solution to decide To: when reply
  ;;;
  
! (defcustom mew-noreplyto-to-list (list mew-from:)
    "*To: field list picked at mew-summary-reply if Reply-To: doesn't exist."
    :group 'mew-reply
    :type '(repeat string))
  
! (defcustom mew-noreplyto-cc-list (list mew-to: mew-cc: mew-apparently-to:)
!   "Cc: field list picked at mew-summary-reply if Reply-To: doesn't exist."
!   :group 'mew-reply
!   :type '(repeat string))
! 
! (defcustom mew-replyto-to-list (list mew-reply-to: mew-from:)
!   "*To: field list picked at mew-summary-reply if Reply-To: exists."
!   :group 'mew-reply
!   :type '(repeat string))
! 
! (defcustom mew-replyto-cc-list (list mew-to: mew-cc: mew-apparently-to:)
!   "*Cc: field list picked at mew-summary-reply if Reply-To: exists."
    :group 'mew-reply
    :type '(repeat string))
  
--- 800,812 ----
  ;;; Temporary solution to decide To: when reply
  ;;;
  
! (defcustom mew-default-reply-to-list nil
    "*To: field list picked at mew-summary-reply if Reply-To: doesn't exist."
    :group 'mew-reply
    :type '(repeat string))
  
! (defcustom mew-default-reply-cc-list nil
!   "*To: field list picked at mew-summary-reply if Reply-To: doesn't exist."
    :group 'mew-reply
    :type '(repeat string))
  
***************
*** 830,835 ****
--- 820,840 ----
    :group 'mew-reply
    :type '(repeat string))
    
+ (defcustom mew-summary-reply-list
+   (list
+    (list mew-reply-to:
+ 	 (list (list mew-reply-to:) nil t)
+ 	 (list nil t))
+    (list mew-followup-to:
+ 	 (list nil nil t)
+ 	 (list (list mew-followup-to:) t))
+    (list t
+ 	 (list (list mew-from:) (list mew-to: mew-cc: mew-apparently-to:) nil)
+ 	 (list (list mew-newsgroups:) nil)))
+   ""
+   :group 'mew-reply
+   :type 'sexp)
+ 
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
  ;;; Attachments


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