branch: elpa/drupal-mode
commit 47fda0a38a5b197f4606137d9c3b7d44aaeaa886
Author: Arne Jørgensen <[email protected]>
Commit: Arne Jørgensen <[email protected]>

    Ignore errors in `drupal/gxref-get-function-args`
    
    `drupal/gxref-get-function-args` would throw an error if the symbol was
    not in the GTAGS file (because we assumed `xref-item-summary` would
    operate on an eieio object).
    
    Instead cluttering the code with even more checks we just ignore errors.
---
 drupal/gxref.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drupal/gxref.el b/drupal/gxref.el
index 61afe24398..5e0e42ada3 100644
--- a/drupal/gxref.el
+++ b/drupal/gxref.el
@@ -55,10 +55,11 @@ Include path to the executable if it is not in your $PATH.")
 (defun drupal/gxref-get-function-args (symbol &optional version)
   "Get function arguments for SYMBOL from GNU GLOBAL.
 Optional argument VERSION is ignored."
-  (let* ((line (car (gxref--find-symbol symbol)))
-         (string (xref-item-summary line)))
-    (string-match "(\\(.*\\))" string)
-    (match-string-no-properties 1 string)))
+  (ignore-errors
+    (let* ((line (car (gxref--find-symbol symbol)))
+           (string (xref-item-summary line)))
+      (string-match "(\\(.*\\))" string)
+      (match-string-no-properties 1 string))))
 
 (add-hook 'drupal-mode-hook #'drupal/gxref-enable)
 

Reply via email to