help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting up filecache and ido


From: address@hidden
Subject: setting up filecache and ido
Date: Sun, 2 Nov 2008 23:12:07 -0800 (PST)
User-agent: G2/1.0

Hi,

I am trying to following this:
http://sachachua.com/wp/2008/07/27/eclipse-to-emacs-navigating-your-source-tree/#comment-103149

to setup my emacs with etag.

But when I include the following in my emacs.
emacs goes up to 100% cpu for > 5 minutes.  Can you please tell me how
can I fix my problem?

Thank you.

(require 'filecache)
(require 'ido)
(defun file-cache-ido-find-file (file)
  "Using ido, interactively open file from file cache'.
First select a file, matched using ido-switch-buffer against the
contents
in `file-cache-alist'. If the file exist in more than one
directory, select directory. Lastly the file is opened."
  (interactive (list (file-cache-ido-read "File: "
                                          (mapcar
                                           (lambda (x)
                                             (car x))
                                           file-cache-alist))))
  (let* ((record (assoc file file-cache-alist)))
    (find-file
     (expand-file-name
      file
      (if (= (length record) 2)
          (car (cdr record))
        (file-cache-ido-read
         (format "Find %s in dir: " file) (cdr record)))))))

(defun file-cache-ido-read (prompt choices)
  (let ((ido-make-buffer-list-hook
         (lambda ()
           (setq ido-temp-list choices))))
    (ido-read-buffer prompt)))

(ido-mode t)
;; Change this to filter out your version control files
(add-to-list 'file-cache-filter-regexps "\\.svn-base$")
(if drupal-project-path
    (file-cache-add-directory-using-find drupal-project-path))

(global-set-key (kbd "ESC ESC f") 'file-cache-ido-find-file)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]