# HG changeset patch # User Augie Fackler # Date 1480447291 18000 # Node ID b460b464f9d2857beede1a74e581c38b24c14293 # Parent 97f12f43f73b793f8d27696a4fb8134f12e05e99 textmate.el: set default-directory instead of adding a 'cd' command This fixes textmate.el with TRAMP. diff --git a/.elisp/textmate.el b/.elisp/textmate.el --- a/.elisp/textmate.el +++ b/.elisp/textmate.el @@ -290,8 +290,8 @@ project root directory before starting t (let ((root (textmate-project-root))) (when (null root) (error "Not in a project area.")) - (let ((realcommand (concat "cd " root " ; " command))) - (compilation-start realcommand mode name-function highlight-regexp)))) + (let ((default-directory root)) + (compilation-start command mode name-function highlight-regexp)))) (defun textmate-compile () "Run a command in compilation-mode rooted at the project root." @@ -387,28 +387,30 @@ specific type of file." (defun textmate-project-files (root) "Finds all files in a given project using either hg, git, or find." - (let ((type (textmate-project-root-type root))) + (let ((type (textmate-project-root-type root)) + (default-directory root)) (cond ((string= type "git") (split-string - (shell-command-to-string - (concat "cd " root " && git ls-files")) "\n" t)) - ((string= type "hg") (split-string - (shell-command-to-string - (concat "cd " root " && hg locate 'set:added() or modified() or clean()'")) "\n" t)) + (shell-command-to-string + "git ls-files") "\n" t)) + ((string= type "hg") + (split-string + (shell-command-to-string + "hg locate 'set:not(ignored() or removed() or unknown())'") + "\n" t)) ((string= type "unknown") (textmate-cached-project-files-find root)) ))) (defun textmate-project-files-find (root) "Finds all files in a given project using find." - (split-string - (shell-command-to-string - (concat - "find " - root - " -type f | grep -vE '" - *textmate-gf-exclude* - "' | sed 's:" - *textmate-project-root* - "/::'")) "\n" t)) + (let ((default-directory root)) + (split-string + (shell-command-to-string + (concat + "find . -type f | grep -vE '" + *textmate-gf-exclude* + "' | sed 's:" + *textmate-project-root* + "/::'")) "\n" t))) (defun textmate-cached-project-files-find (&optional root) "Finds and caches all files in a given project using find." @@ -447,7 +449,7 @@ specific type of file." (when (null root) (setq root default-directory)) (cond ((root-matches root *textmate-project-roots*) - (expand-file-name root)) + (expand-file-name root)) ((equal (expand-file-name root) "/") nil) (t (textmate-find-project-root (concat (file-name-as-directory root) "..")))))