From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Chris McMahan Newsgroups: gmane.emacs.help Subject: Re: How to make a command ask "You *really* want to do this?" Date: 29 Apr 2003 13:41:29 -0400 Organization: PANIX Public Access Internet and UNIX, NYC Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <87ptn5jjs3.fsf@blarg.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1051641080 17906 80.91.224.249 (29 Apr 2003 18:31:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2003 18:31:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 29 20:31:17 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19AZsB-0004a8-00 for ; Tue, 29 Apr 2003 20:30:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19AZrx-0001vZ-00 for gnu-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2003 14:30:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: panix2.panix.com Original-X-Trace: reader1.panix.com 1051638093 4687 166.84.1.2 (29 Apr 2003 17:41:33 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Tue, 29 Apr 2003 17:41:33 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:112532 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9029 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9029 Here's some code to do just that... ;;;====================================================================== ;;; ask if you REALLY want to quit emacs ;;;====================================================================== (defun ask-before-quit () "Ask if the user really wants to quit Emacs." (interactive) (y-or-n-p "Really quit emacs? ")) (add-hook 'kill-emacs-query-functions 'ask-before-quit) Eric Hanchrow writes: > >>>>> "David" == David Combs writes: > > David> Anyway, I do like how C-x n asks if I'm sure that I really > David> want to narrow; I'd like to get eg C-x C-c to do the same > David> thing (requiring a fully-typed-in "yes", maybe even two of > David> them!), > > Simply "disable" the command, like so: > > (put 'save-buffers-kill-emacs 'disabled > "Nobody in their right mind would ever want to kill Emacs.\n") > > -- > > |\ _,,,---,,_ > ZZZzz /,`.-'`' -. ;-;;,_ > |,4- ) )-,_. ,\ ( `'-' > '---''(_/--' `-'\_) fL > -- Igor Pechtchanski -- (. .) =ooO=(_)=Ooo======================== Chris McMahan | cmcmahan-AT-one.net ====================================