From: Stefan Bund Date: Tue, 14 May 2013 14:44:00 +0000 (+0200) Subject: some updates X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=c092392ed120e24105657ad2ac61a7fd03261b2d;p=emacs-init.git some updates --- diff --git a/setup/magit.el b/setup/magit.el index b3d0b70..8b72824 100644 --- a/setup/magit.el +++ b/setup/magit.el @@ -84,3 +84,15 @@ (dired (cons default-directory (split-string (shell-command-to-string "git ls-files") "\n"))))) (global-set-key "\C-cGD" 'dired-git-files) + +(defun magit-svn-fetch () + (interactive) + (magit-run-git-async "svn" "fetch")) + +(define-key magit-mode-map "Nf" 'magit-svn-fetch) + +(defun magit-quit-window (&optional kill-buffer) + (interactive "P") + (quit-window kill-buffer)) + +(setq magit-diff-options '("-w")) diff --git a/setup/mywin.el b/setup/mywin.el index 63ab71d..28314e8 100644 --- a/setup/mywin.el +++ b/setup/mywin.el @@ -154,25 +154,30 @@ window smaller than MIN-HEIGHT lines." (global-set-key "\C-xp" 'other-window-reverse) (global-set-key "\C-\M-_" (lambda () (interactive) (safe-shrink-window 5))) -(defun my-swap-window-to-right (&optional stay) +(defun my-swap-window-to-right (&optional below) + "If swap buffer in this window with buffer on the right. If BELOW is set, +instead move current buffer to right and replace it with the next buffer from +the buffer stack in the current window." (interactive "P") (let ((cb (current-buffer)) (cw (selected-window))) + (if below + (switch-to-buffer nil)) (windmove-right) - (set-window-buffer cw (current-buffer)) - (switch-to-buffer cb) - (if stay - (select-window cw)))) + (if (not below) + (set-window-buffer cw (current-buffer))) + (switch-to-buffer cb))) -(defun my-swap-window-to-left (&optional stay) +(defun my-swap-window-to-left (&optional below) (interactive "P") (let ((cb (current-buffer)) (cw (selected-window))) + (if below + (switch-to-buffer nil)) (windmove-left) - (set-window-buffer cw (current-buffer)) - (switch-to-buffer cb) - (if stay - (select-window cw)))) + (if (not below) + (set-window-buffer cw (current-buffer))) + (switch-to-buffer cb))) (global-set-key "\C-x>" 'my-swap-window-to-right) (global-set-key "\C-x<" 'my-swap-window-to-left)