From b929c2d2ac2aaaae2658a6daa74e36b2b3d3768e Mon Sep 17 00:00:00 2001 From: yoichi Date: Sat, 27 Apr 2002 16:16:48 +0000 Subject: [PATCH] * wl-draft (wl-draft-mimic-kill-buffer): Mimic kill-buffer and ask if the current buffer is modified. --- wl/wl-draft.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 108a970..a10a0ce 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1303,12 +1303,17 @@ Derived from `message-save-drafts' in T-gnus." (let ((bufname (read-buffer (format "Kill buffer: (default %s) " (buffer-name)))) wl-draft-use-frame) - (when (or (not bufname) + (if (or (not bufname) (string-equal bufname "") (string-equal bufname (buffer-name))) - (setq bufname (current-buffer)) - (wl-draft-hide bufname)) - (kill-buffer bufname))) + (let ((bufname (current-buffer))) + (when (or (not (buffer-modified-p)) + (yes-or-no-p + (format "Buffer %s modified; kill anyway? " bufname))) + (set-buffer-modified-p nil) + (wl-draft-hide bufname) + (kill-buffer bufname))) + (kill-buffer bufname)))) (defun wl-draft-save-and-exit () "Save current draft and exit current draft mode." -- 1.7.10.4