From: tomo Date: Sat, 28 Aug 2004 15:41:01 +0000 (+0000) Subject: (canna-self-insert-string-filter): Define for every cases; add DOC. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7d8f15b44355d80b17d1121c86ac4bdd9a6bea47;p=elisp%2Femacs-canna.git (canna-self-insert-string-filter): Define for every cases; add DOC. (canna-self-insert-string): Call `canna-self-insert-string-filter' even if non-XEmacs is running. (canna-mode-map): Add settings for [delete] and [backspace] in XEmacs. --- diff --git a/canna.el b/canna.el index df4d72f..8c4e055 100644 --- a/canna.el +++ b/canna.el @@ -65,9 +65,16 @@ (interactive) (message (concat canna-version " ..."))) +(defvar canna-self-insert-string-filter nil + "*確定時に呼ばれるフィルター関数を指定するための変数。 +設定されるフィルター関数は1引数の関数で、 +その引数に確定文字列が渡される。 +また、フィルター関数は文字列を返さなければならない。 +上記の使用を満たす関数の他、nil を指定することができ、 +その場合は無変換を表す。") + (cond ((featurep 'xemacs) - (defvar canna-self-insert-string-filter (function identity)) (defun canna-self-insert-string (string) (if (functionp canna-self-insert-string-filter) (setq string (funcall canna-self-insert-string-filter string))) @@ -81,7 +88,11 @@ (setq i (1+ i))))) ) (t - (defalias 'canna-self-insert-string 'insert) + ;; (defalias 'canna-self-insert-string 'insert) + (defun canna-self-insert-string (string) + (if canna-self-insert-string-filter + (setq string (funcall canna-self-insert-string-filter string))) + (insert string)) )) @@ -308,6 +319,8 @@ t の時はデフォルトの色を使用する。 (define-key canna-mode-map [(control left)] "\C-b") (define-key canna-mode-map [kanji] " ") (define-key canna-mode-map [(control space)] [(control @)]) + (define-key canna-mode-map [delete] "\C-?") + (define-key canna-mode-map [backspace] "\C-h") ) (t (define-key canna-mode-map [up] [?\C-p])