Gnus development mailing list
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: ding@gnus.org
Subject: [Patch] Make vcard formatting function configurable
Date: Mon, 19 Nov 2007 20:24:27 +0100	[thread overview]
Message-ID: <87k5oeujh0.fsf@member.fsf.org> (raw)

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



             reply	other threads:[~2007-11-19 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 19:24 Tassilo Horn [this message]
2007-11-19 20:50 ` Reiner Steib
2007-11-20  9:25 ` Tassilo Horn

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=87k5oeujh0.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=ding@gnus.org \
    /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).