summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs21
1 files changed, 18 insertions, 3 deletions
diff --git a/.emacs b/.emacs
index 6d7ba70..b044ac8 100644
--- a/.emacs
+++ b/.emacs
@@ -226,6 +226,20 @@
(require 'project)
(magit-status (project-prompt-project-dir)))
+(defun my/magit-toggle-margin-date ()
+ (interactive)
+ (let ((do-message
+ (lambda (old new)
+ (message
+ "%s ⇒ %s"
+ (propertize old 'face 'shadow)
+ (propertize new 'face 'bold)))))
+ (apply do-message (if magit-log-margin-show-committer-date
+ '("commit" "author") '("author" "commit")))
+ (setq magit-log-margin-show-committer-date
+ (not magit-log-margin-show-committer-date))
+ (revert-buffer)))
+
(defmacro my/define-prefix-command (name doc bindings)
(declare (indent defun))
`(defvar ,name
@@ -255,10 +269,11 @@
(my/define-prefix-command my/magit-map
"Keymap for Magit commands."
- '(("f" magit-file-dispatch)
- ("\C-f" magit-find-file)
+ '(("d" my/magit-toggle-margin-date)
+ ("f" magit-file-dispatch)
("g" magit-status)
- ("x" magit-dispatch)))
+ ("x" magit-dispatch)
+ ("\C-f" magit-find-file)))
(my/define-prefix-command my/input-map
"Keymap for input methods shortcuts."