[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No query on C-c C-k (message-kill-buffe)
From: |
Joe Casadonte |
Subject: |
Re: No query on C-c C-k (message-kill-buffe) |
Date: |
14 Sep 2002 10:19:56 -0400 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 |
On Fri, 13 Sep 2002, Harry Putnam wrote:
> How can I arrange things so that if I hit C-c C-k to kill a mesage
> buffer, it is just done with no double query?
(defun my-message-kill-buffer ()
"Kill the current buffer."
(interactive)
(let ((actions message-kill-actions))
(setq buffer-file-name nil)
(kill-buffer (current-buffer))
(message-do-actions actions)))
Then bind it to C-c C-k.
Alternately, point yes-or-no-p to something that no-ops, maybe as
around advice (so you can set it back afterwords).
(defadvice message-kill-buffer (around my-message-kill-buffer act)
"Disable annoying confirmation message."
(let (current)
(fset 'current (symbol-function 'yes-or-no-p))
(fset 'yes-or-no-p 'ignore)
ad-do-it
(fset 'yes-or-no-p (symbol-function 'current))))
The former solution is simpler, but should be revisited every time
'message' is updated; the latter will grow/change with 'message', but
you may be masking something other than just the question to kill the
current message buffer.
--
Regards,
joe
Joe Casadonte
jcasadonte@northbound-train.com
------------------------------------------------------------------------------
Llama Fresh Farms => http://www.northbound-train.com
Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
Perl for Win32 => http://www.northbound-train.com/perlwin32.html
Emacs Stuff => http://www.northbound-train.com/emacs.html
Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
Live Free, that's the message!
------------------------------------------------------------------------------