[Mew-dist 16446] Re: E でのメールアドレス

Tatsuya Kinoshita tatsuyak at example.com
2001年 2月 18日 (日) 09:51:05 JST


In message "[Mew-dist 16442] E でのメールアドレス"
早間義博 <yossi at example.com> wrote:

>  mew-config-alist
> で指定されている default 以外で メールの編集(E)を実行すると
> 送信の設定が default に戻るというのが仕様ですか。

+queue以外にあるメールについて、再編集の際に、現状のcaseがヘッダへ
反映されず、caseとヘッダが一致しない状態になる、という不具合があり
ます。

ad hocな対策として、[Mew-dist 14990]のパッチを当てる方法があります。
そのままだとrejectされるので、b106にも適用できるパッチを添付してお
きます。

なお、+queueにあるメールの再編集だと、+queueに保存した時点のcaseや
ヘッダに復帰してくれます。+draftについても、+queueと同じような動作
になってくれた方が良いのかもしれません。

そのほか、+draftに保存した添付ファイルが再編集できない、再編集時
にエラーになる場合がある、といった不具合が見つかっており、再編集、
Configなど、ドラフトモード関連は今後の課題になっているはずです。

-- 
木下達也 (Tatsuya Kinoshita)
-------------- next part --------------

 This patch is written by Tatsuya Kinoshita.

 Permission is granted to use, copy, distribute, and/or modify it 
 without restriction.  There is NO WARRANTY.

diff -ur mew-1.95b104/mew-config.el mew-1.95b104-tats20010215/mew-config.el
--- mew-1.95b104/mew-config.el	Mon Feb 12 22:23:03 2001
+++ mew-1.95b104-tats20010215/mew-config.el	Thu Feb 15 23:17:56 2001
@@ -278,18 +278,18 @@
 you can modify the locally stored value. Then this command replace
 fields in the header according to the new value."
   (interactive "P")
