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

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

[elpa] externals/consult 9acc792eda 1/2: Fix nil error in consult-xref (


From: ELPA Syncer
Subject: [elpa] externals/consult 9acc792eda 1/2: Fix nil error in consult-xref (Fix #901)
Date: Wed, 6 Dec 2023 00:57:38 -0500 (EST)

branch: externals/consult
commit 9acc792eda901dff29303f88d6585288f007aacf
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Fix nil error in consult-xref (Fix #901)
---
 consult-xref.el | 45 +++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/consult-xref.el b/consult-xref.el
index 306990f63c..751326e488 100644
--- a/consult-xref.el
+++ b/consult-xref.el
@@ -92,28 +92,29 @@ FETCHER and ALIST arguments."
          (candidates (consult-xref--candidates))
          (display (alist-get 'display-action alist)))
     (xref-pop-to-location
-     (if (cdr candidates)
-         (apply
-          #'consult--read
-          candidates
-          (append
-           (consult--customize-get #'consult-xref)
-           (list
-            :prompt "Go to xref: "
-            :history 'consult-xref--history
-            :require-match t
-            :sort nil
-            :category 'consult-xref
-            :group #'consult--prefix-group
-            :state
-            ;; do not preview other frame
-            (when-let (fun (pcase-exhaustive display
-                             ('frame nil)
-                             ('window #'switch-to-buffer-other-window)
-                             ('nil #'switch-to-buffer)))
-              (consult-xref--preview fun))
-            :lookup (apply-partially #'consult--lookup-prop 'consult-xref))))
-       (get-text-property 0 'consult-xref (car candidates)))
+     (or (if (cdr candidates)
+             (apply
+              #'consult--read
+              candidates
+              (append
+               (consult--customize-get #'consult-xref)
+               (list
+                :prompt "Go to xref: "
+                :history 'consult-xref--history
+                :require-match t
+                :sort nil
+                :category 'consult-xref
+                :group #'consult--prefix-group
+                :state
+                ;; do not preview other frame
+                (when-let (fun (pcase-exhaustive display
+                                 ('frame nil)
+                                 ('window #'switch-to-buffer-other-window)
+                                 ('nil #'switch-to-buffer)))
+                  (consult-xref--preview fun))
+                :lookup (apply-partially #'consult--lookup-prop 
'consult-xref))))
+           (get-text-property 0 'consult-xref (car candidates)))
+         (user-error "No location selected"))
      display)))
 
 (provide 'consult-xref)



reply via email to

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