From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [PATCHv4 1/4] `kill-buffer' runs query functions before checking buffer modification. Date: Tue, 25 Jun 2013 08:47:02 +0200 Message-ID: <51C93CE6.9090303@gmx.at> References: <1c8f2cfbb1b7a321184c6d840763f1c60bbfc95b.1372076606.git.mina86@mina86.com> <51C87C47.4090300@gmx.at> <51C8B2AF.2090409@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1372142846 13158 80.91.229.3 (25 Jun 2013 06:47:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Jun 2013 06:47:26 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Michal Nazarewicz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 25 08:47:26 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UrN2B-0005Z5-Tk for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 08:47:24 +0200 Original-Received: from localhost ([::1]:48376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrN2B-0004z9-Hu for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 02:47:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrN23-0004oQ-1z for emacs-devel@gnu.org; Tue, 25 Jun 2013 02:47:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrN21-0004eH-0t for emacs-devel@gnu.org; Tue, 25 Jun 2013 02:47:14 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:53948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrN20-0004dr-OS for emacs-devel@gnu.org; Tue, 25 Jun 2013 02:47:12 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.1]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0Ll3jn-1UJ8Cw3kvN-00akPF for ; Tue, 25 Jun 2013 08:47:11 +0200 Original-Received: (qmail invoked by alias); 25 Jun 2013 06:47:11 -0000 Original-Received: from 62-47-49-71.adsl.highway.telekom.at (EHLO [62.47.49.71]) [62.47.49.71] by mail.gmx.net (mp001) with SMTP; 25 Jun 2013 08:47:11 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1++L50x2sC+g71FaxwFZx8E6u3u19Ja3Tec+LfGLQ FjhPr5Bb9jHIUE In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161012 Archived-At: > Changing the > > if (INTERACTIVE && !NILP (BVAR (b, filename)) > && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) > > condition to > > if (INTERACTIVE && BUFFER_LIVE_P (b) && !NILP (BVAR (b, filename)) > && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) > > would solve the issue. Either that or adding > > if (!BUFFER_LIVE_P (b)) > return unbind_to (count, Qt); > > just prior to the whole if statement which has the side effect of not > calling kill-buffer-hook if any of the kill-buffer-query-functions kills > the buffer, which actually may be desired. It's the early return I had in mind but changing the condition looks equally well to me. Note that we also have to change the Elisp info entry of `kill-buffer-query-functions'. martin