From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: remove-hook. Date: Fri, 10 Oct 2003 16:25:49 +0200 Organization: CWI, Amsterdam Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1065796229 5803 80.91.224.253 (10 Oct 2003 14:30:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2003 14:30:29 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 10 16:30:27 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7yHj-0001E9-00 for ; Fri, 10 Oct 2003 16:30:27 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7yHb-0001ZM-00 for ; Fri, 10 Oct 2003 16:30:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A7yEk-0004HZ-CP for emacs-devel@quimby.gnus.org; Fri, 10 Oct 2003 10:27:22 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A7yEP-0004GQ-BC for emacs-devel@gnu.org; Fri, 10 Oct 2003 10:27:01 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A7yDr-00047m-Th for emacs-devel@gnu.org; Fri, 10 Oct 2003 10:27:00 -0400 Original-Received: from [192.16.191.8] (helo=hera.cwi.nl) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A7yDJ-0003qz-IN; Fri, 10 Oct 2003 10:25:53 -0400 Original-Received: from occarina.pna.cwi.nl (occarina.pna.cwi.nl [192.16.184.200]) by hera.cwi.nl with ESMTP id h9AEPo3t027913 for ; Fri, 10 Oct 2003 16:25:51 +0200 (MEST) Original-Received: (from lute@localhost) by occarina.pna.cwi.nl (8.12.8/8.12.5) id h9AEPnXw004216; Fri, 10 Oct 2003 16:25:49 +0200 X-Authentication-Warning: occarina.pna.cwi.nl: lute set sender to Lute.Kamstra@cwi.nl using -f Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 08 Oct 2003 00:52:10 -0400") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Original-Lines: 32 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17015 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17015 Richard Stallman 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.