From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Phillip Lord Newsgroups: gmane.emacs.help Subject: Re: How to protect a buffer from being deleted by accident? Date: 05 Dec 2002 13:58:25 +0000 Organization: BIOSCI/MRC Human Genome Mapping Project Resource Centre Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039097138 20595 80.91.224.249 (5 Dec 2002 14:05:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2002 14:05:38 +0000 (UTC) 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 18JwdC-0005L4-00 for ; Thu, 05 Dec 2002 15:05:34 +0100 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 18JwYr-0000Xc-00; Thu, 05 Dec 2002 09:01:05 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!peer1.news.newnet.co.uk!mephistopheles.news.clara.net!news.clara.net!feed.news.nacamar.de!newsfeed01.sul.t-online.de!t-online.de!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!hgmp.mrc.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: bromine.hgmp.mrc.ac.uk Original-X-Trace: niobium.hgmp.mrc.ac.uk 1039096706 7962 193.62.192.35 (5 Dec 2002 13:58:26 GMT) Original-X-Complaints-To: news@net.bio.net Original-NNTP-Posting-Date: Thu, 5 Dec 2002 13:58:26 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.92 Original-Xref: shelby.stanford.edu gnu.emacs.help:107755 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:4305 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4305 >>>>> "Adalbert" == Adalbert Perbandt writes: Adalbert> Hi there, Adalbert> At my site we're using clearcase mode (clearcase.el) for a Adalbert> long time with very few problems. Some time ago one of our Adalbert> users deleted the buffer "*clearcase*" inadvertently. Adalbert> Now I'd like to provide a simple mechanism which disallows Adalbert> for deletion of this buffer. I think, it would not be too Adalbert> complex to implement this but I don't know any simple Adalbert> method to get it done. Maybe there is a posibility to mark Adalbert> a specific buffer as "undeletable" or so. Adalbert> Any hints are welcome. There is a kill buffer hook, and also a variable called "kill-buffer-query-functions". You could put something in there. So it would go something like (defun clearcase-query-function() (interactive) (y-or-n-p "Really kill this buffer")) (add-hook 'clearcase-mode-hook (lambda() (interactive) (make-local-variable 'kill-buffer-query-functions) (add-to-list 'kill-buffer-query-functions 'clearcase-query-function))) I don't have a copy of clearcase.el around, so I don't know if clearcase-mode-hook is right or not. There should be something similar though. Cheers Phil