From bce09e9291381b477232aef295c54027d31bb6f3 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 18 Nov 1998 06:49:50 +0000 Subject: [PATCH] (message-mimic-kill-buffer): New function. (message-mode-map): Use it for `C-x k'. --- lisp/message.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lisp/message.el b/lisp/message.el index 49f1953..b753274 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1995,6 +1995,19 @@ The text will also be indented the normal way." (message-delete-frame frame org-frame))) (message "")) +(defun message-mimic-kill-buffer () + "Kill the current buffer with query." + (interactive) + (if (buffer-modified-p) + (message-kill-buffer) + (let ((command this-command) + (bufname (read-buffer (format "Kill buffer: (default %s) " + (buffer-name))))) + (if (or (not bufname) + (string-equal bufname (buffer-name))) + (message-kill-buffer) + (message "%s must be invoked only for the current buffer." command))))) + (defun message-delete-frame (frame org-frame) "Delete frame for editing message." (when (and (or (and (featurep 'xemacs) -- 1.7.10.4