Re: occur-hook changing the current buffer

From:

Lute Kamstra

Subject:

Re: occur-hook changing the current buffer

Date:

Thu, 23 Jun 2005 17:54:50 +0200

User-agent:

Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Jason Rumney <address@hidden> writes:
> 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.
You are drawing conclusions on a hunch. Maybe it's better to first
get a good understanding of the problems you're experiencing.
Lute.