Files
dot-emacs/conf-lisp/grep.el

27 lines
684 B
EmacsLisp
Raw Normal View History

2023-04-12 16:39:35 +02:00
;; https://github.com/leoliu/ack-el
2023-04-12 20:25:04 +02:00
(defun tvd-kill-ack()
2023-04-13 13:53:47 +02:00
"Close the *ack* window and kill the associated buffer along
with the ack process"
2023-04-13 07:23:09 +02:00
(interactive)
(let ((kill-buffer-query-functions nil))
(delete-window)
(kill-buffer "*ack*")))
(defun tvd-hook-kill-ack()
2023-04-13 13:53:47 +02:00
"set local keys in temporary ack buffer"
2023-04-13 07:23:09 +02:00
(local-set-key (kbd "q") 'tvd-kill-ack))
2023-04-12 20:25:04 +02:00
(use-package ack
:config
2023-04-13 13:53:47 +02:00
;; don't annoy me with git search & co
2023-04-13 07:23:09 +02:00
(setq ack-defaults-function 'ack-legacy-defaults)
2023-04-12 20:25:04 +02:00
2023-04-13 13:53:47 +02:00
;; focus the *ack* buffer directly
(advice-add 'ack-mode :after
'(lambda ()
(pop-to-buffer "*ack*")))
:init
(add-hook 'ack-mode-hook 'tvd-hook-kill-ack))