[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] address and datebook conduits.



On Fri, Oct 26, 2001 at 11:13:46AM -0400, J. Nicholas Laneman wrote:
> Incidentally, it was great to see some conduits written in something
> other than perl.  I'm not quite up to speed on it yet, so reading
> examples are pretty hard for me.

	Shameless self-promotion: see
http://www.ooblick.com/text/perl/

> For what it's worth, I've seen numerous postings (10-20, not 1000's,
> not *yet* anyway) on various newsgroups by people wanting to sync
> between Emacs (bbdb, memos, diary, etc.) and their Palms.  My general
> impression in skimming those messages is that it's hard to do things
> within Emacs itself because there is no PDB reading routines in elisp,
> and relatively few people are elisp hackers.

	Another rather fundamental problem is that Emacs is basically
text-oriented, whereas PDBs are binary files. It's not that Emacs
can't handle binary files (see hexl-mode, for instance). Rather, there
are different design decisions.
	For instance, each AddressDB record contains a flags field
that indicates whether the record contains a first name, a last name,
a company name, etc. In Emacs, it would make more sense to just have

	First Name: 
	Last Name: 
	Company:
	...

and allow the user to fill in the blanks (or not) any way he chooses.
	Obviously, one way to handle this would be to have Emacs hooks
that parse the PDB file when it's read, convert it to text, then
convert the text buffer back to a PDB when it's saved. However, this
seems clumsy.
	A better approach would be to use a standard text format that
can be edited any text editor, be it Emacs, vi, or Notepad, and have
Perl scripts (or whatever) to convert to and from PDB format. In
Emacs, you can have a mode for the various text formats.
	(BTW, if you want to learn to hack Emacs, I can recommend
"Writing GNU Emacs Extensions", from O'Reilly. Although it talks about
hacking Emacs, it doesn't spend a whole lot of time on specifics;
rather, it teaches something much more valuable: how to find out what
you need to do to make the change you want.)

> after
> reading a bunch of stuff I think I need a bit of help and guidance.
> For example, I have a few ideas about how one could glue together
> various pieces of code from other projects, e.g., SyncBBDB perl code,
> BBDB perl library, your conduits, etc. to get something going, but
> patching together lots of different pieces of packages seems like it
> might get tricky.  On the other hand, designing all the conduits
> myself would take me forever.

	One useful thing you could do would be to come up with file
formats that are editable in Emacs, and also contain the information
that conduits will need.
	At a minimum, a conduit will need, well, the record data. But
it would be really useful to have the record ID, category, and record
flags. For MemoDB, for instance, you might have records of the form

	## MEMO SEPARATOR
	>Id: 12345
	>Category: Personal
	>Flags: Private

	This is a memo.

Of course, I've just made this up, since I'm not sure which standard
Emacs formats exist for these sorts of things.

> If you, and other folks from this list, might be interested in teaming
> up to make more of this a reality, I'd be happy to join in.  It would
> probably take me a little while to get up to speed, but I think I
> could contribute at some point.

	This sounds like a cool and useful project (meaning: this is
the sort of thing I'd personally like to be able to do).

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com                      views of ooblick.com
	    Blood is thicker than water--and much tastier.
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.