all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Letting hooks?
Date: Wed, 06 Jun 2012 13:07:10 +0800	[thread overview]
Message-ID: <87mx4hxc3l.fsf@ericabrahamsen.net> (raw)

I'm trying to temporarily add a function to a hook within the space of
one function. I've tried a bunch of stuff and nothing's worked properly,
and I suspect I'm just doing the Wrong Thing. Everything I've tried has
been along the lines of:

--8<---------------cut here---------------start------------->8---
(defun my-function ()
  (let ((grommet-created-hook
	 (push my-hook-function
	       grommet-created-hook)))
    (create-grommet)))
--8<---------------cut here---------------end--------------->8---

I've tried it with append and copy-sequence, everything blows up in
different ways.

Is this simply the wrong approach, or have I just not tried the right
commands? All advice appreciated!

Eric


-- 
GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-06-06 on pellet




             reply	other threads:[~2012-06-06  5:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  5:07 Eric Abrahamsen [this message]
2012-06-06  6:36 ` Letting hooks? Tassilo Horn
     [not found] ` <mailman.2336.1338964587.855.help-gnu-emacs@gnu.org>
2012-06-08  0:57   ` Stefan Monnier
2012-06-08  3:28     ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mx4hxc3l.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.