anything-etags.elで二階層より上のディレクトリにTAGSファイルがあると無限ループになる?
詳しく調査していないので間違ってたらごめんなさい。
anything-etags-enable-tag-file-dir-cache が nil の状態で、 anything-etags-get-tag-file 関数が呼ばれたとき、TAGSファイルが二階層以上上のディレクトリにあると無限ループになっているような気がします。
ちょっと直してみたのでpatch貼っておきます。
--- /Users/imakado/c/codecheckin/lang/elisp/anything-etags/trunk/anything-etags.el 2009-02-01 01:41:27.000000000 +0900 +++ /Users/imakado/c/.emacs.d/elisp/anything/anything-etags.el 2009-02-01 01:29:41.000000000 +0900 @@ -247,11 +247,28 @@ (let ((current-dir default-directory)) ;; Try to search tag file with up directories ;; if current directory is not found. - (while (and (not (file-exists-p (concat current-dir anything-etags-tag-file-name))) - (not (equal current-dir ""))) - (setq current-dir (file-name-directory (substring default-directory 0 -1)))) - (setq anything-etags-tag-file-dir current-dir) ;set tag file directory - (concat current-dir anything-etags-tag-file-name)))) + + ;; return nil if not find tag file. + (let ((current-dir (anything-etags-get-tag-file-updir current-dir))) + (when current-dir + (setq anything-etags-tag-file-dir current-dir) ;set tag file directory + (concat current-dir anything-etags-tag-file-name)))))) + +(defun anything-etags-find-tag-file-updir (current-dir) + (let ((file-exists? (lambda (dir) + (let ((tag-path (concat dir anything-etags-tag-file-name))) + (and (stringp tag-path) + (file-exists-p tag-path) + (file-readable-p tag-path)))))) + (loop with count = 0 + until (funcall file-exists? current-dir) + if (= count 10) ;limit + do (return nil) + else + do (progn (incf count) + (setq current-dir (expand-file-name (concat current-dir "../")))) + finally return current-dir))) + (defun anything-etags-generate-tag-buffer (&optional tag-file) "Generate Etags tag buffer with TAG-FILE.