From 9a501daa7a949b3b220176a37fa08e3bf314b3ee Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 25 Feb 1998 09:11:03 +0000 Subject: [PATCH] Last update forgot its-map change of fence mode. --- ChangeLog | 6 ++++++ its-keydef.el | 50 +++++++++++++++++++++++++++----------------------- its.el | 29 +++++++++++++---------------- 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d3f3f6..a6b5d83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 1998-02-25 KATAYAMA Yoshio + * its.el (its-put-cursor): Enable its-map change in fence mode. + + * its-keydef.el (its-make-select-func): Same as above. + +1998-02-25 KATAYAMA Yoshio + * its.el (its-set-cursor-status): New function. (its-setup-fence-mode): New function. (its-insert-fence-open its-insert-fence-close): Deleted. diff --git a/its-keydef.el b/its-keydef.el index 8c617f7..9ccbf1f 100644 --- a/its-keydef.el +++ b/its-keydef.el @@ -6,7 +6,7 @@ (defvar its-zhuyin nil) (make-variable-buffer-local 'its-zhuyin) -(defun its-make-select-func (key name file map &optional lang zhuyin) +(defun its-make-select-func (key1 key2 name file map &optional lang zhuyin) (setq name (intern (concat "its-select-" (symbol-name name))) file (intern (concat "its/" (symbol-name file))) map (intern (concat "its-" (symbol-name map) "-map")) @@ -27,7 +27,11 @@ ,(if zhuyin `(setq its-zhuyin ,(eq zhuyin 'T))) (if (null mode-line-unchange) (egg-set-mode-line-title))) - `(define-key map ,(concat "\C-x\C-m" key) ',name))) + `(define-key map + (if fence + ,(concat "\e" (vector key2)) + ,(concat "\C-x\C-m" (vector key1))) + ',name))) (defmacro its-do-list-make-select-func (list) (eval-when (eval compile) @@ -39,29 +43,29 @@ (setq list (cdr list))) `(progn ,@funcs - (defun its-define-select-keys (map) + (defun its-define-select-keys (map &optional fence) ,@keydefs))))) (its-do-list-make-select-func - (("Q" upcase ascii up) - ("q" downcase ascii down) - ("h" hiragana hira hira Japanese) - ("K" katakana kata kata Japanese) - ("x" hankaku-katakana hankata han-kata Japanese) - ("Z" zenkaku-upcase zenkaku zenkaku-up Japanese) - ("z" zenkaku-downcase zenkaku zenkaku-down Japanese) - ("\C-e" erpin-cn erpin erpin-cn Chinese-GB NIL) - ("\C-p" pinyin-cn pinyin pinyin-cn Chinese-GB NIL) - ("\C-z" zhuyin-cn zhuyin zhuyin-cn Chinese-GB T) - ("\C-u" quanjiao-upcase-cn quanjiao quanjiao-up-cn Chinese-GB) - ("\C-d" quanjiao-downcase-cn quanjiao quanjiao-down-cn Chinese-GB) - ("E" erpin-tw erpin erpin-tw Chinese-CNS NIL) - ("P" pinyin-tw pinyin pinyin-tw Chinese-CNS NIL) - ("Z" zhuyin-tw zhuyin zhuyin-tw Chinese-CNS T) - ("U" quanjiao-upcase-tw quanjiao quanjiao-up-tw Chinese-CNS) - ("C" quanjiao-downcase-tw quanjiao quanjiao-down-tw Chinese-CNS) - ("H" hangul hangul hangul Korean) - ("J" jeonkak-upcase jeonkak jeonkak-up Korean) - ("j" jeonkak-downcase jeonkak jeonkak-down Korean))) + ((?Q ?Q upcase ascii up) + (?q ?q downcase ascii down) + (?h ?\C-h hiragana hira hira Japanese) + (?k ?\C-k katakana kata kata Japanese) + (?x ?\C-x hankaku-katakana hankata han-kata Japanese) + (?Z ?Z zenkaku-upcase zenkaku zenkaku-up Japanese) + (?z ?z zenkaku-downcase zenkaku zenkaku-down Japanese) + (?\C-e ?\C-e erpin-cn erpin erpin-cn Chinese-GB NIL) + (?\C-p ?\C-p pinyin-cn pinyin pinyin-cn Chinese-GB NIL) + (?\C-z ?\C-z zhuyin-cn zhuyin zhuyin-cn Chinese-GB T) + (?\C-u ?\C-u quanjiao-upcase-cn quanjiao quanjiao-up-cn Chinese-GB) + (?\C-d ?\C-d quanjiao-downcase-cn quanjiao quanjiao-down-cn Chinese-GB) + (?E ?E erpin-tw erpin erpin-tw Chinese-CNS NIL) + (?P ?P pinyin-tw pinyin pinyin-tw Chinese-CNS NIL) + (?Z ?Z zhuyin-tw zhuyin zhuyin-tw Chinese-CNS T) + (?U ?U quanjiao-upcase-tw quanjiao quanjiao-up-tw Chinese-CNS) + (?C ?C quanjiao-downcase-tw quanjiao quanjiao-down-tw Chinese-CNS) + (?H ?H hangul hangul hangul Korean) + (?J ?J jeonkak-upcase jeonkak jeonkak-up Korean) + (?j ?j jeonkak-downcase jeonkak jeonkak-down Korean))) (provide 'its-keydef) diff --git a/its.el b/its.el index b66e1f4..a97c860 100644 --- a/its.el +++ b/its.el @@ -159,6 +159,8 @@ ;; ;; +(require 'its-keydef) + (defvar its-mode-map (let ((map (make-sparse-keymap)) (i 33)) @@ -184,18 +186,13 @@ (define-key map " " 'its-kick-convert-region) (define-key map "\177" 'its-delete-backward-SYL) ;; - (define-key map "\C-p" 'its-previous-map) - (define-key map "\C-n" 'its-next-map) -; (define-key map "\M-h" 'its-hiragana) ; hiragana-region for input-buffer -; (define-key map "\M-k" 'its-katakana) -; (define-key map "\M-<" 'its-hankaku) -; (define-key map "\M->" 'its-zenkaku) -; (define-key map "\M-\C-h" 'its-select-hiragana) -; (define-key map "\M-\C-k" 'its-select-katakana) -;;; (define-key map "\M-q" 'its-select-downcase) ; -; (define-key map "\M-Q" 'its-select-upcase) -; (define-key map "\M-z" 'its-select-zenkaku-downcase) -; (define-key map "\M-Z" 'its-select-zenkaku-upcase) + (define-key map "\M-p" 'its-previous-map) + (define-key map "\M-n" 'its-next-map) + (define-key map "\M-h" 'its-hiragana) ; hiragana-region for input-buffer + (define-key map "\M-k" 'its-katakana) + (define-key map "\M-<" 'its-hankaku) + (define-key map "\M->" 'its-zenkaku) + (its-define-select-keys map t) map) "Keymap for ITS mode.") @@ -206,9 +203,11 @@ (defconst its-setup-fence-before-insert-SYL nil) (defun its-put-cursor (cursor) - (let ((p (point))) + (let ((p (point)) + (map (copy-keymap its-mode-map))) + (its-define-select-keys map) (insert "!") - (add-text-properties p (point) (list 'local-map its-mode-map + (add-text-properties p (point) (list 'local-map map 'invisible t 'intangible 'its-part-2 'its-cursor cursor)) @@ -762,7 +761,5 @@ Return last state." (delete-region start end) (insert its-translation-result))) -(require 'its-keydef) - (provide 'its) ;;; its.el ends here. -- 1.7.10.4