(Emacs)+rg.el command to search in new frame

rg.el uses the compilation system to manage and display
results (similar to the *grep family of functions in Emacs).  I'd like
to be able to search in a separate frame (making that a 'searcher'
frame) instead of the current frame sometimes, so make a command that
does that for me.
This commit is contained in:
2021-03-09 18:08:38 +00:00
parent 1176428888
commit 5d625c8068

View File

@@ -1069,8 +1069,11 @@ most repositories nowadays.
*** rg
#+begin_src emacs-lisp
(use-package rg
:commands (+rg/search-in-new-frame)
:general
(leader "sr" #'rg)
(leader
"sr" #'rg
"sR" #'+rg/search-in-new-frame)
(:keymaps 'rg-mode-map
"]]" #'rg-next-file
"[[" #'rg-prev-file
@@ -1082,7 +1085,13 @@ most repositories nowadays.
rg-show-header t
rg-custom-type-aliases nil
rg-default-alias-fallback "all"
rg-buffer-name "*ripgrep*"))
rg-buffer-name "*ripgrep*")
:config
(defun +rg/search-in-new-frame ()
(interactive)
(let ((frame (make-frame)))
(select-frame frame)
(call-interactively #'rg))))
#+end_src
* Applications
** Dashboard