[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find-alternate-file and kill-buffer-query-functions
From: |
Noah Friedman |
Subject: |
find-alternate-file and kill-buffer-query-functions |
Date: |
Mon, 26 Aug 2002 21:01:19 -0700 (PDT) |
I've been wondering why it was that sometimes all my shell buffers and
other things I had protected from accidentally killing with a hook on
kill-buffer-query-functions, would sometimes get killed anyway when I
marked everything for deletion in the buffer menu.
It turns out that find-alternate-file is setting
kill-buffer-query-functions to nil; this was a change made 2002-07-14.
This variable is not buffer-local by default. I think you need to
let-bind it carefully using something like the logic below:
...
(unless (eq (current-buffer) obuf)
;; We already asked; don't ask again.
(save-excursion
;; switch to buffer before shadowing query functions, in case
;; they are buffer-local
(set-buffer obuf)
(let ((kill-buffer-query-functions nil))
(kill-buffer obuf))))
- find-alternate-file and kill-buffer-query-functions,
Noah Friedman <=