branch: externals/consult
commit 7e1792577891f7523a4dabae61ae5f3ef3f50f87
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Allow consult-xref to be customized via consult-customize (Fix #322)
---
consult-xref.el | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/consult-xref.el b/consult-xref.el
index d7177b6..d104bc6 100644
--- a/consult-xref.el
+++ b/consult-xref.el
@@ -87,22 +87,26 @@ FETCHER and ALIST arguments."
(display (alist-get 'display-action alist)))
(xref-pop-to-location
(if (cdr candidates)
- (consult--read
+ (apply
+ #'consult--read
candidates
- :prompt "Go to xref: "
- :history 'consult-xref--history
- :require-match t
- :sort nil
- :category 'xref-location
- :group #'consult-xref--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 #'consult--lookup-candidate)
+ (append
+ (alist-get #'consult-xref consult--read-config)
+ (list
+ :prompt "Go to xref: "
+ :history 'consult-xref--history
+ :require-match t
+ :sort nil
+ :category 'xref-location
+ :group #'consult-xref--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 #'consult--lookup-candidate)))
(get-text-property 0 'consult--candidate (car candidates)))
display)))