From: yoichi Date: Sat, 27 Apr 2002 16:16:48 +0000 (+0000) Subject: * wl-draft (wl-draft-mimic-kill-buffer): Mimic kill-buffer and ask if X-Git-Tag: elmo-mark-root~195 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b929c2d2ac2aaaae2658a6daa74e36b2b3d3768e;p=elisp%2Fwanderlust.git * wl-draft (wl-draft-mimic-kill-buffer): Mimic kill-buffer and ask if the current buffer is modified. --- 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."