[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c697c1d 2/7: Fix #127: Improve ggtags-make-project in find
From: |
Leo Liu |
Subject: |
[elpa] master c697c1d 2/7: Fix #127: Improve ggtags-make-project in finding tag files |
Date: |
Sun, 2 Oct 2016 01:47:27 +0000 (UTC) |
branch: master
commit c697c1d55a95daa5bbe214153c8bbc71ba5b9ba9
Author: Leo Liu <address@hidden>
Commit: Leo Liu <address@hidden>
Fix #127: Improve ggtags-make-project in finding tag files
---
README.rst | 4 +++-
ggtags.el | 56 ++++++++++++++++++++++++++++++--------------------------
2 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/README.rst b/README.rst
index 819ae1e..5bb0eb2 100644
--- a/README.rst
+++ b/README.rst
@@ -319,6 +319,8 @@ NEWS
#. ``ggtags-navigation-mode`` is more discreet in displaying lighter
when ``ggtags-enable-navigation-keys`` is set to nil.
+#. ``ggtags-make-project`` tries harder to find TAG files respecting
+ ``GTAGSDBPATH``.
[2015-12-15 Tue] 0.8.11
+++++++++++++++++++++++
@@ -385,7 +387,7 @@ NEWS
[2014-04-12 Sat] 0.8.3
++++++++++++++++++++++
-#. Tweak mode-line ligter in ``ggtags-navigation-mode``.
+#. Tweak mode-line lighter in ``ggtags-navigation-mode``.
[2014-04-05 Sat] 0.8.2
++++++++++++++++++++++
diff --git a/ggtags.el b/ggtags.el
index 1c72845..58b15d4 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -465,32 +465,36 @@ Set to `nil' to disable tag highlighting."
(defun ggtags-make-project (root)
(cl-check-type root string)
- (pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" root)))
- (`(,mtime ,_ ,tag-size . ,_)
- (let* ((default-directory (file-name-as-directory root))
- (rtags-size (nth 7 (file-attributes "GRTAGS")))
- (has-refs
- (when rtags-size
- (and (or (> rtags-size (* 32 1024))
- (with-demoted-errors "ggtags-make-project: %S"
- (not (equal "" (ggtags-process-string "global"
"-crs")))))
- 'has-refs)))
- ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518
- (has-path-style
- (and (ggtags-process-succeed-p "global" "--path-style" "shorter"
"--help")
- 'has-path-style))
- ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542
- (has-color (and (ggtags-process-succeed-p "global" "--color"
"--help")
- 'has-color)))
- (puthash default-directory
- (ggtags-project--make :root default-directory
- :tag-size tag-size
- :has-refs has-refs
- :has-path-style has-path-style
- :has-color has-color
- :mtime (float-time mtime)
- :timestamp (float-time))
- ggtags-projects)))))
+ (let* ((default-directory (file-name-as-directory root))
+ ;; NOTE: use of GTAGSDBPATH is not recommended. -- GLOBAL(1)
+ ;; ROOT and DB can be different directories due to GTAGSDBPATH.
+ (dbdir (concat (file-remote-p root)
+ (ggtags-process-string "global" "-p"))))
+ (pcase (nthcdr 5 (file-attributes (expand-file-name "GTAGS" dbdir)))
+ (`(,mtime ,_ ,tag-size . ,_)
+ (let* ((rtags-size (nth 7 (file-attributes (expand-file-name "GRTAGS"
dbdir))))
+ (has-refs
+ (when rtags-size
+ (and (or (> rtags-size (* 32 1024))
+ (with-demoted-errors "ggtags-make-project: %S"
+ (not (equal "" (ggtags-process-string "global"
"-crs")))))
+ 'has-refs)))
+ ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1518
+ (has-path-style
+ (and (ggtags-process-succeed-p "global" "--path-style"
"shorter" "--help")
+ 'has-path-style))
+ ;; http://thread.gmane.org/gmane.comp.gnu.global.bugs/1542
+ (has-color (and (ggtags-process-succeed-p "global" "--color"
"--help")
+ 'has-color)))
+ (puthash default-directory
+ (ggtags-project--make :root default-directory
+ :tag-size tag-size
+ :has-refs has-refs
+ :has-path-style has-path-style
+ :has-color has-color
+ :mtime (float-time mtime)
+ :timestamp (float-time))
+ ggtags-projects))))))
(defun ggtags-project-expired-p (project)
(or (< (ggtags-project-timestamp project) 0)
- [elpa] master updated (3d0eb58 -> 378f13a), Leo Liu, 2016/10/01
- [elpa] master 08ed052 5/7: Apply changes from GNU ELPA, Leo Liu, 2016/10/01
- [elpa] master 7a7ee76 6/7: Doc fix, Leo Liu, 2016/10/01
- [elpa] master cf17576 4/7: Fix #89: Make sure compilation-auto-jump run before cleanup, Leo Liu, 2016/10/01
- [elpa] master c697c1d 2/7: Fix #127: Improve ggtags-make-project in finding tag files,
Leo Liu <=
- [elpa] master b4ee572 1/7: Fix #124: Fix lighter for ggtags-navigation-mode, Leo Liu, 2016/10/01
- [elpa] master 378f13a 7/7: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2016/10/01
- [elpa] master 811f2e1 3/7: Fix #88 and #130: Adapt to changes in Emacs 25.1, Leo Liu, 2016/10/01