Commits

steveb  committed 579ab7a

more egg-its patches under the wire

  • Participants
  • Parent commits 2cfbe6e

Comments (0)

Files changed (5)

+1999-07-26  Katsumi Yamaoka   <yamaoka@jpl.org>
+
+	* egg-sj3-client.el (sj3-put-tanconv): Use `shift_jis' instead of
+	`sjis'.
+	(sj3-server-bunsetu-henkou): Ditto.
+	(sj3-server-henkan-kouho): Ditto.
+	(sj3-server-henkan-begin): Ditto.
+	(sj3-get-convert-string): Ditto.
+	(sj3-put-string*): Ditto.
+
+1999-07-23  Hirokazu FUKUI  <hfukui@sannet.ne.jp>
+
+	* egg.el: (fence-zenkaku): Use `japanese-zenkaku-region' instead of
+	`zenkaku-region'.
+	(fence-hankaku): Use `japanese-hankaku-region' instead of
+	`hankaku-region'.
+	(fence-hiragana): Use `japanese-hiragana-region' instead of
+	`hiragana-region'.
+	(fence-katakana): Use `japanese-katakana-region' instead of
+	`katakana-region'.
+
+	(*zenkaku-alist*): Remove variable.
+
+	(zenkaku-word): Use `japanese-zenkaku-region' instead of
+	`zenkaku-region'.
+	(zenkaku-sentence): Ditto.
+	(zenkaku-paragraph): Ditto.
+	(zenkaku-region): Remove function.
+
+	(*hankaku-alist*): Remove variable.
+
+	(hankaku-word): Use `japanese-hankaku-region' instead of
+	`hankaku-region'.
+	(hankaku-sentence): Ditto.
+	(hankaku-paragraph): Ditto.
+	(hankaku-region): Remove function.
+
+	(katakana-sentence): Use `japanese-katakana-region' instead of
+	`katakana-region'.
+	(katakana-paragraph): Ditto.
+	(katakana-region): Remove function.
+
+	(hiragana-sentence): Use `japanese-hiragana-region' instead of
+	`hiragana-region'.
+	(hiragana-paragraph): Ditto.
+	(hiragana-region): Remove function.
+
+	* egg-keymap.el (global-map): Use `japanese-katakana-region',
+	`japanese-hiragana-region', `japanese-zenkaku-region', and
+	`japanese-hankaku-region' instead of `katakana-region',
+	`hiragana-region', `zenkaku-region' and `hankaku-region' for
+	function keys f5 .. f8.
+
+	* egg-jisx0201.el (fence-katakana): Use `japanese-katakana-region'
+	instead of `katakana-region'.
+	(fence-hiragana): Use `japanese-hiragana-region' instead of
+	`hiragana-region'.
+
 1999-07-14  Katsumi Yamaoka   <yamaoka@jpl.org>
 
 	* egg-wnn.el (diced-mode-map): Set the default binding to

