Skip to content

Commit 0cd2412

Browse files
committed
Avoid "no tags containing" error in hook skeleton
The hook implementation skeleton funcalls `drupal-get-function-args` to check whether the new function implementation already exists elsewhere in the project. When the value of this variable is `drupal/etags-get-function-args`, it throws an error for non-existent function names, making it impossible to insert a new implementation. Adding `ignore-errors` around the call fixes this.
1 parent cf0364c commit 0cd2412

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drupal-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ buffer."
556556
(user-error "%s already exists in file." (replace-regexp-in-string "^hook" (drupal-module-name) v2)))
557557
;; User error if the hook is already inserted elsewhere.
558558
(when (and drupal-get-function-args
559-
(funcall drupal-get-function-args (replace-regexp-in-string "^hook" (drupal-module-name) v2)))
559+
(ignore-errors
560+
(funcall drupal-get-function-args (replace-regexp-in-string "^hook" (drupal-module-name) v2))))
560561
(user-error "%s already exists elsewhere." (replace-regexp-in-string "^hook" (drupal-module-name) v2)))
561562
(drupal-ensure-newline)
562563
"/**\n"

0 commit comments

Comments
 (0)