branch: elpa/drupal-mode
commit cd3e68f6b3e51cafaf3d279aeef68d313b80d629
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>
Better support for hook_form_FORM_ID_alter() et al.
---
drupal-mode.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index c061ffa8af..ffbc81c493 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -1,6 +1,6 @@
;;; drupal-mode.el --- Advanced minor mode for Drupal development
-;; Copyright (C) 2012 Arne Jørgensen
+;; Copyright (C) 2012, 2013 Arne Jørgensen
;; Author: Arne Jørgensen <[email protected]>
;; URL: https://github.com/arnested/drupal-mode
@@ -411,9 +411,12 @@ should save your files with unix style end of line."
(funcall drupal-symbol-collection)
drupal-symbol-collection)
nil nil "hook_"))
+ '(setq v2 (let ((case-fold-search nil))
+ (when (string-match "\\([A-Z][A-Z_]*[A-Z]\\)" v1)
+ (concat " for " (match-string 1 v1) "()"))))
(drupal-ensure-newline)
"/**\n"
- " * Implements " v1 "().\n"
+ " * Implements " v1 "()" v2 ".\n"
" */\n"
"function " (replace-regexp-in-string "^hook" (drupal-module-name) v1) "("
(when drupal-get-function-args (funcall drupal-get-function-args v1
(drupal-major-version))) ") {\n"
" " @ _ "\n"