[mew-dist 26483] Re: spotlight
Hideyuki SHIRAI ( 白井秀行 )
shirai at example.com
2005年 7月 8日 (金) 12:40:29 JST
From: Kazu Yamamoto (山本和彦) <kazu at example.com> さん曰く
Subject: [mew-dist 26481] Re: spotlight
Message-ID: <20050708.120957.40786255.kazu at example.com>
Date: Fri, 08 Jul 2005 12:09:57 +0900 (JST)
> > (defun mew-nmz-transit-folder ()
>
> これはどう取り込めばいいですか?
> パッチにして頂けるとありがたいです。
了解。動かすタイミングを(いろいろと使っているので) status の
update 後にしてみました。
> ゆっくり時間をとって、[mew-dist 26404] なども検討したいのですが、
あぁ、あれかぁ。本人も忘れていました。
方針させ問題なければ、ちゃんと作りこみますよ。
--
白井秀行 (mailto:shirai at example.com)
-------------- next part --------------
? .cvsignore
Index: mew-nmz.el
===================================================================
RCS file: /cvsmew/mew/mew-nmz.el,v
retrieving revision 1.26
diff -u -r1.26 mew-nmz.el
--- mew-nmz.el 16 Jun 2005 04:48:09 -0000 1.26
+++ mew-nmz.el 8 Jul 2005 03:36:18 -0000
@@ -915,7 +915,7 @@
(mew-circular-complete-function 'mew-circular-complete-case:)
(mew-input-folder-search-multi t)
;; mew-inherit-case must be nil
- (ret (read-from-minibuffer "Namazu folder name: "
+ (ret (read-from-minibuffer "Taget folder for Namazu: "
init map nil
'mew-nmz-input-folder-hist)))
(when (string= ret "")
@@ -1466,6 +1466,54 @@
(call-process mew-nmz-prog-rfnmz nil nil nil dir))
(message "mew-nmz: reindexing %s...done" dir)))
+;; Spotlight does not handle Files/Directories starting with ".".
+(defun mew-nmz-transit-folder ()
+ (let ((alist mew-transit-folder-alist)
+ transit-occur
+ ent olddir newdir oldnmz newnmz
+ dirs subold subnew)
+ (with-temp-buffer
+ (while alist
+ (setq ent (car alist))
+ (setq alist (cdr alist))
+ (setq oldnmz (mew-nmz-expand-folder (nth 0 ent)))
+ (setq newnmz (mew-nmz-expand-folder (nth 1 ent)))
+ (setq olddir (mew-expand-folder (nth 0 ent)))
+ (setq newdir (mew-expand-folder (nth 1 ent)))
+ (when (and (file-directory-p oldnmz) (not (file-exists-p newnmz)))
+ (rename-file oldnmz newnmz)
+ (cd newnmz)
+ (setq dirs (directory-files "."))
+ (while dirs
+ (setq subold (car dirs))
+ (setq dirs (cdr dirs))
+ ;; % is a special character for URL.
+ ;; And "open" does not convert % to %25, sigh.
+ (when (string-match "@[^%]+\\(%\\)" subold)
+ (setq transit-occur t)
+ (setq subnew (copy-sequence subold))
+ (aset subnew (match-beginning 1) ?#)
+ (rename-file subold subnew)
+ (mew-nmz-transit-folder-uri (expand-file-name subnew newnmz)
+ (expand-file-name subold olddir)
+ (expand-file-name subnew newdir))))))
+ (when transit-occur
+ (mew-nmz-clean-up 'remove)))))
+
+(defun mew-nmz-transit-folder-uri (dir old new)
+ (when mew-nmz-use-drive-letter
+ (when (string-match "^\\([a-zA-Z]\\):\\(/.*\\)" old)
+ (setq old (concat "/"
+ (substring old (match-beginning 1) (match-end 1))
+ "|"
+ (substring old (match-beginning 2) (match-end 2)))))
+ (when (string-match "^\\([a-zA-Z]\\):\\(/.*\\)" new)
+ (setq new (concat "/"
+ (substring new (match-beginning 1) (match-end 1))
+ "|"
+ (substring new (match-beginning 2) (match-end 2))))))
+ (mew-nmz-folder-reindex-recursively dir old new))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; mew-nmz-setup
Index: mew.el
===================================================================
RCS file: /cvsmew/mew/mew.el,v
retrieving revision 1.268
diff -u -r1.268 mew.el
--- mew.el 6 Jul 2005 07:01:30 -0000 1.268
+++ mew.el 8 Jul 2005 03:36:18 -0000
@@ -159,6 +159,7 @@
(run-hooks 'mew-init-hook)
(mew-transit-folder)
(mew-status-update t)
+ (mew-nmz-transit-folder)
(mew-passwd-setup)
(mew-highlight-timer-setup)
(setq mew-init-p t)
Mew-dist メーリングリストの案内