From 59d9f1b6997f91558d9895ab42761ba19e0cab47 Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 8 Jun 1998 14:59:38 +0000 Subject: [PATCH] (mule-caesar-region): Don't compare charset with 'us-ascii. --- mule-caesar.el | 71 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/mule-caesar.el b/mule-caesar.el index 7cf9734..d080cc4 100644 --- a/mule-caesar.el +++ b/mule-caesar.el @@ -41,42 +41,41 @@ for 96 or 96x96 graphic character set)." (narrow-to-region start end) (goto-char start) (while (< (point)(point-max)) - (let* ((chr (char-after (point))) - (charset (char-charset chr)) - ) - (if (eq charset 'ascii) - (cond ((and (<= ?A chr) (<= chr ?Z)) - (setq chr (+ chr stride-ascii)) - (if (> chr ?Z) - (setq chr (- chr 26)) - ) - (delete-char 1) - (insert chr) - ) - ((and (<= ?a chr) (<= chr ?z)) - (setq chr (+ chr stride-ascii)) - (if (> chr ?z) - (setq chr (- chr 26)) - ) - (delete-char 1) - (insert chr) - ) - (t - (forward-char) - )) - (let* ((stride (lsh (charset-chars charset) -1)) - (ret (mapcar (function - (lambda (octet) - (if (< octet 80) - (+ octet stride) - (- octet stride) - ))) - (cdr (split-char chr))))) - (delete-char 1) - (insert (make-char (char-charset chr) - (car ret)(car (cdr ret)))) - ))))))) - + (let* ((chr (char-after (point)))) + (cond ((and (<= ?A chr) (<= chr ?Z)) + (setq chr (+ chr stride-ascii)) + (if (> chr ?Z) + (setq chr (- chr 26)) + ) + (delete-char 1) + (insert chr) + ) + ((and (<= ?a chr) (<= chr ?z)) + (setq chr (+ chr stride-ascii)) + (if (> chr ?z) + (setq chr (- chr 26)) + ) + (delete-char 1) + (insert chr) + ) + ((<= chr ?\x9f) + (forward-char) + ) + (t + (let* ((stride (lsh (charset-chars (char-charset chr)) -1)) + (ret (mapcar (function + (lambda (octet) + (if (< octet 80) + (+ octet stride) + (- octet stride) + ))) + (cdr (split-char chr))))) + (delete-char 1) + (insert (make-char (char-charset chr) + (car ret)(car (cdr ret)))) + ))) + ))))) + (provide 'mule-caesar) -- 1.7.10.4