emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/drupal-mode 9a6d3623b9 237/308: User error if the hook is


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode 9a6d3623b9 237/308: User error if the hook is already inserted elsewhere.
Date: Tue, 25 Jan 2022 10:59:50 -0500 (EST)

branch: elpa/drupal-mode
commit 9a6d3623b91838ac9a0ca123fccea6444e5bd648
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>

    User error if the hook is already inserted elsewhere.
---
 drupal-mode.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drupal-mode.el b/drupal-mode.el
index 5185385965..125027c1e1 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -563,6 +563,10 @@ buffer."
   (when (and (boundp 'imenu--index-alist)
              (assoc (replace-regexp-in-string "^hook" (drupal-module-name) v2) 
(assoc "Named Functions" imenu--index-alist)))
     (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)))
+    (user-error "%s already exists elsewhere." (replace-regexp-in-string 
"^hook" (drupal-module-name) v2)))
   (drupal-ensure-newline)
   "/**\n"
   " * Implements " str "().\n"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]