Re: Snarf Vcards
Roland Winkler <[email protected]> Tue, 12 Jul 2022 10:00:04 -0500
| Newsgroups | gmane.emacs.bbdb.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 12 2022, Pascal Quesseveur wrote: > There was a lot of confusion around vcard parsing libraries. Following > an email on gnu.emacs.help Stefan Monnier decided to merge vcard.el > file from Noah Friedmann with vcard package on GNU ELPA. > > In the future version of vcard package current vcard.el file in > package will be renamed as vcard-mode.el, vcard-parse.el will remain > basically unchanged, and vcard.el will be an upgraded version of > Noah's file. From vcard-parse.el: This may require a bit more care: - Noah Friedman's vcard.el includes a vcard parser like Eric's vcard-parse.el. It also includes a pretty-printer that uses the parser. - Noah's vcard.el is old code. It duplicates functionality like decoding quoted-printable (and, if I am not mistaken, more basic text processing functionality) that are now part of "emacs core". - Eric's vcard.el just fontifies vcard files. Though it is packaged with vcard-parse.el, these are rather separate things. - A few weeks ago I exchanged a few emails with Eric regarding vcard-parse.el. He told me that this code is still awaiting real-world use cases. - I checked the thread on gnu.emacs.help. My reading of Stefan's posts is that he is in favor of merging the vcard packages. But he suggested that You could look at this. Likely, it will be good to get Eric involved and probably also Noah. > Parsing in vcard.el should be done using functions from > vcard-parse.el. Noah's vcard pretty-printer can probably use Eric's vcard parser so that Noah's vcard parser could be declared obsolete. > I think it would be worth using the functions from vcard-parse.el in > bbdb-snarf too. My main concern regarding this idea is that vcard-parse.el would be the first package outside emacs core that BBDB relies on. On the other hand, there is really only one modest function in bbdb-snarf (bbdb-snarf-vcard-property) that encapsulates the actual parsing of vcards for bbdb-snarf. I am hesitant to replace this function with a dependency on an external package. > Concerning the fact that in gnus when the vcard is printed with > vcard-pretty-print it can no longer be parsed, and that therefore it > should be parsed before, I have no other idea than to make a function > that would combine bbd-snarf-vcard and mm-inline-text-vcard, and > associate this function with the text/vcard MIME type in > mm-inline-media-tests. I am not familiar with how gnus handles vcard attachments. But I am pretty sure that this could branch out into multiple options like pretty-printing and feeding the vcard attachment into BBDB.