From 8644265551ee36c0ba8624e668a49542be2fa6da Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Sat, 1 Feb 2020 23:35:23 +0100 Subject: Replace add-hook calls with :hook --- lisp/init-grep.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp/init-grep.el') diff --git a/lisp/init-grep.el b/lisp/init-grep.el index 934ba7c..8b04c6e 100644 --- a/lisp/init-grep.el +++ b/lisp/init-grep.el @@ -11,21 +11,21 @@ (interactive) (grep-visit-buffer-other-window event t)) +(defun grep-mode-buffer-local-variables () + ;; wrap lines + (setq-local truncate-lines nil)) + (use-package grep :ensure nil ;; package is bundled with emacs + :hook (grep-mode . grep-mode-buffer-local-variables) + :bind (:map grep-mode-map ;; make C-o and o behave as in dired ("o" . grep-visit-buffer-other-window) ("C-o" . grep-visit-buffer-other-window-noselect) ;; n and p changes line as in ag-mode ("n" . compilation-next-error) - ("p" . compilation-previous-error)) - - :config - (add-hook 'grep-mode-hook - (lambda () - ;; wrap lines - (setq-local truncate-lines nil)))) + ("p" . compilation-previous-error))) (provide 'init-grep) -- cgit v1.2.3