emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 25/38: Fix ggtags-find-project to check on the GTAGS file


From: Leo Liu
Subject: [elpa] 25/38: Fix ggtags-find-project to check on the GTAGS file
Date: Mon, 24 Mar 2014 09:31:36 +0000

leoliu pushed a commit to branch master
in repository elpa.

commit 28e6316d31472d8329e1651aa5d553ad426026ca
Author: Leo Liu <address@hidden>
Date:   Thu Mar 20 08:58:52 2014 +0800

    Fix ggtags-find-project to check on the GTAGS file
    
    Note: this is to reduce false positives in case-insensitive file
    systems.
    
    Improve ggtags-include-pattern to strip leading ../ in path.
---
 ggtags.el |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index b686eda..b3def18 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -111,7 +111,7 @@ automatically switches to 'global --single-update'."
   :group 'ggtags)
 
 (defcustom ggtags-include-pattern
-  '("^\\s-*#\\(?:include\\|import\\)\\s-*[\"<]\\(.*?\\)[\">]" . 1)
+  '("^\\s-*#\\(?:include\\|import\\)\\s-*[\"<]\\(?:[./]*\\)?\\(.*?\\)[\">]" . 
1)
   "Pattern used to detect #include files.
 Value can be (REGEXP . SUB) or a function with no arguments."
   :type '(choice (const :tag "Disable" nil)
@@ -411,11 +411,11 @@ Value is new modtime if updated."
                 ;;
                 ;; Note: `locate-dominating-file' doesn't accept
                 ;; function for NAME before 24.3.
-                (let ((gtags (locate-dominating-file default-directory 
"GTAGS")))
+                (let ((dir (locate-dominating-file default-directory "GTAGS")))
                   ;; `file-truename' may strip the trailing '/' on
                   ;; remote hosts, see http://debbugs.gnu.org/16851
-                  (and gtags (file-regular-p gtags)
-                       (file-name-as-directory (file-truename gtags))))))
+                  (and dir (file-regular-p (expand-file-name "GTAGS" dir))
+                       (file-name-as-directory (file-truename dir))))))
       (when ggtags-project-root
         (if (gethash ggtags-project-root ggtags-projects)
             (ggtags-find-project)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]