[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 2cca689e26 268/308: Better gtags-helm support.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 2cca689e26 268/308: Better gtags-helm support. |
Date: |
Tue, 25 Jan 2022 10:59:53 -0500 (EST) |
branch: elpa/drupal-mode
commit 2cca689e26d78a8fb2b454e7ca392c6b6c964c36
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Better gtags-helm support.
Closes #67.
---
drupal-mode.el | 2 +-
drupal/helm-gtags.el | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 8509f13808..0b7faa84c9 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -922,7 +922,7 @@ mode-hook."
(eval-after-load 'eldoc '(require 'drupal/eldoc))
(eval-after-load 'etags '(require 'drupal/etags))
(eval-after-load 'gtags '(require 'drupal/gtags))
-(eval-after-load 'helm-gtags '(require 'drupal/gtags))
+(eval-after-load 'helm-gtags '(require 'drupal/helm-gtags))
(eval-after-load 'ggtags '(require 'drupal/ggtags))
(eval-after-load 'ispell '(require 'drupal/ispell))
(eval-after-load 'flymake-phpcs '(require 'drupal/flymake-phpcs))
diff --git a/drupal/helm-gtags.el b/drupal/helm-gtags.el
new file mode 100644
index 0000000000..8f74bd0923
--- /dev/null
+++ b/drupal/helm-gtags.el
@@ -0,0 +1,63 @@
+;;; drupal/helm-gtags.el --- Drupal-mode support for helm-gtags
+
+;; Copyright (C) 2012, 2013, 2014, 2015, 2016 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 helm-gtags.
+
+;;; Code:
+
+(require 'helm-gtags)
+
+(defvar drupal/helm-gtags-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/helm-gtags-enable ()
+ "Setup rootdir for helm-gtags."
+ (let ((dir (locate-dominating-file (or buffer-file-name default-directory)
"GTAGS")))
+ (when dir
+ (set (make-local-variable 'helm-gtags--tag-location) dir)
+
+ ;; 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() (helm-gtags--complete 'tag ""
nil t)))
+ (setq drupal-get-function-args #'drupal/helm-gtags-get-function-args)
+ (helm-gtags-mode 1))))
+
+(defun drupal/helm-gtags-get-function-args (symbol &optional version)
+ "Get function arguments from GNU GLOBAL."
+ (when (file-exists-p (concat helm-gtags--tag-location "GTAGS"))
+ (with-temp-buffer
+ (ignore-errors
+ (call-process drupal/helm-gtags-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/helm-gtags-enable)
+
+
+
+(provide 'drupal/helm-gtags)
+
+;;; drupal/helm-gtags.el ends here
- [nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is already inserted in the file., (continued)
- [nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is already inserted in the file., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4bd52836b3 238/308: Inherit drupal-style from php style., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2e51a209df 223/308: Properly concat phpcs option in newer flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 914d2df539 222/308: Fixed URL of Drupalcontrib.org API., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5ad113d48f 255/308: Add `drupal-drush-sql-cli` command, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b62d89c177 251/308: Fix up for latest flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c2d7bc42e3 252/308: Merge pull request #63 from arnested/feature/flycheck-update, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 59bbaaf4f1 249/308: Merge branch 'release/0.6.1' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0cd2412756 257/308: Avoid "no tags containing" error in hook skeleton, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 36ea4003da 259/308: Merge pull request #65 from joddie/feature/sql-cli, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2cca689e26 268/308: Better gtags-helm support.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode a02e1dde00 271/308: Merge pull request #72 from arnested/fix-phpcs-output-parsing, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f425ba445a 276/308: Merge branch 'release/0.7.1' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode eec2e557d7 277/308: Updated to the latest flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 643c7538b0 279/308: Merge pull request #78 from arnested/continuation-style, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode dea5a8da78 280/308: Fix thinko, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ca569eaa62 281/308: Update obsoleted comment, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 47fda0a38a 287/308: Ignore errors in `drupal/gxref-get-function-args`, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 95bf73b4b6 288/308: Create SECURITY.md, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ee53f9e12b 289/308: Create CODE_OF_CONDUCT.md, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ba80d4d5c8 290/308: Remove drupalcontrib.com as search URL option, ELPA Syncer, 2022/01/25