From: yamaoka Date: Wed, 18 Nov 1998 06:51:08 +0000 (+0000) Subject: (message-mimic-kill-buffer): New function. X-Git-Tag: pgnus-ichikawa-199811302358~32 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0085ac597bba655e83a334e799dd04192c369a3a;p=elisp%2Fgnus.git- (message-mimic-kill-buffer): New function. (message-mode-map): Use it for `C-x k'. --- diff --git a/lisp/message.el b/lisp/message.el index 9e4f83f..5c87339 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1459,7 +1459,7 @@ Point is left at the beginning of the narrowed-to region." (define-key message-mode-map "\t" 'message-tab) (define-key message-mode-map "\C-x\C-s" 'message-save-drafts) - (define-key message-mode-map "\C-xk" 'message-kill-buffer)) + (define-key message-mode-map "\C-xk" 'message-mimic-kill-buffer)) (easy-menu-define message-mode-menu message-mode-map "Message Menu." @@ -2171,6 +2171,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)