[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function-args' to fail gracefully. |
Date: |
Tue, 25 Jan 2022 10:59:30 -0500 (EST) |
branch: elpa/drupal-mode
commit 0b770695f8c82a367f56b208ed6693a7344f5aa6
Author: Arne Jørgensen <arne@arnested.dk>
Commit: Arne Jørgensen <arne@arnested.dk>
Fixed `drupal-get-function-args' to fail gracefully.
If no `drupal-get-function-args' function is defined just don't insert
any arguments instead of failing.
Let the functions `drupal-get-function-args' and
`drupal/gtags-get-function-args' ignore errors do they will also fail
gracefully.
---
drupal-mode.el | 13 +++++++------
drupal/gtags.el | 9 +++++----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/drupal-mode.el b/drupal-mode.el
index c0cee4fe58..6e6de21532 100644
--- a/drupal-mode.el
+++ b/drupal-mode.el
@@ -398,7 +398,7 @@ function arguments.")
"/**\n"
" * Implements " v1 "().\n"
" */\n"
- "function " (replace-regexp-in-string "hook" (drupal-module-name) v1) "("
(funcall drupal-get-function-args v1 (drupal-major-version)) ") {\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"
"}\n")
@@ -434,11 +434,12 @@ instead."
(unless version
(setq version (drupal-detect-drupal-version)))
(with-temp-buffer
- (url-insert-file-contents (format-spec drupal-search-url `((?v . ,version)
- (?s .
,symbol))))
- (search-forward "<tr class=\"active\">" nil t)
- (search-forward-regexp (concat symbol "(\\(.*\\))") nil t)
- (match-string-no-properties 1)))
+ (ignore-errors
+ (url-insert-file-contents (format-spec drupal-search-url `((?v .
,version)
+ (?s .
,symbol))))
+ (search-forward "<tr class=\"active\">" nil t)
+ (search-forward-regexp (concat symbol "(\\(.*\\))") nil t)
+ (match-string-no-properties 1))))
diff --git a/drupal/gtags.el b/drupal/gtags.el
index 96d9ae3e4b..ee14e9cc07 100644
--- a/drupal/gtags.el
+++ b/drupal/gtags.el
@@ -46,10 +46,11 @@
(when (and (boundp 'drupal-rootdir)
(file-exists-p (concat drupal-rootdir "GTAGS")))
(with-temp-buffer
- (call-process gtags-global-command nil t nil "-x" symbol)
- (goto-char (point-min))
- (search-forward-regexp ".*(\\(.*\\)).*" nil t)
- (match-string 1))))
+ (ignore-errors
+ (call-process gtags-global-command nil t nil "-x" symbol)
+ (goto-char (point-min))
+ (search-forward-regexp ".*(\\(.*\\)).*" nil t)
+ (match-string-no-properties 1)))))
(add-hook 'drupal-mode-hook #'drupal/gtags-enable)
- [nongnu] elpa/drupal-mode 2245c415ee 123/308: Added check for `drupal-drush-program` is set., (continued)
- [nongnu] elpa/drupal-mode 2245c415ee 123/308: Added check for `drupal-drush-program` is set., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 213ebf5e65 124/308: Fixed eshell site-alias expansion for aliases beginning with @. Suggestion by Tassilo Horn:, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f4a4985134 132/308: Check if our checker can be used before enforcing it., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 2ad9decdb7 136/308: Merge branch 'develop' into pr/35, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ec024f1e2a 148/308: `drupal/phpcs-dont-show-trailing-whitespace` common to flycheck and flymake., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode da62dbfc22 149/308: Added missing EOL., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode f77dd902b4 009/308: Add :link to defcustom. Part of #9., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode e4d21708db 010/308: Untabify and indent., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 24bae05adf 036/308: Merge branch 'master' of github.com:arnested/drupal-mode, ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 02eacb79f2 078/308: Added `drupal/etags-get-function-args' for finding arguments using Etags., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b770695f8 072/308: Fixed `drupal-get-function-args' to fail gracefully.,
ELPA Syncer <=
- [nongnu] elpa/drupal-mode 551cc3c803 093/308: Eliminated `drupal-drush-mode'. It had no purpose., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode c81cdfd343 096/308: Made `drupal-search-url' et el safe for `string-or-null-p'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 05e0a86bed 099/308: Added keyboard shortcut for `drupal-module-name'., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode ae4dd40f05 122/308: Added pcomplete for drush., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 57897dbed5 125/308: Fixed locating drush version number., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 0b9e5d25b4 129/308: Added basic support for flycheck., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 4f54f8bcb8 134/308: Fixed documentation., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode bd22697642 135/308: Mark `drupal/flymake-phpcs-standard' as obsolete., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode 3ba088c812 139/308: No need for make-local-variable., ELPA Syncer, 2022/01/25
- [nongnu] elpa/drupal-mode a6a4bfa842 144/308: No quoting necessary, says wiser minds than mine., ELPA Syncer, 2022/01/25