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: Tue, 07 Oct 2003 16:00:36 +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 1065535610 1845 80.91.224.253 (7 Oct 2003 14:06:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2003 14:06:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Oct 07 16:06:48 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 1A6sUC-00025d-00 for ; Tue, 07 Oct 2003 16:06:48 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A6sU7-0000BK-00 for ; Tue, 07 Oct 2003 16:06:48 +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 1A6sTV-0004qd-1M for emacs-devel@quimby.gnus.org; Tue, 07 Oct 2003 10:06:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A6sTP-0004pP-OL for emacs-devel@gnu.org; Tue, 07 Oct 2003 10:05:59 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A6sSs-0004Wp-UV for emacs-devel@gnu.org; Tue, 07 Oct 2003 10:05:58 -0400 Original-Received: from [192.16.191.8] (helo=hera.cwi.nl) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A6sOL-0003cE-WD for emacs-devel@gnu.org; Tue, 07 Oct 2003 10:00:46 -0400 Original-Received: from occarina.pna.cwi.nl (occarina.pna.cwi.nl [192.16.184.200]) by hera.cwi.nl with ESMTP id h97E0bfA005509 for ; Tue, 7 Oct 2003 16:00:37 +0200 (MEST) Original-Received: (from lute@localhost) by occarina.pna.cwi.nl (8.12.8/8.12.5) id h97E0a5l008826; Tue, 7 Oct 2003 16:00:36 +0200 X-Authentication-Warning: occarina.pna.cwi.nl: lute set sender to Lute.Kamstra@cwi.nl using -f Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "07 Oct 2003 09:42:23 -0400") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Original-Lines: 27 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:16983 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16983 Stefan Monnier writes: >> When does remove-hook need to make a hook buffer-local to remove a >> function from it? > > (add-hook 'foo-hook 'bar) > (remove-hook 'foo-hook 'bar 'local) > > > PS: Admittedly, this doesn't work in Emacs-CVS because the only way this > can work is if we can put "negative" entries on the local side of > a hook to disable an element on the global side. If it doesn't work, the docstring is confusing. > I have code to make it work, I'm curious... can I have a peek? > but last time this came up RMS said it was overkill. I tend to agree that such a system would get rather complicated. It also seems necessary to keep remove-hook efficient: when I instrumented it, I noticed that it was called twice every keystroke. Lute.