From 3cb44c0ba3f74639ad1abde5cf77292825fdd378 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Wed, 31 May 2017 20:57:41 +0200 Subject: Do not use :config to declare functions --- lisp/init-git.el | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'lisp/init-git.el') diff --git a/lisp/init-git.el b/lisp/init-git.el index c739e74..1cd7d39 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -13,6 +13,21 @@ (when (featurep 'flyspell) (flyspell-mode 1))))) ;; magit config +(defun magit-diff-visit-file-other-window (&optional noselect) + "Visit current file in another window." + (interactive) + (let ((current-window (selected-window)) + ;; magit-diff-visit-file visits in other-window with prefix arg + (current-prefix-arg t)) + (call-interactively 'magit-diff-visit-file) + (when noselect + (select-window current-window)))) + +(defun magit-diff-visit-file-other-window-noselect () + "Visit current file in another window, but don't select it." + (interactive) + (magit-diff-visit-file-other-window t)) + (use-package magit :init ;; disable gravatars @@ -23,23 +38,7 @@ :map magit-status-mode-map ;; make C-o and o behave as in dired ("o" . magit-diff-visit-file-other-window) - ("C-o" . magit-diff-visit-file-other-window-noselect)) - - :config - (defun magit-diff-visit-file-other-window (&optional noselect) - "Visit current file in another window." - (interactive) - (let ((current-window (selected-window)) - ;; magit-diff-visit-file visits in other-window with prefix arg - (current-prefix-arg t)) - (call-interactively 'magit-diff-visit-file) - (when noselect - (select-window current-window)))) - - (defun magit-diff-visit-file-other-window-noselect () - "Visit current file in another window, but don't select it." - (interactive) - (magit-diff-visit-file-other-window t))) + ("C-o" . magit-diff-visit-file-other-window-noselect))) ;; follow symlinks to files under version control (setq vc-follow-symlinks t) -- cgit v1.2.3