<<< Date Index >>>     <<< Thread Index >>>

Re: sig hooking and more (was "Re: Signature formatting")



On Mon, Mar 15, 2004 at 08:36:11AM EST, David T-G wrote:
> ...and then David Yitzchak Cohen said...
> % On Wed, Mar 10, 2004 at 11:14:50PM EST, David T-G wrote:

> % > I've tinkered with hooks to add 'HTH & HAND' to list postings, since I'm
> % > usually offering help (but not uncommonly asking for it!), or 'Love,' on
> % > posts to family members, but in the end I'm *way* too lazy to automate
> % > that -- and that's probably a good thing in the long run :-)
> % 
> % Hmm, I think you may've just given me another idea for a new feature.
> 
> How hard is that?  A bird flies overhead or the sun comes up and you get
> an idea for a new feature ;-)

LOL ;-)

> % I'll sleep on it, and maybe I'll add it to my address book.  I need to
> % think about how to do it, though.  Should we have signatures by group?
> % Should we have signatures by nickname?  Should we have signatures by
> 
> Absolutely fully customizable.  Any way an address can be identified or
> categorized should apply to prefs such as sigs.

ditto ;-P

> % email addy?  How about signature components on a group/nickname/email
> % basis?  Maybe we want to change signatures by language (like my mailing
> % list config does)?  Do we want some sort of override mechanism, perhaps
> % using standard hooks?
> 
> But of course :-)
> 
> I keep meaning to have a look at your contact manager but haven't yet.
> Ah, well.  There's always tomorrow :-)  Meanwhile, keep us posted.

FWIW - I'm actually rewriting the entire thing now into a userspace
filesystem, using FUSE.  The idea is that instead of complicated
parsers, processors, and RC file generators, I'm just going to have a
virtual filesystem where every contact has a full set of files for each
thing that can be customized (sigs, and all), and anything you want to
override you simply write to the corresponding file.  If you want to
revert to a default, just delete the file.  Now, if you want to change
the signatures for a whole bunch of entries (say, everybody in group
"blah"), you do something like this:
for $blah in /search/group/blah/*/signature ; do cat my_new_sig > $blah ; done
Oh, so you want to change only the guys in group "blah" who speak French?
for $blah in /search/group/blah/speaks/re/fr/*/signature ; do
 cat my_new_sig > $blah ;
done

The only downside I can see is that field names become reserved words,
which wouldn't be much of a problem were it not for the fact that I
allow arbitrary field names.  I guess that means caution is necessary
in contact naming.  (The other option is to make your own rules about
which fields you're going to allow, and do your own enforcement.)

Obviously, I'll still need an RC generator, but it'll be trivially
simple: basically just walking the entire contacts filesystem (except
the /search directory, and any other special directories, like maybe
/muttrcs) and generating aliases, hooks, etc.  Not only that, but I can
integrate the RC generator right into the filesystem, so Mutt thinks
it's loading regular files, but in reality the configs are generated
on-the-fly by a persistent back-end program, so there's no program startup
overhead involved.  Other neat advantages have to do with the ability
to "export" the database to any other program (like a chat program)
by simply offering a /myfavoritechatprogramrcs directory, and "import"
functionality can be achieved by monitoring write(2)s to the same files.
(If a silly program insists on using ~/.blahblahblahrc as its RC file,
you can just symlink it to ~/contacts/blahblahblahrcs/main, assuming
you've mounted the contacts FS on ~/contacts.)

 - Dave

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpZpLSovznRC.pgp
Description: PGP signature