summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-06-29 20:38:50 -0400
committerKyle Meyer <kyle@kyleam.com>2016-06-29 20:38:50 -0400
commit6c1a913818b3be52ad96c32ee08e3f7dc2f43b6f (patch)
tree0cd744bde73ba84a54b19676bcebb798b5ab0ca0
parent2c149f17ab3f6a0441e4f185b2bf96611dab4984 (diff)
downloademacs.d-6c1a913818b3be52ad96c32ee08e3f7dc2f43b6f.tar.gz
Add magit-status variant
-rw-r--r--init.el4
-rw-r--r--lisp/km-magit.el12
2 files changed, 14 insertions, 2 deletions
diff --git a/init.el b/init.el
index 0ccb8e1..ae7505d 100644
--- a/init.el
+++ b/init.el
@@ -838,8 +838,8 @@
(use-package magit
:load-path "~/src/emacs/magit/lisp/"
:defer t
- :bind ("C-x g" . magit-status)
- :chords ("jg" . magit-status)
+ :bind ("C-x g" . km/magit-status)
+ :chords ("jg" . km/magit-status)
:init
(load "magit-autoloads.el" t)
(bind-keys :map km/git-map
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 5edfbb4..9455237 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -26,6 +26,18 @@
(require 'magit)
(require 'projectile)
+(defun km/magit-status (&optional default-display)
+ "Like `magit-status', but change the meaning of the prefix argument.
+If DEFAULT-DISPLAY is non-nil, use
+`magit-display-buffer-traditional' as the value for
+`magit-display-buffer-function'."
+ (interactive "P")
+ (let ((magit-display-buffer-function (if default-display
+ #'magit-display-buffer-traditional
+ magit-display-buffer-function))
+ (current-prefix-arg nil))
+ (call-interactively #'magit-status)))
+
(defun km/magit-auto-commit ()
"Commit all changes with \"auto\" commit message.
This can be useful for non-source code repos (e.g., Org mode note