Gnus development mailing list
 help / color / mirror / Atom feed
From: Andrew J Cosgriff <ajc@bing.wattle.id.au>
Cc: Noah Friedman <friedman@splode.com>,
	MORIOKA Tomohiko <morioka@jaist.ac.jp>
Subject: forgive me father, but...tm-vcard.el
Date: 07 Aug 1998 13:48:57 +1000	[thread overview]
Message-ID: <ruilnp1wixi.fsf@goaway.cc.monash.edu.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]


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

[-- Attachment #2: tm-vcard.el --]
[-- Type: text/plain, Size: 3034 bytes --]

;;; 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 <ajc@bing.wattle.id.au>
;; 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

[-- Attachment #3: Type: text/plain, Size: 223 bytes --]


Footnotes: 
[1]  of course, with nnimap and all, I can still use Gnus. yay ! :)

-- 
Andrew J Cosgriff <ajc@bing.wattle.id.au> exterminate all rational thought !
                    space dogs celebrity compulsion brother

             reply	other threads:[~1998-08-07  3:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-07  3:48 Andrew J Cosgriff [this message]
     [not found] ` <ajc@bing.wattle.id.au>
1998-08-14  2:59   ` Noah Friedman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ruilnp1wixi.fsf@goaway.cc.monash.edu.au \
    --to=ajc@bing.wattle.id.au \
    --cc=friedman@splode.com \
    --cc=morioka@jaist.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).