Index: lang/elisp/pdicv-mode/trunk/nt-bocu.el
===================================================================
--- lang/elisp/pdicv-mode/trunk/nt-bocu.el (revision 67)
+++ lang/elisp/pdicv-mode/trunk/nt-bocu.el (revision 71)
@@ -1,9 +1,10 @@
 ;;; nt-bocu.el --- decode/encode BOCU-1 string (via utf-8, so requires Mule-UCS)
 ;;
-;; Copyright (C) 2005 Naoya TOZUKA. All Rights Reserved.
+;; Copyright (C) 2005-2009 naoya_t. All Rights Reserved.
 ;;
-;; Author: Naoya TOZUKA <pdicviewer@gmail.com>
-;; Maintainer: Naoya TOZUKA <pdicviewer@gmail.com>
-;; Primary distribution site: http://pdicviewer.naochan.com/el/
+;; Author: naoya_t <naoya.t@aqua.plala.or.jp>
+;; Maintainer: naoya_t <naoya.t@aqua.plala.or.jp>
+;; Primary distribution site:
+;;   http://lambdarepos.svnrepository.com/svn/share/lang/elisp/pdicv-mode/trunk
 ;;
 ;; Created: 12 Feb 2005
@@ -38,6 +39,6 @@
    ((>= tr #x10) (- tr 10)) ;10 ... 19 >> 06 ... 0F
    (t (1- tr))              ;01 ... 06 >> 00 ... 05
-   ); cond
-  )
+   ))
+
 (defsubst nt:bocu-encode-trail-char (c)
   "[BOCU] encode trail char"
@@ -47,6 +48,5 @@
    ((>= c #x06) (+ c 10)) ;06 ... 0F >> 10 ... 19
    (t (1+ c))             ;00 ... 05 >> 01 ... 06
-   ); cond
-  )
+   ))
 
 (defun nt:bocustr-to-rawcode-list (s)
@@ -67,6 +67,5 @@
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
+             (setq diff (+ diff tr)) )
             ((< lead #x25) ;22-24 (L T T)
              (setq diff (+ -10513 (* (- lead #x25) 243 243)))
@@ -76,21 +75,17 @@
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
+             (setq diff (+ diff tr)) )
             ((< lead #x50) ;25-4f (L T)
              (setq diff (+ -64 (* (- lead #x50) 243)))
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
+             (setq diff (+ diff tr)) )
             ((< lead #xd0) ;50-cf (L)
-             (setq diff (- lead #x90))
-             )
+             (setq diff (- lead #x90)) )
             ((< lead #xfb) ;d0-fa (L T)
              (setq diff (+ 64 (* (- lead #xd0) 243)))
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
+             (setq diff (+ diff tr)) )
             ((< lead #xfe) ;fb-fd (L T T)
              (setq diff (+ 10513 (* (- lead #xfb) 243 243)))
@@ -100,6 +95,5 @@
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
+             (setq diff (+ diff tr)) )
             ((= lead #xfe) ;fe    (L T T T)
              (setq diff 187660)
@@ -112,9 +106,6 @@
                                         ; trail 1
              (setq tr (nt:bocu-decode-trail-char (aref s i)) i (1+ i))
-             (setq diff (+ diff tr))
-             )
-            ((= lead #xff) ; reset
-             )
-            ); end of cond.
+             (setq diff (+ diff tr)) )
+            ((= lead #xff) )) ; reset
 
       (cond
@@ -122,10 +113,8 @@
         (push lead l)
                                         ;	(setq r (concat r (string lead)))
-        (if (< lead #x20) (setq pc #x40)) ;#x20�ʤ餽�Τޤ�        )
-       ((< lead #xff)
+        (if (< lead #x20) (setq pc #x40)) ) ;#x20�ʤ餽�Τޤ�       ((< lead #xff)
         (progn
           (setq code (+ pc diff))
           (if (< code 0) (setq code 0));; error recovery
-
           (push code l)
                                         ;	  (setq r (concat r (if (> code 0) (code-to-utf8 code) "?")))
@@ -140,10 +129,6 @@
                     )); pc
           ))
-       (t (setq pc #x40)); #xFF: reset
-       )
-      ); wend
-    (nreverse l)
-    ); let
-  )
+       (t (setq pc #x40)) )); #xFF: reset
+    (nreverse l) ))
 
 (defun nt:diff-to-bocustr (diff)
@@ -160,7 +145,5 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
                                         ;(setq t0 diff)
-          (string #x21 (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2) (nt:bocu-encode-trail-char t3))
-          )
-        )
+          (string #x21 (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2) (nt:bocu-encode-trail-char t3)) ))
        ((< diff -10513)   ; [-187660,-10513) : 22-24
         (progn
@@ -169,7 +152,5 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
           (setq t0 diff)
-          (string (+ #x22 t0) (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2))
-          )
-        )
+          (string (+ #x22 t0) (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2)) ))
        ((< diff -64)      ; [-10513,-64) : 25-4F
         (progn
@@ -177,14 +158,10 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
           (setq t0 diff)
-          (string (+ #x25 t0) (nt:bocu-encode-trail-char t1))
-          )
-        )
+          (string (+ #x25 t0) (nt:bocu-encode-trail-char t1)) ))
        ((< diff 64)       ; [-64,63) : 50-CF
         (progn
           (setq diff (- diff -64))
           (setq t0 diff)
-          (string (+ #x50 t0))
-          )
-        )
+          (string (+ #x50 t0)) ))
        ((< diff 10513)    ; [64,10513) : D0-FA
         (progn
@@ -192,7 +169,5 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
           (setq t0 diff)
-          (string (+ #xD0 t0) (nt:bocu-encode-trail-char t1))
-          )
-        )
+          (string (+ #xD0 t0) (nt:bocu-encode-trail-char t1)) ))
        ((< diff 187660)   ; [10513,187660) : FB-FD
         (progn
@@ -201,7 +176,5 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
           (setq t0 diff)
-          (string (+ #xFB t0) (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2))
-          )
-        )
+          (string (+ #xFB t0) (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2)) ))
        ((< diff 14536567) ; [187660,14536567) : FE
         (progn
@@ -211,12 +184,6 @@
           (setq t1 (% diff 243)) (setq diff (/ diff 243))
                                         ;(setq t0 diff)
-          (string #xFE (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2) (nt:bocu-encode-trail-char t3))
-          )
-        )
-       (t (throw 'bocu-encode-diff 'overflow-exception))
-       ); cond
-      ); let
-    ); caught
-  )
+          (string #xFE (nt:bocu-encode-trail-char t1) (nt:bocu-encode-trail-char t2) (nt:bocu-encode-trail-char t3)) ))
+       (t (throw 'bocu-encode-diff 'overflow-exception)) ))))
 
 (defun nt:rawcode-list-to-bocustr (l) ; not tested much
@@ -234,10 +201,6 @@
                   ((and (<= #x4E00 code) (<= code #x9FA5)) #x7711)
                   ((and (<= #xAC00 code) (<= code #xD7A3)) #xC1D1)
-                  (t (+ (logand code #xffff80) #x40))))
-        ); let*
-      ); wend
-    s
-    ); let*
-  )
+                  (t (+ (logand code #xffff80) #x40)))) ))
+    s))
 
 (defsubst nt:bocu-decode (s)
@@ -245,7 +208,5 @@
   (let* ((rawcode-list (nt:bocustr-to-rawcode-list s))
          (utf8str (nt:rawcode-list-to-utf8str rawcode-list)))
-    (decode-coding-string utf8str 'utf-8)
-    )
-  )
+    (decode-coding-string utf8str 'utf-8) ))
 
 (defsubst nt:bocu-encode (s)
@@ -253,9 +214,6 @@
   (let* ((utf8str (encode-coding-string s 'utf-8))
          (rawcode-list (nt:utf8str-to-rawcode-list utf8str))
-         (bocustr (nt:rawcode-list-to-bocustr rawcode-list))
-         )
-    bocustr
-    )
-  )
+         (bocustr (nt:rawcode-list-to-bocustr rawcode-list)))
+    bocustr))
 
 ;;; nt-bocu.el ends here
