[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 6ec0cb9f0b 1/2: consult-global-mark: Attach con
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/consult 6ec0cb9f0b 1/2: consult-global-mark: Attach consult-location property to full candidate |
|
Date: |
Sun, 28 Jan 2024 18:57:34 -0500 (EST) |
branch: externals/consult
commit 6ec0cb9f0b9ade5f14954ca6f896cf47f5ccf500
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
consult-global-mark: Attach consult-location property to full candidate
Reported by @oantolin in #929. This change ensures that `embark-export` can
successfully retrieve the location. Fix #929.
---
consult.el | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/consult.el b/consult.el
index 75fcde764d..1e69e5c9a5 100644
--- a/consult.el
+++ b/consult.el
@@ -3236,15 +3236,12 @@ The symbol at point is added to the future history."
(when (consult--in-range-p pos)
(goto-char pos)
;; `line-number-at-pos' is slow, see comment in
`consult--mark-candidates'.
- (let ((line (line-number-at-pos pos
consult-line-numbers-widen)))
- (push (concat
- (propertize
- (consult--format-file-line-match (buffer-name buf)
line "")
- 'consult-location (cons marker line)
- 'consult-strip t)
- (consult--line-with-mark marker)
- (consult--tofu-encode marker))
- candidates))))))))
+ (let* ((line (line-number-at-pos pos
consult-line-numbers-widen))
+ (prefix (consult--format-file-line-match (buffer-name
buf) line ""))
+ (cand (concat prefix (consult--line-with-mark marker)
(consult--tofu-encode marker))))
+ (put-text-property 0 (length prefix) 'consult-strip t cand)
+ (put-text-property 0 (length cand) 'consult-location (cons
marker line) cand)
+ (push cand candidates))))))))
(unless candidates
(user-error "No global marks"))
(nreverse (delete-dups candidates))))