diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-02-01 23:35:23 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2020-02-01 23:37:27 +0100 |
commit | 8644265551ee36c0ba8624e668a49542be2fa6da (patch) | |
tree | aac3ee6cce8c55ab6d76c4b3227f94218e8c97e5 /lisp/init-grep.el | |
parent | bf6902c6da2c72df399f8136c9511bde7c2b4783 (diff) |
Replace add-hook calls with :hook
Diffstat (limited to 'lisp/init-grep.el')
-rw-r--r-- | lisp/init-grep.el | 14 |
1 files changed, 7 insertions, 7 deletions
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) |