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
|
* PROJ Missing Features
|
||||||
** TODO Icons
|
** TODO Icons
|
||||||
https://github.com/minad/marginalia/issues/59
|
https://github.com/minad/marginalia/issues/59
|
||||||
** WAIT =C-C C-e= wgrep fun
|
** TODO =C-C C-e= wgrep fun
|
||||||
- rework into using ~embark-export~ directly, after [[https://github.com/oantolin/embark/issues/226][this issue]] gets resolved
|
|
||||||
- check if we can add this to ~consult-line~ too
|
- check if we can add this to ~consult-line~ too
|
||||||
** TODO bibtex-actions improvements?
|
** TODO bibtex-actions improvements?
|
||||||
currently =SPC n b= is bound to a function, but =bibtex-actions= doesn't have a
|
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)
|
(require 'wgrep)
|
||||||
(pcase-let ((`(,type . ,candidates)
|
(pcase-let ((`(,type . ,candidates)
|
||||||
(run-hook-with-args-until-success 'embark-candidate-collectors)))
|
(run-hook-with-args-until-success 'embark-candidate-collectors)))
|
||||||
(if (null candidates)
|
(if (not (eq type 'consult-grep))
|
||||||
(user-error "No candidates for export")
|
(user-error "embark category %S doesn't support wgrep" type)
|
||||||
(if (eq type 'consult-grep)
|
(let ((embark-after-export-hook #'wgrep-change-to-wgrep-mode))
|
||||||
(embark--quit-and-run
|
(embark-export)))))
|
||||||
(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)))))
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue