help-gnu-emacs
[Top][All Lists]
Advanced

[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:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

gnuist006 wrote:

Kevin Rodgers <kevinr@ihs.com> 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 :-)

--
<a href="mailto:&lt;kevinr&#64;ihs.com&gt;";>Kevin Rodgers</a>



reply via email to

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