From: akr Date: Sat, 7 Nov 1998 13:35:33 +0000 (+0000) Subject: * mime-view.el: (mime-display-text/x-vcard): New function. X-Git-Tag: semi-vcard-199811302358~3 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef96e3f812f690f1be86a02c07e5a8d41a34fd48;p=elisp%2Fsemi.git * mime-view.el: (mime-display-text/x-vcard): New function. (mime-preview-condition): Set up for 'mime-preview-text/x-vcard. --- diff --git a/ChangeLog b/ChangeLog index 1a8fe9c..482cb93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +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. + 1998-10-31 MORIOKA Tomohiko * SEMI: Version 1.10.2 (Higashi-Kanazawa) released. diff --git a/mime-view.el b/mime-view.el index 2804365..a707658 100644 --- a/mime-view.el +++ b/mime-view.el @@ -390,6 +390,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))) @@ -454,6 +460,29 @@ 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 (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 + (string-as-multibyte + (mime-decode-string + (decode-coding-string + (buffer-substring (match-beginning 2) (match-end 2)) '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) "\