[mew-dist 21489] Re: mew-dir-messages

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
2002年 8月 20日 (火) 11:18:35 JST


From: Kazu Yamamoto (山本和彦) <kazu at example.com>
Subject: [mew-dist 21488] Re: mew-dir-messages

> (1) 引数のディレクトリを expand-file (必要なら default-directory が使
>     われる)して、default-file-name-coding-system で符号化します。
> 
> (2) default-file-name-coding-system と file-name-coding-system を nil 
>     に束縛し、符号化したディレクトリに対し、directory-files します。
> 
> pick の引数を符号化するのと似てますよね? それで、今回の質問になった訳
> です。

作りました。恐いので、まだ commit していません。

日本語のフォルダ名をお使いの方:

anon cvs のバージョンに以下のパッチを当てて、うまく動くか試して下さい。
日本語のフォルダ名において、次のメールの番号がうまく算出できるかのテス
トですので、あるメールを日本語のフォルダへ refile するだけで十分です。

"x" が速いと感じるようになっていると嬉しいのですが。

--かず

Index: mew-func.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-func.el,v
retrieving revision 1.79
diff -c -r1.79 mew-func.el
*** mew-func.el	2002/07/31 05:06:54	1.79
--- mew-func.el	2002/08/20 02:13:44
***************
*** 621,631 ****
      (concat (file-name-as-directory folder) subfolder)))
  
  (defsubst mew-dir-messages (dir)
!   ;; (default-file-name-coding-system nil)
!   ;; (file-name-coding-system nil)
!   ;; This makes scan faster but makes non-ASCII directories
!   ;; unavailable.
!   (directory-files dir nil mew-regex-message-files 'no-sort))
  
  (defun mew-folder-new-message (folder &optional num-only)
    (let* ((dir (mew-expand-folder folder))
--- 621,636 ----
      (concat (file-name-as-directory folder) subfolder)))
  
  (defsubst mew-dir-messages (dir)
!   ;; directory_files uses ENCODE_FILE() for DIR and
!   ;;                      DECODE_FILE() for results(FILES).
!   ;; Both ENCODE_FILE() and DECODE_FILE() are too slow.
!   ;; If {default-,}file-name-coding-system are bound to nil, 
!   ;; they are skipped, resulting speed up.
!   ;; So, we need to encode DIR by Emacs Lisp.
!   (let ((edir (expand-file-name dir)))
!     (setq edir (mew-cs-encode-string edir default-file-name-coding-system))
!     (mew-alet
!      (directory-files dir nil mew-regex-message-files 'no-sort))))
  
  (defun mew-folder-new-message (folder &optional num-only)
    (let* ((dir (mew-expand-folder folder))
Index: mew-mule0.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-mule0.el,v
retrieving revision 1.5
diff -c -r1.5 mew-mule0.el
*** mew-mule0.el	2002/03/14 07:11:34	1.5
--- mew-mule0.el	2002/08/20 02:13:44
***************
*** 86,94 ****
  (defmacro mew-piolet (input output &rest body)
    `(progn , at example.com))
  
- (defmacro mew-pioalet (input output arg &rest body)
-   `(progn , at example.com))
- 
  (defmacro mew-flet (&rest body)
    `(let ((jka-compr-inhibit t))
       , at example.com))
--- 86,91 ----
***************
*** 96,101 ****
--- 93,101 ----
  (defmacro mew-frwlet (read write &rest body)
    `(let ((jka-compr-inhibit t))
       , at example.com))
+ 
+ (defmacro mew-alet (&rest body)
+   `(progn , at example.com))
  
  ;;
  ;;
Index: mew-mule3.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-mule3.el,v
retrieving revision 1.20
diff -c -r1.20 mew-mule3.el
*** mew-mule3.el	2002/04/15 03:26:42	1.20
--- mew-mule3.el	2002/08/20 02:13:44
***************
*** 193,204 ****
  	 (coding-system-for-write ,write))
       , at example.com))
  
- (defmacro mew-pioalet (read write arg &rest body)
-   `(let ((coding-system-for-read  ,read)
- 	 (coding-system-for-write ,write)
- 	 (file-name-coding-system ,arg))
-      , at example.com))
- 
  (defmacro mew-flet (&rest body)
    `(let ((coding-system-for-read  'binary)
  	 (coding-system-for-write 'binary)
--- 193,198 ----
***************
*** 213,218 ****
--- 207,217 ----
  	 (format-alist nil)
  	 (auto-image-file-mode nil)
  	 (jka-compr-inhibit t))
+      , at example.com))
+ 
+ (defmacro mew-alet (&rest body)
+   `(let ((default-file-name-coding-system nil)
+ 	 (file-name-coding-system nil))
       , at example.com))
  
  ;;
Index: mew-pick.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-pick.el,v
retrieving revision 1.18
diff -c -r1.18 mew-pick.el
*** mew-pick.el	2002/04/01 04:25:44	1.18
--- mew-pick.el	2002/08/20 02:13:45
***************
*** 127,134 ****
  	(cd dir)
  	(mew-piolet
  	 mew-cs-text-for-read mew-cs-text-for-write
! 	 (let ((file-name-coding-system nil)) ;; for XEmacs
! 	   (funcall mew-summary-pick-with-external-function pattern msgs)))
  	(goto-char (point-min))
  	(setq msgs nil)
  	(while (not (eobp))
--- 127,134 ----
  	(cd dir)
  	(mew-piolet
  	 mew-cs-text-for-read mew-cs-text-for-write
! 	 (mew-alet
! 	  (funcall mew-summary-pick-with-external-function pattern msgs)))
  	(goto-char (point-min))
  	(setq msgs nil)
  	(while (not (eobp))
Index: mew-virtual.el
===================================================================
RCS file: /cvsroot/mew/mew/mew-virtual.el,v
retrieving revision 1.30
diff -c -r1.30 mew-virtual.el
*** mew-virtual.el	2002/08/14 06:43:39	1.30
--- mew-virtual.el	2002/08/20 02:13:45
***************
*** 105,113 ****
  	(mew-erase-buffer)
  	(mew-piolet
  	 mew-cs-text-for-read mew-cs-text-for-write
! 	 (let ((file-name-coding-system nil)) ;; for XEmacs
! 	   (setq file (funcall mew-summary-virtual-with-external-function
! 			       folders pattern)))))
        (mew-remove-buffer buf)
        (setq func `(lambda () (if (file-exists-p ,file) (delete-file ,file))))
        (setq opts (list "-i" file))
--- 105,113 ----
  	(mew-erase-buffer)
  	(mew-piolet
  	 mew-cs-text-for-read mew-cs-text-for-write
! 	 (mew-alet
! 	  (setq file (funcall mew-summary-virtual-with-external-function
! 			      folders pattern)))))
        (mew-remove-buffer buf)
        (setq func `(lambda () (if (file-exists-p ,file) (delete-file ,file))))
        (setq opts (list "-i" file))



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