 (defvar textmate-use-file-cache t
   "* Should `textmate-goto-file' keep a local cache of files?")
 
-(defvar textmate-completing-library 'ido 
+(defvar textmate-completing-library 'ido
   "The library `textmade-goto-symbol' and `textmate-goto-file' should use for completing filenames and symbols (`ido' by default)")
 
-(defvar *textmate-completing-function-alist* '((ido ido-completing-read) 
-                                               (icicles  icicle-completing-read) 
-                                               (none completing-read)) 
+(defvar *textmate-completing-function-alist* '((ido ido-completing-read)
+                                               (icicles  icicle-completing-read)
+                                               (none completing-read))
   "The function to call to read file names and symbols from the user")
 
-(defvar *textmate-completing-minor-mode-alist* 
-  `((ido ,(lambda (a) (progn (ido-mode a) (setq ido-enable-flex-matching t)))) 
-    (icicles ,(lambda (a) (icy-mode a))) 
+(defvar *textmate-completing-minor-mode-alist*
+  `((ido ,(lambda (a) (progn (ido-mode a) (setq ido-enable-flex-matching t))))
+    (icicles ,(lambda (a) (icy-mode a)))
     (none ,(lambda (a) ())))
   "The list of functions to enable and disable completing minor modes")
 
 (defvar *textmate-mode-map* (make-sparse-keymap))
 (defvar *textmate-project-root* nil)
 (defvar *textmate-project-files* '())
-(defvar *textmate-gf-exclude* 
+(defvar *textmate-gf-exclude*
   "/\\.|vendor|fixtures|tmp|log|build|\\.xcodeproj|\\.nib|\\.framework|\\.app|\\.pbproj|\\.pbxproj|\\.xcode|\\.xcodeproj|\\.bundle")
 
-(defvar *textmate-keybindings-list* `((textmate-next-line 
+(defvar *textmate-keybindings-list* `((textmate-next-line
                                      [A-return]    [M-return])
-                                     (textmate-clear-cache 
+                                     (textmate-clear-cache
                                       ,(kbd "A-M-t") [(control c)(control t)])
-                                     (align 
+                                     (align
                                       ,(kbd "A-M-]") [(control c)(control a)])
-                                     (indent-according-to-mode 
+                                     (indent-according-to-mode
                                       ,(kbd "A-M-[") nil)
-                                     (indent-region 
+                                     (indent-region
                                       ,(kbd "A-]")   [(control tab)])
-                                     (comment-or-uncomment-region-or-line 
+                                     (comment-or-uncomment-region-or-line
                                       ,(kbd "A-/")   [(control c)(control k)])
-                                     (textmate-goto-file 
+                                     (textmate-goto-file
                                       ,(kbd "A-t")   [(meta t)])
-                                     (textmate-goto-symbol 
-                                      ,(kbd "A-T")   [(meta T)])))
+                                     (textmate-goto-symbol
+                                      ,(kbd "A-T")   [(meta T)])
+				     (textmate-toggle-camel-case
+				      ,(kbd "C-_")   [(control _)])))
+
+(defvar *textmate-project-root-p*
+  #'(lambda (coll) (or (member ".git" coll)
+                       (member ".hg" coll)
+                       (member "prj.el" coll)
+                       ))
+  "*Lambda that, given a collection of directory entries, returns
+  non-nil if it represents the project root.")
+
+(defvar *textmate-find-in-project-default* nil)
+(defvar *textmate-find-in-project-type-default* nil)
 
 ;;; Bindings
 

(defun textmate-find-project-root (&optional root)
  (when (null root) (setq root default-directory))
  (cond
   ((member ".git" (directory-files root)) (expand-file-name root))
   ((equal (expand-file-name root) "/") nil)
   (t (textmate-find-project-root (concat (file-name-as-directory root) "..")))))


                             (cond
                              ((and (listp symbol) (imenu--subalist-p symbol))
                               (addsymbols symbol))

                              ((listp symbol)
                               (setq name (car symbol))
                               (setq position (cdr symbol)))

                              ((stringp symbol)
                               (setq name symbol)
                               (setq position (get-text-property 1 'org-imenu-marker symbol))))

                             (unless (or (null position) (null name))
                               (add-to-list 'symbol-names name)
                               (add-to-list 'name-and-pos (cons name position))))))))