+  (mew-draft-set-config-and-replace-header 
+   (if arg
+       (mew-input-config mew-draft-buffer-config "This draft" 'edit)
+     (mew-input-config (mew-draft-get-config-by-guess) "This draft"))))
+
+(defun mew-draft-set-config-and-replace-header (new-config)
   (let ((old-config mew-draft-buffer-config))
-    (setq mew-draft-buffer-config
-	  (if arg
-	      (mew-input-config mew-draft-buffer-config "This draft" 'edit)
-	    (mew-input-config
-	     (or (mew-draft-get-config-by-guess) mew-config-output)
-	     "This draft")))
+    (setq mew-draft-buffer-config new-config)
     (mew-draft-mode-name mew-header-message)
     (save-excursion
       (goto-char (point-min))
-      (let ((new-config mew-draft-buffer-config) ;; save length
-	    from dcc)
+      (let (from dcc)
 	(cond
 	 ((re-search-forward "^Resent" (mew-header-end) t)
 	  (setq from mew-resent-from:)
@@ -321,11 +321,7 @@
   (let ((cfgs (mew-refile-guess-by-alist1 mew-config-guess-alist)))
     (if cfgs
 	(mew-join "," cfgs)
-      nil)))
-
-(defun mew-draft-set-config-by-guess ()
-  (let ((cfg (mew-draft-get-config-by-guess)))
-    (if cfg (setq mew-draft-buffer-config cfg))))
+      mew-config-output)))
 
 (provide 'mew-config)
 
diff -ur mew-1.95b104/mew-draft.el mew-1.95b104-tats20010215/mew-draft.el
--- mew-1.95b104/mew-draft.el	Wed Feb 14 14:35:21 2001
+++ mew-1.95b104-tats20010215/mew-draft.el	Thu Feb 15 23:11:22 2001
@@ -338,7 +338,6 @@
 	  (mew-insert-address-list2 mew-cc: cc)
 	(mew-insert-address-list mew-cc: cc del nil))))
     (mew-draft-header-insert mew-newsgroups:  newsgroups)
-    (mew-draft-set-config-by-guess) ;; xxx
     (mew-draft-header-insert mew-cc:          (mew-cc case))
     (mew-draft-header-insert mew-subj:        (or subject ""))
     (mew-draft-header-insert mew-from:        (mew-from case))
@@ -731,6 +730,9 @@
   "Compose a MIME message then put it into a queue folder."
   (interactive)
   (run-hooks 'mew-send-hook)
+  (if mew-config-insert-when-composed
+      (mew-draft-set-config-and-replace-header
+       (mew-draft-get-config-by-guess)))
   (mew-draft-process-message 'queue privacy signer)
   (run-hooks 'mew-real-send-hook))
 
@@ -738,6 +740,9 @@
   "Compose a MIME message then send it."
   (interactive)
   (run-hooks 'mew-send-hook)
+  (if mew-config-insert-when-composed
+      (mew-draft-set-config-and-replace-header
+       (mew-draft-get-config-by-guess)))
   (if (or (not mew-ask-send)
 	  (y-or-n-p "Really send this message? "))
       (progn
diff -ur mew-1.95b104/mew-edit.el mew-1.95b104-tats20010215/mew-edit.el
--- mew-1.95b104/mew-edit.el	Wed Feb 14 14:35:21 2001
+++ mew-1.95b104-tats20010215/mew-edit.el	Thu Feb 15 23:11:22 2001
@@ -593,6 +593,8 @@
   (mew-summary-prepare-draft
    (mew-draft-find-and-switch (mew-expand-folder fld msg)) ;; mew-cs-m17n
    (mew-summary-edit-header-for-draft)
+   (if (not mew-config-insert-when-prepared)
+       (mew-draft-set-config-and-replace-header mew-config-output))
    (mew-draft-mode)
    (save-excursion
      (if (mew-encode-load-syntax)
@@ -629,6 +631,8 @@
    (mew-summary-edit-message fld msg part)
    ;; get info before backup the original
    (mew-summary-edit-header-for-message)
+   (if (not mew-config-insert-when-prepared)
+       (mew-draft-set-config-and-replace-header mew-config-output))
    (mew-draft-mode)
    (if mew-encode-syntax
        (save-excursion
diff -ur mew-1.95b104/mew-syntax.el mew-1.95b104-tats20010215/mew-syntax.el
--- mew-1.95b104/mew-syntax.el	Fri Feb  2 09:18:14 2001
+++ mew-1.95b104-tats20010215/mew-syntax.el	Thu Feb 15 23:11:22 2001
@@ -951,7 +951,10 @@
 
 (defsubst mew-header-prepared (&optional header)
   (mew-header-set (concat mew-header-separator "\n") header)
-  (mew-highlight-header)
+  (if mew-config-insert-when-prepared
+      (mew-draft-set-config-and-replace-header
+       (mew-draft-get-config-by-guess))
+    (mew-highlight-header))
   (if (null header) (mew-draft-header-keymap)))
 
 (defsubst mew-draft-header-keymap ()
diff -ur mew-1.95b104/mew-vars.el mew-1.95b104-tats20010215/mew-vars.el
--- mew-1.95b104/mew-vars.el	Thu Feb 15 00:08:16 2001
+++ mew-1.95b104-tats20010215/mew-vars.el	Thu Feb 15 23:11:22 2001
@@ -1440,6 +1440,14 @@
   "*If *non-nil*, this value is used to guess values of the Config: field.
 The syntax is exactly the same as 'mew-refile-guess-alist'.")
 
+(defvar mew-config-insert-when-prepared nil 
+  "*If *non-nil*, the Config is inserted according to
+'mew-config-guess-alist' when the draft is prepared.")
+
+(defvar mew-config-insert-when-composed nil
+  "*If *non-nil*, the Config is inserted according to
+'mew-config-guess-alist' when the message is composed.")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; Delete


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