[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is already inserted in the file. |
Date: |
Tue, 25 Jan 2022 10:59:50 -0500 (EST) |
branch: elpa/drupal-mode
commit d09cdf87816638bde3c2476977cfe810db9325f4
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
User error if the hook is already inserted in the file.
Fixes #22.
---
drupal-mode.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index 132e3d7364..5185385965 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, 2013, 2014 Arne Jørgensen
+;; Copyright (C) 2012, 2013, 2014, 2015 Arne Jørgensen
;; Author: Arne Jørgensen <arne@arnested.dk>
;; URL: https://github.com/arnested/drupal-mode
@@ -559,6 +559,10 @@ buffer."
(concat "Implements " hook "(): ")
(drupal-next-update-id)))
(replace-regexp-in-string (regexp-quote
update-id-placeholder) (number-to-string update-id) hook t))
hook))))
+ ;; User error if the hook is already inserted in the file.
+ (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)))
(drupal-ensure-newline)
"/**\n"
" * Implements " str "().\n"
- [nongnu] elpa/drupal-mode 7b2c43bd41 200/308: Merge pull request #44 from joddie/ggtags, (continued)
- [nongnu] elpa/drupal-mode 7b2c43bd41 200/308: Merge pull request #44 from joddie/ggtags, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0cca19ed14 205/308: Misc documentation cleanup., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f205ee475e 213/308: drupal-detect-drupal-version: Allow tabs in .info, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e6f955e367 218/308: Removed api.drupalize.me., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e803c00379 220/308: Only use our phpcs special checker on non PHP-files., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 9a6d3623b9 237/308: User error if the hook is already inserted elsewhere., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d9e2137a54 229/308: Use `auto-revert-mode` and auto-load., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode accf63bac1 234/308: Made blacklist a configurable regexp., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 945ddcca95 239/308: Implemented async cache clear., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 319acd5761 240/308: Moved eldoc stuff to separate file., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode d09cdf8781 236/308: User error if the hook is already inserted in the file.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 4bd52836b3 238/308: Inherit drupal-style from php style., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2e51a209df 223/308: Properly concat phpcs option in newer flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 914d2df539 222/308: Fixed URL of Drupalcontrib.org API., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 5ad113d48f 255/308: Add `drupal-drush-sql-cli` command, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode b62d89c177 251/308: Fix up for latest flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c2d7bc42e3 252/308: Merge pull request #63 from arnested/feature/flycheck-update, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 59bbaaf4f1 249/308: Merge branch 'release/0.6.1' into develop, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0cd2412756 257/308: Avoid "no tags containing" error in hook skeleton, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 36ea4003da 259/308: Merge pull request #65 from joddie/feature/sql-cli, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2cca689e26 268/308: Better gtags-helm support., ELPA Syncer, 2022/01/25