Gnus development mailing list
 help / color / mirror / Atom feed
* [Patch] Make vcard formatting function configurable
@ 2007-11-19 19:24 Tassilo Horn
  2007-11-19 20:50 ` Reiner Steib
  2007-11-20  9:25 ` Tassilo Horn
  0 siblings, 2 replies; 3+ messages in thread
From: Tassilo Horn @ 2007-11-19 19:24 UTC (permalink / raw)
  To: ding

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  <tassilo@member.fsf.org>

	* 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  <tassilo@member.fsf.org>

	* 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-20  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-19 19:24 [Patch] Make vcard formatting function configurable Tassilo Horn
2007-11-19 20:50 ` Reiner Steib
2007-11-20  9:25 ` Tassilo Horn

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).