From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: remove-hook. Date: 07 Oct 2003 11:24:49 -0400 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 1065540442 14258 80.91.224.253 (7 Oct 2003 15:27:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2003 15:27:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Oct 07 17:27:21 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 1A6tk9-0007mU-00 for ; Tue, 07 Oct 2003 17:27:21 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A6tk8-0000SL-00 for ; Tue, 07 Oct 2003 17:27:20 +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 1A6tjO-0001gY-8x for emacs-devel@quimby.gnus.org; Tue, 07 Oct 2003 11:26:34 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A6tiW-0001XX-QS for emacs-devel@gnu.org; Tue, 07 Oct 2003 11:25:40 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A6ti0-0000vp-H6 for emacs-devel@gnu.org; Tue, 07 Oct 2003 11:25:39 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A6thv-0000jM-Sf for emacs-devel@gnu.org; Tue, 07 Oct 2003 11:25:03 -0400 Original-Received: from vor.iro.umontreal.ca (vor.iro.umontreal.ca [132.204.24.42]) by mercure.iro.umontreal.ca (8.12.9/8.12.9) with ESMTP id h97FOoKS025169; Tue, 7 Oct 2003 11:24:50 -0400 Original-Received: by vor.iro.umontreal.ca (Postfix, from userid 20848) id 211F53C549; Tue, 7 Oct 2003 11:24:50 -0400 (EDT) Original-To: Lute Kamstra In-Reply-To: Original-Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-MailScanner-DIRO: Found to be clean 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:16986 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16986 > And you still have the mechanism where t in the buffer-local value of > a hook is substituted by the functions in the global value? Sure. Think of it as: (defun run-hook (h) (let ((inhibit nil) (funs (symbol-value h))) (while funs (let ((fun (pop funs))) (cond ((eq 'not (car-safe fun)) (push fun inhibit)) ((member fun inhibit) nil) ((eq t fun) (setq funs (append (default-value h) funs))) (t (funcall fun))))))) -- Stefan