[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 7b2c43bd41 200/308: Merge pull request #44 fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 7b2c43bd41 200/308: Merge pull request #44 from joddie/ggtags |
Date: |
Tue, 25 Jan 2022 10:59:47 -0500 (EST) |
branch: elpa/drupal-mode
commit 7b2c43bd4162eaae752be74422f8558319c8c9a5
Merge: 09c622e53c 135c5f669e
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Merge pull request #44 from joddie/ggtags
Add interface with gtags via `ggtags.el'
---
drupal-mode.el | 1 +
drupal/ggtags.el | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diff --git a/drupal-mode.el b/drupal-mode.el
index c0967c1ae2..69ff5b6a26 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -780,6 +780,7 @@ mode-hook."
(eval-after-load 'autoinsert '(require 'drupal/autoinsert))
(eval-after-load 'etags '(require 'drupal/etags))
(eval-after-load 'gtags '(require 'drupal/gtags))
+(eval-after-load 'ggtags '(require 'drupal/ggtags))
(eval-after-load 'ispell '(require 'drupal/ispell))
(eval-after-load 'flymake-phpcs '(require 'drupal/flymake-phpcs))
(eval-after-load 'flycheck '(require 'drupal/flycheck))
diff --git a/drupal/ggtags.el b/drupal/ggtags.el
new file mode 100644
index 0000000000..bbb0c34ffc
--- /dev/null
+++ b/drupal/ggtags.el
@@ -0,0 +1,62 @@
+;;; drupal/ggtags.el --- Drupal-mode support for ggtags.el
+
+;; Copyright (C) 2012, 2013, 2014 Arne Jørgensen
+
+;; Author: Arne Jørgensen <arne@arnested.dk>
+
+;; This file is part of Drupal mode.
+
+;; Drupal mode is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published
+;; by the Free Software Foundation, either version 3 of the License,
+;; or (at your option) any later version.
+
+;; Drupal mode is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with Drupal mode. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Enable drupal-mode support for gtags.
+
+;;; Code:
+
+(require 'ggtags)
+
+(defvar drupal/ggtags-global-command (executable-find "global")
+ "Name of the GNU GLOBAL `global' executable.
+Include path to the executable if it is not in your $PATH.")
+
+(defun drupal/ggtags-enable ()
+ "Setup rootdir for gtags."
+ (let ((dir (locate-dominating-file (or buffer-file-name default-directory)
"GTAGS")))
+ (when dir
+ (ggtags-mode 1)
+ ;; Connect `drupal-symbol-collection' to `ggtags-mode'
+ ;; completion
+ (setq drupal-symbol-collection
+ (lambda () (all-completions "" ggtags-completion-table)))
+ (setq drupal-get-function-args #'drupal/ggtags-get-function-args))))
+
+(defun drupal/ggtags-get-function-args (symbol &optional version)
+ "Get function arguments from GNU GLOBAL."
+ (when (and (boundp 'ggtags-project-root)
+ (file-exists-p (expand-file-name "GTAGS" ggtags-project-root)))
+ (with-temp-buffer
+ (ignore-errors
+ (call-process drupal/ggtags-global-command nil t nil "-x" symbol)
+ (goto-char (point-min))
+ (search-forward-regexp "[^(]*(\\(.*\\))[^)]*" nil t)
+ (match-string-no-properties 1)))))
+
+(add-hook 'drupal-mode-hook #'drupal/ggtags-enable)
+
+
+
+(provide 'drupal/ggtags)
+
+;;; drupal/ggtags.el ends here
- [nongnu] elpa/drupal-mode a08207b0c9 161/308: Merge branch 'release/0.3.1', (continued)
- [nongnu] elpa/drupal-mode a08207b0c9 161/308: Merge branch 'release/0.3.1', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 8f5a7568b0 159/308: Fixed `drupal-search-documentation` for PHP keywords., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 72ceba6089 174/308: Merge pull request #39 from xendk/develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 46ad71de46 170/308: Used `default-directory` as fallback if `buffer-file-name` us not set., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f1985b5ca5 181/308: Merge branch 'release/0.4.0', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 230e579786 185/308: Removed flymake-phpcs from `drush-make-mode' files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 03b7e28b8d 192/308: Fixed bad indentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 1a73416e78 190/308: Fixed flymake when real file is in a symlinked dir., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode da97264d7e 195/308: Merge branch 'release/0.4.1', ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bef3447608 198/308: Add menu items for function & hook templates, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 7b2c43bd41 200/308: Merge pull request #44 from joddie/ggtags,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 0cca19ed14 205/308: Misc documentation cleanup., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f205ee475e 213/308: drupal-detect-drupal-version: Allow tabs in .info, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e6f955e367 218/308: Removed api.drupalize.me., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e803c00379 220/308: Only use our phpcs special checker on non PHP-files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9a6d3623b9 237/308: User error if the hook is already inserted elsewhere., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d9e2137a54 229/308: Use `auto-revert-mode` and auto-load., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode accf63bac1 234/308: Made blacklist a configurable regexp., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 945ddcca95 239/308: Implemented async cache clear., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 319acd5761 240/308: Moved eldoc stuff to separate file., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is already inserted in the file., ELPA Syncer, 2022/01/25