X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=setup%2Fmagit.el;h=c4405bba0458785cb3fdf8bd9be37baa956cd8cd;hb=e65c852bf3affe8d97a5d1122e5a44ff2baf2cc7;hp=1c2b2f078620da08708311f9193d7c74a76ead98;hpb=61cf5b5991669543f8710999aedd1d6b69972ae5;p=emacs-init.git diff --git a/setup/magit.el b/setup/magit.el index 1c2b2f0..c4405bb 100644 --- a/setup/magit.el +++ b/setup/magit.el @@ -1,27 +1,32 @@ (add-to-list 'load-path "~/.emacs.d/magit") (require 'magit) -(require 'advice) (require 'cl) -(setf (symbol-function 'builtin-process-file) (symbol-function 'process-file)) +(when (eq system-type 'windows-nt) -(defvar my-magit-shell "c:\\Program Files (x86)\\Git\\bin\\sh") + (require 'advice) -(defun my-magit-process-file (program &optional infile buffer display &rest args) - (builtin-process-file my-magit-shell infile buffer display - "-c" (mapconcat 'shell-quote-argument (cons "/bin/git" args) " "))) + (setf (symbol-function 'builtin-process-file) (symbol-function 'process-file)) -(defadvice magit-cmd-output (around my-magit-process-file activate) - (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) - ad-do-it)) + (defvar my-magit-shell "c:\\Program Files (x86)\\Git\\bin\\sh") -(defadvice magit-git-exit-code (around my-magit-process-file activate) - (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) - ad-do-it)) + (defun my-magit-process-file (program &optional infile buffer display &rest args) + (builtin-process-file my-magit-shell infile buffer display + "-c" (mapconcat 'shell-quote-argument (cons "/bin/git" args) " "))) -(defadvice magit-run (around activate) - (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) - ad-do-it)) + (defadvice magit-cmd-output (around my-magit-process-file activate) + (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) + ad-do-it)) + + (defadvice magit-git-exit-code (around my-magit-process-file activate) + (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) + ad-do-it)) + + (defadvice magit-run (around activate) + (letf (((symbol-function 'process-file) (symbol-function 'my-magit-process-file))) + ad-do-it)) + +); End Windows-NT (global-set-key "\C-cGS" 'magit-status) @@ -59,6 +64,6 @@ (if (not dir) (error "No git repository")) (if arg (setq symbol (read-string "Symbol: " nil nil symbol))) (let ((default-directory dir)) - (grep (format "git ls-files -z | xargs -r0 grep -nHF %s | cat -" symbol))))) + (grep (format "git ls-files -z | xargs -r0 grep -nwHF %s | cat -" symbol))))) (global-set-key "\C-cGF" 'git-files-find-symbol)