selectrum: simplify +selectrum/embark-wgrep
now that oantolin/embark#226 has been resolved.
This commit is contained in:
parent
436794aa87
commit
85be33556b
2 changed files with 5 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue