[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: occur-hook changing the current buffer
From: |
Miles Bader |
Subject: |
Re: occur-hook changing the current buffer |
Date: |
Wed, 22 Jun 2005 13:16:21 +0900 |
Juanma Barranquero <address@hidden> writes:
>> Once your code is fixed this is not needed any more. If the occur-hook is
>> expected to set-buffer in most/many cases, it might make sense, but
>> otherwise it doesn't.
>
> Well, I think it makes sense even if occur-hook is not expected to
> change the current buffer in most/many cases. Just one is enough, if
> it makes the user lose work.
The hook-invoker shouldn't have to protect against every possible
bizarre action that a hook _might_ perform -- it's impossible to do, and
even trying to do it adds unnecessary overhead.
I find it hard to believe that anybody would expect changing the current
buffer in a hook _not_ to cause weird problems. Returning from a
function with the current buffer changed is a fairly serious thing; you
should never do it without considering the effects on your caller. This
is not something esoteric, it's elisp programming 101.
-Miles
--
Come now, if we were really planning to harm you, would we be waiting here,
beside the path, in the very darkest part of the forest?
- occur-hook changing the current buffer, Juanma Barranquero, 2005/06/20
- Re: occur-hook changing the current buffer, Stefan Monnier, 2005/06/21
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/21
- Re: occur-hook changing the current buffer, Stefan Monnier, 2005/06/22
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/22
- Re: occur-hook changing the current buffer,
Miles Bader <=
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/22
- Re: occur-hook changing the current buffer, Miles Bader, 2005/06/22
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/22
- Re: occur-hook changing the current buffer, Juri Linkov, 2005/06/22
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/22
- Re: occur-hook changing the current buffer, Miles Bader, 2005/06/22
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/23
- Re: occur-hook changing the current buffer, Emilio Lopes, 2005/06/23
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/23
- Re: occur-hook changing the current buffer, Jason Rumney, 2005/06/23