(mule-caesar-region): Don't compare charset with 'us-ascii.
authormorioka <morioka>
Mon, 8 Jun 1998 14:59:38 +0000 (14:59 +0000)
committermorioka <morioka>
Mon, 8 Jun 1998 14:59:38 +0000 (14:59 +0000)
mule-caesar.el

index 7cf9734..d080cc4 100644 (file)
@@ -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)