From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Noah Friedman Newsgroups: gmane.emacs.devel Subject: find-alternate-file and kill-buffer-query-functions Date: Mon, 26 Aug 2002 21:01:19 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: <20020826210119.446702.FMU965@piglet.prv.splode.com> Reply-To: Noah Friedman NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1030420939 9860 127.0.0.1 (27 Aug 2002 04:02:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 Aug 2002 04:02:19 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17jXYX-0002Yl-00 for ; Tue, 27 Aug 2002 06:02:17 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17jY3f-0007fg-00 for ; Tue, 27 Aug 2002 06:34:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jXZq-0004VB-00; Tue, 27 Aug 2002 00:03:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jXXg-0004Qu-00 for emacs-devel@gnu.org; Tue, 27 Aug 2002 00:01:24 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jXXe-0004Qi-00 for emacs-devel@gnu.org; Tue, 27 Aug 2002 00:01:24 -0400 Original-Received: from scones-of-silence.splode.com ([216.27.180.143] helo=piglet.prv.splode.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jXXe-0004Qa-00; Tue, 27 Aug 2002 00:01:22 -0400 Original-Received: (from friedman@localhost) by piglet.prv.splode.com (8.9.3/8.9.3) id VAA14059; Mon, 26 Aug 2002 21:01:19 -0700 Original-To: rms@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6959 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6959 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))))