From cdaf04968469d1fad281d74cd42fc84ddcbeab06 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 1 Jul 2014 23:33:11 -0400 Subject: Use Magit autoloads --- lisp/init-git.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'lisp') diff --git a/lisp/init-git.el b/lisp/init-git.el index 5affb59..6860744 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -1,8 +1,8 @@ (add-to-list 'load-path "~/src/emacs/git-modes") (add-to-list 'load-path "~/src/emacs/magit") -(require 'magit) -(autoload 'magit-blame-mode "magit-blame" nil t) +(require 'magit-autoloads) +(require 'git-modes-autoloads) (require-package 'git-annex) (require 'git-annex) @@ -13,9 +13,6 @@ (key-chord-define-global ",g" 'magit-status) -(define-key magit-popup-mode-map (kbd "SPC ") 'magit-invoke-popup-switch) -(define-key magit-popup-mode-map (kbd "SPC SPC ") 'magit-invoke-popup-option) - (defun km/magit-auto-commit () "Commit all changes with \"auto\" commit message. Useful for non-source code repos (e.g., Org mode note files)." @@ -49,17 +46,6 @@ Useful for non-source code repos (e.g., Org mode note files)." (magit-run-git "branch" (concat "b/" current-branch)) (user-error "No current branch"))) -(magit-define-popup-action 'magit-commit-popup - ?u "Auto commit" 'km/magit-auto-commit) -(magit-define-popup-action 'magit-push-popup - ?a "Push all" 'km/magit-push-all) -(magit-define-popup-action 'magit-log-popup - ?a "All branches" 'km/magit-log-all-branches) -(magit-define-popup-action 'magit-branch-popup - ?t "Local tracking" 'km/magit-checkout-local-tracking) -(magit-define-popup-action 'magit-branch-popup - ?s "Backup current branch" 'km/magit-backup-branch) - ;; http://whattheemacsd.com/setup-magit.el-01.html (defadvice magit-status (around magit-fullscreen activate) ad-do-it @@ -73,4 +59,19 @@ Useful for non-source code repos (e.g., Org mode note files)." (setq vc-follow-symlinks t) +(after 'magit + (define-key magit-popup-mode-map (kbd "SPC ") 'magit-invoke-popup-switch) + (define-key magit-popup-mode-map (kbd "SPC SPC ") 'magit-invoke-popup-option) + + (magit-define-popup-action 'magit-commit-popup + ?u "Auto commit" 'km/magit-auto-commit) + (magit-define-popup-action 'magit-push-popup + ?a "Push all" 'km/magit-push-all) + (magit-define-popup-action 'magit-log-popup + ?a "All branches" 'km/magit-log-all-branches) + (magit-define-popup-action 'magit-branch-popup + ?t "Local tracking" 'km/magit-checkout-local-tracking) + (magit-define-popup-action 'magit-branch-popup + ?s "Backup current branch" 'km/magit-backup-branch)) + (provide 'init-git) -- cgit v1.2.3