From 1cb4564cb71d18d6cd7a4675d84fa069df0b25ae Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 17 Jan 1999 09:07:36 +0000 Subject: [PATCH] Sync up with semi-vcard. --- ChangeLog | 14 ++++++++++++++ mime-view.el | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/ChangeLog b/ChangeLog index 506ff56..6a0b7c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +1998-11-12 Tanaka Akira + + * mime-view.el: (mime-display-text/x-vcard): Fix multibyteness + problem. + +1998-11-07 Tanaka Akira + + * mime-view.el: (mime-display-text/x-vcard): Preserve encoding. + +1998-11-07 Tanaka Akira + + * mime-view.el: (mime-display-text/x-vcard): New function. + (mime-preview-condition): Set up for 'mime-preview-text/x-vcard. + 1999-01-15 MORIOKA Tomohiko * mime-view.el: Must require `emu'. diff --git a/mime-view.el b/mime-view.el index 763b20e..16b2dc7 100644 --- a/mime-view.el +++ b/mime-view.el @@ -395,6 +395,12 @@ Each elements are regexp of field-name.") (ctree-set-calist-strictly 'mime-preview-condition + '((type . text)(subtype . x-vcard) + (body . visible) + (body-presentation-method . mime-display-text/x-vcard))) + +(ctree-set-calist-strictly + 'mime-preview-condition '((type . text)(subtype . t) (body . visible) (body-presentation-method . mime-display-text/plain))) @@ -459,6 +465,31 @@ Each elements are regexp of field-name.") (enriched-decode beg (point-max)) ))) +(defun mime-display-text/x-vcard (entity situation) + (save-restriction + (narrow-to-region (point-max)(point-max)) + (insert (string-as-multibyte (mime-entity-content entity))) + (goto-char (point-min)) + (while (re-search-forward + "\\(;\\(encoding=\\)?quoted-printable:\\)\\(\\(=[0-9A-F][0-9A-F]\\|=\r\n\\|[^\r\n]\\)*\\)" + nil t) + (replace-match + (concat + (buffer-substring (match-beginning 1) (match-end 1)) + (string-as-multibyte + (mime-decode-string + (decode-coding-string + (buffer-substring (match-beginning 3) (match-end 3)) 'raw-text-dos) + "quoted-printable"))) + t t)) + (decode-coding-region (point-min) (point-max) 'undecided) + (goto-char (point-max)) + (if (not (eq (char-after (1- (point))) ?\n)) + (insert "\n")) + (mime-add-url-buttons) + (run-hooks 'mime-display-text/x-vcard-hook) + )) + (defvar mime-view-announcement-for-message/partial (if (and (>= emacs-major-version 19) window-system) "\ -- 1.7.10.4