From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/15902 Path: main.gmane.org!not-for-mail From: Andrew J Cosgriff Newsgroups: gmane.emacs.gnus.general Subject: forgive me father, but...tm-vcard.el Date: 07 Aug 1998 13:48:57 +1000 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: multipart/mixed; boundary="Multipart_Fri_Aug__7_13:48:55_1998-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035154861 24755 80.91.224.250 (20 Oct 2002 23:01:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:01:01 +0000 (UTC) Cc: Noah Friedman , MORIOKA Tomohiko Return-Path: Original-Received: from gwyn.tux.org (gwyn.tux.org [207.96.122.8]) by altair.xemacs.org (8.9.1/8.9.1) with ESMTP id UAA20152 for ; Thu, 6 Aug 1998 20:56:20 -0700 Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by gwyn.tux.org (8.8.8/8.8.8) with ESMTP id XAA28820 for ; Thu, 6 Aug 1998 23:51:43 -0400 Original-Received: from sina.hpc.uh.edu (sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.7.6/8.7.3) with ESMTP id WAS12785; Thu, 6 Aug 1998 22:22:40 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 06 Aug 1998 22:49:40 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [209.195.19.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id WAA21550 for ; Thu, 6 Aug 1998 22:49:24 -0500 (CDT) Original-Received: from goaway.cc.monash.edu.au (ajc@goaway.cc.monash.edu.au [130.194.250.20]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id XAA23831 for ; Thu, 6 Aug 1998 23:49:20 -0400 (EDT) Original-Received: (from ajc@localhost) by goaway.cc.monash.edu.au (8.8.8/8.8.8) id NAA10943; Fri, 7 Aug 1998 13:49:09 +1000 (EST) Original-To: ding@gnus.org X-Attribution: ajc X-URI: X-PGP-Key-ID: C7BD53F5 X-Face: PBPJ+.AE`FBN4$}HrwwEhJ)x?-5$MQ%Z)svNR@Q\WG6[GDr,}a@8ULwGWBsk,Pqxm!Z- X-Emacs: the Swiss Army of Editors. Original-Lines: 121 X-Mailer: Gnus v5.6.27/XEmacs 21.0 - "Corsican" Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:15902 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:15902 --Multipart_Fri_Aug__7_13:48:55_1998-1 Content-Type: text/plain; charset=US-ASCII I know vcards are evil and all, but since my Place of Employment is going Netscape[1], i'm going to have to deal with vcards more and more. So I gave in and got TM to display vcards using Noah Friedman's vcard.el library. If anybody's got any good enhancements or wants to take it anywhere, feel free - I'm not that good with Emacs-Lisp :) I hope it's useful to other similarly afflicted people. Enjoy, Andrew --Multipart_Fri_Aug__7_13:48:55_1998-1 Content-Type: text/plain; type=emacs-lisp; charset=US-ASCII Content-Disposition: attachment; filename="tm-vcard.el" Content-Transfer-Encoding: 7bit ;;; tm-vcard --- allow TM (and hence Gnus, RMAIL, et al) to display a vcard MIME part ;; ;; Copyright (C) 1998 Andrew J Cosgriff ;; ;; Author: Andrew J Cosgriff ;; Created: Fri Aug 7 10:56:16 1998 ;; Version: $Id: tm-vcard.el,v 1.5 1998/08/07 03:14:16 ajc Exp $ ;; URI: http://bing.bofh.asn.au/sw/emacs-lisp/ ;; Keywords: tm vcard gnus rmail mime ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, you can either send email to this ;; program's maintainer or write to: The Free Software Foundation, ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; ;; Noah Friedman wrote a generic bit of Emacs Lisp to parse VCard ;; data, saying "it'd be neat if somebody made this work with TM, so ;; Gnus and RMAIL can use it." - here goes... ;; ;; You'll need to get vcard.el from ;; http://www.splode.com/users/friedman/software/emacs-lisp/ ;; ;; This code is available from http://bing.bofh.asn.au/sw/emacs-lisp/ ;; ;;; TO DO: ;; ;; - buttonize things like email addresses and web pages (I think this ;; is gnus-specific, so I'm not sure how it ought to be done) ;; ;; - BBDB ? ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; History: ;; ;; 1.1 - Initial version - show the vcard stuff in a separate buffer. ;; ;; 1.2 - show the vcard stuff in the same buffer. much better ! ;; ;; 1.3/1.4 - misc. fixes and prettying up for general release. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Code: ;; (require 'vcard) (if (not (member "text/x-vcard" mime-viewer/default-showing-Content-Type-list)) (setq mime-viewer/default-showing-Content-Type-list (append mime-viewer/default-showing-Content-Type-list '("text/x-vcard")))) (if (not (member '("text/x-vcard" . mime-preview/filter-for-text/x-vcard) mime-viewer/content-filter-alist)) (setq mime-viewer/content-filter-alist (append '(("text/x-vcard" . mime-preview/filter-for-text/x-vcard)) mime-viewer/content-filter-alist))) (defun mime-preview/filter-for-text/x-vcard (ctype params encoding) (let* ((mode mime::preview/original-major-mode) (m (assq mode mime-viewer/code-converter-alist)) (charset (cdr (assoc "charset" params))) (beg (point-min)) (str (buffer-substring beg (point-max))) ) (delete-region beg (point-max)) (insert (vcard-format-string (vcard-parse-string str))) (mime-preview/decode-text-buffer charset encoding) )) (provide 'tm-vcard) ;;; tm-vcard.el ends here --Multipart_Fri_Aug__7_13:48:55_1998-1 Content-Type: text/plain; charset=US-ASCII Footnotes: [1] of course, with nnimap and all, I can still use Gnus. yay ! :) -- Andrew J Cosgriff exterminate all rational thought ! space dogs celebrity compulsion brother --Multipart_Fri_Aug__7_13:48:55_1998-1--