emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: remove-hook.


From: Lute Kamstra
Subject: Re: remove-hook.
Date: Fri, 10 Oct 2003 16:25:49 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     It also seems necessary to keep remove-hook efficient: when I
>     instrumented it, I noticed that it was called twice every
>     keystroke.
>
> That really surprises me.  Who is calling it, and why?

I tried to figure this out, but it is rather annoying, to say the
least.  Once I instrument remove-hook, almost every key I press
triggers Edebug (one or more times).  Who is calling remove hook to do
what depends on which features are turned on.  I also get the
impression (not sure, though) that Edebug itself causes remove-hook to
be called.  The horror, the horror...

Before I went insane, I did manage to come up with a simple and,
hopefully, easy to reproduce example.  Start Emacs with "emacs -q
--no-site-file lisp/subr.el" and do "C-u C-M-x" on remove-hook.  Now
try moving around the buffer a bit.  Every keystroke will warp you
into Edebug due to a (remove-hook 'pre-command-hook
'blink-cursor-end).

If you want to go insane too, start Emacs with "emacs -q
--no-site-file lisp/subr.el", do "M-x global-font-lock-mode", and do
"C-u C-M-x" on remove-hook.  Now switch to the *scratch* buffer with
"C-x b RET" (this will invoke Edebug some 12 times, just `c' through
them) and then try to type something into the *scratch* buffer.  Every
insertion evokes Edebug 5 times.

Enjoy!

  Lute.




reply via email to

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