File egg-jisx0201.el

 (defun fence-katakana  ()
   (interactive)
   (zenkaku-katakana-region egg:*region-start* egg:*region-end* )
-  (katakana-region egg:*region-start* egg:*region-end*))
+  (japanese-katakana-region egg:*region-start* egg:*region-end*))
 
 (defun fence-hiragana  ()
   (interactive)
   (zenkaku-katakana-region egg:*region-start* egg:*region-end*)
-  (hiragana-region egg:*region-start* egg:*region-end*))
+  (japanese-hiragana-region egg:*region-start* egg:*region-end*))
 
 (define-key fence-mode-map "\ex"  'fence-hankaku-katakana)

File egg-keymap.el

 (define-key global-map [f2] 'edit-dict-item)
 (define-key global-map [f3] 'jis-code-input)
 (define-key global-map [f4] 'toroku-region)
-(define-key global-map [f5] 'zenkaku-region)
-(define-key global-map [f6] 'hankaku-region)
-(define-key global-map [f7] 'katakana-region)
-(define-key global-map [f8] 'hiragana-region)
+(define-key global-map [f5] 'japanese-zenkaku-region)
+(define-key global-map [f6] 'japanese-hankaku-region)
+(define-key global-map [f7] 'japanese-katakana-region)
+(define-key global-map [f8] 'japanese-hiragana-region)
 (define-key global-map [f9] 'henkan-region)
 
 (define-key global-map [f11] 'insert-buffer)
 (define-key sun-fkeymap "12~" 'edit-dict-item)	        ; F2
 (define-key sun-fkeymap "13~" 'jis-code-input)   	; F3
 (define-key sun-fkeymap "14~" 'toroku-region)		; F4
-(define-key sun-fkeymap "15~" 'zenkaku-region)		; F5
-(define-key sun-fkeymap "17~" 'hankaku-region)		; F6
-(define-key sun-fkeymap "18~" 'katakana-region)		; F7
-(define-key sun-fkeymap "19~" 'hiragana-region)		; F8
+(define-key sun-fkeymap "15~" 'japanese-zenkaku-region)	; F5
+(define-key sun-fkeymap "17~" 'japanese-hankaku-region)	; F6
+(define-key sun-fkeymap "18~" 'japanese-katakana-region); F7
+(define-key sun-fkeymap "19~" 'japanese-hiragana-region); F8
 (define-key sun-fkeymap "20~" 'henkan-region)		; F9
 
 (define-key sun-fkeymap "23~" 'insert-buffer)		; F11 or         L1

File egg-sj3-client.el

 (defun sj3-put-string* (str)
   (let ((sstr (if (= *sj3-current-server-version* 2)
 		  (encode-coding-string str 'euc-japan)
-		(encode-coding-string str 'sjis))))
+		(encode-coding-string str 'shift_jis))))
     (insert sstr 0)))
 
 ;;;
     (delete-region point (point))
     (insert (if (= *sj3-current-server-version* 2)
 		(decode-coding-string str 'euc-japan)
-	      (decode-coding-string str 'sjis)) 0)))
+	      (decode-coding-string str 'shift_jis)) 0)))
 
 (defun sj3-get-stdy ()
   (let ((c 0) (point (point)))
 	(setq sj3-henkan-string henkan-string)
 	(if (= *sj3-current-server-version* 2)
 	    (setq mb-str (encode-coding-string henkan-string 'euc-japan))
-	    (setq mb-str (encode-coding-string henkan-string 'sjis))
+	    (setq mb-str (encode-coding-string henkan-string 'shift_jis))
         )
 	(set-buffer sj3-result-buffer)
 	(erase-buffer)
 		(setq yp (+ yp yl))
 		(if (= *sj3-current-server-version* 2)
 		    (setq yl (length (decode-coding-string ystr 'euc-japan)))
-		  (setq yl (length (decode-coding-string ystr 'sjis)))
+		  (setq yl (length (decode-coding-string ystr 'shift_jis)))
 		)
 		(sj3-get-stdy) ;;; skip study-data
 		(sj3-get-convert-string)
   (if (not (sj3-server-active-p)) -1
     (let ((mb-str (if (= *sj3-current-server-version* 2)
 		      (encode-coding-string str 'euc-japan)
-		    (encode-coding-string str 'sjis)))
+		    (encode-coding-string str 'shift_jis)))
 	  len kouho-suu)
       (setq len (length mb-str))
       (setq kouho-suu (sj3-server-henkan-kouho-suu len mb-str))
 			    (setq ystr (sj3-get-yomi yp1 ll))
 			    (setq mb-str (if (= *sj3-current-server-version* 2)
 					     (encode-coding-string ystr 'euc-japan)
-					   (encode-coding-string ystr 'sjis)))
+					   (encode-coding-string ystr 'shift_jis)))
 			    (setq i (sj3-server-henkan-kouho-suu 
 				     (length mb-str) mb-str))
 			    (set-buffer sj3-result-buffer)
   (let ((point (point)) len ksuu
 	(mb-str (if (= *sj3-current-server-version* 2)
 		    (encode-coding-string str 'euc-japan)
-		  (encode-coding-string str 'sjis))))
+		  (encode-coding-string str 'shift_jis))))
     (setq len (length mb-str))
     (setq ksuu (sj3-server-henkan-kouho-suu len mb-str))
     (if (>= ksuu 0)
 ;;; $B$R$i$,$JJQ49(B
 ;;;
 
-(defun hiragana-region (start end)
-  (interactive "r")
-    (goto-char start)
-    (while (re-search-forward kanji-katakana end end)
-      (let ((ch (char-before (point))))
-	(cond( (not (or (> ch ?$B%s(B)
-			(eq ch ?$B!<(B)
-			(eq ch ?$B!+(B)
-			(eq ch ?$B!,(B)))
-	       (delete-char -1)
-	       (insert (make-char (find-charset 'japanese-jisx0208) 36
-				  (nth 2 (split-char ch)))))))))
-
 (defun hiragana-paragraph ()
   "hiragana  paragraph at or after point."
   (interactive )
     (forward-paragraph)
     (let ((end (point)))
       (backward-paragraph)
-      (hiragana-region (point) end ))))
+      (japanese-hiragana-region (point) end))))
 
 (defun hiragana-sentence ()
   "hiragana  sentence at or after point."
     (forward-sentence)
     (let ((end (point)))
       (backward-sentence)
-      (hiragana-region (point) end ))))
+      (japanese-hiragana-region (point) end))))
 
 ;;;
 ;;; $B%+%?%+%JJQ49(B
 ;;;
 
-(defun katakana-region (start end)
-  (interactive "r")
-  (goto-char start)
-  (while (re-search-forward kanji-hiragana end end)
-    (let ((ch (char-before (point))))
-      (cond ((not (memq ch '(?$B!<(B ?$B!+(B ?$B!,(B)))
-	     (delete-char -1)
-	     (insert (make-char (find-charset 'japanese-jisx0208) 37
-				(nth 2 (split-char ch)))))))))
-
 (defun katakana-paragraph ()
   "katakana  paragraph at or after point."
   (interactive )
     (forward-paragraph)
     (let ((end (point)))
       (backward-paragraph)
-      (katakana-region (point) end ))))
+      (japanese-katakana-region (point) end))))
 
 (defun katakana-sentence ()
   "katakana  sentence at or after point."
     (forward-sentence)
     (let ((end (point)))
       (backward-sentence)
-      (katakana-region (point) end ))))
+      (japanese-katakana-region (point) end))))
 
 ;;;
 ;;; $BH>3QJQ49(B
 ;;; 
 
-(defun hankaku-region (start end)
-  (interactive "r")
-  (save-restriction
-    (narrow-to-region start end)
-    (goto-char (point-min))
-    (while (re-search-forward "\\cS\\|\\cA\\|\\cK" (point-max) (point-max))
-      (let* ((ch (split-char (char-before (point))))
-	     (ch1 (nth 1 ch))
-	     (ch2 (nth 2 ch)))
-	(cond ((= ch1 33) ;Symbols
-	       (let ((val (cdr (assq ch2 *hankaku-alist*))))
-		 (if val (progn
-			   (delete-char -1)
-			   (insert val)))))
-;	      ((= ch1 37) ;Katakana
-;	       (delete-char -1)
-;	       (insert (- ch2 ?\200 )))
-	      ((= ch1 35) ;Alphas
-	       (delete-char -1)
-	       (insert ch2)))))))
-
 (defun hankaku-paragraph ()
   "hankaku  paragraph at or after point."
   (interactive )
     (forward-paragraph)
     (let ((end (point)))
       (backward-paragraph)
-      (hankaku-region (point) end ))))
+      (japanese-hankaku-region (point) end 'ascii-only))))
 
 (defun hankaku-sentence ()
   "hankaku  sentence at or after point."
     (forward-sentence)
     (let ((end (point)))
       (backward-sentence)
-      (hankaku-region (point) end ))))
+      (japanese-hankaku-region (point) end 'ascii-only))))
 
 (defun hankaku-word (arg)
   (interactive "p")
   (let ((start (point)))
     (forward-word arg)
-    (hankaku-region start (point))))
-
-(defvar *hankaku-alist*
-  '(( 161 . ?\  ) 
-    ( 170 . ?\! )
-    ( 201 . ?\" )
-    ( 244 . ?\# )
-    ( 240 . ?\$ )
-    ( 243 . ?\% )
-    ( 245 . ?\& )
-    ( 199 . ?\' )
-    ( 202 . ?\( )
-    ( 203 . ?\) )
-    ( 246 . ?\* )
-    ( 220 . ?\+ )
-    ( 164 . ?\, )
-    ( 221 . ?\- )
-    ( 165 . ?\. )
-    ( 191 . ?\/ )
-    ( 167 . ?\: )
-    ( 168 . ?\; )
-    ( 227 . ?\< )
-    ( 225 . ?\= )
-    ( 228 . ?\> )
-    ( 169 . ?\? )
-    ( 247 . ?\@ )
-    ( 206 . ?\[ )
-    ( 239 . ?\\ )
-    ( 207 . ?\] )
-    ( 176 . ?^ )
-    ( 178 . ?\_ )
-    ( 208 . ?\{ )
-    ( 195 . ?\| )
-    ( 209 . ?\} )
-    ( 177 . ?\~ )
-    ( 198 . ?` )			; 92.6.26 by M.Shikida
-    ))
+    (japanese-hankaku-region start (point) 'ascii-only)))
 
 ;;;
 ;;; $BA43QJQ49(B
 ;;;
 
-(defun zenkaku-region (start end)
-  (interactive "r")
-  (save-restriction
-    (narrow-to-region start end)
-    (goto-char (point-min))
-    (while (re-search-forward "[ -~]" (point-max) (point-max))
-      (let ((ch (char-before (point))))
-	(if (and (<= ?  ch) (<= ch ?~))
-	    (progn
-	      (delete-char -1)
-	      (let ((zen (cdr (assq ch *zenkaku-alist*))))
-		(if zen (insert zen)
-		  (insert (make-char (find-charset 'japanese-jisx0208) 38
-				     (char-to-int ch)))))))))))
-
 (defun zenkaku-paragraph ()
   "zenkaku  paragraph at or after point."
   (interactive )
     (forward-paragraph)
     (let ((end (point)))
       (backward-paragraph)
-      (zenkaku-region (point) end ))))
+      (japanese-zenkaku-region (point) end))))
 
 (defun zenkaku-sentence ()
   "zenkaku  sentence at or after point."
     (forward-sentence)
     (let ((end (point)))
       (backward-sentence)
-      (zenkaku-region (point) end ))))
+      (japanese-zenkaku-region (point) end))))
 
 (defun zenkaku-word (arg)
   (interactive "p")
   (let ((start (point)))
     (forward-word arg)
-    (zenkaku-region start (point))))
-
-(defvar *zenkaku-alist*
-  '((?  . "$B!!(B") 
-    (?! . "$B!*(B")
-    (?\" . "$B!I(B")
-    (?# . "$B!t(B")
-    (?$ . "$B!p(B")
-    (?% . "$B!s(B")
-    (?& . "$B!u(B")
-    (?' . "$B!G(B")
-    (?( . "$B!J(B")
-    (?) . "$B!K(B")
-    (?* . "$B!v(B")
-    (?+ . "$B!\(B")
-    (?, . "$B!$(B")
-    (?- . "$B!](B")
-    (?. . "$B!%(B")
-    (?/ . "$B!?(B")
-    (?: . "$B!'(B")
-    (?\; . "$B!((B")
-    (?< . "$B!c(B")
-    (?= . "$B!a(B")
-    (?> . "$B!d(B")
-    (?? . "$B!)(B")
-    (?@ . "$B!w(B")
-    (?[ . "$B!N(B")
-    (?\\ . "$B!o(B")
-    (?] . "$B!O(B")
-    (?^ . "$B!0(B")
-    (?_ . "$B!2(B")
-    (?{ . "$B!P(B")
-    (?| . "$B!C(B")
-    (?} . "$B!Q(B")
-    (?~ . "$B!1(B")
-    (?` . "$B!F(B")))			; 92.6.26 by M.Shikida
+    (japanese-zenkaku-region start (point))))
 
 ;;;
 ;;; $B%m!<%^;z$+$JJQ49(B
 
 (defun fence-katakana  ()
   (interactive)
-  (katakana-region egg:*region-start* egg:*region-end* ))
+  (japanese-katakana-region egg:*region-start* egg:*region-end*))
 
 (defun fence-hiragana  ()
   (interactive)
-  (hiragana-region egg:*region-start* egg:*region-end*))
+  (japanese-hiragana-region egg:*region-start* egg:*region-end*))
 
 (defun fence-hankaku  ()
   (interactive)
-  (hankaku-region egg:*region-start* egg:*region-end*))
+  (japanese-hankaku-region egg:*region-start* egg:*region-end* 'ascii-only))
 
 (defun fence-zenkaku  ()
   (interactive)
-  (zenkaku-region egg:*region-start* egg:*region-end*))
+  (japanese-zenkaku-region egg:*region-start* egg:*region-end*))
 
 (defun fence-backward-char ()
   (interactive)