+1999-01-17 Tanaka Akira <akr@jaist.ac.jp>
+
+ * 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 <akr@jaist.ac.jp>
- * 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 <akr@jaist.ac.jp>
- * 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 <akr@jaist.ac.jp>
- * 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 <morioka@jaist.ac.jp>
(require 'mime-view)
(require 'alist)
(require 'filename)
+(require 'ccl)
(eval-when-compile
(condition-case nil
;;; @ 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)
)
(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)