From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: occur-hook changing the current buffer Date: Thu, 23 Jun 2005 16:30:07 +0100 Message-ID: <42BAD57F.8040407@gnu.org> References: <871x6ucqat.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1119540367 27108 80.91.229.2 (23 Jun 2005 15:26:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Jun 2005 15:26:07 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 23 17:26:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DlTZA-0002uI-JK for ged-emacs-devel@m.gmane.org; Thu, 23 Jun 2005 17:24:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DlTg1-0002D8-Bq for ged-emacs-devel@m.gmane.org; Thu, 23 Jun 2005 11:31:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DlTff-000250-Gm for emacs-devel@gnu.org; Thu, 23 Jun 2005 11:31:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DlTfc-00023y-Qw for emacs-devel@gnu.org; Thu, 23 Jun 2005 11:31:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DlTfb-00022l-R7 for emacs-devel@gnu.org; Thu, 23 Jun 2005 11:31:11 -0400 Original-Received: from [217.207.198.106] (helo=exchange.integrasp.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DlThJ-0003tx-6W for emacs-devel@gnu.org; Thu, 23 Jun 2005 11:32:57 -0400 Original-Received: from ASSP-nospam (localhost [127.0.0.1]) by exchange.integrasp.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id NLJQCKMH; Thu, 23 Jun 2005 16:27:21 +0100 Original-Received: from 10.10.5.77 ([10.10.5.77] helo=[10.10.5.77]) by ASSP-nospam ; 23 Jun 05 15:27:21 -0000 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: Juanma Barranquero In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39369 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39369 Juanma Barranquero wrote: >The issue is that `fit-window-to-buffer', when called from >`occur-hook', changes the current buffer. > Yes, this seems like a real bug. I have noticed some other strange behaviour lately with things taking place in the wrong buffer. I use BBDB along with Gnus, and when I quit Gnus, there is a hook to offer to save ~/.bbdb if it has changed. Recently, this started to prompt me for the filename to save to, which I thought was strange, and when I investigated I discovered it was trying to save the Gnus "*Groups*" buffer instead of ~/.bbdb. I tried to trace through, but this just resulted in the correct behaviour. Another place I have noticed this is auto-insert. Sometimes (not consistently), when executing C-x C-f new-file.h, the auto-insert text for new-file.h is inserted into the buffer that was current before the C-x C-f, and that buffer stays current. Again, whenever I have tried to trace through the code, everything works perfectly. Both of these also involve hooks, which leads me to think something has changed with the ways hooks are run. If we continue to insist that it is the hooks that are wrong, not Emacs, then this will cause a lot of disruption to users.