[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 41d382c9da 2/2: consult-xref: Let-bind this-com
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 41d382c9da 2/2: consult-xref: Let-bind this-command |
Date: |
Tue, 16 Jul 2024 06:57:53 -0400 (EDT) |
branch: externals/consult
commit 41d382c9da9a84ab5391ee906e24f7126d03bd53
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
consult-xref: Let-bind this-command
---
consult-xref.el | 37 +++++++++++++++++--------------------
consult.el | 6 +++---
2 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/consult-xref.el b/consult-xref.el
index 639feaf08e..028c27bd79 100644
--- a/consult-xref.el
+++ b/consult-xref.el
@@ -88,31 +88,28 @@ See `xref-show-xrefs-function' for the description of the
FETCHER and ALIST arguments."
(let* ((consult-xref--fetcher fetcher)
(candidates (consult-xref--candidates))
- (display (alist-get 'display-action alist)))
+ (display (alist-get 'display-action alist))
+ (this-command #'consult-xref))
(unless candidates
(user-error "No xref locations"))
(xref-pop-to-location
(if (cdr candidates)
- (apply
- #'consult--read
+ (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))))
+ :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)))
display)))
diff --git a/consult.el b/consult.el
index 578465caa1..5e46dfee86 100644
--- a/consult.el
+++ b/consult.el
@@ -2995,10 +2995,10 @@ corresponding customization options."
(setq args (cddr args)))))
(macroexp-progn setter)))
-(defun consult--customize-get (&optional cmd)
- "Get configuration from `consult--customize-alist' for CMD."
+(defun consult--customize-get ()
+ "Get configuration from `consult--customize-alist' for `this-command'."
(mapcar (lambda (x) (eval x 'lexical))
- (alist-get (or cmd this-command) consult--customize-alist)))
+ (alist-get this-command consult--customize-alist)))
;;;; Commands