[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 01:50:36PM -0400, J. Nicholas Laneman wrote:
> Andrew Arensburger writes:
> > > On Fri, Oct 26, 2001 at 01:50:36PM -0400, J. Nicholas Laneman wrote:
...I'll snip lot's of great stuff that you've already read... 
> > 	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.
> >

This is sort of what I attempted with my address and datebook
conduits.  The dump just writes a flat text file, with some extra
work to "escape" special characters (a double quote turns into a \',
etc.).  The fetch just reads the same format, and tries to be
forgiving about field order and white space.

The part that makes the address book format emacs friendly is that
each record is surrounded by percent signs.  So you can sort the
records by company, (e.g.) using

(sort-regexp-fields nil "%[^%]*%\s *" "Company:.*"
		    (region-beginning) (region-end))

or maybe

(sort-regexp-fields nil "%[^%]*%\s *" "\(Company:.*\)\|\(END%\)"
		    (region-beginning) (region-end))


I haven't actually written an emacs mode for it. 


> 
> > Of course, I've just made this up, since I'm not sure which standard
> > Emacs formats exist for these sorts of things.
> 
> I'll throw out some packages that I use for various things, just to
> see what other people have to say.  This would be my first cut at
> trying to match things up with the Palm.
> 
> Addresses: bbdb mode
> DateBook: diary mode
> Memos + Todo: records mode
> 

I use lbdb (little brother DB) to pick addresses out of my palm
address book: ~/.palm/backup/AddressDB.pdb and put them into my email
address in emacs.  I didn't like bbdb because I found it hard to edit
the records.  I couldn't figure out how to do search-and-replace, but
perhaps I just didn't stick with it very much.

I'll have to look at diary mode.

For memos, I was thinking it would be nice to have one control file that
links each memo to a different file.
For example, the file ~/netsource/coldsync/Notes is tied to the memo coldsync.
I've started work on a sync conduit for that, but I'm scared of using
it on my own palm with no testing.

It could use diff3 to merge the file with the memo if the both
changed, just like CVS does.


> > 	This sounds like a cool and useful project (meaning: this is
> > the sort of thing I'd personally like to be able to do).
> 
> Same here.  Problem is time (I'm also trying to write my thesis) and
> experience (I don't know perl or elisp).  Banding together with others
> having similar interests would be great.
> 

Count me in!  I'm no expert, but I've done some elisp and a little
perl, I'm better at C and am re-learning C++.  For the conduit stuff,
my language of choice would be C/C++, because it yells at me when the
types are wrong.  Should I put the code I've got onto some place like
sourceforge?  Or is that premature?  

-- Fred.


-- 
----------------------------------------------------------------------
	    Fred Gylys-Colwell      fredgc@member.ams.org
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.