summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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