From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: BUG REPORT: `kill-buffer-query-functions' Date: Mon, 03 Mar 2003 13:58:55 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1046718275 11057 80.91.224.249 (3 Mar 2003 19:04:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 3 Mar 2003 19:04:35 +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 18pvEA-0002qQ-00 for ; Mon, 03 Mar 2003 20:03:54 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18pvX9-0007JS-00 for ; Mon, 03 Mar 2003 20:23:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18pvC1-00012k-00 for emacs-devel@quimby.gnus.org; Mon, 03 Mar 2003 14:01:41 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18pv9l-0000U0-00 for emacs-devel@gnu.org; Mon, 03 Mar 2003 13:59:21 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18pv9a-0000Mx-00 for emacs-devel@gnu.org; Mon, 03 Mar 2003 13:59:12 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18pv9R-00007S-00 for emacs-devel@gnu.org; Mon, 03 Mar 2003 13:59:01 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.10) id 18pv9L-0004kX-00; Mon, 03 Mar 2003 13:58:55 -0500 Original-To: Le Wang In-reply-to: (message from Le Wang on Fri, 28 Feb 2003 22:08:53 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12077 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12077 Now I understand. Does this fix it? Thanks. *** buffer.c.~1.414.~ Wed Feb 26 04:57:11 2003 --- buffer.c Sun Mar 2 15:07:46 2003 *************** *** 150,155 **** --- 150,156 ---- /* List of functions to call that can query about killing a buffer. If any of these functions returns nil, we don't kill it. */ Lisp_Object Vkill_buffer_query_functions; + Lisp_Object Qkill_buffer_query_functions; /* List of functions to call before changing an unmodified buffer. */ Lisp_Object Vfirst_change_hook; *************** *** 1304,1321 **** { int count = SPECPDL_INDEX (); Lisp_Object list; record_unwind_protect (save_excursion_restore, save_excursion_save ()); set_buffer_internal (b); /* First run the query functions; if any query is answered no, don't kill the buffer. */ ! for (list = Vkill_buffer_query_functions; CONSP (list); list = XCDR (list)) ! { ! tem = call0 (XCAR (list)); ! if (NILP (tem)) ! return unbind_to (count, Qnil); ! } /* Then run the hooks. */ Frun_hooks (1, &Qkill_buffer_hook); --- 1305,1320 ---- { int count = SPECPDL_INDEX (); Lisp_Object list; + Lisp_Object arglist[1]; record_unwind_protect (save_excursion_restore, save_excursion_save ()); set_buffer_internal (b); /* First run the query functions; if any query is answered no, don't kill the buffer. */ ! arglist[0] = Qkill_buffer_query_functions; ! if (NILP (Frun_hook_with_args_until_failure (1, arglist))) ! return unbind_to (count, Qnil); /* Then run the hooks. */ Frun_hooks (1, &Qkill_buffer_hook); *************** *** 5150,5155 **** --- 5149,5157 ---- Qafter_change_functions = intern ("after-change-functions"); staticpro (&Qafter_change_functions); staticpro (&Qucs_set_table_for_input); + + Qkill_buffer_query_functions = intern ("kill-buffer-query-functions"); + staticpro (&Qkill_buffer_query_functions); Fput (Qprotected_field, Qerror_conditions, Fcons (Qprotected_field, Fcons (Qerror, Qnil)));