From: akr Date: Sun, 17 Jan 1999 09:17:55 +0000 (+0000) Subject: * mime-play.el: Reuiqre `ccl'. X-Git-Tag: akemi-1_12_1~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd3ce8319b77a8d06e40225a03c16ee3381d9e22;p=elisp%2Fsemi.git * mime-play.el: Reuiqre `ccl'. (translate-string): New CCL program. (mime-view-caesar): Try to deal with `standard-translation-table-for-decode'. --- diff --git a/ChangeLog b/ChangeLog index 6a0b7c8..e64f6bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,22 @@ +1999-01-17 Tanaka Akira + + * mime-play.el: Reuiqre `ccl'. + (translate-string): New CCL program. + (mime-view-caesar): Try to deal with + `standard-translation-table-for-decode'. + 1998-11-12 Tanaka Akira - * mime-view.el: (mime-display-text/x-vcard): Fix multibyteness + * 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. + * 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-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 diff --git a/mime-play.el b/mime-play.el index bf2b19b..b8ead21 100644 --- a/mime-play.el +++ b/mime-play.el @@ -29,6 +29,7 @@ (require 'mime-view) (require 'alist) (require 'filename) +(require 'ccl) (eval-when-compile (condition-case nil @@ -690,6 +691,14 @@ It is registered to variable `mime-preview-quitting-method-alist'." ;;; @ rot13-47 ;;; +(define-ccl-program translate-string + '(4 + (loop + (read-multibyte-character r1 r2) + (translate-character r0 r1 r2) + (write-multibyte-character r1 r2) + (repeat)))) + (defun mime-view-caesar (entity situation) "Internal method for mime-view to display ROT13-47-48 message." (let* ((new-name (format "%s-%s" (buffer-name) @@ -704,8 +713,27 @@ It is registered to variable `mime-preview-quitting-method-alist'." ) (setq buffer-read-only nil) (erase-buffer) - (mime-insert-text-content entity) + (let ((standard-translation-table-for-decode nil)) + (mime-insert-text-content entity)) (mule-caesar-region (point-min) (point-max)) + (let ((str (buffer-string)) + (status (make-vector 9 nil)) + (table + (catch 'tbl + (let ((i 0) e) + (while (and (< i (length translation-table-vector)) + (setq e (aref translation-table-vector i))) + (if (eq (cdr e) standard-translation-table-for-decode) + (throw 'tbl i)) + (setq i (1+ i))) + nil)))) + (when table + (aset status 0 table) + (delete-region (point-min) (point-max)) + (insert (ccl-execute-on-string + 'translate-string + status + str)))) (set-buffer-modified-p nil) (set-buffer mother) (view-buffer new-name)