From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65736 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: [Patch] Make vcard formatting function configurable Date: Mon, 19 Nov 2007 20:24:27 +0100 Message-ID: <87k5oeujh0.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195500437 2996 80.91.229.12 (19 Nov 2007 19:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2007 19:27:17 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14232@lists.math.uh.edu Mon Nov 19 20:27:14 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IuCGZ-0005zs-LQ for ding-account@gmane.org; Mon, 19 Nov 2007 20:26:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IuCEa-00048f-IR; Mon, 19 Nov 2007 13:24:40 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IuCEZ-00048H-0t for ding@lists.math.uh.edu; Mon, 19 Nov 2007 13:24:39 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IuCES-0003nX-Oo for ding@lists.math.uh.edu; Mon, 19 Nov 2007 13:24:38 -0600 Original-Received: from out1.smtp.messagingengine.com ([66.111.4.25]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IuCEO-0005SL-00 for ; Mon, 19 Nov 2007 20:24:28 +0100 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id B85B7485FE for ; Mon, 19 Nov 2007 14:24:30 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 19 Nov 2007 14:24:30 -0500 X-Sasl-enc: QzYVn96ioa/6tAWIbPmty5+AgrPIVYvXHIZaTCuzdGcH 1195500270 Original-Received: from baldur (dslb-084-063-066-071.pools.arcor-ip.net [84.63.66.71]) by mail.messagingengine.com (Postfix) with ESMTP id D0BAE2B1BE for ; Mon, 19 Nov 2007 14:24:29 -0500 (EST) Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65736 Archived-At: Hi, I've just discovered vcard.el (in gnus/contrib) and I like it. But I like the box-style more than the normal string-style Gnus uses by default. This patch makes the function to use configurable. Here're the ChangeLog entries: contrib/ChangeLog --8<---------------cut here---------------start------------->8--- 2007-11-19 Tassilo Horn * vcard.el (vcard-standard-format-function): New variable. --8<---------------cut here---------------end--------------->8--- lisp/ChangeLog --8<---------------cut here---------------start------------->8--- 2007-11-19 Tassilo Horn * mm-view.el (mm-inline-text-vcard): Use new variable vcard-standard-format-function from vcard.el. --8<---------------cut here---------------end--------------->8--- And here's the patch itself: --8<---------------cut here---------------start------------->8--- Index: lisp/mm-view.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v retrieving revision 7.50 diff -u -r7.50 mm-view.el --- lisp/mm-view.el 4 Oct 2007 18:51:28 -0000 7.50 +++ lisp/mm-view.el 19 Nov 2007 19:16:45 -0000 @@ -395,9 +395,9 @@ (ignore-errors (if (fboundp 'vcard-pretty-print) (vcard-pretty-print (mm-get-part handle)) - (vcard-format-string - (vcard-parse-string (mm-get-part handle) - 'vcard-standard-filter)))))))) + (funcall vcard-standard-format-function + (vcard-parse-string (mm-get-part handle) + 'vcard-standard-filter)))))))) (defun mm-inline-text (handle) (let ((b (point)) Index: contrib/vcard.el =================================================================== RCS file: /usr/local/cvsroot/gnus/contrib/vcard.el,v retrieving revision 7.5 diff -u -r7.5 vcard.el --- contrib/vcard.el 4 Oct 2007 18:51:27 -0000 7.5 +++ contrib/vcard.el 19 Nov 2007 19:16:45 -0000 @@ -35,6 +35,11 @@ the function `vcard-standard-filter' is supplied as the second argument to `vcard-parse-string'.") +(defvar vcard-standard-format-function 'vcard-format-string + "*Standard function used by applications like Gnus to display vcards. +Currently the functions `vcard-format-string' and +`vcard-format-box' (or something home-brewn) can be used here.") + (defun vcard-parse-string (raw &optional filter) "Parse RAW vcard data as a string, and return an alist representing data. --8<---------------cut here---------------end--------------->8--- Bye, Tassilo