unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* No query on C-c C-k (message-kill-buffe)
@ 2002-09-13 22:59 Harry Putnam
  2002-09-14 14:19 ` Joe Casadonte
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Putnam @ 2002-09-13 22:59 UTC (permalink / raw)



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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: No query on C-c C-k (message-kill-buffe)
  2002-09-13 22:59 No query on C-c C-k (message-kill-buffe) Harry Putnam
@ 2002-09-14 14:19 ` Joe Casadonte
  2002-09-14 17:38   ` Harry Putnam
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Casadonte @ 2002-09-14 14:19 UTC (permalink / raw)


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!
------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: No query on C-c C-k (message-kill-buffe)
  2002-09-14 14:19 ` Joe Casadonte
@ 2002-09-14 17:38   ` Harry Putnam
  0 siblings, 0 replies; 3+ messages in thread
From: Harry Putnam @ 2002-09-14 17:38 UTC (permalink / raw)


"Joe Casadonte" <jcasadonte@northbound-train.com> writes:

> 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?

Thanks for the code Joe.

Looks interesting.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-14 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-13 22:59 No query on C-c C-k (message-kill-buffe) Harry Putnam
2002-09-14 14:19 ` Joe Casadonte
2002-09-14 17:38   ` Harry Putnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).