From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Case Newsgroups: gmane.emacs.help Subject: Re: What do 'hooks' do and how do they do it? Date: Sat, 01 Aug 2009 20:43:28 +0000 Message-ID: <1249159408.2246.35.camel@CASE> References: <1249147043.2246.18.camel@CASE> <86iqh7ct32.wl%djcb@djcbsoftware.nl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249159498 19839 80.91.229.12 (1 Aug 2009 20:44:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Aug 2009 20:44:58 +0000 (UTC) Cc: Emacs Help List To: djcb@djcbsoftware.nl Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 01 22:44:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MXLRi-0001ZD-QT for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Aug 2009 22:44:51 +0200 Original-Received: from localhost ([127.0.0.1]:46339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXLRi-0005lr-5I for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Aug 2009 16:44:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXLRK-0005lg-LM for help-gnu-emacs@gnu.org; Sat, 01 Aug 2009 16:44:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXLRG-0005lQ-Pn for help-gnu-emacs@gnu.org; Sat, 01 Aug 2009 16:44:26 -0400 Original-Received: from [199.232.76.173] (port=57008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXLRG-0005lN-Jv for help-gnu-emacs@gnu.org; Sat, 01 Aug 2009 16:44:22 -0400 Original-Received: from smtp115.rog.mail.re2.yahoo.com ([68.142.225.231]:41465) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MXLRG-0003gV-8U for help-gnu-emacs@gnu.org; Sat, 01 Aug 2009 16:44:22 -0400 Original-Received: (qmail 47061 invoked from network); 1 Aug 2009 20:44:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-Id:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=iPlDecd9mtqjD9Ig540vrrcsfsZf9n8+FyF1W5DQHEwM3+y66ed7G9Vf5oG/ibd/5IZztmOO0aeenh01tXZwMRuC6UrbFqKZIyJAnlVvXhgyygba7NVp4kUh17KJ9EMMNm7Wqu1TsACmezhAhgXsgntFAo+ocbCh+bGVjyu69e4= ; Original-Received: from unknown (HELO ?192.168.1.3?) (billlinux@99.245.242.191 with plain) by smtp115.rog.mail.re2.yahoo.com with SMTP; 1 Aug 2009 20:44:21 -0000 X-YMail-OSG: KAiqdR4VM1nhtJutGTQnAmRlDI.wNV9jtx3esTDAdPAjVJ3A.kQHAmRmA9L956uD_A-- X-Yahoo-Newman-Property: ymail-3 In-Reply-To: <86iqh7ct32.wl%djcb@djcbsoftware.nl> X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66631 Archived-At: Thanks Dirk; On Sat, 2009-08-01 at 21:00 +0300, Dirk-Jan C.Binnema wrote: > Hi Bill, > I think Drew Adams gave a very clear answer about the Emacs implementation, Yes he did. However, I tried to point out in my original post that I was aware of how to implement a 'hook' in emacs. > but let me add that the concept of a 'hook' is simply a programming technique: > the ability to set some function to be run whenever a particular event > happens. I was curious about the programming technique that was used -- or more specifically -- how the hook function was setup so that the hook automagically responded to a program's hook event. > The concept is in use in many places (such as SE-Linux), but how it's > implemented is quite different. In Emacs-Lisp, the hooks are simply Lisp > functions to be called -- no kernel involved (well...). > > See: http://en.wikipedia.org/wiki/Hooking The wikipedia site you suggest above covers just about everything I wanted to know. I don't know how I missed it. -- Regards Bill Fedora 11, Gnome 2.26.3 Evo.2.26.3, Emacs 22.3.1