From: morioka Date: Mon, 8 Jun 1998 14:59:38 +0000 (+0000) Subject: (mule-caesar-region): Don't compare charset with 'us-ascii. X-Git-Tag: apel-8_15~10 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59d9f1b6997f91558d9895ab42761ba19e0cab47;p=elisp%2Fapel.git (mule-caesar-region): Don't compare charset with 'us-ascii. --- 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)