From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: ** Graded examples of lambda functions in emacs lisp, how to create hook variable? ** Date: Tue, 08 Oct 2002 11:19:50 -0600 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3DA313B6.1010306@ihs.com> References: <9e8ebeb2.0210070738.1b12118d@posting.google.com> <3DA1C8EC.6070801@ihs.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1034097741 1803 127.0.0.1 (8 Oct 2002 17:22:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2002 17:22:21 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17yy3N-0000Pu-00 for ; Tue, 08 Oct 2002 19:21:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17yy2f-0007N8-00; Tue, 08 Oct 2002 13:21:09 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 44 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1034097587 18342764 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:105841 comp.emacs:75144 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2388 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2388 gnuist006 wrote: > Kevin Rodgers wrote in message news:<3DA1C8EC.6070801@ihs.com>... > >>gnuist wrote: >> >>>One last question at this stage: I know how you "add-hook" but how do you >>>create a hook variable in the first place? Is it something particular to >>>emacs? I should have responded: yes, it is particular to Emacs Lisp. >>(defvar some-hook nil) >> >>(defun some-function (...) >> ... >> (run-hooks 'some-hook) >> ...) >> > > defvar creates a hook variable. > run-hooks associates some-hook with the some-function. > > Now one writes lambda functions associated with the some-hook > without modifying the some-function???? > > Is that the idea? The post was incomplete. Perhaps the author > know too much for us. But I want a simple concrete minimal example > of running code. Yes, that is the idea. For concrete examples, simply grep (search) for run-hooks and run-hook-with-args in the lisp/*.el and lisp/*/*.el files of your Emacs distribution. Then check out advice.el :-) -- Kevin Rodgers