From 2f9c95ae254ef34aa6b0bc9d5bdde5f9af2bbe75 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Tue, 5 Aug 2008 00:30:16 +0300 Subject: [PATCH] Provide default message when buffer is empty. --- git-status.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-status.el b/git-status.el index 946fef00..7e1dc6f1 100644 --- a/git-status.el +++ b/git-status.el @@ -369,7 +369,9 @@ (defun gits-log-edit-commit () (interactive) - (write-region (point-min) (point-max) ".git/gits-log") + (if (> (buffer-size) 0) + (write-region (point-min) (point-max) ".git/gits-log") + (write-region "(Empty description)" nil ".git/gits-log")) (erase-buffer) (gits-run "git-commit" "-F" ".git/gits-log") (bury-buffer)