branch: master commit 8c093c3d4ba66170034e53a63356e6bf66a5bcf6 Author: Leo Liu <sdl....@gmail.com> Date: Sun Nov 30 15:32:33 2014 +0800
Fix combining process-file with ggtags-project-relative-file Without also binding default-directory the result of ggtags-project-relative-file may not make sense to process-file. --- ggtags.el | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ggtags.el b/ggtags.el index 6f22617..b8bcb1c 100644 --- a/ggtags.el +++ b/ggtags.el @@ -654,8 +654,11 @@ Value is new modtime if updated." (when (ggtags-find-project) (with-temp-buffer (ggtags-with-current-project - (process-file (ggtags-program-path "global") nil t nil - "-vP" (concat "^" (ggtags-project-relative-file file) "$"))) + ;; NOTE: `process-file' requires all files in ARGS be relative + ;; to `default-directory'; see its doc string for details. + (let ((default-directory (ggtags-current-project-root))) + (process-file (ggtags-program-path "global") nil t nil + "-vP" (concat "^" (ggtags-project-relative-file file) "$")))) (goto-char (point-min)) (not (re-search-forward "^file not found" nil t))))) @@ -746,8 +749,10 @@ Do nothing if GTAGS exceeds the oversize limit unless FORCE." (cl-check-type file string) (let ((nowait (unless (file-remote-p file) nowait))) (ggtags-with-current-project - (process-file (ggtags-program-path "global") nil (and nowait 0) nil - "--single-update" (ggtags-project-relative-file file))))) + ;; See comment in `ggtags-project-file-p'. + (let ((default-directory (ggtags-current-project-root))) + (process-file (ggtags-program-path "global") nil (and nowait 0) nil + "--single-update" (ggtags-project-relative-file file)))))) (defun ggtags-delete-tags () "Delete file GTAGS, GRTAGS, GPATH, ID etc. generated by gtags."