mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 12:30:59 +01:00
finally got ack to work
This commit is contained in:
@@ -1,20 +1,26 @@
|
|||||||
;; https://github.com/leoliu/ack-el
|
;; https://github.com/leoliu/ack-el
|
||||||
|
|
||||||
(defun tvd-kill-ack()
|
(defun tvd-kill-ack()
|
||||||
|
"Close the *ack* window and kill the associated buffer along
|
||||||
|
with the ack process"
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((kill-buffer-query-functions nil))
|
(let ((kill-buffer-query-functions nil))
|
||||||
(delete-window)
|
(delete-window)
|
||||||
(kill-buffer "*ack*")))
|
(kill-buffer "*ack*")))
|
||||||
|
|
||||||
(defun tvd-hook-kill-ack()
|
(defun tvd-hook-kill-ack()
|
||||||
;; FIXME: still asks!
|
"set local keys in temporary ack buffer"
|
||||||
(local-set-key (kbd "q") 'tvd-kill-ack))
|
(local-set-key (kbd "q") 'tvd-kill-ack))
|
||||||
|
|
||||||
(use-package ack
|
(use-package ack
|
||||||
:config
|
:config
|
||||||
|
|
||||||
|
;; don't annoy me with git search & co
|
||||||
(setq ack-defaults-function 'ack-legacy-defaults)
|
(setq ack-defaults-function 'ack-legacy-defaults)
|
||||||
|
|
||||||
|
;; focus the *ack* buffer directly
|
||||||
(advice-add 'ack-mode :after
|
(advice-add 'ack-mode :after
|
||||||
'(lambda ()
|
'(lambda ()
|
||||||
(switch-to-buffer "*ack*"))))
|
(pop-to-buffer "*ack*")))
|
||||||
|
:init
|
||||||
(add-hook 'ack-mode-hook 'tvd-hook-kill-ack)
|
(add-hook 'ack-mode-hook 'tvd-hook-kill-ack))
|
||||||
|
|||||||
Reference in New Issue
Block a user