diff --git a/drupal-mode.el b/drupal-mode.el index f6c9476..63d3273 100644 --- a/drupal-mode.el +++ b/drupal-mode.el @@ -556,7 +556,8 @@ buffer." (user-error "%s already exists in file." (replace-regexp-in-string "^hook" (drupal-module-name) v2))) ;; User error if the hook is already inserted elsewhere. (when (and drupal-get-function-args - (funcall drupal-get-function-args (replace-regexp-in-string "^hook" (drupal-module-name) v2))) + (ignore-errors + (funcall drupal-get-function-args (replace-regexp-in-string "^hook" (drupal-module-name) v2)))) (user-error "%s already exists elsewhere." (replace-regexp-in-string "^hook" (drupal-module-name) v2))) (drupal-ensure-newline) "/**\n"