From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6454: 24.0.50; kill-buffer switches current-buffer Date: Fri, 25 Jun 2010 01:07:10 +0200 Message-ID: References: <4C1CC855.4060508@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1277422160 2120 80.91.229.12 (24 Jun 2010 23:29:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Jun 2010 23:29:20 +0000 (UTC) Cc: 6454@debbugs.gnu.org To: Helmut Eller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 25 01:29:19 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ORvrC-0003Ss-7g for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Jun 2010 01:29:18 +0200 Original-Received: from localhost ([127.0.0.1]:36188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORvrB-00051X-GS for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Jun 2010 19:29:17 -0400 Original-Received: from [140.186.70.92] (port=51883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORvr3-000505-LH for bug-gnu-emacs@gnu.org; Thu, 24 Jun 2010 19:29:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORvr2-0008E2-Jm for bug-gnu-emacs@gnu.org; Thu, 24 Jun 2010 19:29:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52849) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORvr2-0008Dy-Gt for bug-gnu-emacs@gnu.org; Thu, 24 Jun 2010 19:29:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ORvWd-0001CY-1r; Thu, 24 Jun 2010 19:08:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Jun 2010 23:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6454 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6454-submit@debbugs.gnu.org id=B6454.12774208414601 (code B ref 6454); Thu, 24 Jun 2010 23:08:03 +0000 Original-Received: (at 6454) by debbugs.gnu.org; 24 Jun 2010 23:07:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORvVw-0001CA-L1 for submit@debbugs.gnu.org; Thu, 24 Jun 2010 19:07:20 -0400 Original-Received: from smtp-04.vtx.ch ([194.38.175.93]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORvVu-0001C2-4K for 6454@debbugs.gnu.org; Thu, 24 Jun 2010 19:07:19 -0400 Original-Received: from ceviche.home (dyn.83-228-154-025.dsl.vtx.ch [83.228.154.25]) by smtp-04.vtx.ch (VTX Services SA) with ESMTP id 4449229ACC0; Fri, 25 Jun 2010 01:07:13 +0200 (CEST) Original-Received: by ceviche.home (Postfix, from userid 20848) id A1A47660E5; Fri, 25 Jun 2010 01:07:10 +0200 (CEST) In-Reply-To: (Helmut Eller's message of "Sun, 20 Jun 2010 09:48:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 24 Jun 2010 19:08:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37995 Archived-At: > Actually, I think there is a small bug there: if kill-buffer-hook is a > list of functions, the first function could potentially switch buffer > and the second function would be called in the wrong buffer. This is true of many hooks, yes, and we have generally taken the point of view that if a hook function changes the current buffer, there can be the following cases: - it's OK the hook expects this anyway (e.g. write-region-annotate-functions) - it breaks the code that runs the hook (e.g. kill-buffer): if the breakage is serious, it's a bug in the code that runs the hook that should protect itself from such changes. If the breakage is not too serious and/or the performance is considered a serious issue you may just say "don't do that" in the docstring of the hook. - it doesn't break the code that runs the hook, but it can break subsequent functions on that hook: we say that the bug is in the hook function, which simply should not change the current buffer. We may add a note in the hook's docstring telling coders no to do that. I think kill-buffer-hook is in the third category. -- Stefan