From add6299da8e4fcbb2efa16d75b9126a536cdfca5 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Mon, 26 Aug 2002 17:39:25 +0000 Subject: Try to prevent associated buffers being killed off by user. --- generic/proof-utils.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'generic/proof-utils.el') diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 18ca1db8..e060d5af 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -242,6 +242,24 @@ Restrict to BUFLIST if it's set." (if (with-current-buffer buf (eq mode major-mode)) (setq bufs-got (cons buf bufs-got)))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Associated buffers +;; + +(defun pg-save-from-death () + "Prevent this associated buffer from being killed. +A hook function for `kill-buffer-hook'. +This is a fairly crude and not-entirely-robust way to prevent the +user accidently killing an associated buffer." + (if (and (proof-shell-live-buffer) proof-buffer-type) + (progn + (let ((bufname (buffer-name))) + (bury-buffer) + (message + "Warning: buffer %s not killed; still associated with prover process." + bufname))))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Key functions -- cgit v1.2.3