all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phillip Lord <p.lord@russet.org.uk>
Subject: Re: How to protect a buffer from being deleted by accident?
Date: 05 Dec 2002 13:58:25 +0000	[thread overview]
Message-ID: <vfptsgr2im.fsf@rpc71.cs.man.ac.uk> (raw)
In-Reply-To: ypfqr8cwip18.fsf@yew.hl.siemens.de

>>>>> "Adalbert" == Adalbert Perbandt <adalbert.perbandt@infineon.com> 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

  reply	other threads:[~2002-12-05 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-05 13:16 How to protect a buffer from being deleted by accident? Adalbert Perbandt
2002-12-05 13:58 ` Phillip Lord [this message]
2002-12-05 14:38 ` Colin Marquardt
2002-12-05 15:22 ` Jesper Harder
2002-12-05 15:36 ` Tom Capey
2002-12-06 19:43 ` Jeffery B. Rancier
     [not found] ` <mailman.1039203908.24681.help-gnu-emacs@gnu.org>
2002-12-11 17:48   ` Adalbert Perbandt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vfptsgr2im.fsf@rpc71.cs.man.ac.uk \
    --to=p.lord@russet.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.