branch: elpa/drupal-mode
commit d9a34a4a5fa5c72231c23d19ebcdc5f88e055c42
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>

    Enabled `gtags-mode` if GTAGS is in use.
---
 drupal/gtags.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drupal/gtags.el b/drupal/gtags.el
index 10355f82db..87da53f6ac 100644
--- a/drupal/gtags.el
+++ b/drupal/gtags.el
@@ -29,13 +29,15 @@
 
 (defun drupal/gtags-enable ()
   "Setup rootdir for gtags to be DRUPAL_ROOT."
-  (when (boundp 'drupal-rootdir)
+  (when (and (boundp 'drupal-rootdir)
+             (file-exists-p (concat drupal-rootdir "GTAGS")))
     (setq gtags-rootdir drupal-rootdir)
 
     ;; Set `drupal-symbol-collection' to a call to
     ;; `gtags-completing-gtags' so that inserting hooks will do
     ;; completion based on gtags.
-    (setq drupal-symbol-collection #'(lambda() (gtags-completing-gtags "" nil 
t)))))
+    (setq drupal-symbol-collection #'(lambda() (gtags-completing-gtags "" nil 
t)))
+    (gtags-mode 1)))
 
 (add-hook 'drupal-mode-hook #'drupal/gtags-enable)
 

Reply via email to