Commit 4a30fd88 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-commit-diff: allow local quit to terminate diffing

without also aborting the commit.  This is useful when committing
unusually large changes.  Quitting causes the diff buffer to be
partially unwashed.

Do not use `with-local-quit' because that would be propagated to
the `with-local-quit' in `server-execute', which would cause the
commit to be aborted instead of just the diffing.
parent 17584ad6
......@@ -4,6 +4,10 @@ Magit v2.5.1 Release Notes (draft)
Updates since v2.5.0
--------------------
* When washing the diff that is to be displayed while writing a
commit message takes to long, then it is now possible to abort that
by pressing `C-g'. Previously that would have aborted the commit.
Fixes since v2.5.0
------------------
......
......@@ -303,9 +303,13 @@ depending on the value of option `magit-commit-squash-confirm'."
(apply-partially 'magit-diff-staged nil))
(`magit-commit-amend 'magit-diff-while-amending)
(`magit-commit-reword 'magit-diff-while-amending)))
(let ((magit-inhibit-save-previous-winconf 'unset)
(magit-display-buffer-noselect t))
(funcall it (car (magit-diff-arguments))))))
(condition-case nil
(let ((magit-inhibit-save-previous-winconf 'unset)
(magit-display-buffer-noselect t)
(inhibit-quit nil))
(message "Diffing changes to be committed (C-g to abort diffing)")
(funcall it (car (magit-diff-arguments))))
(quit))))
(add-hook 'server-switch-hook 'magit-commit-diff)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment