summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-11-08 08:21:05 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-11-08 08:21:05 -0700
commit3520e3b516980c3f543601ab2e0835f293f2cb24 (patch)
tree9e3a566fc160db6a98a541139be05359ea372766
parentdd2c257a5d3c26bf15f51df7ff8cf0262a5b4c00 (diff)
downloaddotfiles-3520e3b516980c3f543601ab2e0835f293f2cb24.tar.gz
move calling log-edit-show-diff into log-edit-hook
-rw-r--r--.emacs.d/init.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index dbf0e335..46efa01c 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -252,7 +252,7 @@ windows side-by-side in the frame."
'(imenu-auto-rescan t)
'(kill-read-only-ok t)
'(log-edit-hook
- '(log-edit-insert-message-template log-edit-insert-cvs-template log-edit-insert-changelog) nil nil "Avoid list of files window becoming the most recently used for C-x o.")
+ '(log-edit-insert-message-template log-edit-insert-cvs-template log-edit-insert-changelog spw/log-edit-show-diff) nil nil "Drop log-edit-show-files to avoid its window becoming most recently used for C-x o.")
'(magit-define-global-key-bindings nil)
'(magit-diff-refine-hunk 'all)
'(magit-save-repository-buffers nil)
@@ -3711,14 +3711,13 @@ mutt's review view, after exiting EDITOR."
"@{1}" "@{0}" nil "*vc-reflog-diff*")))
(global-set-key "\C-cvD" #'eshell/rld)
-(defun spw/vc-next-action ()
+(defun spw/log-edit-show-diff ()
"Unless directly committing a diff, immediately show what we're committing."
(interactive)
- (let ((diff-mode-p (derived-mode-p 'diff-mode)))
- (call-interactively #'vc-next-action)
- (when (and (derived-mode-p 'log-edit-mode) (not diff-mode-p))
- (log-edit-show-diff))))
-(global-set-key [remap vc-next-action] #'spw/vc-next-action)
+ (unless (and vc-parent-buffer
+ (with-current-buffer vc-parent-buffer
+ (derived-mode-p 'diff-mode)))
+ (log-edit-show-diff)))
;;; If we just add `vc-print-root-log' to `project-switch-commands', it seems
;;; to work, but if you try to expand any commits it'll try to run git(1) in