[imp] moving/deleting option
Paul
list-imp@dragon.net
Tue, 04 Sep 2001 14:43:40 -0700
chuck> Adding one user preference isn't going to make IMP any easier
chuck> or harder to get running.
Nope. It's just one short stop down the long, slippery slope into
creeping featurism. B^)
palu> Function cleanup hooks also have advantages and
palu> disadvantages. Makes the baseline code much cleaner but makes
palu> backward compatibility as folks do creative things with hook
palu> functions much harder.
chuck> You're going to have to elaborate on all this. No idea what
chuck> you're really suggesting.
You create a "hook" that you register with the main program. In this
case, it would be the draft-cleanup or some such.
Every time the main program gets to the code where the hook is
supposed to be set, if no hook exists, you do the default thing. If
the hook exists, you run it then. For things with order or where
certain things must be done, you have pre-process hooks or
post-process hooks.
I have a "signature" hook. After emacs is done with my mail compose
buffer and invokes the add-signature routine, it checks for a hook. I
have one that varies the signature based on some rules and sets the
variable holding the signature to different file names based on those
rules.
The upside is that emacs can simply run a relatively simple "put file
at end of email buffer as signature" and I can make my life as
complicated (or feature rich B^) as I like.
The downside is that if emacs changes enough where it already stomps
things I need to play with or I stomp things that emacs doesn't expect
me to play with, life gets hairy.
It's a fascinating bit of rope to pass out...
--
Paul
>From chuck@horde.org Date: Tue, 4 Sep 2001 18:31:29 -0400
Return-Path: <chuck@horde.org>
Mailing-List: contact imp-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list imp@lists.horde.org
Received: (qmail 37928 invoked from network); 4 Sep 2001 22:33:35 -0000
Received: from h00104bc60b3c.ne.mediaone.net (HELO marina.horde.org) (24.91.198.7)
by horde.org with SMTP; 4 Sep 2001 22:33:35 -0000
Received: by marina.horde.org (Postfix, from userid 33)
id 9CD0D39F4; Tue, 4 Sep 2001 18:31:29 -0400 (EDT)
Received: from 206.243.191.252 ( [206.243.191.252])
as user chuck@localhost by marina.horde.org with HTTP;
Tue, 4 Sep 2001 18:31:29 -0400
Message-ID: <999642689.3b9556417b363@marina.horde.org>
Date: Tue, 4 Sep 2001 18:31:29 -0400
From: Chuck Hagenbuch <chuck@horde.org>
To: imp@lists.horde.org
References: <200109042143.f84LheL00564@ns1.pae.com>
In-Reply-To: <200109042143.f84LheL00564@ns1.pae.com>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 2.3.7-cvs
Subject: Re: [imp] moving/deleting option
Quoting Paul <list-imp@dragon.net>:
> You create a "hook" that you register with the main program. In this
> case, it would be the draft-cleanup or some such.
Ah. So you're talking about the kinds of things that are defined in the $conf
['hooks'] section of conf.php.dist. :)
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
Some fallen angels have their good reasons.