From 5d625c806871b9392e39d01f5592e22504ceae03 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 9 Mar 2021 18:08:38 +0000 Subject: (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. --- Emacs/.config/emacs/config.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index f22e5a4..326791f 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -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 -- cgit v1.2.3-13-gbd6f