Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

alternate find-file-in-project

  • Loading branch information...
commit eaed83925d6e5d0c3b324d54ec8fc7e0dfe97a2b 1 parent 71ca016
@ajkovar authored
View
28 find-file-in-project-extension.el
@@ -0,0 +1,28 @@
+(require 'find-file-in-project)
+
+;; alternate implentation of file-file-in-project
+(defun directory-files-recursive (directory)
+ (let ((files (mapcar (lambda (file)
+ ;; add full path
+ (concat (file-name-as-directory directory) file))
+ ;; remove hidden directories
+ (remove-if (lambda (file)
+ (string= (subseq file 0 1) "."))
+ (directory-files directory))))
+ subdirectory-files)
+ (dolist (file files)
+ (if (file-directory-p file)
+ (setq subdirectory-files (append subdirectory-files (directory-files-recursive file)))))
+ (setq files (remove-if 'file-directory-p files))
+ (setq files (append files subdirectory-files))))
+
+(defun find-file-in-project-wrapper ()
+ "Wrapper around find-file-in-project to speed it up when there is no filter on file types to be searched"
+ (interactive)
+ (if ffip-patterns
+ (find-file-in-project)
+ (let ((file (ido-completing-read "Choose recent file: " (directory-files-recursive (ffip-project-root)) nil t)))
+ (when file
+ (find-file file)))))
+
+(provide 'find-file-in-project-extension)
View
1  init.el
@@ -63,6 +63,7 @@
(require 'starter-kit-js)
(require 'vimpulse)
(require 'grep-find-project)
+(require 'find-file-in-project-extension)
(regen-autoloads)
(load custom-file 'noerror)
View
2  starter-kit-bindings.el
@@ -92,7 +92,7 @@
(define-key global-map "\C-ca" 'org-agenda)
(global-set-key (kbd "<f5> f") 'grep-find-project)
-(global-set-key (kbd "<f5> r") 'find-file-in-project)
+(global-set-key (kbd "<f5> r") 'find-file-in-project-wrapper)
(provide 'starter-kit-bindings)
;;; starter-kit-bindings.el ends here
View
4 starter-kit-defuns.el
@@ -96,12 +96,16 @@ Symbols matching the text at point are put first in the completion list."
nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
1 font-lock-warning-face t))))
+(defun adjust-ffip-patterns ()
+ (set (make-local-variable 'ffip-patterns) nil))
+
(add-hook 'coding-hook 'local-column-number-mode)
(add-hook 'coding-hook 'turn-on-hl-line-mode)
(add-hook 'coding-hook 'turn-on-save-place-mode)
(add-hook 'coding-hook 'pretty-lambdas)
(add-hook 'coding-hook 'add-watchwords)
(add-hook 'coding-hook 'turn-on-idle-highlight)
+(add-hook 'coding-hook 'adjust-ffip-patterns)
(defun run-coding-hook ()
"Enable things that are convenient across all coding buffers."
Please sign in to comment.
Something went wrong with that request. Please try again.