branch: externals/embark
commit d546952ccddedd8cca6bb4cfdbbfa2a596c3e114
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    Fix occur export (Fix #791)
---
 embark-consult.el | 3 +++
 embark.el         | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/embark-consult.el b/embark-consult.el
index 021a71ad00..2be7a12527 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -90,7 +90,10 @@ category `consult-line'."
   (let ((buf (generate-new-buffer "*Embark Export Occur*"))
         (mouse-msg "mouse-2: go to this occurrence")
         (inhibit-read-only t)
+        (affixator (embark--get-affixator 'consult-location))
         last-buf)
+    ;; Run affixator for lazy highlighting
+    (setq lines (mapcar #'car (funcall affixator lines)))
     (with-current-buffer buf
       (dolist (line lines)
         (pcase-let*
diff --git a/embark.el b/embark.el
index d50d407a34..9eb579098a 100644
--- a/embark.el
+++ b/embark.el
@@ -3050,7 +3050,7 @@ For non-minibuffers, assume candidates are of given TYPE."
     ;; otherwise fake some metadata for Marginalia users's benefit
     (completion-metadata-get `((category . ,type)) metadatum)))
 
-(defun embark-collect--affixator (type)
+(defun embark--get-affixator (type)
   "Get affixation function for current buffer's candidates.
 For non-minibuffers, assume candidates are of given TYPE."
   (or (embark-collect--metadatum type 'affixation-function)
@@ -3153,7 +3153,7 @@ example)."
          (type (plist-get transformed :orig-type)) ; we need the originals for
          (candidates (plist-get transformed :orig-candidates)) ; default action
          (bounds (plist-get transformed :bounds))
-         (affixator (embark-collect--affixator type))
+         (affixator (embark--get-affixator type))
          (grouper (embark-collect--metadatum type 'group-function)))
     (when (eq type 'file)
       (let ((dir (buffer-local-value 'default-directory buffer)))

Reply via email to