然后把下面的代码加入到.emacs文件:
(defun svn-update() "Svn update" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:update /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd))) (defun svn-commit() "Svn commit" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:commit /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd))) ;;SVN diff (defun svn-diff() "Svn diff" (interactive) (let ((cmd (concat "TortoiseProc.exe /command:diff /path:\"" buffer-file-name "\" /closeonend:0"))) (message cmd) (shell-command cmd)))
在需要进行SVN同步的buffer下,使用方式:
M-x: svn-diff
M-x: svn-update
M-x: svn-commit
最常用的三个命令在emacs下就可以工作了。