[mew-dist 22320] Re: case value is not taken into account in thread mode

Hideyuki SHIRAI ( 白井秀行 ) shirai at example.com
2002年 11月 21日 (木) 12:29:23 JST


From: Kazu Yamamoto (山本和彦) <kazu at example.com> さん曰く
Subject: [mew-dist 22319] Re: case value is not taken into account in thread mode
Message-ID: <20021121.085304.68534462.kazu at example.com>
Date: Thu, 21 Nov 2002 08:53:04 +0900 (JST)

> > thread mode にいるときに、'g' した場合、case の値が考慮されないようで
> > す。
> 
> 問題は二つ:
> 
> (1) thread フォルダには case がコピーされないので、"g" の初期値に case 
>     が現れない。以下のパッチで直ります。

かずさんのパッチに加えて、mew-proto-to-body() へのパッチもあてた
方が幸せだと思われます。

使用前: (mew-proto-to-go "*case:%hoge") => "+"
使用後: (mew-proto-to-go "*case:%hoge") => "%"

> (2) thread を含む virtual フォルダで、$,%,- を打っても mew-input-case 
>     が補完されない。こっちは決めの問題。どうしましょう?

## "g" => "%" したときですよね? 補完されるけど。。。

というわけで、勘違いしているかもしれないけど、(文章で説明しにく
いので) mew-virtual.el へのパッチのように、Virtual folder の対象
フォルダの最初の remote folder の case を使うのはどうでしょうか?

(mew-summary-virtual-get-case '("foo:%hoge" "+hoge" "bar:%hoge"))
=> "foo"

(mew-summary-virtual-get-case '("+hoge" "foo:%hoge" "bar:%hoge"))
=>"foo"

(mew-summary-virtual-get-case '("+hoge" "%hoge" "bar:%hoge"))
=> nil

(1) へのパッチと合わせると、"g" のときに最初に指定してある
folder の proto を使うようになります。
これ、mew-ask-virtual-folder-name => t で名前を変えられると弱い
けど。

# mew-proto-spec の意味をやっと理解した ^^;;;

-- 
白井秀行 (mailto:shirai at example.com)
-------------- next part --------------
Index: mew-vars2.el
===================================================================
RCS file: /cvsroot/shirai/mew/mew/mew-vars2.el,v
retrieving revision 1.98
diff -c -r1.98 mew-vars2.el
*** mew-vars2.el	8 Nov 2002 10:05:32 -0000	1.98
--- mew-vars2.el	21 Nov 2002 03:23:08 -0000
***************
*** 868,876 ****
      ("-" "-" nil "-")))
  
  (defun mew-proto-to-body (fld n)
-   (setq fld (mew-folder-folder fld))
    (if (mew-folder-virtualp fld)
        (setq fld (mew-thread-to-folder fld)))
    (let ((proto (mew-folder-prefix fld)))
      (unless (member proto mew-folder-prefixes)
        (setq proto (mew-proto))) ;; default proto
--- 868,876 ----
      ("-" "-" nil "-")))
  
  (defun mew-proto-to-body (fld n)
    (if (mew-folder-virtualp fld)
        (setq fld (mew-thread-to-folder fld)))
+   (setq fld (mew-folder-folder fld))
    (let ((proto (mew-folder-prefix fld)))
      (unless (member proto mew-folder-prefixes)
        (setq proto (mew-proto))) ;; default proto
-------------- next part --------------
Index: mew-virtual.el
===================================================================
RCS file: /cvsroot/shirai/mew/mew/mew-virtual.el,v
retrieving revision 1.50
diff -c -r1.50 mew-virtual.el
*** mew-virtual.el	12 Nov 2002 00:22:16 -0000	1.50
--- mew-virtual.el	21 Nov 2002 03:23:15 -0000
***************
*** 72,87 ****
        (setq vfolder (mew-folder-to-virtual vfolder)))
      vfolder))
  
  (defun mew-summary-virtual-with-internal ()
    "Create Virtual mode with mewls."
    (let* ((flds (mew-input-folders (mew-summary-folder-name)))
! 	 folders vfolder pattern opts lra)
      (when flds
        (setq folders (mapcar 'mew-folder-remote-to-local flds))
        (setq pattern (mew-input-pick-pattern))
        (setq vfolder (mew-summary-get-vfolder flds))
        (mew-summary-switch-to-folder vfolder)
        (when (mew-summary-exclusive-p)
  	(while folders
  	  (setq opts (cons (car folders) (cons "-s" opts)))
  	  (setq lra (cons (cons (car folders) (car flds)) lra))
--- 72,99 ----
        (setq vfolder (mew-folder-to-virtual vfolder)))
      vfolder))
  
+ (defun mew-summary-virtual-get-case (folders)
+   (let (case)
+     (catch 'detcase
+       (while folders
+ 	(if (setq case (car (mew-folder-case (car folders))))
+ 	    (throw 'detcase case)
+ 	  (if (mew-folder-remotep (car folders))
+ 	      (throw 'detcase nil)))
+ 	(setq folders (cdr folders))))))
+ 
  (defun mew-summary-virtual-with-internal ()
    "Create Virtual mode with mewls."
    (let* ((flds (mew-input-folders (mew-summary-folder-name)))
! 	 case folders vfolder pattern opts lra)
      (when flds
+       (setq case (mew-summary-virtual-get-case flds))
        (setq folders (mapcar 'mew-folder-remote-to-local flds))
        (setq pattern (mew-input-pick-pattern))
        (setq vfolder (mew-summary-get-vfolder flds))
        (mew-summary-switch-to-folder vfolder)
        (when (mew-summary-exclusive-p)
+ 	(mew-sinfo-set-case case)
  	(while folders
  	  (setq opts (cons (car folders) (cons "-s" opts)))
  	  (setq lra (cons (cons (car folders) (car flds)) lra))
***************
*** 100,112 ****
    (interactive)
    (let* ((flds (mew-input-folders (mew-summary-folder-name)))
  	 (buf (generate-new-buffer mew-buffer-prefix))
! 	 folders vfolder pattern file func opts lra)
      (when flds
        (setq folders (mapcar 'mew-folder-remote-to-local flds))
        (setq pattern (mew-input-grep-pattern))
        (setq vfolder (mew-summary-get-vfolder flds))
        (mew-summary-switch-to-folder vfolder)
        (when (mew-summary-exclusive-p)
  	(save-excursion
  	  (set-buffer buf)
  	  (mew-erase-buffer)
--- 112,126 ----
    (interactive)
    (let* ((flds (mew-input-folders (mew-summary-folder-name)))
  	 (buf (generate-new-buffer mew-buffer-prefix))
! 	 case folders vfolder pattern file func opts lra)
      (when flds
+       (setq case (mew-summary-virtual-get-case flds))
        (setq folders (mapcar 'mew-folder-remote-to-local flds))
        (setq pattern (mew-input-grep-pattern))
        (setq vfolder (mew-summary-get-vfolder flds))
        (mew-summary-switch-to-folder vfolder)
        (when (mew-summary-exclusive-p)
+ 	(mew-sinfo-set-case case)
  	(save-excursion
  	  (set-buffer buf)
  	  (mew-erase-buffer)


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