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

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

[nongnu] elpa/drupal-mode 47fda0a38a 287/308: Ignore errors in `drupal/g


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode 47fda0a38a 287/308: Ignore errors in `drupal/gxref-get-function-args`
Date: Tue, 25 Jan 2022 10:59:58 -0500 (EST)

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

    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

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