From 8e5a9df501f02d2b82d76a642b740ccefd0e77cf Mon Sep 17 00:00:00 2001 From: Jonathan Kotta Date: Thu, 18 Mar 2010 17:31:15 -0700 Subject: [PATCH] [commit-patch-buffer.el] Only display the commit-patch output when there is an error. --- commit-patch-buffer.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index b40e0b6..da42fa5 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -26,10 +26,8 @@ `(lambda () (interactive) (let ((patch (make-temp-file "commit-buffer" nil)) (comment (buffer-string)) - (output-buffer (window-buffer - (display-buffer - (get-buffer-create "*commit-patch*"))))) - (unwind-protect + (output-buffer (get-buffer-create "*commit-patch*"))) + (unwind-protect (progn (with-current-buffer ,buffer (write-region (point-min) (point-max) patch)) @@ -40,7 +38,9 @@ output-buffer 'display "-m" comment))) (if (not (eq status 0)) - (message "Commit patch failed with a status of '%S' (%S)." status patch) + (progn + (window-buffer (display-buffer output-buffer)) + (message "Commit patch failed with a status of '%S' (%S)." status patch)) (mapc (lambda (buf) (with-current-buffer buf (vc-resynch-buffer (buffer-file-name buf) 'revert 'noquery) ;; stupid vc-revert-buffer1 doesn't call revert-buffer -- 2.51.2