From 27d1d45d90f20f4dad7d9056502bfe963391ca50 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 8 Dec 2014 15:43:02 +0900 Subject: [PATCH] Add prefs for new git-command api --- emacs.el | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/emacs.el b/emacs.el index 112c697..139c960 100644 --- a/emacs.el +++ b/emacs.el @@ -938,14 +938,25 @@ found, otherwise returns nil." t) (lazy-load-eval 'git-command nil - (if (boundp 'git-command-major-mode-alist) - (progn - (add-to-list 'git-command-major-mode-alist - '("di" . diff-mode)) - (add-to-list 'git-command-major-mode-alist - '("graph" . fundamental-mode)) - (add-to-list 'git-command-major-mode-alist - '("log" . fundamental-mode)))) + ;; old git-command + (when (boundp 'git-command-major-mode-alist) + (add-to-list 'git-command-major-mode-alist + '("di" . diff-mode)) + (add-to-list 'git-command-major-mode-alist + '("graph" . fundamental-mode)) + (add-to-list 'git-command-major-mode-alist + '("log" . fundamental-mode))) + + ;; new git-command + (when (boundp 'git-command-view-command-list) + (add-to-list 'git-command-view-command-list + "graph")) + (when (boundp 'git-command-aliases-alist) + (add-to-list 'git-command-aliases-alist + '("di" . (lambda (options cmd args) + (git-command-exec options + "diff" + args))))) (or git-command-prompt-file (setq git-command-prompt-file (git-command-find-git-ps1