diff options
author | Kyle Meyer <kyle@kyleam.com> | 2017-01-12 22:33:19 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2017-01-16 18:51:46 -0500 |
commit | 6529b9e95d48fe1a85340ef6884bcce2b456ad16 (patch) | |
tree | d2e4bf0b2dee46d895b47d856ed9dfdf347a70e7 | |
parent | 7e5cbba86c54914d6634d836fcdb61f6fc5b394f (diff) | |
download | emacs.d-6529b9e95d48fe1a85340ef6884bcce2b456ad16.tar.gz |
magit: Override sticky logs and diffs
I've tried, but I can't get used to the sticky arguments. Unless I
can see the log/diff buffer in the current frame, just kill it.
-rw-r--r-- | init.el | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -973,6 +973,24 @@ (magit-change-popup-key 'magit-branch-popup :action ?s ?v) + (defun km/magit-mode-kill-hidden (mode) + (let ((buffer (magit-mode-get-buffer mode))) + (unless (or (not buffer) + (get-buffer-window buffer) + (derived-mode-p mode)) + (kill-buffer buffer)))) + + (advice-add 'magit-log-popup + :before + (lambda (&rest _) + (km/magit-mode-kill-hidden 'magit-log-mode)) + '((name . "magit-log-kill-previous"))) + (advice-add 'magit-diff-popup + :before + (lambda (&rest _) + (km/magit-mode-kill-hidden 'magit-diff-mode)) + '((name . "magit-diff-kill-previous"))) + (advice-add 'magit-git-fetch :around (lambda (fn &rest args) |