all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: remove-hook.
Date: 07 Oct 2003 10:59:41 -0400	[thread overview]
Message-ID: <jwv7k3h3xs4.fsf-monnier+emacs/devel@vor.iro.umontreal.ca> (raw)
In-Reply-To: <sgdd6d9xi4b.fsf@occarina.pna.cwi.nl>

>> PS: Admittedly, this doesn't work in Emacs-CVS because the only way this
>> can work is if we can put "negative" entries on the local side of
>> a hook to disable an element on the global side.  

> If it doesn't work, the docstring is confusing.

The docstring is still correct: if you pass the LOCAL flag and the hook has
no local side yet, `remove-hook' will create the local side of the hook.
It is a necessary first step for remove-hook to work.  Admittedly, it's
currently a useless step because the necessary second step doesn't
work anyway.

>> I have code to make it work, 
> I'm curious... can I have a peek?

Can't extract it right now, but it's pretty simple:
If there's no local `bar' element to remove, `remove-hook' adds a (not bar)
element.  When `run-hooks' sees such a (not bar) entry, it doesn't run
anything, but stuffs `bar' in a list of hooks to inhibit when processing
the global side of the hook.

> I tend to agree that such a system would get rather complicated.  It
> also seems necessary to keep remove-hook efficient: when I
> instrumented it, I noticed that it was called twice every keystroke.

I don't see how that calls for efficiency.  It's still tiny compared
to the time it takes for your keystroke to pass through the layers
and processing necessary for Emacs to get the event (and you can
add the time for Emacs to update its display, ...).


        Stefan

  reply	other threads:[~2003-10-07 14:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-07 13:25 remove-hook Lute Kamstra
2003-10-07 13:40 ` remove-hook Luc Teirlinck
2003-10-07 13:42 ` remove-hook Stefan Monnier
2003-10-07 14:00   ` remove-hook Lute Kamstra
2003-10-07 14:59     ` Stefan Monnier [this message]
2003-10-07 15:13       ` remove-hook Lute Kamstra
2003-10-07 15:24         ` remove-hook Stefan Monnier
2003-10-07 22:04         ` remove-hook Luc Teirlinck
2003-10-08  4:52     ` remove-hook Richard Stallman
2003-10-10 14:25       ` remove-hook Lute Kamstra
2003-10-11 17:12         ` remove-hook Richard Stallman
2003-10-08  4:52 ` remove-hook Richard Stallman

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=jwv7k3h3xs4.fsf-monnier+emacs/devel@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@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.