Prevent killing an ESS process buffer unintentionally

rijn at swi.psy.uva.nl rijn at swi.psy.uva.nl
Fri Feb 23 18:29:36 CET 2001


Someone posted a request at the R-help mailing list for a confirmation
question when killing an ESS process buffer. As was pointed out to me by
one of the readers of that list, the solution I posted might be of intrest
for people of this list too. Please find the orginal message below:

Groet,
  Hedderik.

---

A couple of days ago I posted some elisp code that asks the user for
confirmation before deleting a process buffer, e.g. the *R* buffer. However,
this code was only evaluated if a buffer was killed by means of [C-x k]. The
following code does not need to be bound to a particular key, it's
internally called by kill-buffer. (Also works if buffer is deleted in other
ways, e.g., [C-x C-c].)

(defun h-kill-buffer-query-function ()
  (or (not (get-buffer-process (buffer-name)))
      (yes-or-no-p (format "Kill process associated with %s? " (buffer-name)))))

(add-hook 'kill-buffer-query-functions
	  'h-kill-buffer-query-function)

Probably, this functionality already exists in emacs but after searching for
some time, it seemed faster to write it myself. (That is, I
copy-paste-and-adapted it from gnuserv.el.)

Groet,
  Hedderik.

-- 
http://swipc30.swi.psy.uva.nl/~rijn

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
ess-help mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: ess-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the ESS-help mailing list