diff --git a/modules/completion/selectrum/TODO.org b/modules/completion/selectrum/TODO.org index be99a1eb0..2a157cb0d 100644 --- a/modules/completion/selectrum/TODO.org +++ b/modules/completion/selectrum/TODO.org @@ -62,8 +62,7 @@ is it something the custom search function is doing? does ivy cache stuff? * PROJ Missing Features ** TODO Icons https://github.com/minad/marginalia/issues/59 -** WAIT =C-C C-e= wgrep fun -- rework into using ~embark-export~ directly, after [[https://github.com/oantolin/embark/issues/226][this issue]] gets resolved +** TODO =C-C C-e= wgrep fun - check if we can add this to ~consult-line~ too ** TODO bibtex-actions improvements? currently =SPC n b= is bound to a function, but =bibtex-actions= doesn't have a diff --git a/modules/completion/selectrum/autoload/selectrum.el b/modules/completion/selectrum/autoload/selectrum.el index 1c683dae5..76891cb10 100644 --- a/modules/completion/selectrum/autoload/selectrum.el +++ b/modules/completion/selectrum/autoload/selectrum.el @@ -81,19 +81,7 @@ If ARG (universal argument), include all files, even hidden or compressed ones." (require 'wgrep) (pcase-let ((`(,type . ,candidates) (run-hook-with-args-until-success 'embark-candidate-collectors))) - (if (null candidates) - (user-error "No candidates for export") - (if (eq type 'consult-grep) - (embark--quit-and-run - (lambda () - (let ((buf (generate-new-buffer "*Embark Export Wgrep*"))) - (with-current-buffer buf - (insert (propertize "Exported grep results:\n\n" 'wgrep-header t)) - (dolist (line candidates) (insert line "\n")) - (goto-char (point-min)) - (grep-mode) - (setq-local wgrep-header/footer-parser #'ignore) - (wgrep-setup)) - (pop-to-buffer buf) - (wgrep-change-to-wgrep-mode)))) - (user-error "embark category %S doesn't support wgrep" type))))) + (if (not (eq type 'consult-grep)) + (user-error "embark category %S doesn't support wgrep" type) + (let ((embark-after-export-hook #'wgrep-change-to-wgrep-mode)) + (embark-export)))))