dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit 6584352f9cb348193a9a217398776138c91212a3
parent 9f187474ea27c781f93ed9835167067bc4545540
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sun, 30 Jul 2023 11:12:56 +0200

Add command to toggle between author/commit dates

Diffstat:
M.emacs | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git 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."