[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ** Graded examples of lambda functions in emacs lisp, how to create

From: Kevin Rodgers
Subject: Re: ** Graded examples of lambda functions in emacs lisp, how to create hook variable? **
Date: Tue, 08 Oct 2002 11:19:50 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

gnuist006 wrote:

Kevin Rodgers <address@hidden> wrote in message news:<address@hidden>...

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

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 :-)

<a href="mailto:&lt;kevinr&#64;;";>Kevin Rodgers</a>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]