Juanma Barranquero <[EMAIL PROTECTED]> 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? _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel