[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 05/14: Fix #42: Clear ggtags-project-root in non-file buffers
From: |
Leo Liu |
Subject: |
[elpa] 05/14: Fix #42: Clear ggtags-project-root in non-file buffers |
Date: |
Sun, 30 Mar 2014 07:02:39 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit a0d7e04fc7f63e1c0eb14b819d804f941d6b6b2f
Author: Leo Liu <address@hidden>
Date: Thu Mar 27 17:11:14 2014 +0800
Fix #42: Clear ggtags-project-root in non-file buffers
---
ggtags.el | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index e31b45f..aeac34a 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -392,8 +392,19 @@ Value is new modtime if updated."
(defvar-local ggtags-project-root 'unset
"Internal variable for project root directory.")
+(defun ggtags-clear-project-root ()
+ (kill-local-variable 'ggtags-project-root))
+
;;;###autoload
(defun ggtags-find-project ()
+ ;; See https://github.com/leoliu/ggtags/issues/42
+ ;;
+ ;; It is unsafe to cache `ggtags-project-root' in non-file buffers.
+ ;; But we keep the cache for at this a command's duration so that
+ ;; multiple calls of `ggtags-find-project' has no performance
+ ;; impact.
+ (unless buffer-file-name
+ (add-hook 'pre-command-hook #'ggtags-clear-project-root nil t))
(let ((project (gethash ggtags-project-root ggtags-projects)))
(if (ggtags-project-p project)
(if (ggtags-project-expired-p project)
- [elpa] branch master updated (b8924f8 -> 3dc7169), Leo Liu, 2014/03/30
- [elpa] 03/14: Change ggtags-read-tag to completing-read when no default, Leo Liu, 2014/03/30
- [elpa] 02/14: Fix #12: Remove ggtags-completing-read-function, Leo Liu, 2014/03/30
- [elpa] 04/14: Fix ggtags-try-complete-tag to use ggtags-bounds-of-tag-function, Leo Liu, 2014/03/30
- [elpa] 05/14: Fix #42: Clear ggtags-project-root in non-file buffers,
Leo Liu <=
- [elpa] 01/14: Enhance ggtags-view-tag-history to use next-/previous-error, Leo Liu, 2014/03/30
- [elpa] 06/14: New user variable ggtags-global-use-color, Leo Liu, 2014/03/30
- [elpa] 08/14: Fix warning: Making variable buffer-local while let-bound!, Leo Liu, 2014/03/30
- [elpa] 10/14: Disable ggtags-navigation-mode at the right time, Leo Liu, 2014/03/30
- [elpa] 13/14: Fix #44: New variable ggtags-enable-navigation-keys, Leo Liu, 2014/03/30
- [elpa] 09/14: Use compilation-auto-jump in ggtags-global-filter, Leo Liu, 2014/03/30
- [elpa] 11/14: Rename ggtags-handle-single-match to ggtags-global-handle-exit, Leo Liu, 2014/03/30
- [elpa] 12/14: Fix ggtags-navigation-mode-abort when pop-tag-mark errs, Leo Liu, 2014/03/30
- [elpa] 14/14: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2014/03/30
- [elpa] 07/14: Implement feature #43: Jump to match from search history, Leo Liu, 2014/03/30