[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: occur-hook changing the current buffer
From: |
Juanma Barranquero |
Subject: |
Re: occur-hook changing the current buffer |
Date: |
Thu, 23 Jun 2005 01:37:24 +0200 |
> Why setting the not-modified flag comes after running a hook? AFAIK,
> there is a convention that run-hook should be the last element in the
> function body, so users could override every default settings of the
> function, including in this particular case setting the modification flag.
The Emacs Lisp Reference makes that claim about major-mode hooks and,
less strongly, about minor-mode hooks. Certainly I'm not aware of such
a convention for non-mode hooks, like `occur-hook', and I don't think
it would make sense: hooks are set up at convenient moments, which do
not necessarily coincide with function boundaries.
> So it seems the correct fix is just to move (run-hooks 'occur-hook) down
> to be the last funcall in the `occur-1' function body.
Hey, it's funny: if I had proposed to move the code setting the
read-only and not-modified flags to before run-hooks, instead of
protecting the hook functions from changing the current buffer,
perhaps no one would have complained... :)
--
/L/e/k/t/u
- Re: occur-hook changing the current buffer, (continued)
- 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, 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/22
- Re: occur-hook changing the current buffer, Juri Linkov, 2005/06/22
- Re: occur-hook changing the current buffer,
Juanma Barranquero <=
- 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
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/23
- Re: occur-hook changing the current buffer, Lute Kamstra, 2005/06/23
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/23
- Re: occur-hook changing the current buffer, Lute Kamstra, 2005/06/24
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/24