[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-fu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-function-args' for finding arguments using Etags. |
Date: |
Tue, 25 Jan 2022 10:59:31 -0500 (EST) |
branch: elpa/drupal-mode
commit 02eacb79f27a0c7a7eed78e9e6205b05a6f04a92
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Added `drupal/etags-get-function-args' for finding arguments using Etags.
---
drupal-mode.el | 3 ++-
drupal/etags.el | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index b91ce28ab5..14d655ae75 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -212,7 +212,8 @@ Used by `drupal-insert-hook' to fill in arguments on hooks.
The specified function should take two arguments: the function to
find arguments for and the drupal major version.
-See `drupal-get-function-args' (slow) and
+See `drupal-get-function-args' (slow)
+`drupal/etags-get-function-args' and
`drupal/gtags-get-function-args' for functions returning Drupal
function arguments.")
(make-variable-buffer-local 'drupal-get-function-args)
diff --git a/drupal/etags.el b/drupal/etags.el
index 08e165e958..a22b49e0f5 100644
--- a/drupal/etags.el
+++ b/drupal/etags.el
@@ -39,8 +39,20 @@
;; Set `drupal-symbol-collection' to `tags-completion-table' so
;; that inserting hooks will do completion based on etags.
+ (setq drupal-get-function-args #'drupal/etags-get-function-args)
(setq drupal-symbol-collection #'tags-completion-table)))
+(defun drupal/etags-get-function-args (symbol &optional version)
+ "Get function arguments from etags TAGS."
+ (when (and (boundp 'drupal-rootdir)
+ (file-exists-p (concat drupal-rootdir "TAGS")))
+ (with-current-buffer (find-tag-noselect symbol nil nil)
+ (goto-char (point-min))
+ (when (re-search-forward
+ (format "function\\s-+%s\\s-*(\\([^{]*\\))" symbol)
+ nil t)
+ (match-string-no-properties 1)))))
+
(add-hook 'drupal-mode-hook #'drupal/etags-enable)
- [nongnu] elpa/drupal-mode 71f3ba70fe 116/308: Added .inc files as `php-mode` as well., (continued)
- [nongnu] elpa/drupal-mode 71f3ba70fe 116/308: Added .inc files as `php-mode` as well., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2245c415ee 123/308: Added check for `drupal-drush-program` is set., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 213ebf5e65 124/308: Fixed eshell site-alias expansion for aliases beginning with @. Suggestion by Tassilo Horn:, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f4a4985134 132/308: Check if our checker can be used before enforcing it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2ad9decdb7 136/308: Merge branch 'develop' into pr/35, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode da62dbfc22 149/308: Added missing EOL., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f77dd902b4 009/308: Add :link to defcustom. Part of #9., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e4d21708db 010/308: Untabify and indent., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 24bae05adf 036/308: Merge branch 'master' of github.com:arnested/drupal-mode, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-function-args' for finding arguments using Etags.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function-args' to fail gracefully., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 551cc3c803 093/308: Eliminated `drupal-drush-mode'. It had no purpose., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c81cdfd343 096/308: Made `drupal-search-url' et el safe for `string-or-null-p'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 05e0a86bed 099/308: Added keyboard shortcut for `drupal-module-name'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 57897dbed5 125/308: Fixed locating drush version number., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b9e5d25b4 129/308: Added basic support for flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4f54f8bcb8 134/308: Fixed documentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bd22697642 135/308: Mark `drupal/flymake-phpcs-standard' as obsolete., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3ba088c812 139/308: No need for make-local-variable., ELPA Syncer, 2022/01/25