branch: elpa/drupal-mode
commit 587e0eb2ec57679afbe87affd1061a0e71338e57
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Added completion based on gtags.
---
drupal/gtags.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drupal/gtags.el b/drupal/gtags.el
index 60e5cce123..10355f82db 100644
--- a/drupal/gtags.el
+++ b/drupal/gtags.el
@@ -30,7 +30,12 @@
(defun drupal/gtags-enable ()
"Setup rootdir for gtags to be DRUPAL_ROOT."
(when (boundp 'drupal-rootdir)
- (setq gtags-rootdir drupal-rootdir)))
+ (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)))))
(add-hook 'drupal-mode-hook #'drupal/gtags-enable)