emacs-devel
[Top][All Lists]
Advanced

[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: Wed, 22 Jun 2005 10:04:37 +0200

> The hook-invoker shouldn't have to protect against every possible
> bizarre action that a hook _might_ perform

No. Sure I didn't say that. Did I?

What I'm saying is: *some* hooks should protect against *some*
possible actions/errors; which ones it's something to ponder. *In this
case*, occur-hook should IMO protect against changing the buffer,
because *in this case*, not protecting against it could lead to
accidental data loss.

> -- it's impossible to do, and
> even trying to do it adds unnecessary overhead.

Of course.

> 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. 

What part of "my function changed the buffer by accident, not by
design" and "I could have lost data" is not clear?

> This
> is not something esoteric, it's elisp programming 101.

Thanks for the introductory class :)

-- 
                    /L/e/k/t/u




reply via email to

[Prev in Thread] Current Thread [Next in Thread]