--- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/ChangeLog.emcws 2003-02-12 06:55:49 +0000 @@ -0,0 +1,850 @@ +2003-02-12 Katsumi Yamaoka + + * lisp/canna.el (canna:insert-preedit): Fix the face position when + `canna-underline' is non-nil. + +2002-10-12 AMAGAI yoshiji + + * src/canna.c (Fcanna_touroku_string): use STRING_BYTES. + (Fcanna_store_yomi): use STRING_BYTES. + (Fcanna_parse): use STRING_BYTES. + (Fcanna_henkan_begin): use STRING_BYTES. + (mule_strlen): use STRING_BYTES. + Refer to the patch on emacs-canna for GNU Emacs 20 with dl, + (1993, 2000). Thanks to MORIOKA Tomohiko . + +2002-02-06 Katsumi Yamaoka + + * lisp/canna.el (display-minibuffer-mode-in-minibuffer): Default + to t; don't modify the value. + (canna:minibuffer-preprompt-overlay): New variable. + (canna:select-window-hook): Delete a preprompt overlay; clear the + value of `canna:minibuffer-preprompt-overlay' when exiting from + minibuffer. + (canna:minibuffer-setup-hook): Always define. + (anna:minibuffer-exit-hook): Always define. + (mode-line-canna-mode-update): Use an overlay to show a preprompt + string in the minibuffer. + +2002-01-31 Katsumi Yamaoka + + * lisp/wnn-egg.el (diced-mode-esc-map): Removed; move key + definitions to `diced-mode-map'. + (diced-mode-map): Don't invalidate undefined keys. + (read-current-its-string): Rewrote. + + * lisp/sj3-egg.el (diced-mode-esc-map): Removed; move key + definitions to `diced-mode-map'. + (diced-mode-map): Don't invalidate undefined keys. + (edit-dict): Open server if it is disconnected. + (edit-dict-item): Fmakunbound. + (toroku-region): Open server if it is disconnected. + + * lisp/egg.el (egg:read-kanji-string): Rewrote. + (egg:read-hiragana-string): Rewrote. + (egg:*minibuffer-local-hiragana-map*): Invalidate C-x prefix keys, + meta prefix keys and key(s) for the command `toggle-egg-mode'. + (egg:minibuffer-exit-function): Delete a preprompt overlay; clear + the value of `egg:minibuffer-preprompt-overlay'. + (egg:minibuffer-setup-function): Don't clear the value of + `egg:minibuffer-preprompt-overlay'. + +2002-01-28 IWAMA Yoshihiko + + * lisp/sj3-client.el (sj3-get-4byte): Made it work on 64-bit + systems. + +2002-01-19 Kazuhito Ichimura + + * lisp/egg.el (egg:minibuffer-preprompt-overlay): New internal + variable. + (egg:minibuffer-setup-function): Clear it. + (mode-line-egg-mode-update): Use an overlay to show a preprompt + string in the minibuffer. + +2002-01-18 Katsumi Yamaoka + + * configure.in (rename): Replaced --enable-rename=no with + --disable-rename in the help string. + * configure: Regenerated. + + * lisp/egg.el (display-minibuffer-mode-in-minibuffer): Use `defvar' + instead of `defconst' to define it. + (mode-line-egg-mode-in-minibuffer-as-before): New variable. + (egg:minibuffer-setup-function): Keep the value of + `mode-line-egg-mode-in-minibuffer' in + `mode-line-egg-mode-in-minibuffer-as-before'. + (egg:minibuffer-exit-function): Reset the value of + `display-minibuffer-mode'; restore the value of + `mode-line-egg-mode-in-minibuffer' from + `mode-line-egg-mode-in-minibuffer-as-before'. + (egg:minibuffer-preprompt): Use `defvar' instead of `defconst' to + define it. + (mode-line-egg-mode-update): Manipulate a prompt string directly + in the minibuffer. + (egg:select-window-hook, egg:minibuffer-exit-function, + mode-line-egg-mode-update): Don't use `minibuffer-preprompt'. + +2002-01-17 Katsumi Yamaoka + + * configure.in (rename): Invert the logic that renaming emacs to + emcws is the default. Users can inhibit renaming by using the + option --enable-rename=no. + * configure: Regenerated. + +2002-01-05 Kazuhito Ichimura + + * Makefile.in (EMACS): Made it to be substitutable by configure. + (EMACS_POSTFIX): New variable. + (install-arch-dep): Replaced emcws with $(EMACS). + (install-arch-indep): Replaced -emcws with $(EMACS_POSTFIX). + (install-leim): Specify INSTALLDIR. + (mkdir): Replaced -emcws with $(EMACS_POSTFIX). + (uninstall): Replaced -emcws with $(EMACS_POSTFIX); replaced emcws + with $(EMACS). + + * configure.in (TopLevel): Replaced -emcws with $(EMACS_POSTFIX). + (TopLevel): Don't modify the file leim/Makefile.in. + (rename): New option --enable-rename. + (emcws, emcws_postfix): Added substitutions. + (wnn): Integrated wnn4 and wnn6 into it. + (wnn4, wnn6): Removed. + * configure: Regenerated. + + * lisp/eggrc-wnn (wnn7-jserver-setup): New function. + (TopLevel): Call `wnn7-jserver-setup' if Wnn7 server is available. + + * lisp/loadup.el (TopLevel): Don't load egg. + + * lisp/mule-inst.el (load-necessary-files): Don't load + international/quail. + + * lisp/wnn-egg.el (is-wnn7-server): New function. + (wnn7-set-boin-kabusoku): New function. + (wnn7-set-shiin-choka): New function. + (wnn7-set-n-choka): New function. + (wnn7-set-nihongo-kosei): New function. + (wnn7-henkan-synonym): New function. + + * src/config.in (WNN4, WNN6): Removed. + + * src/wnnfns.c (TopLevel): Don't include cplib.h for Wnn7. + (Fwnn_dict_list): Use JSERVER_VERSION instead of WNN6. + (Fwnn_begin_henkan): Make it work with Wnn7; Use JSERVER_VERSION + instead of WNN6. + (Fwnn_bunsetu_henkou): Use JSERVER_VERSION instead of WNN6. + (Fwnn_inspect): Made it work with Wnn7. + (Fwnn_bunsetu_kanji): Ditto. + (Fwnn_bunsetu_yomi): Ditto. + (Fwnn_hindo_update): Use JSERVER_VERSION instead of WNN6. + (Fwnn_word_toroku): Made it work with Wnn7. + (Fwnn_dict_search): Ditto. + (Fwnn_get_msg): Made it work with Wnn7. + (Fwnn_hinsi_number): Use JSERVER_VERSION instead of WNN6. + (Fwnn_okuri_flag): Made it work correctly. + (Fwnn_numeric): Ditto. + (Fwnn_alphabet): Ditto. + (Fwnn_symbol): Ditto. + (Fwnn_boin_kabusoku): New function for Wnn7. + (Fwnn_shiin_choka): Ditto. + (Fwnn_n_choka): Ditto. + (Fwnn_nihongo_kosei): Ditto. + (Fwnn_server_synonym): Ditto. + (syms_of_wnn): Use JSERVER_VERSION instead of WNN6; made it work + with Wnn7. + (w2m): Made it work with Wnn7. + (w2y): Don't define it for Wnn7. + (yes_or_no): Made it work correctly. + +2001-12-17 Richard M. Stallman + + * src/coding.c (code_convert_region): Update + coding->cmp_data->char_offset before calling decode_coding. + + * src/charset.c (Fdefine_charset): Call + Fupdate_coding_systems_internal. + +2001-12-04 Katsumi Yamaoka + + * lisp/wnn-client.el (jd_udp): Fix typo. + (jd_reconv): Comment out. + (wnn-server-open, wnn-command-reset): Replace `buffer-flush-undo' + with `buffer-disable-undo'; Don't handle Nemacs stuff. + + * lisp/sj3-egg.el (get-sj3-host-name): Use `symbol-value' to refer + the variable `sj3serv-host-name'. + + * lisp/isearch-ext.el (isearch-exit-minibuffer-quail): Use + `symbol-value' to refer `quail-current-key' or `quail-current-str'. + (isearch-fep-read-quail): Use `set' instead of `setq' to set the + value of `disable-undo'. + (isearch-minibuffer-exit-canna): Ditto. + (isearch-minibuffer-exit-egg): Ditto. + + * lisp/canna.el (canna-cc-mode-hook, canna-c-electric-brace, + canna-c-electric-semi&comma, canna-c-electric-colon): New + functions for the CC modes. + (canna-c-mode-hook): Use `symbol-value' to refer `c-mode-map'. + (electric-c-brace, electric-c-semi, electric-c-terminator): + Autoload "c-mode" for the functions when compiling. + (canna): Use `symbol-value' to refer `hilit-background-mode'. + (canna:quit-canna-mode): Use `set' instead of `setq' to set the + value of `disable-undo'. + (canna:enter-canna-mode): Ditto. + (canna:create-mode-line): Use `set' or `symbol-value' for the + variable `modeline-format'; use `set-default' or `default-value' + for the variable `default-modeline-format'. + (select-window-hook): Use `set' or `symbol-value' for it. + (canna-dl-handle): Use `eval' to call `dynamic-call' or + `dynamic-link'. + (self-insert-internal, get-frame-background-mode, event-key): + Defalias to `ignore' if the feature `xemacs' is not provided. + + * lisp/busyu.el (busyu-break-string): Simplified. + +2001-10-24 Katsumi Yamaoka + + * lisp/isearch-ext.el: Don't require `quail'. + +2001-10-02 Katsumi Yamaoka + + * lisp/startup.el (command-line): Cancel the last change to add + leim directory to `load-path'. + +2001-09-04 Katsumi Yamaoka + + * lisp/sj3-client.el: Remove `wnn-egg:kill-emacs-function' from + `kill-emacs-hook'. + (sj3-egg:kill-emacs-function): New function. + (kill-emacs): Don't redefine it. Use `kill-emacs-hook' instead. + + * lisp/wnn-client.el (*wnn-do-auto-save-dict*): Removed. + (do-auto-save): Removed. + (kill-emacs): Removed. + + * lisp/wnn-egg.el (set-kserver-host-name): Use `defalias' instead + of `fset'. + (set-cserver-host-name): Ditto. + (set-jserver-host-name): Ditto. + + * lisp/sj3-egg.el (get-sj3serv-host-name): Use `defalias' instead + of `fset'. + + * lisp/egg.el (si:minibuffer-completion-help): Removed. + (si:all-completions): Removed. + +2001-09-03 Katsumi Yamaoka + + * Makefile.in (${srcdir}/configure): Ignore an error even if + autoconf does not exist (Note: patch might make configure.in + newer than configure). + +2001-09-01 Makoto Fujiwara + + * configure: Regenerated (synch with 21.0.105). + +2001-08-30 Katsumi Yamaoka + + * configure: Regenerated. + +2001-08-30 Makoto Fujiwara + + * configure.in: Look for the LEIM package in ${srcdir}/leim/ + instead of leim/ for the use of VPATH; modify the way to check + whether the file ${srcdir}/leim/Makefile.in is the real thing. + +2001-08-29 Makoto Fujiwara + + * src/Makefile.in (bytecomp): Use ./emacs instead of + ${srcdir}/emacs for the use of VPATH. + +2001-07-13 Katsumi Yamaoka + + * lisp/mule-inst.el (load-necessary-files): Load "derived" before + "replace.el". + +2001-06-22 Katsumi Yamaoka + + * lisp/startup.el (normal-top-level): Add leim directory to + `load-path' if it is possible. + + * configure: Regenerate. + + * configure.in: Modify the file leim/Makefile.in to set the value + of `INSTALLDIR' to "${datadir}/emacs/${version}-emcws/leim" if the + file is originated from the LEIM package. + (locallisppath): Don't include leim directory if the LEIM package + does not exist. + + * leim/Makefile.in: Don't modify it when patching. + +2001-05-09 Katsumi Yamaoka + +* Note that the name of Emacs executable and the version specific +* directory names have changed as such as follows: +* +* /usr/local/bin/emacs-VERSION -> /usr/local/bin/emcws-VERSION +* /usr/local/bin/emacs -> /usr/local/bin/emcws +* /usr/local/libexec/emacs/VERSION/ -> /usr/local/libexec/emacs/VERSION-emcws/ +* /usr/local/share/emacs/VERSION/ -> /usr/local/share/emacs/VERSION-emcws/ +* +* You don't have to use the patch named emcws-VERSION-rename.patch.gz. +* It is now useless. + + * leim/Makefile.in (INSTALLDIR): Replace the directory name + "${version}" with "${version}-emcws". + +2001-04-11 Katsumi Yamaoka + + * lisp/startup.el (fancy-splash-tail): Fold a version string if it + is longer than the window width. + + * lisp/egg.el (its:all-completions): Remove too much `if'. + + * configure: Regenerated. + + * configure.in (docdir, archlibdir, etcdir, locallisppath, lispdir): + Replace the directory name "${version}" with "${version}-emcws". + + * Makefile.in (uninstall): Remove "emcws-${version}" instead of + "emacs-${version}". + (uninstall, mkdir, install-arch-dep): Replace the directory name + "${version}" with "${version}-emcws". + (install-arch-dep): Replace the executable file name + "emacs-${version}" with "emcws-${version}". + (EMACS): Replace the value "emacs" with "emcws". + +2001-02-07 HIROSE yuuji + + * lisp/canna.el (canna): Use TTY colors if Emacs 21+ or XEmacs is + running. + (canna:attribute-alist): Add TTY colors. + (canna-background-mode): New variable. + +2001-01-30 Katsumi Yamaoka + + * lisp/textmodes/picture.el (picture-insert-string): Don't use + `char-bytes'. + +2001-01-26 Katsumi Yamaoka + + * src/wnnfns.c (EGG_TIMEOUT): Set it to 0 instead of 5 in order to + inhibit SIGALRM. It is needed for Wnn6 on Solaris. + +2001-01-25 Katsumi Yamaoka + + * lisp/textmodes/picture.el (picture-mode): Don't refer to the + value of `self-insert-after-hook' if it is not bound. + (self-insert-after-hook): Bind it for byte-compiler. + (picture-insert-string): Replace `delete-text-in-column' with + `picture-delete-text-in-column'; replace `sref' with `aref'. + (picture-delete-text-in-column): New function imported from egg.el. + + * lisp/sj3-egg.el (get-sj3-host-name): Use "localhost" by default. + * lisp/wnn-egg.el (open-wnn-if-disconnected): Ditto. + (set-kwnn-host-name): Ditto. + (set-cwnn-host-name): Ditto. + (set-wnn-host-name): Ditto. + +2001-01-24 Katsumi Yamaoka + + * src/Makefile.in (lisp): Add ${lispsource}textmodes/picture.elc. + + * lisp/canna.el (canna:insert-fixed): Set `canna:*region-start*' + and `canna:*region-end*' to the region of inserted kakutei string. + (TopLevel): Substitute `self-insert-command', + `completion-separator-self-insert-command' and + `completion-separator-self-insert-autofilling' with + `canna-self-insert-command' if the feature `picture' is provided. + + * lisp/textmodes/picture.el (picture-mode-map): Substitute + `self-insert-command', `completion-separator-self-insert-command' + and `completion-separator-self-insert-autofilling' with + `canna-self-insert-command' if the feature `canna' is provided. + (picture-mode): Make `self-insert-after-hook' buffer-local. + +1989-09-17 Kenichi Handa + + * lisp/textmodes/picture.el + (picture-mode-old-self-insert-after-hook): Bind it. + (picture-mode): Save the value of `self-insert-after-hook' in the + buffer-local variable `picture-mode-old-self-insert-after-hook'; + set `self-insert-after-hook' to `picture-insert-after-hook'. + (picture-mode-exit): Restore the value of `self-insert-after-hook'. + +1989-09-07 Kenichi Handa + + * lisp/textmodes/picture.el (picture-movement-wnw): New function. + (picture-movement-ene): New function. + (picture-movement-wsw): New function. + (picture-movement-ese): New function. + (picture-insert-after-hook): New function. + (picture-insert-string): New function. + (picture-mode-map): Substitute `self-insert-command', + `completion-separator-self-insert-command' and + `completion-separator-self-insert-autofilling' with + `egg-self-insert-command' if `EGG' is available; define keys as + `picture-insert-string', `picture-movement-wnw', + `picture-movement-ene', `picture-movement-wsw' and + `picture-movement-ese'. + +2001-01-19 Katsumi Yamaoka + + * lisp/canna.el (canna-minibuffer-mode-map): Define [backspace] and + [delete] as [?\C-h]. + (canna-mode-map): Ditto. + +2000-12-09 HIROSE yuuji + + * lisp/canna.el: Update. + +2000-12-11 Katsumi Yamaoka + + * lisp/wnn-egg.el: Use `dolist' instead of `mapcar'. + * lisp/sj3-egg.el: Ditto. + * lisp/egg.el: Ditto. + + * lisp/egg-keymap.el: Replace `set-file-coding-system' with + `set-buffer-file-coding-system'. + +2000-10-05 Katsumi Yamaoka + + * egg.el (dolist): Removed. + (for-each*): Removed. + (for-each): Removed. + +2000-06-22 Katsumi Yamaoka + + * lisp/canna.el (canna-mode-map): Define [backspace] and [delete] + as [?\C-h]. + +2000-06-07 Katsumi Yamaoka + + * lisp/isearch-ext.el: Revert the last change of 1999-08-16; use + `require' with an arg `quail' instead of the use of `load'. + + * lisp/mule-inst.el (load-necessary-files): Load "timer", "frame" + and "international/quail" for compiling isearch-ext.el; load + "emacs-lisp/cl-macs" before "emacs-lisp/bytecomp.el"; load + "emacs-lisp/cl" before "simple"; load "emacs-lisp/backquote" + before "bindings". + + * configure.in, lisp/startup.el, src/config.in, src/emacs.c, + src/xfaces.c, src/xfns.c, src/xterm.c, src/xterm.h: Don't modify + for the line spacing feature. It's already supported in Emacs 21. + +2000-06-02 Katsumi Yamaoka + + * src/xfns.c (x-create-frame): Set the default value of + "LineSpacing" to number 0. + (x_set_line_spacing): Treat the arg as an integer. + + * src/emacs.c (main): Add "--line-spacing" to the help message. + +2000-06-01 Makoto Fujiwara + + * lisp/version.el: move the line provide emcws to the end, add + defconft emcws-version. + +2000-05-25 Makoto Fujiwara + + * src/alloc.c: Set NSTATICS to 1024. + +2000-05-22 Katsumi Yamaoka + + * src/xfns.c: Rename "line space" with "line spacing". + + * configure.in, src/config.in, src/xfaces.c, src/xterm.c, + src/xterm.h: Enable the line spacing feature at all times. + + * lisp/startup.el (command-line-x-option-alist): Rename + "line-space" with "line-spacing"; replace `x-handle-switch' with + `x-handle-numeric-switch' for the options "-lsp" and + "--line-spacing". + +2000-02-09 Katsumi Yamaoka + + * lisp/isearch-ext.el (isearch-fep-canna): Call + `canna:quit-canna-mode' after searching is done. + +2000-01-07 Katsumi Yamaoka + + * lisp/version.el (emcws): Provide as a feature. + +1999-12-10 TSUCHIYA Masatoshi + + * configure.in: Work for "without-*" options. + + * src/config.in: Rearrange the order of `LINESPACE'. + +1999-12-10 TSUCHIYA Masatoshi + + * configure.in, lisp/startup.el(command-line-x-option-alist), + src/config.in, src/xfaces.c(frame_update_line_height), + src/xfns.c(Qline_space,x_set_line_space,x-create-frame), + src/xterm.c(dumpglyphs,x_new_font), src/xterm.h(x_output): + Add line space feature, ported from Mule-2.3 based on Emacs-19.34. + +1999-11-10 Katsumi Yamaoka + + * lisp/busyu.el: New file imported from Mule 2.3@19.34. + +1999-08-16 Katsumi Yamaoka + + * src/Makefile.in (lisp): Add ${lispsource}isearch-ext.elc. + + * lisp/loadup.el (TopLevel): Load isearch-ext. + + * lisp/isearch-ext.el (TopLevel): Uncomment defining fep keys; use + `load' with arg "international/quail" instead of `require' at the + compile time. + + * lisp/its/kanainput.el: Rename from katainput.el. + +1999-08-10 IIJIMA 'Delmonta' Hiromitsu + + * lisp/its/katainput.el: Fix usage. + +1999-07-29 Katsumi Yamaoka + + * lisp/sj3-egg.el (diced-mode-esc-map) Rearrange key definitions. + (henkan-mode-map): Ditto. + (diced-mode-esc-map): Restore keymap. + (henkan-mode-esc-map): Ditto. + + * lisp/wnn-egg.el (diced-mode-esc-map) Rearrange key definitions. + (henkan-mode-map): Ditto. + (diced-mode-esc-map): Restore keymap. + (henkan-mode-esc-map): Ditto. + + * lisp/egg.el (fence-mode-map): Rearrange key definitions. + (fence-mode-esc-map): Restore keymap. + +1999-07-15 Katsumi Yamaoka + + * lisp/wnn-egg.el (henkan-mode-map): Use `substitute-key-definition' + instead of defining each keys with `define-key'. + * lisp/sj3-egg.el (henkan-mode-map): Ditto. + * lisp/egg.el (egg:*minibuffer-local-hiragana-map*, fence-mode-map, + global-map): Ditto. + + * lisp/egg.el (fence-mode-esc-map): Abolish keymap. + (minibuffer-local-menu-map): No need to define [kp-0] .. [kp-9] + because they are defined as ascii chars in simple.el. + + * lisp/wnn-egg.el (diced-mode-map, henkan-mode-map): Inherit the + binding of `function-key-map' with the default binding `undefined'. + * lisp/sj3-egg.el (diced-mode-map, henkan-mode-map): Ditto. + * lisp/egg.el (fence-mode-map, minibuffer-local-menu-map): Ditto. + + * lisp/wnn-egg.el (diced-mode-esc-map, henkan-mode-esc-map): Abolish + keymap. + * lisp/sj3-egg.el (diced-mode-esc-map, henkan-mode-esc-map): Ditto. + +1999-07-13 Katsumi Yamaoka + + * lisp/wnn-egg.el (diced-mode-esc-map): Use it for the meta-prefix + map of `diced-mode-map'. + (henkan-mode-esc-map, henkan-mode-map): Don't bother to define + each keys as `undefined'; use `make-sparse-keymap' instead of + `make-keymap'. + (egg:bunsetu-face-on): Removed the char-boundary stuff. + (sai-henkan, henkan-region-internal): Don't use `disable-undo'. + + * lisp/sj3-egg.el (diced-mode-esc-map): Use it for the meta-prefix + map of `diced-mode-map'. + (henkan-mode-esc-map, henkan-mode-map): Don't bother to define + each keys as `undefined'; use `make-sparse-keymap' instead of + `make-keymap'; define the default binding as `undefined'. + + * lisp/egg.el (fence-mode-esc-map, fence-mode-map): Don't bother to + define each keys as `undefined'; use `make-sparse-keymap' + instead of `make-keymap'. + +1999-07-12 Katsumi Yamaoka + + * lisp/egg.el (menu:goto-nth-element): Don't use + `event-to-character'. + + * lisp/sj3-egg.el (henkan-quit): Sync up with the last change of + lisp/wnn-egg.el. + (henkan-kakutei): Ditto. + +1999-07-11 Masahiro MURATA + + * lisp/wnn-egg.el (henkan-quit): go back to fence mode after the + henkan-quit. + +1999-07-10 Takeshi Yamada + + * lisp/egg.el (fence-exit-mode): Exit from fence-mode-map before + delete-region calls are made, otherwise undesirable deadlock can + happen when delete-region is somehow failed. + + * lisp/wnn-egg.el (henkan-kakutei): Exit from hekan-mode-map and + fence-mode-map before delete-region calls are made, otherwise + undesirable deadlock can happen when delete-region is somehow + failed. + (henkan-kakutei-first-char): Ditto. + +1999-07-01 Katsumi Yamaoka + + * lisp/egg.el (menu:goto-nth-element): Use `event-to-character' + insted of `event-key' for allowing keys [kp-0] .. [kp-9]. + (minibuffer-local-menu-map): Add definitions for some keys. + +1999-06-18 Takeshi Yamada + + * lisp/egg.el (egg:cancel-undo-boundary): new function + borrowed from canna.el. original cancel-undo-boundary was + in mule2.3. + (egg-self-insert-command): consecutive 20 self-insert + commands are treated as a single undo chunk as is done in + the original self-insert-command. + +1999-06-17 Takeshi Yamada + + * lisp/egg.el (menu:select-from-menu): menu handling parts are + completely rewritten by adopting codes originally submitted by + YAMAMOTO Mitsuharu to the + mule-jp mailing list back in 1995. The menu keymap is no more + hard coded! + + * lisp/egg.el some obsolete regular expressions are deleted. + +1999-06-17 Katsumi Yamaoka + + * lisp/sj3-egg.el (diced-add): Use `egg:read-kanji-string' and + `egg:read-hiragana-string' instead of `read-kanji-string' or + `read-hiragana-string'. + (toroku-region): Use `egg:read-hiragana-string' instead of + `read-hiragana-string'. + + * lisp/egg.el (egg:read-kanji-string): Renamed from + `read-kanji-string'. + (egg:read-hiragana-string): Renamed from `read-hiragana-string' + because it was duplicated with Quail's function of the same name. + (egg:quit-egg-mode): Neglect `disable-undo'. + (enter-fence-mode): Ditto. + (its:simulate-input): Don't use `char-bytes' because it always + return 1. + (its-defrule**): Ditto. + (menu:select-from-menu): Don't use `save-selected-window'. + +1999-06-15 Katsumi Yamaoka + + * lisp/sj3-egg.el (henkan-quit): Bug-fix - fence string remained + and `buffer-undo-list' become t in henkan-quit after henkan-region. + +1999-06-13 Masahiro MURATA + + * lisp/egg.el (TopLevel): Make `egg-buffer-modified-flag' + buffer-local. + * lisp/egg.el (suspend-undo): Bug-fix - buffer-modified-p don't + go back to unmodified when undo. Don't set buffer-undo-list to t. + (resume-undo-list): Ditto. + (menu:select-from-menu): Add save-selected-window before + save-window-excursion. Add "?\ " to menu:select-next-item. + * lisp/wnn-egg.el (henkan-quit): Bug-fix - fence string remained + and `buffer-undo-list' become t in henkan-quit after henkan-region. + (sai-henkan): Moved `suspend-undo' after delete-region. + +1999-05-21 Keisuke Mori + + * src/wnnfns.c (wnn-server-open) [WINDOWSNT]: Call init_winsock. + See http://www.kt.rim.or.jp/~ksk/Meadow/indexj.html for more + information. + +1999-03-15 Katsumi Yamaoka + + * ChangeLog.emcws: New file. + +1999-03-13 Takeshi YAMADA + + * lisp/egg.el (egg:fence-face-on): Install `egg:*fence-face*' to + the existing `egg:*fence-overlay*' correctly whenever it is + changed. + + * lisp/wnn-egg.el (set-egg-henkan-mode-format): Handle the case + when open or close is nil correctly. + +1999-03-10 Takeshi YAMADA + + * lisp/egg-jsymbol.el (make-jis-first-level-code-alist): Replace + obsolete code by `make-char'. + (make-jis-second-level-code-alist): Ditto. + (make-jis-hojo-kanji-code-alist):Ditto. + (make-all-jis-code-alist): Ditto. + +1999-03-04 Takeshi YAMADA + + * lisp/egg-sj3.el (henkan-region-internal): Bug fix - + `henkan-region' didn't work. + +1999-03-02 Takeshi YAMADA + + * lib-src/blessmail: Removed. + +1999-03-02 Masahiro MURATA + + * lisp/egg.el (TopLevel): Make `egg-buffer-undo-list' buffer-local. + +1999-02-28 Masahiro MURATA + + * lisp/egg.el (suspend-undo): New function to save the + `buffer-undo-list' and bind it to t. + (enter-fence-mode): Use it. + (resume-undo-list): New function to restore the saved + `buffer-undo-list'. + (fence-exit-internal): Use it. + (egg-buffer-undo-list): New variable for the saved + `buffer-undo-list'. + + * lisp/wnn-egg.el (henkan-kakutei-first-char): Use + `resume-undo-list'. + (henkan-kakutei): Ditto. + (sai-henkan): Use `suspend-undo', `resume-undo-list'. + (henkan-region-internal): Ditto. + + * lisp/sj3-egg.el (henkan-kakutei): Use `resume-undo-list'. + (henkan-region-internal): Use `suspend-undo'. + +1998-12-22 Kaoru Nakajima + + * lisp/canna.el (TopLevel): Enclose `(defadvice undo ...)' with + `eval'. + + * lisp/loadup.el (TopLevel): Don't load "canna". Use `autoload' + instead. + +1998-11-18 Katsumi Yamaoka + + * lisp/sj3-client.el (sj3-server-henkan-next): Bug fix - store the + one of forgotten converted japanese string in `sj3-result-buffer'. + +1998-11-11 Yoshitsugu Mito + + * lisp/canna.el: Fast undo (from emacs-20.3+canna-9.diff.gz). + +1998-11-02 Katsumi Yamaoka + + * lisp/sj3-client.el (sj3-server-open): Generate + `sj3-server-buffer' explicitly. + +1998-10-22 Takeshi YAMADA + + * lisp/sj3-egg.el: Make `henkan-mode-in-use' buffer-local. + * lisp/egg.el: Make `henkan-mode-in-use' buffer-local. + * lisp/sj3-egg.el (henkan-region-internal): Bug fix - wrong logic + at `unwind-protect'. + +1998-10-16 Katsumi Yamaoka + + * lisp/sj3-egg.el (henkan-mode-map): Add some key definitions. + * lisp/sj3-egg.el (egg:henkan-mode-in-use): Use + `minor-mode-map-alist' instead of local-map. + + * lisp/egg.el (egg:*local-map-backup*): Abolished. + * lisp/sj3-egg.el (egg:*local-map-backup*): Abolished. + +1998-10-11 Katsumi Yamaoka + + * lisp/sj3-client.el (sj3-server-open): Set `sj3-server-buffer' as + unibyte. + + * lisp/sj3-client.el: Minimize diffs from original. + * lisp/sj3-egg.el: Ditto. + +1998-10-10 Takeshi YAMADA + + * lisp/wnn-egg.el: Make `egg:henkan-mode-in-use' buffer-local. + +1998-10-10 Takeshi YAMADA + + * lisp/canna.elc, lisp/wnn-egg.elc, lisp/egg.elc ,lisp/sj3-egg.elc, + lisp/sj3-client.elc: Removed. + * configure.in, configure: Has -with-sj3, and outside of source + tree. + +1998-10-05 Katsumi Yamaoka + + * lisp/sj3-egg.el, lisp/sj3-client.el: New files. + + * lisp/egg.el: Modified for sj3. + +1998-10-05 Kunihiro Ishiguro + + * configure.in, configure: Fix Linux _crypt problem. + +1998-09-22 Makoto Fujiwara + + * src/path.h: Removed. + * lib-src/Makefile: Removed. + +1998-09-21 Makoto Fujiwara , + Oki Masaru + + * src/Makefile.in: Do not show sj3*elc not found message. + +1998-09-21 Kaoru Nakajima + + * lisp/canna.el (canna-touroku-region): emacs-20.3+canna-7.diff + +1998-09-20 Kaoru Nakajima + + * lisp/canna.el (canna-henkan-region): emacs-20.3+canna-6.diff + +1998-09-19 Kaoru Nakajima + + * lisp/canna.el: Don't use `canna:*local-map-backup*'. + +1998-09-19 Kaoru Nakajima + + * lisp/canna.el: Wide character no kazoe kata ga 20.3 kara henkou ni + nattatame; wide character no kazoe kata ga 20.3 kara kawatta tame; + 166602 Sep 19 06:05 emacs-20.3+canna-3.diff + +1998-09-19 Masahiro MURATA + + * lisp/canna.el: cf. X-Sequence: installer 2991; + emacs-20.2-canna.el-muse2.patch (cf. X-Sequence: installer 3120) + +1998-09-19 Kazu Yamamoto + + * lisp/canna.el, lisp/egg.el, lisp/wnn-egg.el: + property/overlay/local-map -> overlay + | + v + minor-mode-map-alist/use-local-map/global-map; + cf. mew-1.93/patches/ + 4531 Jul 9 22:16 00readme.jis + 6207 Jul 9 22:16 canna.el-19.34.patch + 5205 Jul 9 22:16 egg.el-19.34.patch + +1998-09-17 Kaoru Nakajima + + * cf. http://www.ceres.dti.ne.jp/~knak/emacs.html#emacs-20.3+canna; + 165474 Sep 11 01:11 emacs-20.3+canna.diff + +1998-09-17 Kunihiro Ishiguro + + * cf. ftp://ftp.zebra.org/pub/emacs/emacs-20.3-wnn6-rel2.tar.gz + +1998-09-17 Oki Masaru + + * cf. http://www.yk.rim.or.jp/~oki/emacs-20.html + +1998-09-17 Masahiro MURATA + + * cf. http://www.ki.nu/software/emacs-20/canna.el-patch + +1998-09-17 Makoto Fujiwara + + * lisp/can-n-egg.el, lisp/canna.el, lisp/egg-jsymbol.el, + lisp/egg-keymap.el, lisp/egg.el, lisp/eggrc-sj3, lisp/eggrc-v41, + lisp/eggrc-wnn, lisp/isearch-ext.el, lisp/its/han-kata.el, + lisp/its/hankaku.el, lisp/its/hira.el, lisp/its/kata.el, + lisp/its/katainput.el, lisp/its/zenkaku.el, lisp/mule-inst.el, + lisp/sj3-client.el, lisp/sj3-egg.el, lisp/wnn-client.el, + lisp/wnn-egg.el, src/canna.c, src/wnnfns.c: New files. + --- emacs-21.2/Makefile.in~ 2001-10-31 14:45:46 +0000 +++ emacs-21.2/Makefile.in 2003-02-12 06:55:49 +0000 @@ -203,7 +203,8 @@ # ============================= Targets ============================== # What emacs should be called when installed. -EMACS = emacs +EMACS = @emcws@ +EMACS_POSTFIX =@emcws_postfix@ # Subdirectories to make recursively. `lisp' is not included # because the compiled lisp files are part of the distribution @@ -273,8 +274,10 @@ config.status: ${srcdir}/configure ./config.status --recheck +# EMCWS CHANGE: As patch might make configure.in newer than configure and +# user might not have autoconf, leading `-' is needed to ignore an error. ${srcdir}/configure: configure.in aclocal.m4 - cd ${srcdir} && autoconf + -cd ${srcdir} && autoconf src/Makefile: $(srcdir)/src/Makefile.in config.status ./config.status @@ -328,10 +331,10 @@ exec_prefix=${exec_prefix} bindir=${bindir} \ libexecdir=${libexecdir} archlibdir=${archlibdir} \ INSTALL_STRIP=${INSTALL_STRIP}) - ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/emacs-${version} - -chmod 1755 ${bindir}/emacs-${version} + ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/$(EMACS)-${version} + -chmod 1755 ${bindir}/$(EMACS)-${version} rm -f ${bindir}/$(EMACS) - -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS) + -ln ${bindir}/$(EMACS)-${version} ${bindir}/$(EMACS) -unset CDPATH; \ for f in `cd lib-src && echo fns-*.el`; do \ if test -r lib-src/$$f ; then \ @@ -383,14 +386,14 @@ done -rm -f ${lispdir}/subdirs.el $(srcdir)/update-subdirs ${lispdir} - if [ -f ${datadir}/emacs/${version}/site-lisp/subdirs.el ]; \ + if [ -f ${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp/subdirs.el ]; \ then true; \ else \ (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \ echo " (normal-top-level-add-subdirs-to-load-path))") \ - > ${datadir}/emacs/${version}/site-lisp/subdirs.el; \ + > ${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp/subdirs.el; \ fi - chmod a+r ${datadir}/emacs/${version}/site-lisp/subdirs.el + chmod a+r ${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp/subdirs.el -if [ -f ${datadir}/emacs/site-lisp/subdirs.el ]; \ then true; \ else \ @@ -458,7 +461,7 @@ ### `install-arch-indep'. People who extracted LEIM files after they ### insalled Emacs itself can install only LEIM files by this target. install-leim: leim/Makefile mkdir - cd leim; $(MAKE) install + cd leim; $(MAKE) INSTALLDIR=${datadir}/emacs/${version}$(EMACS_POSTFIX)/leim install ### Build Emacs and install it, stripping binaries while installing them. install-strip: @@ -476,7 +479,7 @@ $(srcdir)/mkinstalldirs ${COPYDESTS} ${infodir} ${man1dir} \ ${bindir} ${docdir} ${libexecdir} \ ${datadir}/emacs/site-lisp \ - ${datadir}/emacs/${version}/site-lisp \ + ${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp \ `echo ${locallisppath} | sed 's/:/ /g'` ### Delete all the installed files that the `install' target would @@ -497,17 +500,17 @@ * ) rm -rf $${dir} ;; \ esac ; \ case $${dir} in \ - ${datadir}/emacs/${version}/* ) \ - rm -rf ${datadir}/emacs/${version} \ + ${datadir}/emacs/${version}$(EMACS_POSTFIX)/* )\ + rm -rf ${datadir}/emacs/${version}$(EMACS_POSTFIX)\ ;; \ esac ; \ fi ; \ done (cd ${archlibdir} && rm -f fns-*) - -rm -rf ${libexecdir}/emacs/${version} + -rm -rf ${libexecdir}/emacs/${version}$(EMACS_POSTFIX) (cd ${infodir} && rm -f cl* ada-mode* autotype* ccmode* ebrowse* efaq* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* widget* woman* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*) (cd ${man1dir} && rm -f emacs.1 etags.1 ctags.1) - (cd ${bindir} && rm -f emacs-${version} $(EMACS)) + (cd ${bindir} && rm -f $(EMACS)-${version} $(EMACS)) FRC: --- emacs-21.2/configure.in~ 2002-03-15 12:44:20 +0000 +++ emacs-21.2/configure.in 2003-02-12 06:55:49 +0000 @@ -27,13 +27,28 @@ AC_INIT(src/lisp.h) AC_CONFIG_HEADER(src/config.h:src/config.in) -lispdir='${datadir}/emacs/${version}/lisp' -locallisppath='${datadir}/emacs/${version}/site-lisp:'\ -'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim' +lispdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/lisp' + +if test -n \ + "`grep '^# This placeholder appears' ${srcdir}/leim/Makefile.in`" +then +dnl +dnl A case that the LEIM package does not exist. +dnl + locallisppath='${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp:'\ +'${datadir}/emacs/site-lisp' +else +dnl +dnl A case that the LEIM package exists. +dnl + locallisppath='${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp:'\ +'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}$(EMACS_POSTFIX)/leim' +fi + lisppath='${locallisppath}:${lispdir}' -etcdir='${datadir}/emacs/${version}/etc' -archlibdir='${libexecdir}/emacs/${version}/${configuration}' -docdir='${datadir}/emacs/${version}/etc' +etcdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/etc' +archlibdir='${libexecdir}/emacs/${version}$(EMACS_POSTFIX)/${configuration}' +docdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/etc' AC_ARG_WITH(gcc, [ --without-gcc don't use GCC to compile Emacs if GCC is found]) @@ -59,6 +74,36 @@ AC_ARG_WITH(hesiod, [ --with-hesiod support Hesiod to get the POP server host], [AC_DEFINE(HESIOD)]) +dnl +AC_ARG_ENABLE(rename, +[ --disable-rename do not rename emacs to emcws]) +if test "${enable_rename}" = "no"; then + emcws='emacs' emcws_postfix= +else + emcws='emcws' emcws_postfix='-emcws' +fi +AC_SUBST(emcws) +AC_SUBST(emcws_postfix) +AC_ARG_WITH(wnn, +[ --with-wnn use Wnn library to input Japanese or Chinese], +[with_wnn=${withval}]) +AC_ARG_WITH(wnn-includes, +[ --with-wnn-includes=DIR search for WNN header files in DIR]) +AC_ARG_WITH(wnn-libraries, +[ --with-wnn-libraries=DIR search for WNN libraries in DIR]) +AC_ARG_WITH(sj3, +[ --with-sj3 support SJ3], +[ case "${withval}" in + y | yes ) AC_DEFINE(SJ3) ;; + esac +]) +AC_ARG_WITH(canna, +[ --with-canna support CANNA]) +AC_ARG_WITH(canna-includes, +[ --with-canna-includes=DIR search for CANNA header files in DIR]) +AC_ARG_WITH(canna-libraries, +[ --with-canna-libraries=DIR search for CANNA libraries in DIR]) +dnl dnl This should be the last --with option, because --with-x is dnl added later on when we find the path of X, and it's best to dnl keep them together visually. @@ -1103,6 +1148,42 @@ machfile="m/${machine}.h" opsysfile="s/${opsys}.h" +case "${with_wnn}" in + y | yes ) + AC_DEFINE(WNN) + test -n "${with_wnn_includes}" && C_SWITCH_WNN="-I${with_wnn_includes}" + if test -n "${with_wnn_libraries}" ; then + if test -d ${with_wnn_libraries} ; then + LD_SWITCH_WNN="-L${with_wnn_libraries}" + LIBS_MULE="${LIBS_MULE} -lwnn" + else + LIBS_MULE="${LIBS_MULE} ${with_wnn_libraries}" + fi + else + LIBS_MULE="${LIBS_MULE} -lwnn" + fi + AC_CHECK_LIB(crypt, crypt, LIBS_MULE="$LIBS_MULE -lcrypt") + ;; +esac + +case "${with_canna}" in + y | yes ) + AC_DEFINE(CANNA) + test -n "${with_canna_includes}" && C_SWITCH_CANNA="-I${with_canna_includes}" + if test -n "${with_canna_libraries}" ; then + if test -d ${with_canna_libraries} ; then + LD_SWITCH_CANNA="-L${with_canna_libraries}" + LD_SWITCH_CANNA_AUX="-R${with_canna_libraries}" + LIBS_MULE="${LIBS_MULE} -lcanna" + else + LIBS_MULE="${LIBS_MULE} ${with_canna_libraries}" + fi + else + LIBS_MULE="${LIBS_MULE} -lcanna" + fi + ;; +esac + #### Choose a compiler. test -n "$CC" && cc_specified=yes @@ -2196,6 +2277,13 @@ AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE}) AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC}) +AC_DEFINE_UNQUOTED(LIBS_MULE, ${LIBS_MULE}) +AC_DEFINE_UNQUOTED(C_SWITCH_WNN, ${C_SWITCH_WNN}) +AC_DEFINE_UNQUOTED(LD_SWITCH_WNN, ${LD_SWITCH_WNN}) +AC_DEFINE_UNQUOTED(C_SWITCH_CANNA, ${C_SWITCH_CANNA}) +AC_DEFINE_UNQUOTED(LD_SWITCH_CANNA, ${LD_SWITCH_CANNA}) +AC_DEFINE_UNQUOTED(LD_SWITCH_CANNA_AUX, ${LD_SWITCH_CANNA_AUX}) + if test "${HAVE_X_WINDOWS}" = "yes" ; then AC_DEFINE(HAVE_X_WINDOWS) fi --- emacs-21.2/configure~ 2002-03-15 12:46:09 +0000 +++ emacs-21.2/configure 2003-02-12 06:55:49 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 +# Generated automatically using autoconf version 2.14.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -22,6 +22,22 @@ ac_help="$ac_help --with-hesiod support Hesiod to get the POP server host" ac_help="$ac_help + --disable-rename do not rename emacs to emcws" +ac_help="$ac_help + --with-wnn use Wnn library to input Japanese or Chinese" +ac_help="$ac_help + --with-wnn-includes=DIR search for WNN header files in DIR" +ac_help="$ac_help + --with-wnn-libraries=DIR search for WNN libraries in DIR" +ac_help="$ac_help + --with-sj3 support SJ3" +ac_help="$ac_help + --with-canna support CANNA" +ac_help="$ac_help + --with-canna-includes=DIR search for CANNA header files in DIR" +ac_help="$ac_help + --with-canna-libraries=DIR search for CANNA libraries in DIR" +ac_help="$ac_help --with-x-toolkit=KIT use an X toolkit (KIT = yes/lucid/athena/motif/no)" ac_help="$ac_help --with-xpm use -lXpm for displaying XPM images" @@ -364,7 +380,7 @@ verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" + echo "configure generated by autoconf version 2.14.1" exit 0 ;; -with-* | --with-*) @@ -524,7 +540,7 @@ if test -r "$cache_file"; then echo "loading cache $cache_file" - . $cache_file + test -f "$cache_file" && . $cache_file else echo "creating cache $cache_file" > $cache_file @@ -554,13 +570,22 @@ -lispdir='${datadir}/emacs/${version}/lisp' -locallisppath='${datadir}/emacs/${version}/site-lisp:'\ -'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim' +lispdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/lisp' + +if test -n \ + "`grep '^# This placeholder appears' ${srcdir}/leim/Makefile.in`" +then + locallisppath='${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp:'\ +'${datadir}/emacs/site-lisp' +else + locallisppath='${datadir}/emacs/${version}$(EMACS_POSTFIX)/site-lisp:'\ +'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}$(EMACS_POSTFIX)/leim' +fi + lisppath='${locallisppath}:${lispdir}' -etcdir='${datadir}/emacs/${version}/etc' -archlibdir='${libexecdir}/emacs/${version}/${configuration}' -docdir='${datadir}/emacs/${version}/etc' +etcdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/etc' +archlibdir='${libexecdir}/emacs/${version}$(EMACS_POSTFIX)/${configuration}' +docdir='${datadir}/emacs/${version}$(EMACS_POSTFIX)/etc' # Check whether --with-gcc or --without-gcc was given. if test "${with_gcc+set}" = set; then @@ -621,6 +646,67 @@ fi +# Check whether --enable-rename or --disable-rename was given. +if test "${enable_rename+set}" = set; then + enableval="$enable_rename" + : +fi + +if test "${enable_rename}" = "no"; then + emcws='emacs' emcws_postfix= +else + emcws='emcws' emcws_postfix='-emcws' +fi + + +# Check whether --with-wnn or --without-wnn was given. +if test "${with_wnn+set}" = set; then + withval="$with_wnn" + with_wnn=${withval} +fi + +# Check whether --with-wnn-includes or --without-wnn-includes was given. +if test "${with_wnn_includes+set}" = set; then + withval="$with_wnn_includes" + : +fi + +# Check whether --with-wnn-libraries or --without-wnn-libraries was given. +if test "${with_wnn_libraries+set}" = set; then + withval="$with_wnn_libraries" + : +fi + +# Check whether --with-sj3 or --without-sj3 was given. +if test "${with_sj3+set}" = set; then + withval="$with_sj3" + case "${withval}" in + y | yes ) cat >> confdefs.h <<\EOF +#define SJ3 1 +EOF + ;; + esac + +fi + +# Check whether --with-canna or --without-canna was given. +if test "${with_canna+set}" = set; then + withval="$with_canna" + : +fi + +# Check whether --with-canna-includes or --without-canna-includes was given. +if test "${with_canna_includes+set}" = set; then + withval="$with_canna_includes" + : +fi + +# Check whether --with-canna-libraries or --without-canna-libraries was given. +if test "${with_canna_libraries+set}" = set; then + withval="$with_canna_libraries" + : +fi + # Check whether --with-x-toolkit or --without-x-toolkit was given. if test "${with_x_toolkit+set}" = set; then withval="$with_x_toolkit" @@ -744,36 +830,50 @@ if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:840: checking host system type" >&5 +if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then # Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + ac_cv_host_alias=$host + case "$ac_cv_host_alias" in + NONE) + case $nonopt in + NONE) + if ac_cv_host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) ac_cv_host_alias=$nonopt ;; + esac ;; + esac + + ac_cv_host=`$ac_config_sub $ac_cv_host_alias` + ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +else + echo $ac_n "(cached) $ac_c" 1>&6 fi -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:759: checking host system type" >&5 +echo "$ac_t""$ac_cv_host" 1>&6 + +host=$ac_cv_host +host_alias=$ac_cv_host_alias +host_cpu=$ac_cv_host_cpu +host_vendor=$ac_cv_host_vendor +host_os=$ac_cv_host_os + -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 canonical=$host configuration=$host_alias @@ -1728,6 +1828,87 @@ machfile="m/${machine}.h" opsysfile="s/${opsys}.h" +case "${with_wnn}" in + y | yes ) + cat >> confdefs.h <<\EOF +#define WNN 1 +EOF + + test -n "${with_wnn_includes}" && C_SWITCH_WNN="-I${with_wnn_includes}" + if test -n "${with_wnn_libraries}" ; then + if test -d ${with_wnn_libraries} ; then + LD_SWITCH_WNN="-L${with_wnn_libraries}" + LIBS_MULE="${LIBS_MULE} -lwnn" + else + LIBS_MULE="${LIBS_MULE} ${with_wnn_libraries}" + fi + else + LIBS_MULE="${LIBS_MULE} -lwnn" + fi + echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:1850: checking for crypt in -lcrypt" >&5 +ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcrypt $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS_MULE="$LIBS_MULE -lcrypt" +else + echo "$ac_t""no" 1>&6 +fi + + ;; +esac + +case "${with_canna}" in + y | yes ) + cat >> confdefs.h <<\EOF +#define CANNA 1 +EOF + + test -n "${with_canna_includes}" && C_SWITCH_CANNA="-I${with_canna_includes}" + if test -n "${with_canna_libraries}" ; then + if test -d ${with_canna_libraries} ; then + LD_SWITCH_CANNA="-L${with_canna_libraries}" + LD_SWITCH_CANNA_AUX="-R${with_canna_libraries}" + LIBS_MULE="${LIBS_MULE} -lcanna" + else + LIBS_MULE="${LIBS_MULE} ${with_canna_libraries}" + fi + else + LIBS_MULE="${LIBS_MULE} -lcanna" + fi + ;; +esac + #### Choose a compiler. test -n "$CC" && cc_specified=yes @@ -1741,8 +1922,8 @@ * ) # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1745: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:1926: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1771,8 +1952,8 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1775: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:1956: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1818,12 +1999,12 @@ if test -z "$CC"; then case "`uname -s`" in - *win32* | *WIN32*) + *win32* | *WIN32* | *CYGWIN*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1826: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then +echo "configure:2007: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then @@ -1853,8 +2034,8 @@ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1858: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:2039: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1865,12 +2046,12 @@ cat > conftest.$ac_ext << EOF -#line 1869 "configure" +#line 2050 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1895,14 +2076,14 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:2081: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1905: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then +echo "configure:2086: checking whether we are using GNU C" >&5 +if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1929,8 +2110,8 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1933: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then +echo "configure:2114: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c @@ -2009,8 +2190,8 @@ #### #undef clause to src/config.h.in for autoconf to modify. echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:2013: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then +echo "configure:2194: checking whether ln -s works" >&5 +if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata @@ -2030,13 +2211,13 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2034: checking how to run the C preprocessor" >&5 +echo "configure:2215: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then +if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get @@ -2045,13 +2226,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2062,13 +2243,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2079,13 +2260,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2121,9 +2302,9 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2125: checking for a BSD compatible install" >&5 +echo "configure:2306: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then +if eval "test \"\${ac_cv_path_install+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" @@ -2141,6 +2322,10 @@ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 @@ -2169,7 +2354,7 @@ # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' @@ -2178,8 +2363,8 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2182: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then +echo "configure:2367: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_YACC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$YACC"; then @@ -2212,8 +2397,8 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2216: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then +echo "configure:2401: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then @@ -2242,9 +2427,9 @@ fi echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:2246: checking for AIX" >&5 +echo "configure:2431: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:2275: checking the machine- and system-dependent files to find out +echo "configure:2460: checking the machine- and system-dependent files to find out - which libraries the lib-src programs will want, and - whether the GNU malloc routines are usable" >&5 @@ -2421,8 +2606,8 @@ if test "$enable_largefile" != no; then echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6 -echo "configure:2425: checking for special C compiler options needed for large files" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then +echo "configure:2610: checking for special C compiler options needed for large files" >&5 +if eval "test \"\${ac_cv_sys_largefile_CC+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_largefile_CC=no @@ -2430,7 +2615,7 @@ # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat > conftest.$ac_ext < int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1]; @@ -2439,7 +2624,7 @@ ; return 0; } EOF -if { (eval echo configure:2443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -2448,7 +2633,7 @@ ac_save_CC="$CC" CC="$CC -n32" cat > conftest.$ac_ext < int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1]; @@ -2457,7 +2642,7 @@ ; return 0; } EOF -if { (eval echo configure:2461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_largefile_CC=' -n32' else @@ -2477,13 +2662,13 @@ fi echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6 -echo "configure:2481: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then +echo "configure:2666: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +if eval "test \"\${ac_cv_sys_file_offset_bits+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_file_offset_bits=no cat > conftest.$ac_ext < int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1]; @@ -2492,14 +2677,14 @@ ; return 0; } EOF -if { (eval echo configure:2496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -2510,7 +2695,7 @@ ; return 0; } EOF -if { (eval echo configure:2514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_file_offset_bits=64 else @@ -2530,27 +2715,27 @@ fi echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6 -echo "configure:2534: checking for _LARGE_FILES value needed for large files" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then +echo "configure:2719: checking for _LARGE_FILES value needed for large files" >&5 +if eval "test \"\${ac_cv_sys_large_files+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_large_files=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_large_files=1 else @@ -2586,17 +2771,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2590: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2775: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2624,15 +2809,15 @@ # Emulation library used on NetBSD. echo $ac_n "checking for _oss_ioctl in -lossaudio""... $ac_c" 1>&6 -echo "configure:2628: checking for _oss_ioctl in -lossaudio" >&5 +echo "configure:2813: checking for _oss_ioctl in -lossaudio" >&5 ac_lib_var=`echo ossaudio'_'_oss_ioctl | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lossaudio $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2672,17 +2857,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2676: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:2861: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2709,12 +2894,12 @@ done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2713: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then +echo "configure:2898: checking for ANSI C header files" >&5 +if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2722,7 +2907,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2739,7 +2924,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2757,7 +2942,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2778,7 +2963,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2789,7 +2974,7 @@ exit (0); } EOF -if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2813,12 +2998,12 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2817: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then +echo "configure:3002: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"\${ac_cv_header_time+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2827,7 +3012,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2848,12 +3033,12 @@ fi echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 -echo "configure:2852: checking for sys_siglist declaration in signal.h or unistd.h" >&5 -if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then +echo "configure:3037: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +if eval "test \"\${ac_cv_decl_sys_siglist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2865,7 +3050,7 @@ char *msg = *(sys_siglist + 1); ; return 0; } EOF -if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else @@ -2886,12 +3071,12 @@ fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2890: checking for sys/wait.h that is POSIX.1 compatible" >&5 -if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then +echo "configure:3075: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2907,7 +3092,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2929,12 +3114,12 @@ echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:2933: checking for struct utimbuf" >&5 -if eval "test \"`echo '$''{'emacs_cv_struct_utimbuf'+set}'`\" = set"; then +echo "configure:3118: checking for struct utimbuf" >&5 +if eval "test \"\${emacs_cv_struct_utimbuf+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2953,7 +3138,7 @@ static struct utimbuf x; x.actime = x.modtime; ; return 0; } EOF -if { (eval echo configure:2957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_struct_utimbuf=yes else @@ -2974,12 +3159,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2978: checking return type of signal handlers" >&5 -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then +echo "configure:3163: checking return type of signal handlers" >&5 +if eval "test \"\${ac_cv_type_signal+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2996,7 +3181,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3016,19 +3201,19 @@ echo $ac_n "checking for speed_t""... $ac_c" 1>&6 -echo "configure:3020: checking for speed_t" >&5 -if eval "test \"`echo '$''{'emacs_cv_speed_t'+set}'`\" = set"; then +echo "configure:3205: checking for speed_t" >&5 +if eval "test \"\${emacs_cv_speed_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { speed_t x = 1; ; return 0; } EOF -if { (eval echo configure:3032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_speed_t=yes else @@ -3047,12 +3232,12 @@ fi echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 -echo "configure:3051: checking for struct timeval" >&5 -if eval "test \"`echo '$''{'emacs_cv_struct_timeval'+set}'`\" = set"; then +echo "configure:3236: checking for struct timeval" >&5 +if eval "test \"\${emacs_cv_struct_timeval+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3068,7 +3253,7 @@ static struct timeval x; x.tv_sec = x.tv_usec; ; return 0; } EOF -if { (eval echo configure:3072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_struct_timeval=yes else @@ -3090,19 +3275,19 @@ fi echo $ac_n "checking for struct exception""... $ac_c" 1>&6 -echo "configure:3094: checking for struct exception" >&5 -if eval "test \"`echo '$''{'emacs_cv_struct_exception'+set}'`\" = set"; then +echo "configure:3279: checking for struct exception" >&5 +if eval "test \"\${emacs_cv_struct_exception+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1; ; return 0; } EOF -if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_struct_exception=yes else @@ -3124,12 +3309,12 @@ fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3128: checking whether struct tm is in sys/time.h or time.h" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then +echo "configure:3313: checking whether struct tm is in sys/time.h or time.h" >&5 +if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3137,7 +3322,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3157,46 +3342,47 @@ fi -echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3162: checking for tm_zone in struct tm" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then +echo $ac_n "checking for member tm_zone in aggregate type struct tm""... $ac_c" 1>&6 +echo "configure:3347: checking for member tm_zone in aggregate type struct tm" >&5 +if eval "test \"\${ac_cv_c_struct_member_tm_zone+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> int main() { -struct tm tm; tm.tm_zone; +struct tm foo; foo.tm_zone; ; return 0; } EOF -if { (eval echo configure:3175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_struct_tm_zone=yes + ac_cv_c_struct_member_tm_zone=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_struct_tm_zone=no + ac_cv_c_struct_member_tm_zone=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6 -if test "$ac_cv_struct_tm_zone" = yes; then +echo "$ac_t""$ac_cv_c_struct_member_tm_zone" 1>&6 +tm_zone="$ac_cv_c_struct_member_tm_zone" +if test "$ac_cv_c_struct_member_tm_zone" = yes; then cat >> confdefs.h <<\EOF #define HAVE_TM_ZONE 1 EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3195: checking for tzname" >&5 -if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then +echo "configure:3381: checking for tzname" >&5 +if eval "test \"\${ac_cv_var_tzname+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -3206,7 +3392,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3228,19 +3414,19 @@ fi echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:3232: checking for tm_gmtoff in struct tm" >&5 -if eval "test \"`echo '$''{'emacs_cv_tm_gmtoff'+set}'`\" = set"; then +echo "configure:3418: checking for tm_gmtoff in struct tm" >&5 +if eval "test \"\${emacs_cv_tm_gmtoff+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct tm t; t.tm_gmtoff = 0 ; return 0; } EOF -if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_tm_gmtoff=yes else @@ -3262,8 +3448,8 @@ echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:3266: checking for ${CC-cc} option to accept ANSI C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_stdc'+set}'`\" = set"; then +echo "configure:3452: checking for ${CC-cc} option to accept ANSI C" >&5 +if eval "test \"\${ac_cv_prog_cc_stdc+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_prog_cc_stdc=no @@ -3279,7 +3465,7 @@ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -3313,7 +3499,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_prog_cc_stdc="$ac_arg"; break else @@ -3335,7 +3521,7 @@ esac echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 -echo "configure:3339: checking for function prototypes" >&5 +echo "configure:3525: checking for function prototypes" >&5 if test "$ac_cv_prog_cc_stdc" != no; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -3347,12 +3533,12 @@ fi echo $ac_n "checking for working volatile""... $ac_c" 1>&6 -echo "configure:3351: checking for working volatile" >&5 -if eval "test \"`echo '$''{'ac_cv_c_volatile'+set}'`\" = set"; then +echo "configure:3537: checking for working volatile" >&5 +if eval "test \"\${ac_cv_c_volatile+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_volatile=yes else @@ -3382,12 +3568,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3386: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then +echo "configure:3572: checking for working const" >&5 +if eval "test \"\${ac_cv_c_const+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3457,19 +3643,19 @@ fi echo $ac_n "checking for void * support""... $ac_c" 1>&6 -echo "configure:3461: checking for void * support" >&5 -if eval "test \"`echo '$''{'emacs_cv_void_star'+set}'`\" = set"; then +echo "configure:3647: checking for void * support" >&5 +if eval "test \"\${emacs_cv_void_star+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_void_star=yes else @@ -3495,9 +3681,9 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:3499: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:3685: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF @@ -3523,8 +3709,8 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:3527: checking for long file names" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then +echo "configure:3713: checking for long file names" >&5 +if eval "test \"\${ac_cv_sys_long_file_names+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_long_file_names=yes @@ -3574,7 +3760,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3578: checking for X" >&5 +echo "configure:3764: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -3591,7 +3777,7 @@ # Both variables are already set. have_x=yes else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then +if eval "test \"\${ac_cv_have_x+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # One or both of the vars are not set, and there is no cached value. @@ -3636,12 +3822,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3710,14 +3896,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -3898,12 +4084,12 @@ GNU_MALLOC=yes doug_lea_malloc=yes echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6 -echo "configure:3902: checking for malloc_get_state" >&5 -if eval "test \"`echo '$''{'ac_cv_func_malloc_get_state'+set}'`\" = set"; then +echo "configure:4088: checking for malloc_get_state" >&5 +if eval "test \"\${ac_cv_func_malloc_get_state+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_get_state=yes" else @@ -3947,12 +4134,12 @@ fi echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6 -echo "configure:3951: checking for malloc_set_state" >&5 -if eval "test \"`echo '$''{'ac_cv_func_malloc_set_state'+set}'`\" = set"; then +echo "configure:4138: checking for malloc_set_state" >&5 +if eval "test \"\${ac_cv_func_malloc_set_state+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_malloc_set_state=yes" else @@ -3996,19 +4184,19 @@ fi echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6 -echo "configure:4000: checking whether __after_morecore_hook exists" >&5 -if eval "test \"`echo '$''{'emacs_cv_var___after_morecore_hook'+set}'`\" = set"; then +echo "configure:4188: checking whether __after_morecore_hook exists" >&5 +if eval "test \"\${emacs_cv_var___after_morecore_hook+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_var___after_morecore_hook=yes else @@ -4049,17 +4237,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4053: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:4241: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4088,12 +4276,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4092: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:4280: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4141,15 +4330,15 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4145: checking for working mmap" >&5 -if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then +echo "configure:4334: checking for working mmap" >&5 +if eval "test \"\${ac_cv_func_mmap_fixed_mapped+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4312,15 +4501,15 @@ LIBS="$libsrc_libs $LIBS" echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4316: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4505: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4360,22 +4549,22 @@ echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:4364: checking for main in -lXbsd" >&5 +echo "configure:4553: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4397,15 +4586,15 @@ echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6 -echo "configure:4401: checking for cma_open in -lpthreads" >&5 +echo "configure:4590: checking for cma_open in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4445,7 +4634,7 @@ echo $ac_n "checking for XFree86 in /usr/X386""... $ac_c" 1>&6 -echo "configure:4449: checking for XFree86 in /usr/X386" >&5 +echo "configure:4638: checking for XFree86 in /usr/X386" >&5 if test -d /usr/X386/include; then HAVE_XFREE386=yes : ${C_SWITCH_X_SITE="-I/usr/X386/include"} @@ -4477,16 +4666,16 @@ if test "${opsys}" = "gnu-linux"; then echo $ac_n "checking whether X on GNU/Linux needs -b to link""... $ac_c" 1>&6 -echo "configure:4481: checking whether X on GNU/Linux needs -b to link" >&5 +echo "configure:4670: checking whether X on GNU/Linux needs -b to link" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xlinux_first_failure=no else @@ -4506,14 +4695,14 @@ CPPFLAGS="$CPPFLAGS -b i486-linuxaout" LIBS="$LIBS -b i486-linuxaout" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* xlinux_second_failure=no else @@ -4542,9 +4731,9 @@ # Reportedly, some broken Solaris systems have XKBlib.h but are missing # header files included from there. echo $ac_n "checking for Xkb""... $ac_c" 1>&6 -echo "configure:4546: checking for Xkb" >&5 +echo "configure:4735: checking for Xkb" >&5 cat > conftest.$ac_ext < #include @@ -4552,7 +4741,7 @@ XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd); ; return 0; } EOF -if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_xkb=yes else @@ -4574,12 +4763,12 @@ XScreenNumberOfScreen XSetWMProtocols do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4578: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:4767: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4630,12 +4820,12 @@ if test "${window_system}" = "x11"; then echo $ac_n "checking X11 version 6""... $ac_c" 1>&6 -echo "configure:4634: checking X11 version 6" >&5 - if eval "test \"`echo '$''{'emacs_cv_x11_version_6'+set}'`\" = set"; then +echo "configure:4824: checking X11 version 6" >&5 + if eval "test \"\${emacs_cv_x11_version_6+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4645,7 +4835,7 @@ ; return 0; } EOF -if { (eval echo configure:4649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_x11_version_6=yes else @@ -4670,12 +4860,12 @@ if test "${window_system}" = "x11"; then echo $ac_n "checking X11 version 5""... $ac_c" 1>&6 -echo "configure:4674: checking X11 version 5" >&5 - if eval "test \"`echo '$''{'emacs_cv_x11_version_5'+set}'`\" = set"; then +echo "configure:4864: checking X11 version 5" >&5 + if eval "test \"\${emacs_cv_x11_version_5+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4685,7 +4875,7 @@ ; return 0; } EOF -if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_x11_version_5=yes else @@ -4713,12 +4903,12 @@ if test x"${USE_X_TOOLKIT}" = xmaybe; then if test x"${HAVE_X11R5}" = xyes; then echo $ac_n "checking X11 version 5 with Xaw""... $ac_c" 1>&6 -echo "configure:4717: checking X11 version 5 with Xaw" >&5 - if eval "test \"`echo '$''{'emacs_cv_x11_version_5_with_xaw'+set}'`\" = set"; then +echo "configure:4907: checking X11 version 5 with Xaw" >&5 + if eval "test \"\${emacs_cv_x11_version_5_with_xaw+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4727,7 +4917,7 @@ ; return 0; } EOF -if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_x11_version_5_with_xaw=yes else @@ -4755,12 +4945,12 @@ if test "${USE_X_TOOLKIT}" != "none"; then echo $ac_n "checking X11 toolkit version""... $ac_c" 1>&6 -echo "configure:4759: checking X11 toolkit version" >&5 - if eval "test \"`echo '$''{'emacs_cv_x11_toolkit_version_6'+set}'`\" = set"; then +echo "configure:4949: checking X11 toolkit version" >&5 + if eval "test \"\${emacs_cv_x11_toolkit_version_6+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4770,7 +4960,7 @@ ; return 0; } EOF -if { (eval echo configure:4774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_x11_toolkit_version_6=yes else @@ -4800,15 +4990,15 @@ LIBS="-lXt $LIBS" fi echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6 -echo "configure:4804: checking for XmuConvertStandardSelection in -lXmu" >&5 +echo "configure:4994: checking for XmuConvertStandardSelection in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXmu $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4853,15 +5043,15 @@ if test "${HAVE_X11}" = "yes"; then if test "${USE_X_TOOLKIT}" != "none"; then echo $ac_n "checking for XShapeQueryExtension in -lXext""... $ac_c" 1>&6 -echo "configure:4857: checking for XShapeQueryExtension in -lXext" >&5 +echo "configure:5047: checking for XShapeQueryExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeQueryExtension | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4904,12 +5094,12 @@ if test "${USE_X_TOOLKIT}" = "MOTIF"; then echo $ac_n "checking for Motif version 2.1""... $ac_c" 1>&6 -echo "configure:4908: checking for Motif version 2.1" >&5 -if eval "test \"`echo '$''{'emacs_cv_motif_version_2_1'+set}'`\" = set"; then +echo "configure:5098: checking for Motif version 2.1" >&5 +if eval "test \"\${emacs_cv_motif_version_2_1+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4920,7 +5110,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:4924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_motif_version_2_1=yes else @@ -4941,15 +5131,15 @@ EOF echo $ac_n "checking for XpCreateContext in -lXp""... $ac_c" 1>&6 -echo "configure:4945: checking for XpCreateContext in -lXp" >&5 +echo "configure:5135: checking for XpCreateContext in -lXp" >&5 ac_lib_var=`echo Xp'_'XpCreateContext | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4995,17 +5185,17 @@ if test "${USE_X_TOOLKIT}" != "none"; then ac_safe=`echo "X11/Xaw3d/Scrollbar.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/Xaw3d/Scrollbar.h""... $ac_c" 1>&6 -echo "configure:4999: checking for X11/Xaw3d/Scrollbar.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5189: checking for X11/Xaw3d/Scrollbar.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5022,15 +5212,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XawScrollbarSetThumb in -lXaw3d""... $ac_c" 1>&6 -echo "configure:5026: checking for XawScrollbarSetThumb in -lXaw3d" >&5 +echo "configure:5216: checking for XawScrollbarSetThumb in -lXaw3d" >&5 ac_lib_var=`echo Xaw3d'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXaw3d $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5109,17 +5299,17 @@ if test "${with_xpm}" != "no"; then ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure:5113: checking for X11/xpm.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5303: checking for X11/xpm.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5136,15 +5326,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for XpmReadFileToPixmap in -lXpm""... $ac_c" 1>&6 -echo "configure:5140: checking for XpmReadFileToPixmap in -lXpm" >&5 +echo "configure:5330: checking for XpmReadFileToPixmap in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmReadFileToPixmap | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXpm -lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5181,9 +5371,9 @@ if test "${HAVE_XPM}" = "yes"; then echo $ac_n "checking for XpmReturnAllocPixels preprocessor define""... $ac_c" 1>&6 -echo "configure:5185: checking for XpmReturnAllocPixels preprocessor define" >&5 +echo "configure:5375: checking for XpmReturnAllocPixels preprocessor define" >&5 cat > conftest.$ac_ext <&6 -echo "configure:5228: checking for jerror.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5418: checking for jerror.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5251,15 +5441,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for jpeg_destroy_compress in -ljpeg""... $ac_c" 1>&6 -echo "configure:5255: checking for jpeg_destroy_compress in -ljpeg" >&5 +echo "configure:5445: checking for jpeg_destroy_compress in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_destroy_compress | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5310,17 +5500,17 @@ if test "${with_png}" != "no"; then ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:5314: checking for png.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5504: checking for png.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5337,15 +5527,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for png_get_channels in -lpng""... $ac_c" 1>&6 -echo "configure:5341: checking for png_get_channels in -lpng" >&5 +echo "configure:5531: checking for png_get_channels in -lpng" >&5 ac_lib_var=`echo png'_'png_get_channels | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpng -lz -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5396,17 +5586,17 @@ if test "${with_tiff}" != "no"; then ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6 -echo "configure:5400: checking for tiffio.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5590: checking for tiffio.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5426,15 +5616,15 @@ # At least one tiff package requires the jpeg library. if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi echo $ac_n "checking for TIFFGetVersion in -ltiff""... $ac_c" 1>&6 -echo "configure:5430: checking for TIFFGetVersion in -ltiff" >&5 +echo "configure:5620: checking for TIFFGetVersion in -ltiff" >&5 ac_lib_var=`echo tiff'_'TIFFGetVersion | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ltiff $tifflibs $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5485,17 +5675,17 @@ if test "${with_gif}" != "no"; then ac_safe=`echo "gif_lib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gif_lib.h""... $ac_c" 1>&6 -echo "configure:5489: checking for gif_lib.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:5679: checking for gif_lib.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5512,15 +5702,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for DGifOpen in -lungif""... $ac_c" 1>&6 -echo "configure:5516: checking for DGifOpen in -lungif" >&5 +echo "configure:5706: checking for DGifOpen in -lungif" >&5 ac_lib_var=`echo ungif'_'DGifOpen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lungif $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5567,19 +5757,19 @@ # If netdb.h doesn't declare h_errno, we must declare it by hand. echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6 -echo "configure:5571: checking whether netdb declares h_errno" >&5 -if eval "test \"`echo '$''{'emacs_cv_netdb_declares_h_errno'+set}'`\" = set"; then +echo "configure:5761: checking whether netdb declares h_errno" >&5 +if eval "test \"\${emacs_cv_netdb_declares_h_errno+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return h_errno; ; return 0; } EOF -if { (eval echo configure:5583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* emacs_cv_netdb_declares_h_errno=yes else @@ -5602,19 +5792,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5606: checking for working alloca.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then +echo "configure:5796: checking for working alloca.h" >&5 +if eval "test \"\${ac_cv_header_alloca_h+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5635,12 +5825,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5639: checking for alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then +echo "configure:5829: checking for alloca" >&5 +if eval "test \"\${ac_cv_func_alloca_works+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -5700,12 +5890,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5704: checking whether alloca needs Cray hooks" >&5 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then +echo "configure:5894: checking whether alloca needs Cray hooks" >&5 +if eval "test \"\${ac_cv_os_cray+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5734: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:5924: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5785,15 +5976,15 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5789: checking stack direction for C alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then +echo "configure:5980: checking stack direction for C alloca" >&5 +if eval "test \"\${ac_cv_c_stack_direction+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -5837,15 +6028,15 @@ # fmod, logb, and frexp are found in -lm on most systems. # On HPUX 9.01, -lm does not contain logb, so check for sqrt. echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 -echo "configure:5841: checking for sqrt in -lm" >&5 +echo "configure:6032: checking for sqrt in -lm" >&5 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5886,15 +6077,15 @@ # Check for mail-locking functions in a "mail" library echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6 -echo "configure:5890: checking for maillock in -lmail" >&5 +echo "configure:6081: checking for maillock in -lmail" >&5 ac_lib_var=`echo mail'_'maillock | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lmail $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5933,15 +6124,15 @@ fi echo $ac_n "checking for maillock in -llockfile""... $ac_c" 1>&6 -echo "configure:5937: checking for maillock in -llockfile" >&5 +echo "configure:6128: checking for maillock in -llockfile" >&5 ac_lib_var=`echo lockfile'_'maillock | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-llockfile $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5986,8 +6177,8 @@ # Extract the first word of "liblockfile.so", so it can be a program name with args. set dummy liblockfile.so; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5990: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_liblockfile'+set}'`\" = set"; then +echo "configure:6181: checking for $ac_word" >&5 +if eval "test \"\${ac_cv_prog_liblockfile+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$liblockfile"; then @@ -6027,12 +6218,12 @@ for ac_func in touchlock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6031: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:6222: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6083,17 +6275,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6087: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:6279: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6129,12 +6321,12 @@ gai_strerror mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6133: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:6325: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6186,17 +6379,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6190: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:6383: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6225,12 +6418,12 @@ for ac_func in alarm do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6229: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:6422: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6278,15 +6472,15 @@ done echo $ac_n "checking for working mktime""... $ac_c" 1>&6 -echo "configure:6282: checking for working mktime" >&5 -if eval "test \"`echo '$''{'ac_cv_func_working_mktime'+set}'`\" = set"; then +echo "configure:6476: checking for working mktime" >&5 +if eval "test \"\${ac_cv_func_working_mktime+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_func_working_mktime=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_working_mktime=yes else @@ -6463,70 +6657,19 @@ ac_have_func=no # yes means we've found a way to get the load average. -# Some systems have getloadavg without any extra libraries. -echo $ac_n "checking for getloadavg""... $ac_c" 1>&6 -echo "configure:6469: checking for getloadavg" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getloadavg'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char getloadavg(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_getloadavg) || defined (__stub___getloadavg) -choke me -#else -getloadavg(); -#endif - -; return 0; } -EOF -if { (eval echo configure:6497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_getloadavg=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_getloadavg=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'getloadavg`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_have_func=yes -else - echo "$ac_t""no" 1>&6 -fi - - -if test $ac_have_func = no; then - # Some systems with -lutil have (and need) -lkvm as well, some do not. - # On Solaris, -lkvm requires nlist from -lelf, so check that first - # to get the right answer into the cache. - echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 -echo "configure:6522: checking for elf_begin in -lelf" >&5 +# Some systems with -lutil have (and need) -lkvm as well, some do not. +# On Solaris, -lkvm requires nlist from -lelf, so check that first +# to get the right answer into the cache. +echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 +echo "configure:6665: checking for elf_begin in -lelf" >&5 ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lelf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6557,16 +6700,16 @@ echo "$ac_t""no" 1>&6 fi - echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6 -echo "configure:6562: checking for kvm_open in -lkvm" >&5 +echo $ac_n "checking for kvm_open in -lkvm""... $ac_c" 1>&6 +echo "configure:6705: checking for kvm_open in -lkvm" >&5 ac_lib_var=`echo kvm'_'kvm_open | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkvm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6597,17 +6740,17 @@ echo "$ac_t""no" 1>&6 fi - # Check for the 4.4BSD definition of getloadavg. - echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6 -echo "configure:6603: checking for getloadavg in -lutil" >&5 +# Check for the 4.4BSD definition of getloadavg. +echo $ac_n "checking for getloadavg in -lutil""... $ac_c" 1>&6 +echo "configure:6746: checking for getloadavg in -lutil" >&5 ac_lib_var=`echo util'_'getloadavg | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6638,22 +6781,21 @@ echo "$ac_t""no" 1>&6 fi -fi if test $ac_have_func = no; then # There is a commonly available library for RS/6000 AIX. # Since it is not a standard part of AIX, it might be installed locally. ac_getloadavg_LIBS="$LIBS"; LIBS="-L/usr/local/lib $LIBS" echo $ac_n "checking for getloadavg in -lgetloadavg""... $ac_c" 1>&6 -echo "configure:6649: checking for getloadavg in -lgetloadavg" >&5 +echo "configure:6791: checking for getloadavg in -lgetloadavg" >&5 ac_lib_var=`echo getloadavg'_'getloadavg | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lgetloadavg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6691,12 +6833,12 @@ for ac_func in getloadavg do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6695: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:6837: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6757,17 +6900,17 @@ ac_have_func=no ac_safe=`echo "sys/dg_sys_info.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/dg_sys_info.h""... $ac_c" 1>&6 -echo "configure:6761: checking for sys/dg_sys_info.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:6904: checking for sys/dg_sys_info.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6788,15 +6931,15 @@ EOF echo $ac_n "checking for dg_sys_info in -ldgc""... $ac_c" 1>&6 -echo "configure:6792: checking for dg_sys_info in -ldgc" >&5 +echo "configure:6935: checking for dg_sys_info in -ldgc" >&5 ac_lib_var=`echo dgc'_'dg_sys_info | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldgc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6852,17 +6995,17 @@ if test $ac_have_func = no; then ac_safe=`echo "inq_stats/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for inq_stats/cpustats.h""... $ac_c" 1>&6 -echo "configure:6856: checking for inq_stats/cpustats.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:6999: checking for inq_stats/cpustats.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6895,17 +7038,17 @@ if test $ac_have_func = no; then ac_safe=`echo "sys/cpustats.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/cpustats.h""... $ac_c" 1>&6 -echo "configure:6899: checking for sys/cpustats.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:7042: checking for sys/cpustats.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6936,17 +7079,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6940: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:7083: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6976,17 +7119,17 @@ ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:6980: checking for nlist.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:7123: checking for nlist.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7007,19 +7150,19 @@ EOF echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6 -echo "configure:7011: checking for n_un in struct nlist" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then +echo "configure:7154: checking for n_un in struct nlist" >&5 +if eval "test \"\${ac_cv_struct_nlist_n_un+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct nlist n; n.n_un.n_name = 0; ; return 0; } EOF -if { (eval echo configure:7023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_nlist_n_un=yes else @@ -7046,12 +7189,12 @@ # Some definitions of getloadavg require that the program be installed setgid. echo $ac_n "checking whether getloadavg requires setgid""... $ac_c" 1>&6 -echo "configure:7050: checking whether getloadavg requires setgid" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getloadavg_setgid'+set}'`\" = set"; then +echo "configure:7193: checking whether getloadavg requires setgid" >&5 +if eval "test \"\${ac_cv_func_getloadavg_setgid+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:7086: checking group of /dev/kmem" >&5 -if eval "test \"`echo '$''{'ac_cv_group_kmem'+set}'`\" = set"; then +echo "configure:7229: checking group of /dev/kmem" >&5 +if eval "test \"\${ac_cv_group_kmem+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # On Solaris, /dev/kmem is a symlink. Get info on the real file. @@ -7103,27 +7246,27 @@ echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6 -echo "configure:7107: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -if eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then +echo "configure:7250: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +if eval "test \"\${ac_cv_sys_largefile_source+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_sys_largefile_source=no cat > conftest.$ac_ext < int main() { return !fseeko; ; return 0; } EOF -if { (eval echo configure:7120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -7132,7 +7275,7 @@ return !fseeko; ; return 0; } EOF -if { (eval echo configure:7136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sys_largefile_source=1 else @@ -7156,20 +7299,20 @@ # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. echo $ac_n "checking for fseeko""... $ac_c" 1>&6 -echo "configure:7160: checking for fseeko" >&5 -if eval "test \"`echo '$''{'ac_cv_func_fseeko'+set}'`\" = set"; then +echo "configure:7303: checking for fseeko" >&5 +if eval "test \"\${ac_cv_func_fseeko+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_func_fseeko=no cat > conftest.$ac_ext < int main() { return fseeko && fseeko (stdin, 0, 0); ; return 0; } EOF -if { (eval echo configure:7173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_fseeko=yes else @@ -7191,12 +7334,12 @@ for ac_func in grantpt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7195: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:7338: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7248,12 +7392,12 @@ for ac_func in getpt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7252: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:7396: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7306,15 +7451,15 @@ # It's better to believe a function is not available # than to expect to find it in ncurses. echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6 -echo "configure:7310: checking for tparm in -lncurses" >&5 +echo "configure:7455: checking for tparm in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7358,12 +7503,12 @@ # Don't set $LIBS here -- see comments above. resolv=no echo $ac_n "checking for res_send""... $ac_c" 1>&6 -echo "configure:7362: checking for res_send" >&5 -if eval "test \"`echo '$''{'ac_cv_func_res_send'+set}'`\" = set"; then +echo "configure:7507: checking for res_send" >&5 +if eval "test \"\${ac_cv_func_res_send+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_res_send=yes" else @@ -7404,12 +7550,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __res_send""... $ac_c" 1>&6 -echo "configure:7408: checking for __res_send" >&5 -if eval "test \"`echo '$''{'ac_cv_func___res_send'+set}'`\" = set"; then +echo "configure:7554: checking for __res_send" >&5 +if eval "test \"\${ac_cv_func___res_send+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func___res_send=yes" else @@ -7450,15 +7597,15 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_send in -lresolv""... $ac_c" 1>&6 -echo "configure:7454: checking for res_send in -lresolv" >&5 +echo "configure:7601: checking for res_send in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_send | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7488,15 +7635,15 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for __res_send in -lresolv""... $ac_c" 1>&6 -echo "configure:7492: checking for __res_send in -lresolv" >&5 +echo "configure:7639: checking for __res_send in -lresolv" >&5 ac_lib_var=`echo resolv'_'__res_send | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7543,12 +7690,12 @@ RESOLVLIB= fi echo $ac_n "checking for hes_getmailhost""... $ac_c" 1>&6 -echo "configure:7547: checking for hes_getmailhost" >&5 -if eval "test \"`echo '$''{'ac_cv_func_hes_getmailhost'+set}'`\" = set"; then +echo "configure:7694: checking for hes_getmailhost" >&5 +if eval "test \"\${ac_cv_func_hes_getmailhost+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_hes_getmailhost=yes" else @@ -7589,15 +7737,15 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for hes_getmailhost in -lhesiod""... $ac_c" 1>&6 -echo "configure:7593: checking for hes_getmailhost in -lhesiod" >&5 +echo "configure:7741: checking for hes_getmailhost in -lhesiod" >&5 ac_lib_var=`echo hesiod'_'hes_getmailhost | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lhesiod $RESOLVLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7639,15 +7787,15 @@ # These tell us which Kerberos-related libraries to use. if test "${with_kerberos+set}" = set; then echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6 -echo "configure:7643: checking for com_err in -lcom_err" >&5 +echo "configure:7791: checking for com_err in -lcom_err" >&5 ac_lib_var=`echo com_err'_'com_err | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcom_err $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7686,15 +7834,15 @@ fi echo $ac_n "checking for mit_des_cbc_encrypt in -lk5crypto""... $ac_c" 1>&6 -echo "configure:7690: checking for mit_des_cbc_encrypt in -lk5crypto" >&5 +echo "configure:7838: checking for mit_des_cbc_encrypt in -lk5crypto" >&5 ac_lib_var=`echo k5crypto'_'mit_des_cbc_encrypt | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lk5crypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7733,15 +7881,15 @@ fi echo $ac_n "checking for mit_des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6 -echo "configure:7737: checking for mit_des_cbc_encrypt in -lcrypto" >&5 +echo "configure:7885: checking for mit_des_cbc_encrypt in -lcrypto" >&5 ac_lib_var=`echo crypto'_'mit_des_cbc_encrypt | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7780,15 +7928,15 @@ fi echo $ac_n "checking for krb5_init_context in -lkrb5""... $ac_c" 1>&6 -echo "configure:7784: checking for krb5_init_context in -lkrb5" >&5 +echo "configure:7932: checking for krb5_init_context in -lkrb5" >&5 ac_lib_var=`echo krb5'_'krb5_init_context | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb5 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7828,15 +7976,15 @@ if test "${with_kerberos5+set}" != set; then echo $ac_n "checking for des_cbc_encrypt in -ldes425""... $ac_c" 1>&6 -echo "configure:7832: checking for des_cbc_encrypt in -ldes425" >&5 +echo "configure:7980: checking for des_cbc_encrypt in -ldes425" >&5 ac_lib_var=`echo des425'_'des_cbc_encrypt | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldes425 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7873,15 +8021,15 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for des_cbc_encrypt in -ldes""... $ac_c" 1>&6 -echo "configure:7877: checking for des_cbc_encrypt in -ldes" >&5 +echo "configure:8025: checking for des_cbc_encrypt in -ldes" >&5 ac_lib_var=`echo des'_'des_cbc_encrypt | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7922,15 +8070,15 @@ fi echo $ac_n "checking for krb_get_cred in -lkrb4""... $ac_c" 1>&6 -echo "configure:7926: checking for krb_get_cred in -lkrb4" >&5 +echo "configure:8074: checking for krb_get_cred in -lkrb4" >&5 ac_lib_var=`echo krb4'_'krb_get_cred | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7967,15 +8115,15 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for krb_get_cred in -lkrb""... $ac_c" 1>&6 -echo "configure:7971: checking for krb_get_cred in -lkrb" >&5 +echo "configure:8119: checking for krb_get_cred in -lkrb" >&5 ac_lib_var=`echo krb'_'krb_get_cred | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8022,17 +8170,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8026: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8174: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8063,17 +8211,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8067: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8215: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8100,17 +8248,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8104: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8252: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8137,17 +8285,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8141: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8289: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8183,17 +8331,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8187: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8335: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8220,17 +8368,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8224: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8372: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8257,17 +8405,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8261: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8409: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8304,17 +8452,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8308: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8456: checking for $ac_hdr" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8345,15 +8493,15 @@ # Solaris requires -lintl if you want strerror (which calls dgettext) # to return localized messages. echo $ac_n "checking for dgettext in -lintl""... $ac_c" 1>&6 -echo "configure:8349: checking for dgettext in -lintl" >&5 +echo "configure:8497: checking for dgettext in -lintl" >&5 ac_lib_var=`echo intl'_'dgettext | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8393,8 +8541,8 @@ echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6 -echo "configure:8397: checking whether localtime caches TZ" >&5 -if eval "test \"`echo '$''{'emacs_cv_localtime_cache'+set}'`\" = set"; then +echo "configure:8545: checking whether localtime caches TZ" >&5 +if eval "test \"\${emacs_cv_localtime_cache+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test x$ac_cv_func_tzset = xyes; then @@ -8403,7 +8551,7 @@ emacs_cv_localtime_cache=yes else cat > conftest.$ac_ext < extern char **environ; @@ -8435,7 +8583,7 @@ exit (0); } EOF -if { (eval echo configure:8439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then emacs_cv_localtime_cache=no else @@ -8465,12 +8613,12 @@ for ac_func in gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8469: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "configure:8617: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8518,12 +8667,12 @@ done echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6 -echo "configure:8522: checking whether gettimeofday can accept two arguments" >&5 -if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then +echo "configure:8671: checking whether gettimeofday can accept two arguments" >&5 +if eval "test \"\${emacs_cv_gettimeofday_two_arguments+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* emacs_cv_gettimeofday_two_arguments=yes else @@ -8564,25 +8713,25 @@ if test "$ac_cv_func_gettimeofday" = yes; then echo $ac_n "checking for struct timezone""... $ac_c" 1>&6 -echo "configure:8568: checking for struct timezone" >&5 -if eval "test \"`echo '$''{'emacs_cv_struct_timezone'+set}'`\" = set"; then +echo "configure:8717: checking for struct timezone" >&5 +if eval "test \"\${emacs_cv_struct_timezone+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct timezone tz; ; return 0; } EOF -if { (eval echo configure:8580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* if test "$cross_compiling" = yes; then emacs_cv_struct_timezone=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then emacs_cv_struct_timezone=yes else @@ -8627,12 +8776,12 @@ ok_so_far=yes echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:8631: checking for socket" >&5 -if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then +echo "configure:8780: checking for socket" >&5 +if eval "test \"\${ac_cv_func_socket+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -8678,17 +8828,17 @@ if test $ok_so_far = yes; then ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6 -echo "configure:8682: checking for netinet/in.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8832: checking for netinet/in.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8714,17 +8864,17 @@ if test $ok_so_far = yes; then ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6 -echo "configure:8718: checking for arpa/inet.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8868: checking for arpa/inet.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8762,7 +8912,7 @@ fi echo $ac_n "checking whether system supports dynamic ptys""... $ac_c" 1>&6 -echo "configure:8766: checking whether system supports dynamic ptys" >&5 +echo "configure:8916: checking whether system supports dynamic ptys" >&5 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -8774,12 +8924,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:8778: checking for pid_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then +echo "configure:8928: checking for pid_t" >&5 +if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -8790,17 +8940,19 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* - ac_cv_type_pid_t=yes + eval "ac_cv_type_pid_t=yes" else rm -rf conftest* - ac_cv_type_pid_t=no + eval "ac_cv_type_pid_t=no" fi rm -f conftest* fi -echo "$ac_t""$ac_cv_type_pid_t" 1>&6 -if test $ac_cv_type_pid_t = no; then - cat >> confdefs.h <<\EOF +if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <&6 -echo "configure:8812: checking for vfork.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo "configure:8964: checking for vfork.h" >&5 +if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8843,18 +8995,18 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:8847: checking for working vfork" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then +echo "configure:8999: checking for working vfork" >&5 +if eval "test \"\${ac_cv_func_vfork_works+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:8853: checking for vfork" >&5 -if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then +echo "configure:9005: checking for vfork" >&5 +if eval "test \"\${ac_cv_func_vfork+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -8899,7 +9052,7 @@ ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -8994,7 +9147,7 @@ } } EOF -if { (eval echo configure:8998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -9009,7 +9162,7 @@ fi echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 -if test $ac_cv_func_vfork_works = no; then +if test "x$ac_cv_func_vfork_works" = xno; then cat >> confdefs.h <<\EOF #define vfork fork EOF @@ -9019,12 +9172,12 @@ # Fixme: This should be replaced when we have autoconf 2.14. echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:9023: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then +echo "configure:9176: checking for size_t" >&5 +if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9035,17 +9188,19 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* - ac_cv_type_size_t=yes + eval "ac_cv_type_size_t=yes" else rm -rf conftest* - ac_cv_type_size_t=no + eval "ac_cv_type_size_t=no" fi rm -f conftest* fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF +if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <<\EOF #define HAVE_X_WINDOWS 1 @@ -9218,7 +9398,7 @@ ## C preprocessor. cat > conftest.$ac_ext < +;;; All tables are defined directly (not by marcro). +;;; 92.9.20 modified by T.Enami +;;; In busyu-input, unnecessary mapcar avoided. +;;; 92.9.30 modified for Mule Ver.0.9.6 by T.Mitani +;;; In busyu-input and kakusuu-input, bugs in kakusuu check fixed. + +;;; The tables of bushu ($BIte$2$^$7$?!#(B +;$B$3$N%G!<%?$O!"B?$/$NF|K\8l%U%m%s%H%(%s%I%W%m%;%C%5$KBP1~$7$F$$$^$9!#(B +;$B$3$N%G!<%?$r:n@.$9$k$K$O!"#J#G#A#W#K$,I,MW$G$9!#(B +; +; +;$B!?#2!%=PNO7A<0!?(B +; +;$B!&F|K\8l#F#E#P!!0l3g$G<-=qEPO?$G$-$k%F%-%9%H%U%!%$%k$r=PNO$7$^$9!#(B +; +;$B!!!!#A#T#O#K#7(B $B!J3t!K%8%c%9%H%7%9%F%`(B +;$B!!!!>>B{#V#3(B $B!J3t!K4IM}9)3X8&5f=j(B +;$B!!!!#W#X#2!\!J#W#X#P!K(B $B%(!<%"%$%=%U%H!J3t!K(B +;$B!!!!#V#J#E!]&B(B $B!J3t!K%P%C%/%9(B +;$B!!!!#D#F#J(B $B!J3t!K%G%8%?%k!&%U%!!<%`(B +; +;$B!!!!Cm0U!K(B +;$B!!!!!!!!!&#W#X#2!\$N%?%$%W$O%U%j!<%&%'%"HG$N#W#X#P$K$bBP1~$7$F$*$j$^$9!#(B +;$B!!!!!!!!!&#V#J#E!]&B$OC1BN$G$O!"EPO?$G$-$^$;$s!#(B +;$B!!!!!!!!!!F1KAN ($B%j%?!<%s(B) +; +;$B$G!"4JC1$J%Q%i%a!<%?$N@bL@$,$G$F$-$^$9!#(B +;$B>\$7$$@bL@$O!"IUB0$N(B KANMAN.TXT$B!!$K=q$$$F$"$j$^$9!#(B +; +;$B$?$H$($P!"#A#T#O#K#7>l9g$OKAN ATOK B 1 @ +; +;ATOK $B!!!!#A#T#O#K#7MQ(B +;B $B!!!!Am2h?tJQ49<-=q$r=PNO(B +;1 $B!!!!Bh0l?e=`$N$_$r=PNO(B +;@ $B!!!!FI$_$K(B@$B$,IU$1$i$l$k(B +; +;$B0J>e$rl9g$O!"$3$A$i$^$G$*CN$i$;$/$@$5$l$P9,$$$G$9!#l9g$O!"#1!$#2=54V0JFb$K@^(B +;$B$jJV$7$4JV;v$N%a!<%k$r:9$7>e$2$^$9!#K|0l%a!<%k$,$3$J$$>l9g$O!"$*Ld$$9g$o$;2<$5(B +;$B$$!#(B +; +;$B$^$?!"l9g$O!"$*K;$7$$J}$O;EJ}$,$"$j(B +;$B!!$^$;$s$,$J$k$Y$/$46(NO2<$5$k$h$&$*4j$$$$$?$7$^$9!#(B +;$B!&$3$N%G!<%?$K$h$C$F@8$8$?$$$+$J$k;v8N$K$D$$$F$O@UG$$rIi$$$+$M$^$9!#(B +;$B!&%G!<%?$N99?7$KEX$a$^$9$,!"=t=h$N;v>p$K$h$jBZ$k>l9g$,$"$j$^$9!#(B +;$B!&Ld$$9g$o$;$J$I$K$O$J$k$Y$/$4JV;v$$$?$7$^$9!#JV;v$,#1=54V0J>eL5$$>l9g$O!"K;$7(B +;$B!!$$$+K:$l$F$$$k>l9g$G$9!#?=$7Lu$4$6$$$^$;$s$,:FEY$*Aw$j2<$5$$!#(B +; +; +;$B!?#6!%E>:\!">R2p!"HNGd$J$I$K$D$$$F!?(B +; +;$B!cE>:\!d(B +;$B!!B>$N%M%C%H$X$NE>:\$O5v2D$7$^$9$,!"E>:\7$-$^$9$N$G!"$J$k$Y$/$3$N$^$^$N7A$G%"%C%W$7$F2<$5$$!#(B +;$B$b$7!"JQ99$9$k>l9g$O0lEY$4O"Mm2<$5$$!#(B +;$B!!F1;~$K%"%C%W%m!<%I$5$l$F$$$k2<5-$N%U%!%$%k$b0l=o$KEPO?$7$F$/$@$5$$!#(B +; +;$B!&M9JXHV9fJm!!(BZIP91A.LZH $B!&;T306IHVJm!!(BTEL91A.LZH $B!&4A;z<-=q!!(BKANJIDIC.LZH +; +;$B!c>R2p!d(B +;$B!!;(;oEy$N>R2p$d<}O?$KIU$$$F$O!"99?7$J$I$G?7$?$K8x3+$7$F$$$k$b$N$,>R2p$5$l$J$$(B +;$B2DG=@-$,$"$j$^$9$N$G0lEY$4O"Mm2<$5$$!#%U%m%C%T!<$J$I$N<}O?;~$K$O!"8=;~E@$G$N!"(B +;$B=$@5HG$rDs6!$$$?$7$^$9!#(B +; +;$B!cHNGd!d(B +;$B1DMxL\E*$G$3$N%G!<%?$r\$7$$$3$H$O!"2~$a$FLd$$9g$o$;2<$5$$!#(B +; +; +;$B!?#7!%O"Mm@h!?(B +; +;$B%a!<%k$O2<5-$^$G$*Aw$j$/$@$5$$!#(B +; +;$B#A#S#C#I#I!]#N#E#T!J#P#C#S!K(B pcs35011 +;$B#N#I#F#T#Y!]#S#e#r#v#e(B NAG01423 +;$B#P#C!]#V#A#N(B GLG93462 +;$BF|7P#M#I#X(B tadashi +;$B#M#A#S#T#E#R!]#N#E#T(B CAG741 +;************************************************************************** + +(defvar busyu-table + '[0 ; ignore + (("$B0l(B" . "$B$$$A(B") ; 1 + ("$B$\$&!JP$(B,$BCf$J$I!K(B" . "$B$\$&(B") + ("$BP&(B" . "$B$F$s(B") + ("$BP((B" . "$B$N(B") + ("$B25(B" . "$B$*$D(B") + ("$BP-(B" . "$B$O$M$\$&(B") + ) + (("$BFs(B" . "$B$K(B") ; 2 + ("$BP5(B" . "$B$J$Y$U$?(B") + ("$B?M(B" . "$B$R$H(B") + ("$BQ9(B" . "$B$R$H$"$7(B") + ("$BF~(B" . "$B$$$k(B") + ("$BH,(B" . "$B$O$A(B") + ("$BQD(B" . "$B$($s$,$^$((B") + ("$BQL(B" . "$B$o$+$s$`$j(B") + ("$BQR(B" . "$B$K$9$$(B") + ("$BQ\(B" . "$B$D$/$((B") + ("$BQa(B" . "$B$&$1$P$3(B") + ("$BEa(B" . "$B$+$?$J(B") + ("$BNO(B" . "$B$A$+$i(B") + ("$BR1(B" . "$B$D$D$_$,$^$((B") + ("$BR8(B" . "$B$5$8$N$R(B") + ("$BR9(B" . "$B$O$3$,$^$((B") + ("$BR>(B" . "$B$+$/$7$,$^$((B") + ("$B==(B" . "$B$8$e$&(B") + ("$BKN(B" . "$B$\$/$N$H(B") + ("$BRG(B" . "$B$U$7$E$/$j(B") + ("$BRL(B" . "$B$,$s$@$l(B") + ("$BRS(B" . "$B$`(B") + ("$BKt(B" . "$B$^$?(B") + ) + (("$B8}!J$/$A!K(B" . "$B$/$A(B") ; 3 + ("$BSx!J$/$K$,$^$(!K(B" . "$B$/$K$,$^$((B") + ("$BEZ(B" . "$B$D$A(B") + ("$B;N(B" . "$B$5$`$i$$(B") + ("$BTi(B" . "$B$U$f$,$7$i(B") + ("$BTj(B" . "$B$9$$$K$g$&(B") + ("$BM<(B" . "$B$f$&$Y(B") + ("$BBg(B" . "$B$@$$(B") + ("$B=w(B" . "$B$*$s$J(B") + ("$B;R(B" . "$B$3(B") + ("$BU_(B" . "$B$&$+$s$`$j(B") + ("$B@#(B" . "$B$9$s(B") + ("$B>.(B" . "$B$A$$$5$$(B") + ("$BUw(B" . "$B$^$2$"$7(B") + ("$BUy(B" . "$B$7$+$P$M(B") + ("$BV%(B" . "$B$F$D(B") + ("$B;3(B" . "$B$d$^(B") + ("$BV_(B" . "$B$^$,$j$,$o(B") + ("$B9)(B" . "$B$?$/$_(B") + ("$B8J(B" . "$B$*$N$l(B") + ("$B6R(B" . "$B$O$P(B") + ("$B43(B" . "$B$[$9(B") + ("$BVv(B" . "$B$$$H$,$7$i(B") + ("$BVx(B" . "$B$^$@$l(B") + ("$BW.(B" . "$B$($s$K$g$&(B") + ("$BW0(B" . "$B$K$8$e$&$"$7(B") + ("$BW5(B" . "$B$7$-$,$^$((B") + ("$B5](B" . "$B$f$_(B") + ("$BW@(B" . "$B$1$$$,$7$i(B") + ("$BWD(B" . "$B$5$s$E$/$j(B") + ("$BWF(B" . "$B$.$g$&$K$s$Y$s(B") + ) + (("$B?4(B" . "$B$3$3$m(B") ; 4 + ("$BXy(B" . "$B$+$N$[$3(B") + ("$B8M(B" . "$B$H$S$i$N$H(B") + ("$BNn(B") + (16 . "$Bp9p?p@pApBpC(B") + (17 . "$BpD2bAz(B") + (18 . "$BpE(B") + (19 . "$BpFL8(B") + (20 . "$BpGO*(B") + (21 . "$B[1pH(B") + (22 . "$BpIpJ(B") + (24 . "$BpMpKpLpN(B") + (25 . "$BpO(B")) + ("$B$"$i$:(B" + (8 . "$BHs(B") + (15 . "$BpQ(B") + (19 . "$BsS(B")) + ("$B$$$7(B" + (5 . "$B@P(B") + (8 . "$Bbe(B") + (9 . "$B8&:=:Ubfbg(B") + (10 . "$B:VEVbi5NGKK$EW9\(B") + (11 . "$Bbk(B") + (12 . "$B8'9E>KN2H#bm(B") + (13 . "$BbpORbl37:l8k10Dvbobqbn(B") + (14 . "$Bbtbr<'HjJKbubs@Y(B") + (15 . "$Bbwbv3Nbxbybzb{HXb|b}(B") + (16 . "$Bc"b~c!Ka(B") + (17 . "$B0kc#>Lc$(B") + (18 . "$Bc&ACc'c%(B") + (19 . "$Bc((B") + (20 . "$Bc)bjc*bh(B")) + ("$B$$$?$k(B" + (6 . "$B;j(B") + (10 . "$BCW(B") + (14 . "$BgJ(B") + (16 . "$BgK(B")) + ("$B$$$A$?(B" + (4 . "$B]F(B") + (6 . "$B;`(B") + (8 . "$B]G]H(B") + (9 . "$BKX]I]J(B") + (10 . "$B;De>fK|M?(B") + (4 . "$BP"1/IT(B") + (5 . "$B5V3n@$RBP#J:(B") + (6 . "$B>gN>(B") + (8 . "$BJB(B")) + ("$B$$$H$,$7$i(B" + (3 . "$BVv(B") + (4 . "$B88(B") + (5 . "$BMD(B") + (9 . "$BM)(B") + (12 . "$B4v(B")) + ("$B$$$H(B" + (6 . "$B;e(B") + (7 . "$B7Od}(B") + (9 . "$Bd~5*5i5j9He!Ls(B") + (10 . "$Be"9I:0:Ye';g=*>R?Be(AHe)D]e*e+N_e&(B") + (12 . "$Be/3(5k7k0<9Je,e-e.e0e1@dE}e3Mme2(B") + (13 . "$Be47Q8(e6e7B3e8e9e5(B") + (14 . "$B0]e:e;e<9Ke=e>e?eBDVeCHlLJLV0=NPeEeFN}eGe@en(B") + (15 . "$BeMeD1o4KeH6[eIFleJ@~eKeLDyeNJTLKeO(B") + (16 . "$B0^ePeQu68`=`>`?`;(B") + (8 . "$B8Q`@6iA@9}`A(B") + (9 . "$B`C69`D](B") + (13 . "$Bl6(B") + (14 . "$B9k(B") + (16 . "$BP.l7(B")) + ("$B$$$k(B" + (2 . "$BF~(B") + (6 . "$BA4(B") + (8 . "$BQ@(B") + (9 . "$BQA(B")) + ("$B$$$m(B" + (6 . "$B?'(B") + (19 . "$B1p(B") + (24 . "$Bgf(B")) + ("$B$&$*(B" + (11 . "$B5{(B") + (15 . "$BO%r7(B") + (16 . "$Br80>r9J+r:r:z;-r?A/r@(B") + (18 . "$BrArBrC8qrDrErFrG(B") + (19 . "$BrH7_rIrJrK;*BdrLrOrPrN03(B") + (20 . "$BrQrSrTrU3brVrWrXrYrRrZr\OL(B") + (21 . "$Br[r]IIr^0sr_r`(B") + (22 . "$B3orM17rdC-rcrarb(B") + (23 . "$BKpNZre(B") + (24 . "$Brfrg(B") + (26 . "$Brh(B") + (27 . "$Bri(B")) + ("$B$&$+$s$`$j(B" + (3 . "$BU_(B") + (5 . "$BU`(B") + (6 . "$B0B1',UbMF(B") + (11 . "$BUcFR4s(B") + (19 . "$B`9(B") + (20 . "$B`:(B")) + ("$B$&$8(B" + (4 . "$B;a(B") + (5 . "$BL1(B") + (8 . "$B]b(B")) + ("$B$&$9(B" + (6 . "$B11(B") + (9 . "$BgLgM(B") + (11 . "$BgN(B") + (13 . "$BgO(B") + (14 . "$BgP(B") + (16 . "$B6=(B") + (17 . "$BZ*(B") + (18 . "$BgQ(B")) + ("$B$&$^$l$k(B" + (5 . "$B@8(B") + (11 . "$B;:(B") + (12 . "$B1ya4(B")) + ("$B$&$^(B" + (10 . "$BGO(B") + (12 . "$BqGqH(B") + (13 . "$BFkCZ(B") + (14 . "$B1X6nBLG}qI(B") + (15 . "$B6o2o6pqJqKqLqMCsqN(B") + (16 . "$BqOqPqQqR(B") + (17 . "$BqS=YqTqU(B") + (18 . "$B53qV83qWA{qX(B") + (19 . "$BqYBM(B") + (20 . "$Bq[qZF-(B") + (21 . "$Bq\q]q^q_q`(B") + (22 . "$B6Cqaqb(B") + (23 . "$Bqcqd(B") + (24 . "$Bqe(B") + (26 . "$Bqf(B") + (27 . "$Bqgqh(B") + (28 . "$Bqi(B") + (29 . "$Bqk(B") + (30 . "$Bqj(B")) + ("$B$&$j(B" + (6 . "$B1;(B") + (11 . "$Ba!(B") + (16 . "$BI;(B") + (19 . "$Ba"(B")) + ("$B$($s$,$^$((B" + (2 . "$BQD(B") + (4 . "$BFb1_(B") + (5 . "$B:}QFQGQE(B") + (6 . "$B:F(B") + (7 . "$BQH(B") + (9 . "$BQIKA(B") + (10 . "$BQJ(B") + (11 . "$BQK(B")) + ("$B$($s$K$g$&(B" + (3 . "$BW.(B") + (7 . "$BDn(B") + (8 . "$B1dW/(B") + (9 . "$B2v7zG6(B")) + ("$B$*$$(B" + (6 . "$B9MO7(B") + (8 . "$B*@+09U'EJU(Ke(B") + (9 . "$BU,0#0RU)0y4/U*;QLE18U-0((B") + (10 . "$BU3U.I1U/8dU0L+GLU9IXO,U:U5(B") + (12 . "$BI2L;G^U;(B") + (13 . "$BU<2G7yU=<;U>U?U@UL(B") + (14 . "$BUCUAUBCdUDUE(B") + (15 . "$BUFUG4rUHUI(B") + (16 . "$B>nUJ(B") + (17 . "$B1ED\UKUMUN(B") + (19 . "$BUO(B") + (20 . "$BUPUQUR(B")) + ("$B$+$$(B" + (7 . "$B3-(B") + (9 . "$BIi(B") + (10 . "$B9W:b(B") + (11 . "$B2_4S@UlEHNIOlIlD(B") + (12 . "$BlF2l5.lGLcB_CyE=lHGcHqlJKGlL(B") + (13 . "$BB1lK;qDBO(OEA(l\(B") + (14 . "$BFx(B") + (15 . "$B;?;r>^lM(B") + (4 . "$B6hI$(B") + (7 . "$B0e(B") + (10 . "$BF?(B") + (11 . "$BR?(B")) + ("$B$+$/$N$+$o(B" + (9 . "$B3W(B") + (12 . "$BpVpW?Y(B") + (13 . "$B7$pX(B") + (14 . "$BpYpZ3sp\p]p[(B") + (15 . "$Bp^0Hp_p`(B") + (16 . "$B>d(B") + (17 . "$B5Gpa(B") + (18 . "$BkqpcpdJ\pb(B") + (19 . "$Bpfpe(B") + (22 . "$Bpg(B") + (24 . "$Bpiph(B")) + ("$B$+$/(B" + (10 . "$Br/(B") + (22 . "$Bdx(B")) + ("$B$+$1$k(B" + (4 . "$B7g(B") + (6 . "$B5=6V(B") + (13 . "$B]<]=(B") + (14 . "$B2N]>(B") + (15 . "$B]?4?C7(B") + (16 . "$B]@]A(B") + (17 . "$B]B(B") + (18 . "$B]C(B") + (22 . "$B]D(B")) + ("$B$+$<(B" + (9 . "$BIw(B") + (12 . "$Bq$(B") + (14 . "$Bq%q&(B") + (17 . "$Bq'(B") + (20 . "$Bq(q)(B") + (21 . "$Bq*(B")) + ("$B$+$?$J(B" + (2 . "$BEa(B") + (3 . "$B?OQc(B") + (4 . "$B4"@ZJ,(B") + (5 . "$B4)Qd(B") + (6 . "$B7:QfNsQe(B") + (7 . "$BQh=iH=JLMxQg(B") + (8 . "$BQi7tQj9o:~;I@)QkE~(B") + (9 . "$BQlQmQn:oA0B'DfQo(B") + (10 . "$BQp7u9d:^QqGmK6(B") + (11 . "$BQ{>jQtQrI{(B") + (12 . "$BQs3dAOQu(B") + (13 . "$BQvQw(B") + (14 . "$B3D(B") + (15 . "$BQx7`Q|N-(B") + (16 . "$BQzQyQ}(B")) + ("$B$+$?(B" + (4 . "$BJR(B") + (8 . "$BHG(B") + (12 . "$BGW`0(B") + (13 . "$BD-(B") + (17 . "$B`/(B") + (19 . "$B`1(B")) + ("$B$+$J$((B" + (13 . "$BE$(B")) + ("$B$+$M(B" + (8 . "$B6b(B") + (10 . "$Bn[?KE#3xn]n^n\(B") + (11 . "$Bn_KUn`6|D`na(B") + (12 . "$BnbncndF_ng3CneoO(B") + (13 . "$Bnh1tninjnk8Z9[nlnm>`E4noH-npNknqnv(B") + (14 . "$Bnnnr6dns=FA,A-ntnuF{?m;,ao*CCo+EUIEo,o((B") + (18 . "$Bo-3;o.:?AyDCo/DJo03yo1(B") + (19 . "$Bo5o26@o3o4o6o7E-o8o9o:o;(B") + (20 . "$BoEo<>bo=o>F*o?oAo@(B") + (21 . "$BoDoBoCBxoF(B") + (22 . "$BoILzoGoH(B") + (23 . "$BoJ4UoKoLoMoT(B") + (24 . "$BoN(B") + (25 . "$BoP(B") + (26 . "$BoQoR(B") + (27 . "$BoSoUoVoX(B") + (28 . "$BoW(B")) + ("$B$+$N$[$3(B" + (4 . "$BXy(B") + (5 . "$BXzJj(B") + (6 . "$BX{=?X|@.(B") + (7 . "$B2f2|(B") + (8 . "$B0?X}(B") + (11 . "$BX~@LlC(B") + (12 . "$BY!7a(B") + (13 . "$BY"@o(B") + (14 . "$BY#(B") + (15 . "$B5:Y$(B") + (16 . "$BY%(B") + (17 . "$BY&(B") + (18 . "$BBWY'(B")) + ("$B$+$_$,$7$i(B" + (10 . "$Bqu(B") + (13 . "$Bqv(B") + (14 . "$BH1qwqx(B") + (15 . "$Bq|qyq{I&qzq}(B") + (16 . "$Bq~r!(B") + (18 . "$Br"(B") + (21 . "$Br#(B") + (22 . "$Br$(B") + (23 . "$Br%(B") + (24 . "$Br&(B") + (25 . "$Br'(B")) + ("$B$+$a(B" + (16 . "$Bs}(B")) + ("$B$+$i$$(B" + (7 . "$B?I(B") + (12 . "$Bmc(B") + (13 . "$Bmd(B") + (14 . "$Bme(B") + (16 . "$BQ~R!(B") + (19 . "$Bmf(B") + (21 . "$Bmg(B")) + ("$B$+$o$i(B" + (5 . "$B4$(B") + (7 . "$Ba#(B") + (8 . "$Ba$(B") + (9 . "$Ba%a&a(a'(B") + (11 . "$Ba*ISa)(B") + (14 . "$Ba+a,a-(B") + (16 . "$Ba.a/a0(B") + (17 . "$B9y(B") + (18 . "$Ba1a2(B")) + ("$B$,$s$@$l(B" + (2 . "$BRL(B") + (4 . "$BLq(B") + (9 . "$B8|RMNR(B") + (10 . "$B86(B") + (11 . "$BRN(B") + (12 . "$BRPRO19?_(B") + (14 . "$B1^RQRR(B") + (17 . "$B87(B")) + ("$B$-$$$m(B" + (11 . "$B2+(B") + (25 . "$BsT(B")) + ("$B$-$,$^$((B" + (4 . "$B]c(B") + (6 . "$B5$(B") + (8 . "$B]d(B") + (10 . "$B]f]e(B")) + ("$B$-$P(B" + (4 . "$B2g(B")) + ("$B$-$S(B" + (12 . "$B5P(B") + (15 . "$BsU(B") + (17 . "$BsV(B") + (23 . "$BsW(B")) + ("$B$-$s(B" + (4 . "$B6T(B") + (5 . "$B@M(B") + (8 . "$BI`(B") + (9 . "$BZQ(B") + (11 . "$B;BCG(B") + (12 . "$B;[(B") + (13 . "$B?7(B") + (18 . "$BZR(B")) + ("$B$-(B" + (4 . "$BLZ(B") + (5 . "$B;%[2K\KvL$(B") + (6 . "$B4y5`[3r>sB+B2L9:;^5O>>[@?u@O[AKmElGUHDHz[B[C[DKgNS[FOH[?[G[EGG(B") + (9 . "$B[V1I2M[H[I4;[K[L[M[N8O::?[kDt[l233a[o[pM|[qNB[r[u[tEn[n(B") + (12 . "$B\&\"0X[v4=4}[w[y8![~\#\%?"?9@3\'DG\(Eo\*\+C*K@LIL:OP\/?z3q\2(B\ +$B\![|\,[x[}[s\1\.\0\)\-[{[z(B") + (13 . "$BG`\$\3\43Z4~6H6K\6\7Fj=]\8A?\:DX\;\=FoIv\?\@ML\BO0FN\>\5\D\<(B\ +$B\9\CBJ\A(B") + (14 . "$B\FO11]\G359=\I\J\K\L\NMM?:\cAdDHKjt"\P\Q\R\TLO\V\W\X:g\U\E\H(B\ +$B\S\O\Y(B") + (15 . "$B\d\Z\[\l\k2#DP\\\]8"\`\a>@\bAeCtHu\hI8\i3_\g\e\_\f\n\x(B") + (16 . "$B3r\m5!5L66AFK\rC.\s\t\u\v\w\p\o\q(B") + (17 . "$B\}\y3`\{\|8i\~CI]!\z],[X(B") + (18 . "$B\j]#]$]%[m]&]']((B") + (19 . "$B6{]-]+O&])]*(B") + (20 . "$BMs].H'(B") + (21 . "$B]/]0]2(B") + (22 . "$B\^(B") + (23 . "$B]3(B") + (25 . "$B]4(B") + (26 . "$B15(B") + (29 . "$B]6(B")) + ("$B$.$U$N$U(B" + (6 . "$Bot(B") + (7 . "$Bow:eouovKI(B") + (8 . "$BIlox0$AKBKIm(B") + (9 . "$B8Boyo{oz(B") + (10 . "$B1!4Y9_=|o~?Xp!p"JEo}p#(B") + (11 . "$Bo|1"81p$p%DDF+GfN&N4NM(B") + (12 . "$Bg!?o3,6yp&BbM[7((B") + (13 . "$Bp'p(p)3V(B") + (14 . "$B7d1#:]>c(B") + (16 . "$Bp*p+NY(B") + (17 . "$Bp,p.p-(B") + (19 . "$Bp/(B")) + ("$B$.$g$&$K$s$Y$s(B" + (3 . "$BWF(B") + (7 . "$BLrWG(B") + (8 . "$BWJ1}WH7B@,WIH`(B") + (9 . "$B8eWLWNBTN'WK(B") + (10 . "$BWM=>=yEL(B") + (11 . "$BWRWOWPF@WQ(B") + (12 . "$B8fWS=[I|(B") + (13 . "$BHyWT(B") + (14 . "$BD'FA(B") + (15 . "$BE0(B") + (16 . "$BWU(B") + (17 . "$B5+(B")) + ("$B$.$g$&(B" + (6 . "$B9T(B") + (9 . "$B^'(B") + (11 . "$BjJ=Q(B") + (12 . "$B39(B") + (13 . "$BjK(B") + (15 . "$B>W(B") + (16 . "$B1RjL9U(B") + (24 . "$BjM(B")) + ("$B$/$5(B" + (6 . "$Bgggh0r(B") + (7 . "$Bgigj2V7]h6h4hOh9h:2[5F6]:ZCxJnK((B") + (12 . "$BhHh?0`?{hA8VhBhC>ThDhEhFhGhIEQhJhKhLhNMiI)hRF:h@hMh_0*GkArMUMn(B") + (13 . "$B01hShU3khX3~hYIxG,F!h]Irh^h`N*hThWhbhPh[hahdh\>xC_MV(B") + (14 . "$BhZhc38hehfhgL,IGhi<,hj=/hlhmhnAsho3wLXhhhphkDUB"(B") + (15 . "$BhyhQ0~16hqhsht>UhuhvhwhxL"JNK)h{OOh|>Vh}h~i!AIi?i@iBiCiDiA(B") + (21 . "$B]"]1b$BfRZR[1&R]R\(B") + (6 . "$B5H5I6+R^8~9!9gD_EG1%F1L>My3F(B") + (7 . "$B5[R_R`4^Ra6c7/8b8cRbRc9p?aRdDhReF]KJH]J-RfJrO$RgRh(B") + (8 . "$BRiRjRkRl8FRmRn:pRo(B") + (10 . "$BS*0wS'S)S+S,S-:6>%?0E/Eb14S.KiS/S(0"(B") + (11 . "$BS17&>'S5BCS6BoS7S8S9LdM#S:S0S3S;S2(B") + (12 . "$B3e1DS(SUSVSXSW(B") + (15 . "$BSY4oSZ13S\>|S]A91=S^S_J.3z2^(B") + (16 . "$BS`SaSbScFUH8Sd(B") + (17 . "$B3ESeSiSjSgSf(B") + (18 . "$BSh(B") + (19 . "$BSkSl(B") + (20 . "$BSmSn(B") + (21 . "$BSoSpSqSrSs(B") + (22 . "$BStG9Su(B") + (24 . "$BSvSw(B")) + ("$B$/$K$,$^$((B" + (3 . "$BSx(B") + (5 . "$B<|;M(B") + (6 . "$B0x2sCD(B") + (7 . "$B0OSy:$?^(B") + (8 . "$B8G9qSz(B") + (9 . "$BS{S|(B") + (10 . "$BS}J`(B") + (11 . "$BT"S~T!(B") + (12 . "$BT#7w(B") + (13 . "$BT$1`T'(B") + (14 . "$BT%T&(B") + (16 . "$BT((B")) + ("$B$/$S(B" + (9 . "$BFpmD(B") + (12 . "$BmEmF7Z<4mG(B") + (13 . "$B3S:\mHmImJmR(B") + (14 . "$BmKmLmNJe(B") + (15 . "$BmM51mOmPGZmQNXmS(B") + (16 . "$B=4mTmUM"mV(B") + (17 . "$BmW3mmXmYMA(B") + (18 . "$Bm[m\mZ(B") + (19 . "$Bm]E2(B") + (20 . "$Bm^(B") + (21 . "$B9lm_(B") + (22 . "$B7%m`(B") + (23 . "$Bmamb(B")) + ("$B$/$m(B" + (11 . "$B9u(B") + (15 . "$BL[(B") + (16 . "$B`TsX(B") + (17 . "$BBcsYsZs[(B") + (18 . "$Bs\(B") + (20 . "$Bs^s](B") + (21 . "$Bs_(B") + (23 . "$Bs`(B") + (26 . "$Bsa(B") + (27 . "$Bsb(B")) + ("$B$0$&$N$"$7(B" + (9 . "$Bc;c<(B") + (13 . "$B6Y(B")) + ("$B$1$$$,$7$i(B" + (3 . "$BW@(B") + (6 . "$BEv(B") + (9 . "$BWA(B") + (11 . "$BWB(B") + (13 . "$BWC(B") + (16 . "$BW4(B") + (18 . "$BW3(B")) + ("$B$1(B" + (4 . "$BLS(B") + (8 . "$B][(B") + (11 . "$B]\]](B") + (12 . "$B]^]_(B") + (17 . "$B]a(B")) + ("$B$2$s(B" + (5 . "$B8<(B") + (11 . "$BN((B")) + ("$B$3$3$m(B" + (4 . "$B?4(B") + (5 . "$BI,(B") + (6 . "$BWVK;(B") + (7 . "$B1~4w;VG&K:2wWWWXWYWZX-(B") + (8 . "$B9zCiW[G0W]WaW^2x61W`@-WeWfI]WgWhWiNgWjWb(B") + (9 . "$B1e5^;WWcBUE\WdWpW_2y2zWmWo91Wq3fWr:(WtWuWvWwWx(B") + (10 . "$BWkWl2862637CWs=zB)CQWyNxWnX&1YWzW{8gW}W~X!X"DpG:X#X%X'X$(B") + (11 . "$B0-45<=M*0TX)X+9{;4>pX,X.@KX/X0EiFWX1W|(B") + (12 . "$BW\X*AZHaLeOGX=X392X5X7X8X9XL|X234XCXAXD?5XFXHXKXIXx(B") + (14 . "$BX@XBXEXGBVJiXJXN47XLXMXPXRXTXVXXK}XYXSXU(B") + (15 . "$B0V7D7EXOXQXWM+M]N8X\A~X]X^X_F4XbXcJ0Ny(B") + (16 . "$BXZX[7F7{X`XaXdXe212{Xh48XjXkXn(B") + (17 . "$BXfXi:)XlXo(B") + (18 . "$BD(XpXs(B") + (19 . "$BXgXq(B") + (20 . "$B7|Xr(B") + (21 . "$BXuXvXw(B") + (22 . "$BXt(B")) + ("$B$3$H$P(B" + (7 . "$B8@(B") + (9 . "$B7WD{k>(B") + (10 . "$B5-k?71k@kA?VBwF$(B") + (11 . "$B@_kBkC5v7m>YkDK,Lu(B") + (12 . "$B1SkEkF:>;l>Z>[?GAJkGBBkHCpkII>kJ(B") + (13 . "$BkK3:kL5M7X8XkM;m;nkN>\@?OMkOkPM@kQOCA'(B") + (14 . "$BkRkSkT8l8mkU;okVkW@@@bFIG'kXM6(B") + (15 . "$B1Z2]5C?[kY=tC/@AkZBzCBCLD4k[HpNJO@k\k](B") + (16 . "$Bk`k^0bk_4Rkakbkc8Akd;pD5D|kekfKEM!kgMXkk(B") + (17 . "$Bkhko6`8,ki9Vkjyk~l!l"(B") + (21 . "$Bl%l$(B") + (22 . "$Bl&;>(B") + (23 . "$Bl'l(=2(B") + (24 . "$Bl*l)l+(B") + (25 . "$Bl,(B") + (26 . "$Bl-(B")) + ("$B$3$a(B" + (6 . "$BJF(B") + (8 . "$Bdb(B") + (9 . "$B6N7)Lb(B") + (10 . "$Bdc?hJ4L0dd(B") + (11 . "$BAFG4GtN3(B") + (12 . "$Bdedg4!>Q0@didjdfdh(B") + (13 . "$Bdkdldmdn(B") + (14 . "$Bdo@:dqdp(B") + (15 . "$B8RdrA8ds(B") + (16 . "$BE|dudt(B") + (17 . "$Bdw9GAldvJ5(B") + (18 . "$BNH(B") + (20 . "$Bdy(B") + (21 . "$Bdz(B") + (22 . "$Bd{(B") + (25 . "$Bd|(B")) + ("$B$3$m$b(B" + (6 . "$B0a(B") + (8 . "$BjNI=(B") + (9 . "$B6^jRjSCojUjV(B") + (10 . "$BjOjPjQ?jB5jWjXjZj[Hoj\(B") + (11 . "$B76B^j]jYj^jTj_0Aj`jajb>X(B") + (12 . "$B:[AuNvjeJdM5N#(B") + (13 . "$BjfjcjdN":@jh?~jijkMgjljm(B") + (14 . "$Bjg@=jj3ljnJ#jojpj|(B") + (15 . "$BK+jrjsjtju(B") + (16 . "$Bjzjvjy(B") + (17 . "$Bjqjwjxj{p7(B") + (18 . "$B2(6_j}(B") + (19 . "$Bj~k!k"(B") + (20 . "$Bk#k$(B") + (21 . "$Bk%(B") + (22 . "$B=1k&k'(B")) + ("$B$3$s(B" + (6 . "$B:1(B") + (7 . "$BNI(B") + (17 . "$Bge(B")) + ("$B$3(B" + (3 . "$BUS;R(B") + (4 . "$B9&(B") + (5 . "$BUT(B") + (6 . "$B;zB8(B") + (7 . "$B9'UUUV(B") + (8 . "$B3XUWLR8I5((B") + (9 . "$BUX(B") + (10 . "$BB9(B") + (11 . "$BUY(B") + (12 . "$BV#(B") + (13 . "$BUZ(B") + (14 . "$BU[(B") + (16 . "$BU\(B") + (17 . "$BU^(B")) + ("$B$5$1$N$H$j(B" + (7 . "$BFS(B") + (9 . "$B=6nD(B") + (10 . "$B<`_nR(B") + (20 . "$BnS>znT(B") + (21 . "$BnU(B") + (24 . "$BnV(B") + (25 . "$BnW(B")) + ("$B$5$8$N$R(B" + (2 . "$BR8(B") + (4 . "$B2=(B") + (5 . "$BKL(B") + (11 . "$B:|(B")) + ("$B$5$H(B" + (7 . "$BN$(B") + (9 . "$B=E(B") + (11 . "$BLn(B") + (12 . "$BNL(B") + (18 . "$BnZ(B")) + ("$B$5$`$i$$(B" + (3 . "$B;N(B") + (4 . "$B?Q(B") + (6 . "$BAT(B") + (7 . "$BTc0m@4(B") + (15 . "$B1F(B")) + ("$B$7$+$7$F(B" + (6 . "$B<)(B") + (9 . "$BBQ(B")) + ("$B$7$+$P$M(B" + (3 . "$BUy(B") + (4 . "$BUz<\(B") + (5 . "$B?,Ft(B") + (6 . "$B?T(B") + (7 . "$B6IG"U{Hx(B") + (8 . "$BFOU|5o6~(B") + (9 . "$B20;SU}V"Ck(B") + (10 . "$BV!6}E8U~(B") + (12 . "$BB0EKM(B") + (11 . "$B:WI~;tK0(B") + (14 . "$B0;(B") + (15 . "$Bq-1Bq.M\L_2n(B") + (16 . "$Bq1;Aq/q04[(B") + (17 . "$Bq3q2q4q5q6(B") + (18 . "$Bq7q8(B") + (19 . "$Bq9q:q;(B") + (20 . "$Bqq?q@qAqB(B") + (22 . "$B6BqC(B")) + ("$B$7$m(B" + (5 . "$BGr(B") + (6 . "$BI4(B") + (7 . "$Bb%b&(B") + (8 . "$BE*(B") + (9 . "$Bb'3'9D(B") + (10 . "$Bb((B") + (11 . "$B;)b)(B") + (12 . "$Bb*b+(B") + (13 . "$Bb,(B") + (15 . "$Bb-(B")) + ("$B$7$s$K$e$&(B" + (5 . "$BmhJU9~(B") + (6 . "$BDT?W(B") + (7 . "$B1*KxC)6a7^JV(B") + (8 . "$Bmi=RE3Gw(B") + (9 . "$B2`mjmkmlmmFvmn5UAwB`DIF(LB(B") + (10 . "$Bmqmomrm~mp@BB$B.C`DLD~ESF)O"(B") + (11 . "$BmtmsGgmumvmwmx?`my0)n%0o=5?JBa(B") + (12 . "$Bm{m|m}1?2a6x?kC#CYF;JWM7MZ(B") + (13 . "$Bn!n"n#n$n&F[I/n'n(0c1s8/(B") + (14 . "$BmzALn*t#n)B=AxE,(B") + (15 . "$Bn+#RAR@(B") + (5 . "$BRCH>(B") + (6 . "$BRD(B") + (8 . "$B6(B4Bn(B") + (9 . "$BFnH\C1(B") + (12 . "$BGn(B")) + ("$B$9$G$N$D$/$j(B" + (4 . "$BZ\Z[(B") + (10 . "$B4{(B")) + ("$B$9$s(B" + (3 . "$B@#(B") + (6 . "$B;{(B") + (7 . "$B-(B") + (11 . "$BUsUr0S(B") + (12 . "$B?RB:(B") + (14 . "$BUt(B") + (15 . "$BF3(B")) + ("$B$;$$(B" + (14 . "$Bsn(B") + (17 . "$Bc7(B") + (21 . "$BlZ(B") + (23 . "$Bpm(B")) + ("$B$?$+$$(B" + (10 . "$B9b(B") + (23 . "$Bqt(B")) + ("$B$?$/$_(B" + (3 . "$B9)(B") + (5 . "$B5p9*:8(B") + (7 . "$BV`(B") + (10 . "$B:9(B")) + ("$B$?$1(B" + (6 . "$BC](B") + (8 . "$B<3(B") + (9 . "$B4Hcs(B") + (10 . "$B5hct>Pcucvd$(B") + (11 . "$Bcw?ZcxcyBhczE+Idc|3^:{c}c{(B") + (12 . "$BH&c~6Zd":vd#d%d&C^EyEzE{H5I.d8(B") + (13 . "$Bd!d'd(d)d*d.@ad-d+d,(B") + (14 . "$Bd=2U4Id/L'd0d1d2d3d4;;d5d6d7Gsd9JO(B") + (15 . "$Bd:d;H"d>@}H$d?JSdOcnpo(B") + (12 . "$Bco=WcpF8(B") + (13 . "$BC((B") + (14 . "$BcqC`b(B") + (12 . "$BaA>vHVaBaG(B") + (13 . "$BaCFmaD(B") + (15 . "$B5&(B") + (16 . "$BaJ(B") + (19 . "$BaEaF(B") + (22 . "$BaHaI(B")) + ("$B$@$$(B" + (3 . "$BBg(B") + (4 . "$BToB@E7IWTp(B") + (5 . "$B1{<:Tq(B") + (6 . "$B0PTr(B") + (7 . "$BTs(B") + (8 . "$B1b4qF`JtK[(B") + (9 . "$BTuTvTw7@AU(B") + (10 . "$BTxTyEe(B") + (12 . "$B1|TzT{(B") + (13 . "$BT|>)(B") + (14 . "$BT~T}C%(B") + (16 . "$BJ3(B")) + ("$B$A$$$5$$(B" + (3 . "$B>.(B") + (4 . "$B>/(B") + (5 . "$BUu(B") + (6 . "$B@m(B") + (8 . "$B>0(B") + (13 . "$BUv(B")) + ("$B$A$+$i(B" + (2 . "$BNO(B") + (5 . "$B2C8y(B") + (6 . "$BNt(B") + (7 . "$BR"9e=uR#EXNeO+(B") + (8 . "$BR%3/8zR$(B") + (9 . "$BR&D!Jg(B") + (13 . "$B4+@*R+R-R*(B") + (15 . "$B7.(B") + (16 . "$BR.(B") + (17 . "$BR/(B") + (20 . "$BR0(B")) + ("$B$A$A(B" + (4 . "$BIc(B") + (13 . "$BLl(B")) + ("$B$A$g$&(B" + (10 . "$Br.(B") + (29 . "$B]5(B")) + ("$B$A(B" + (6 . "$B7l(B") + (9 . "$BjI(B") + (10 . "$BjH(B") + (12 . "$B=0(B")) + ("$B$D$-(B" + (4 . "$B7n(B") + (6 . "$BM-(B") + (8 . "$BI~J~(B") + (9 . "$B[,(B") + (10 . "$B:sD?O/(B") + (11 . "$B[-K>(B") + (12 . "$B4|[.D+(B") + (18 . "$B[/(B") + (20 . "$B[0(B")) + ("$B$D$/$((B" + (2 . "$BQ\(B") + (3 . "$BK^(B") + (5 . "$B=hB|(B") + (6 . "$BQ^Fd(B") + (8 . "$BQ_(B") + (11 . "$BQ`(B") + (12 . "$B3.(B")) + ("$B$D$A(B" + (3 . "$BEZ(B") + (5 . "$B05T)(B") + (6 . "$B7=:_COT*T+(B") + (7 . "$BT,T-6Q9#:AT.T/:dK7(B") + (8 . "$BT0:%?bC3T3T4DZT56F(B") + (9 . "$BT23@T6T77?9$>kT9T:T;T8(B") + (10 . "$BTBT1TT=(B") + (11 . "$BTA0h4p:kKY<9>}BOF2G]IVTDTCG8(B") + (12 . "$BTE1aTF4.7x>lBDDMDiEHEcJsTHN]J=TN:ft!(B") + (13 . "$BTJ2tH9TMA::IE6EIEdJhTKTI1v(B") + (14 . "$BTG6-TO=NTP?PA}KO(B") + (15 . "$BTXTRDFJ/TSTQTW(B") + (16 . "$BTT2u:&>mCEJITY(B") + (17 . "$BTVTZT[9hT\(B") + (18 . "$BT^T](B") + (19 . "$BTUT`Tb(B") + (20 . "$BTaT_(B")) + ("$B$D$D$_$,$^$((B" + (2 . "$BR1(B") + (3 . "$B<[(B") + (4 . "$B8{L^FwLh(B") + (5 . "$BR2Jq(B") + (6 . "$BR3(B") + (9 . "$BR5(B") + (11 . "$BR7R6(B")) + ("$B$D$E$_(B" + (13 . "$B8](B") + (14 . "$Bsi(B") + (18 . "$Bsj(B")) + ("$B$D$N(B" + (7 . "$B3Q(B") + (12 . "$Bk8k9k:(B") + (13 . "$B2r?((B") + (15 . "$Bk;(B") + (18 . "$Bk<(B") + (20 . "$Bk=(B")) + ("$B$D$a(B" + (4 . "$BD^(B") + (8 . "$B`'`((B") + (9 . "$B`)(B") + (12 . "$B`*(B") + (17 . "$B<_(B")) + ("$B$F$D(B" + (3 . "$BV%(B") + (4 . "$BFV(B")) + ("$B$F$s(B" + (1 . "$BP&(B") + (3 . "$B4](B") + (4 . "$BC0(B") + (5 . "$B6Y4BrEjY5GDH4HcI^J1Y7Y8M^Y2@^Y0(B") + (8 . "$B>5Y;YDY62!Y92}3HY:5q5r94>7@[BsY>C4CjDqY@GRGoYBHdYCYEJzYFKuYGZ-(B") + (9 . "$BY9?dYY@\A8YZYgIA0.1gYaYb494xYdYeYfB7DsYhYiM,MHMIYc(B") + (13 . "$BYSEkYj7HYlYmYnYo@]A_B;YqYrYsHB:q(B") + (14 . "$BYkYt@"YvE&LNYw(B") + (15 . "$B7bYuK`;#@q;5F5E1YzG2GEY{IoKPY|Y}Yy3I(B") + (16 . "$BZ$Z!Y?Y~Z"Z#A`Z%MJZ'(B") + (17 . "$BZ&Z(5<;$Z+Z,E'Z.Z/(B") + (18 . "$BZ)Z2>qZ3Z4Z6Z1Z9(B") + (19 . "$BZ5(B") + (20 . "$BZ7(B") + (21 . "$BZ8Yp(B") + (22 . "$BZ:(B") + (23 . "$BZ;YxZ<(B") + (24 . "$BZ0(B")) + ("$B$H$&$,$^$((B" + (10 . "$Br((B") + (15 . "$Br)(B") + (16 . "$Br*(B") + (18 . "$Br+(B") + (20 . "$Br,(B") + (26 . "$Br-(B")) + ("$B$H$S$i$N$H(B" + (4 . "$B8M(B") + (7 . "$BLa(B") + (8 . "$BK<=j(B") + (9 . "$BY((B") + (10 . "$B@p(B") + (11 . "$Bn=(B") + (12 . "$BHb(B")) + ("$B$H$V(B" + (9 . "$BHt(B") + (21 . "$BfL(B")) + ("$B$H$^$9(B" + (4 . "$BEM(B") + (10 . "$BNA(B") + (11 . "$BZO(B") + (6 . "$BZ@Z?(B") + (7 . "$B2~96;ZZA(B") + (8 . "$BJ|(B") + (9 . "$B8N@/(B") + (10 . "$BZCIR(B") + (11 . "$B(B") + (16 . "$B1u3{rvrx<2ryrurrrs2)2*rt(B") + (17 . "$Brw9crzr{r|r}r~(B") + (18 . "$Bs!s"s$9t1-s%L9s#s&(B") + (19 . "$B7\s's(s)s+K2s,(B") + (20 . "$Bs-s.s/s*(B") + (21 . "$Bs1Das2s3s4s5s0s8s6s7(B") + (22 . "$Bs9s:(B") + (23 . "$Bs;OIs:m(B") + (24 . "$Bs?Bk(B") + (28 . "$Bs@(B") + (29 . "$BsA(B") + (30 . "$BsB(B")) + ("$B$J$+$l(B" + (4 . "$B]Y(B") + (5 . "$BJl(B") + (6 . "$BKh(B") + (8 . "$BFG(B") + (14 . "$B]Z(B")) + ("$B$J$,$$(B" + (8 . "$BD9(B")) + ("$B$J$Y$U$?(B" + (2 . "$BP5(B") + (3 . "$BK4(B") + (4 . "$BP6(B") + (6 . "$BKr0g8r(B") + (7 . "$B5|(B") + (8 . "$B5}5~(B") + (9 . "$BP7DbN<(B") + (10 . "$BP8(B") + (13 . "$BP9(B")) + ("$B$J$a$7$,$o(B" + (9 . "$Bpj(B") + (17 . "$B4Z(B") + (19 . "$Bpk(B")) + ("$B$K$*$$$3$&(B" + (9 . "$B9a(B") + (18 . "$BqF(B") + (20 . "$B3>(B")) + ("$B$K$/(B" + (6 . "$BFyH)O>(B") + (7 . "$B4Nfjfk>SI*fl(B") + (8 . "$Bfn0i9N8*8T:h9O;hHnKCfofm(B") + (9 . "$B0_0}8UfpfqfrB[C@fsftGXGYfufvK&fw(B") + (10 . "$B6;6f}(B") + (12 . "$Bf~9P?UD1g"g#g$g%g&OS(B") + (13 . "$Bg*g'g?g@g;gE(B") + (18 . "$BgAgB(B") + (19 . "$BB!gD(B") + (20 . "$BgCgF(B") + (22 . "$BgG(B") + (25 . "$BgH(B")) + ("$B$K$7(B" + (6 . "$Bk(@>(B") + (9 . "$BMW(B") + (12 . "$Bk)(B") + (18 . "$BJ$(B") + (19 . "$Bk*GF(B") + (25 . "$Bk+(B")) + ("$B$K$8$e$&$"$7(B" + (3 . "$BW0(B") + (4 . "$BF{(B") + (5 . "$BJ[(B") + (7 . "$BO.W1(B") + (10 . "$BW2(B") + (15 . "$BJ@(B")) + ("$B$K$9$$(B" + (2 . "$BQR(B") + (5 . "$BE_(B") + (6 . "$BQTQVQSQU(B") + (7 . "$B:cLjNdQW(B") + (8 . "$BQX(B") + (10 . "$BQY=Z@(C|E`QZ(B") + (11 . "$BN?(B") + (12 . "$BRE(B") + (15 . "$BQ[(B") + (16 . "$B6E(B")) + ("$B$K$A(B" + (4 . "$BF|(B") + (5 . "$BC65l(B") + (6 . "$B00;]=\Aa(B") + (7 . "$BZ](B") + (8 . "$B0W2"Z_:+:*>:>;@NZ`L@Za(B") + (9 . "$B971G:rZc=U><@'@1ZdKfZeZf[&(B") + (10 . "$BZg98Zh;~?8ZiZj;/(B") + (11 . "$BZl3"ZkZmZnZoZpZq(B") + (12 . "$B6G7J=k>=@2ZrCRHUIaZs(B") + (13 . "$BZuZx0EZt2KZvZwCH(B") + (14 . "$BD*JkZyNq(B") + (15 . "$B;CK=(B") + (16 . "$BZ|ZzZ{Z}F^[!Z~["(B") + (17 . "$B[#(B") + (18 . "$B=l[$MK(B") + (19 . "$B[%Gx(B") + (20 . "$B['(B") + (21 . "$B[((B")) + ("$B$K$i(B" + (9 . "$Bpl(B") + (13 . "$BG#(B") + (19 . "$Bpn(B")) + ("$B$K(B" + (2 . "$BFs(B") + (3 . "$BP2(B") + (4 . "$B1>8^8_0f(B") + (6 . "$BOJOK(B") + (7 . "$B0!:3(B") + (8 . "$BP3(B") + (9 . "$BP4(B")) + ("$B$M$:$_(B" + (8 . "$Bsk(B") + (13 . "$BAM(B") + (18 . "$Bsl(B")) + ("$B$N$.(B" + (5 . "$B2S(B") + (7 . "$B;d=(FE(B") + (8 . "$Bc=(B") + (9 . "$B2J=)c>IC(B") + (10 . "$BHkc?c@>NGi?AAECacBcA(B") + (11 . "$B0\(B") + (12 . "$BcC5)@GcDDx(B") + (13 . "$BL-CUcGI#NGcHcEcF(B") + (14 . "$BcJ9rwcQ(B") + (19 . "$BcS(B") + (21 . "$BcT(B") + (22 . "$BcU(B")) + ("$B$N$4$a(B" + (7 . "$BHP(B") + (8 . "$B:S(B") + (11 . "$Bh(B") + (10 . "$BP+(B")) + ("$B$O$3$,$^$((B" + (2 . "$BR9(B") + (6 . "$B6)>"(B") + (7 . "$BR:(B") + (10 . "$BH[(B") + (13 . "$BR;(B") + (14 . "$BR<(B") + (15 . "$BR=(B")) + ("$B$O$7$k(B" + (5 . "$Bla(B") + (7 . "$BAv(B") + (9 . "$BIk(B") + (10 . "$B5/lb(B") + (12 . "$B1[D6lc(B") + (14 . "$Bld(B") + (15 . "$BoD"(B") + (12 . "$BVjVkVlI}K9Vs(B") + (13 . "$BKZKkVm(B") + (14 . "$BVnVo(B") + (15 . "$BVpVqH(J>Vr(B")) + ("$B$O(B" + (15 . "$Bso(B") + (17 . "$BspNp(B") + (20 . "$Bsqsrssst(B") + (21 . "$Bsusv(B") + (22 . "$Bsxsw(B") + (24 . "$Bsyszs{(B")) + ("$B$R$-(B" + (5 . "$BI%(B") + (11 . "$BAA(B") + (12 . "$BAB(B") + (14 . "$B5?(B")) + ("$B$R$D$8(B" + (6 . "$BMS(B") + (8 . "$Bf5(B") + (9 . "$BH~(B") + (10 . "$Bf6(B") + (11 . "$Bf7f8f9(B") + (13 . "$B5A72f:A"(B") + (15 . "$Bf;f>(B") + (16 . "$Bf<(B") + (19 . "$Bf=f?f@(B") + (20 . "$BfA(B")) + ("$B$R$H$"$7(B" + (2 . "$BQ9(B") + (3 . "$BQ:(B") + (4 . "$B0t85(B") + (5 . "$B7;(B") + (6 . "$B6$8w=<@hC{(B") + (7 . "$B9n;yQ(B")) + ("$B$R$H(B" + (2 . "$B?M(B") + (4 . "$B2p5X:#=:P;?NPP:(B") + (5 . "$B0J;E;FP?P@PA@gPBB>BeIUNa(B") + (6 . "$B0K2>2qPC4k4l5Y6D7o8`PDCgEAG$H2IzPg(B") + (7 . "$BPG0LPE2?2@PFPH:4:n;G;w=;?-PIC"PJBNDcDQGlHNbU$(B") + (8 . "$B0M2A2B4&PK6!8s;HPL;xPMPNPOPPPQInJ;PRPSPTNcPU6"PVKy(B") + (9 . "$B2d78PW8tPX=SPY?.?/B%B/PZJXP[J]P\P]P^N7P_P`Ks(B") + (10 . "$BPaOA26Pb6fPcPd7p7q8D8u8vPePf(B") + (12 . "$B:GA=BX(B") + (13 . "$BPr(B")) + ("$B$R(B" + (4 . "$B2P(B") + (6 . "$B3%Et(B") + (7 . "$B5d:R<^(B") + (8 . "$B1j_U?f_VO'(B") + (9 . "$B_W_Y_ZC:_[_\0YE@_q(B") + (10 . "$B1(__Nu_`_^_](B") + (11 . "$B_X_aK#_b(B") + (12 . "$B1k_cF>GA3L5J2_d(B") + (13 . "$B1l_e_f_h_i_j>H@y_kGa_lN{HQ(B") + (14 . "$B_g_m@z_o7'_pMP(B") + (15 . "$B_r=OG.(B") + (16 . "$BEu_v1m_t_u_wG3_x_yNU_s(B") + (17 . "$BRYS[_z_{;8?$_|Ag_}(B") + (18 . "$B_n_~`!`"(B") + (19 . "$BGz`#(B") + (20 . "$B`$(B") + (21 . "$B`%(B") + (29 . "$B`&(B")) + ("$B$U$$$K$g$&(B" + (3 . "$BTj(B") + (10 . "$B2F(B") + (14 . "$BTk(B")) + ("$B$U$7$E$/$j(B" + (2 . "$BRG(B") + (5 . "$BRH1,RI(B") + (6 . "$B0u4m(B") + (7 . "$B5QB(Mq(B") + (8 . "$BRK(B") + (9 . "$BRJ27(B") + (10 . "$B6*(B")) + ("$B$U$D(B" + (12 . "$Bsc(B") + (17 . "$Bsd(B") + (19 . "$Bse(B")) + ("$B$U$G$E$/$j(B" + (6 . "$Bff(B") + (11 . "$B=M(B") + (13 . "$Bfifgfh(B") + (14 . "$BH%(B")) + ("$B$U$M(B" + (6 . "$B=.(B") + (10 . "$B9RHLgVgUgd(B") + (11 . "$BBIgW8?A%gXGu(B") + (13 . "$BDzgY(B") + (16 . "$BgZg[(B") + (17 . "$Bg]g\(B") + (18 . "$Bg^(B") + (19 . "$Bg`g_(B") + (20 . "$Bga(B") + (21 . "$B4Ogb(B") + (22 . "$Bgc(B")) + ("$B$U$f$,$7$i(B" + (3 . "$BTi(B") + (9 . "$BJQ(B")) + ("$B$U$k$H$j(B" + (8 . "$Bp2(B") + (10 . "$B@IH;(B") + (11 . "$B?}Ue(B") + (12 . "$B4g8[=8M:(B") + (13 . "$B2m;sp3p4p5p6(B") + (14 . "$B;((B") + (16 . "$Bp:(B") + (17 . "$Bj-(B") + (18 . "$BRVp8?wFq(B") + (19 . "$BN%(B")) + ("$B$V$s(B" + (4 . "$BJ8(B") + (7 . "$BU](B") + (8 . "$B@F(B") + (11 . "$B:X(B") + (12 . "$BHCHeIL(B")) + ("$B$Y$s(B" + (13 . "$Bsf(B") + (24 . "$Bsg(B") + (25 . "$Bsh(B")) + ("$B$[$&(B" + (4 . "$BJ}(B") + (8 . "$B1w(B") + (9 . "$B;\(B") + (10 . "$BZSZTZUZVN9(B") + (11 . "$BZWB2@{(B") + (12 . "$BZX(B") + (14 . "$B4z(B") + (16 . "$BZZ(B") + (18 . "$BZY(B")) + ("$B$[$9(B" + (3 . "$B43(B") + (5 . "$BJ?(B") + (6 . "$BVtG/Vu(B") + (8 . "$B9,(B") + (13 . "$B44(B")) + ("$B$[$H$.(B" + (6 . "$B4L(B") + (9 . "$Be}(B") + (10 . "$Be~(B") + (17 . "$Bf!(B") + (20 . "$Bf"(B") + (21 . "$Bf#(B") + (22 . "$Bf$(B") + (24 . "$Bf%(B")) + ("$B$[$M(B" + (10 . "$B9|(B") + (13 . "$Bql(B") + (14 . "$Bqm(B") + (16 . "$B31(B") + (7 . "$B=x>2H_(B") + (8 . "$B9.DlE9I\Jy(B") + (9 . "$BEYVy(B") + (10 . "$B8K:BDm(B") + (11 . "$B0C9/MG=n(B") + (12 . "$BVzV{GQO-(B") + (13 . "$BV|Nw(B") + (14 . "$B3GV~V}W!(B") + (15 . "$BW"W&W#>3W$W%I@W'(B") + (16 . "$BW(W)(B") + (19 . "$BW*(B") + (20 . "$BW-(B") + (21 . "$BW+(B") + (25 . "$BW,(B")) + ("$B$^$a(B" + (7 . "$BF&(B") + (10 . "$Bl1(B") + (13 . "$BK-(B") + (15 . "$Bl2l3(B") + (18 . "$Bl4(B")) + ("$B$_$:$+$i(B" + (6 . "$B<+(B") + (9 . "$B=-(B")) + ("$B$_$:(B" + (4 . "$B?e(B") + (5 . "$B1JI9=ADuHE(B") + (6 . "$B1x4@9>]hFr<.CSHF]i(B") + (7 . "$B5a]g]j5%]k5b7h]l:;]m]nBABt2-D@FY]o]p]q]r]tKW]sM`(B") + (8 . "$B7#1K]u1h]v]w2O5c67]x]y]z]|>B]}<#CmE%]~GHGq^"Hg^#J(K!K"^$KwL}^!^%]{(B") + (9 . "$B@t^&1L3$3h^(^)9?^*^+^,='^-MN>tDE^/@u@v@wF6GIMl^0^.(B") + (10 . "$BBY^3^1^29@^4>C^5?;^6^7^8^:IMIb1:Ma3=N.N^O2M0EsFB(B") + (11 . "$B^F^I0|1UJ%^<^=^;363i^>^?7L^A^B:.^C=B=J=_>D^D?<@6:Q^G^H^JC8E:(B\ +$BMdEq^KNC^MNT^N^E^L^@(B") + (12 . "$B^Y=m0/^O^P2912^R5t8:8P9A^U^V<"<>>E^W^XL+B,C9^Z^[EOEr^]^^^_K~(B\ +$B^a^bM/OQ^Q^\^T^S^cH.(B") + (13 . "$B^d0n3j4A8;9B^e^f^g^h=`^i^j^k^lBZE.^mGy^p^q^rLGMON/Bl^o(B") + (14 . "$B^`^|1i^t^v^w^xDRoi(B") + (18 . "$B_G_C_D_E_FMt_H_I(B") + (19 . "$BFTBm_+_J_KCuIN@%_M_N(B") + (20 . "$B_O_P_Q_R(B") + (21 . "$B^u(B") + (22 . "$B_SFg(B") + (25 . "$B_T(B")) + ("$B$_$_(B" + (6 . "$B<*(B") + (9 . "$BLmfW(B") + (10 . "$BfVC?(B") + (11 . "$BfXfY(B") + (12 . "$BfZ(B") + (13 . "$B@;f[(B") + (14 . "$Bf]f\AoJ9f^(B") + (15 . "$Bf_(B") + (17 . "$Bfbf`faD0N~(B") + (18 . "$Bfc?&(B") + (20 . "$Bfd(B") + (22 . "$BfeO8(B")) + ("$B$_$k(B" + (7 . "$B8+(B") + (11 . "$B5,;kk,(B") + (12 . "$B3PGAk-(B") + (14 . "$Bk.(B") + (16 . "$Bk/?Fk0(B") + (17 . "$Bk1k2Mw(B") + (18 . "$B4Qk3(B") + (20 . "$Bk4(B") + (21 . "$Bk5(B") + (22 . "$Bk6(B") + (25 . "$Bk7(B")) + ("$B$_(B" + (7 . "$B?H(B") + (10 . "$Bm;(B") + (11 . "$B6m(B") + (12 . "$Bm<(B") + (13 . "$Bm>(B") + (16 . "$Bm?(B") + (19 . "$Bm@(B") + (20 . "$Bm=(B") + (24 . "$BmA(B")) + ("$B$`$.(B" + (7 . "$BG~(B") + (11 . "$BsNsP(B") + (15 . "$BsOsQ(B") + (16 . "$BsR(B") + (19 . "$B9m(B") + (20 . "$BLM(B")) + ("$B$`$7(B" + (6 . "$BCn(B") + (8 . "$BiM(B") + (9 . "$BFz0:(B") + (10 . "$BiNiPGB;=2ciSiOiQiR(B") + (11 . "$BiT7ViWj?j@(B") + (21 . "$BjAiZjB(B") + (23 . "$BjCjF(B") + (24 . "$BjDjE(B") + (25 . "$BjG(B")) + ("$B$`$8$J(B" + (7 . "$Bl8(B") + (10 . "$Bl9I?(B") + (11 . "$BlA(B") + (12 . "$Bl:(B") + (13 . "$Bl;lKF(B") + (15 . "$Bl?(B") + (17 . "$Bl@(B") + (18 . "$BlB(B")) + ("$B$`$N$[$3(B" + (5 . "$BL7(B") + (9 . "$Bbb(B")) + ("$B$`$i(B" + (7 . "$BM8n7FaK.(B") + (8 . "$Bn8n9n:E!(B") + (11 . "$B3T6?ETItM9(B") + (12 . "$Bn?(B") + (13 . "$Bn@(B") + (14 . "$BnA(B") + (15 . "$BE"nBnC(B")) + ("$B$`(B" + (2 . "$BRS(B") + (5 . "$B5n(B") + (8 . "$B;2(B") + (11 . "$BRT(B")) + ("$B$a$a(B" + (4 . "$B`+(B") + (9 . "$B`,(B") + (11 . "$BAV(B") + (14 . "$B<$(B")) + ("$B$a$s(B" + (9 . "$BLL(B") + (14 . "$BpR(B") + (16 . "$BpS(B") + (23 . "$BpT(B")) + ("$B$a(B" + (5 . "$BL\(B") + (8 . "$BD>LU(B") + (9 . "$B4Gb==bAj>Jb>H}b?b@8)(B") + (10 . "$BbA??bCbDbEbFL2bB(B") + (11 . "$B4cbGD/bH(B") + (12 . "$BCebI(B") + (13 . "$BbJbKbL?gbMFDbNKS(B") + (14 . "$BbObPbQ(B") + (15 . "$BbRbSbT(B") + (16 . "$BbUbV(B") + (17 . "$BbWF7JMNFbXbY(B") + (18 . "$BbZb[b\=Vb](B") + (19 . "$Bb^(B") + (20 . "$Bb_(B") + (24 . "$Bb`(B") + (26 . "$Bba(B")) + ("$B$b$A$$$k(B" + (5 . "$BMQ(B") + (7 . "$BJca5(B")) + ("$B$b$s(B" + (8 . "$BLg(B") + (9 . "$BoY(B") + (10 . "$BA.(B") + (11 . "$BJDoZo[(B") + (12 . "$B3+4V4W1I?>aUaVHhIBaW(B") + (11 . "$BaX:/<&aYaZ(B") + (12 . "$Ba[a\DKEwa]N!(B") + (13 . "$Ba^a_a`aaabCTadaeac(B") + (14 . "$Bafagah(B") + (15 . "$BaiajakalAiaman(B") + (16 . "$Baoapaq(B") + (17 . "$Bar4basNEat(B") + (18 . "$BauJJL~av(B") + (19 . "$Baw(B") + (20 . "$Bax(B") + (21 . "$Bayaza{a|(B") + (22 . "$Ba}(B") + (23 . "$Ba~(B") + (24 . "$Bb!(B")) + ("$B$d$^(B" + (3 . "$B;3(B") + (4 . "$BV&(B") + (5 . "$BV'(B") + (6 . "$BV((B") + (7 . "$B4tV)V*V,V+(B") + (8 . "$B3Y4_2,L(V-A;BRV1V.V3V2V0V/4d(B") + (9 . "$B6.V5F=V4(B") + (10 . "$BV72eV6=TV9EgJvJwV;V8(B") + (11 . "$BV>V<33V=:jV@VAVBVC?rVDJxVGVFVE(B") + (12 . "$BVKV?VHVJMrVI?s(B") + (13 . "$BVL:7VMVN(B") + (14 . "$BV:EhVOVPVQ(B") + (15 . "$BVWVRVS(B") + (16 . "$BVUVT(B") + (17 . "$BVVVXVYNf(B") + (20 . "$B4`VZ(B") + (21 . "$BV[(B") + (22 . "$BV\V](B") + (23 . "$BV^(B")) + ("$B$d(B" + (5 . "$BLp(B") + (7 . "$Bbc(B") + (9 . "$BGj(B") + (10 . "$B6k(B") + (12 . "$BC;(B") + (13 . "$Bbd(B") + (17 . "$B6:(B")) + ("$B$f$&$Y(B" + (3 . "$BM<(B") + (5 . "$B30(B") + (6 . "$B=HB?Tl(B") + (8 . "$BLk(B") + (11 . "$BTm(B") + (13 . "$BL4(B") + (14 . "$BTn(B")) + ("$B$f$_(B" + (3 . "$B5](B") + (4 . "$B0zD$W7(B") + (5 . "$B90J&(B") + (6 . "$BCP(B") + (7 . "$BDo(B") + (8 . "$B89W8Lo(B") + (9 . "$B8LW9W?(B") + (10 . "$B(B")) + ("$B$i$$$9$-(B" + (6 . "$BfP(B") + (10 . "$BfQ9LfRLW(B") + (11 . "$BfS(B") + (13 . "$BfT(B") + (16 . "$BfU(B")) + ("$B$j$e$&(B" + (16 . "$BN6(B") + (22 . "$Bs|(B")) + ("$B$k$^$?(B" + (4 . "$B]U(B") + (8 . "$B2%(B") + (9 . "$BCJ(B") + (10 . "$B]V;&(B") + (11 . "$B3L(B") + (12 . "$B]W(B") + (13 . "$BTLEB(B") + (15 . "$B]X5#(B")) + ("$B$l$$$E$/$j(B" + (8 . "$Bp0(B") + (16 . "$BNl(B") + (17 . "$Bp1(B")) + ("$B$m(B" + (11 . "$BsC(B") + (20 . "$BsD(B") + (24 . "$BsE84(B")) + ("$B$o$+$s$`$j(B" + (2 . "$BQL(B") + (4 . "$B>i(B") + (5 . "$B==KNRGRLRSKt(B" ; 2 + "$B2<;0>e>fK|M?P$4]5W8pLiP2K4Q:K^?OQc<[@i:58}SxEZ;NTiTjM.UwUyV%;3V_@n9)Va8JL&6R43VvVxW.W0W55]W@WDWF:M(B" ; 3 + "$BP"1/ITCfC0G7M=1>8^8_0fP62p5X:#=:P;?NPP:0t85QB8xO;Fb1_(B\ +$B>i6'4"@ZJ,8{L^FwLh2=6hI$8a>#RAR@RFLq5ZAPH?M'?QToB@E7IWTp9&>/(B\ +$BL`Uz<\FVV&GC88F{P!0zD$W7?4Xy8MJ8EM6TJ}Z\Z[F|[)7nLZ(B\ +$B7g;_]F]U]YHfLS;a]c?e2PD^Ic`+`-JR2g5m8$2&(B" ; 4 + "$B5V3n@$RBP#J:P%BeIUNa7;:}QFQGQE@jRH1,RI5n<}3pC!2D6g8E9f;J;KB~(B\ +$B<8>$BfRZR[1&R]R\<|;M05T)301{<:TqE[UTU`Uu?,FtV'5p9*:8AY;TI[J?(B\ +$BMD9-D#>1J[P190J&I,XzJjBGJ'@MC65l;%[2K\KvL$@5:!JlL11JI9=ADuHE(B\ +$BHH8<6L4$4E@8MQ9C?=EDM3I%b"GrHi;.L\L7Lp@P<(Ni2S7jN)lamhJU9~(B" ; 5 + "$B>gN>AhOJOKKr0g8r0K2>2qPC4k4l5Y6D7o8`PDCgEAG$H2IzPg6$8w=<@hC{(B\ +$BA46&:FQTQVQSQUQ^Fd7:QfNsQeNtR36)>"RD0u4m5H5I6+R^8~9!9gD_EG1%(B\ +$BF1L>My3F0x2sCD7=:_COT*T+AT=HB?Tl0PTrG!U!9%U"H^LQ;zB80B1']hFr<.CSHF]i3%Et(B\ +$BLFL6`<1;I4C]JF;e4Lf&MS1)9MO7<)fP<*ffFyH)O><+;j11@eA$=.:1?'gg(B\ +$Bgh0riHCn7l9T0ak(@>DT?Wot(B" ; 6 + "$B6ziIMpP/0!:35|PG0LPE2?2@PFPH:4:n;G;w=;?-PIC"PJBNDcDQGlH(B\ +$BNbU$9n;yQ2H_DnO.W1Do7ALrWG1~4w;VG&K:(B\ +$B2wWWWXWYWZX-2f2|LaY/5;Y193Y3>6Y4BrEjY5GDH4HcI^J1Y7Y8M^Y2@^Y0(B\ +$B2~96;ZZAU]Z][*99Mh[80I[9:`?y>r>sB+Bu68`=`>`?(B\ +$B`;6ja#Jca5R4CKD.a6aKb%b&bcSI*fl?CNI(B\ +$Bgigj2V7]*@+09U'EJU(Ke3XUWLR(B\ +$B8I5(0841590FOU|5o6~3Y4_2,L(V-A;BRV1V.V3V2V0V/4d(B\ +$BD!VdVeVfVg9,9.DlE9I\Jy1dW/89W8LoWJ1}WH7B@,WIH`9zCiW[G0W]WaW^(B\ +$B2x61W`@-WeWfI]WgWhWiNgWjWb0?X}K<=j>5Y;YDY62!Y92}3HY:5q5r94>7(B\ +$B@[BsY>C4CjDqY@GRGoYBHdYCYEJzYFKuYGZ-J|@FI`1w0W2"Z_:+:*>:>;@N(B\ +$BZ`L@ZaI~J~Z^Zb[>2L9:;^5O>>[@?u@O[AKmElGUHDHz[B[C[DKgNS[FOH[?[G(B\ +$B[EGG2$6UIpJb]G]H2%FG][]b]d7#1K]u1h]v]w2O5c67]x]y]z]|>B]}<#Cm(B\ +$BE%]~GHGq^"Hg^#J(K!K"^$KwL}^!^%]{1j_U?f_VO'`'`(`.HGKRJ*8Q`@6i(B\ +$BA@9}`A4aa$2ha7aLaME*b3D>LUbec+775';cc=cV6uFMch<3dbf(f5hP4P7DbN<2d78PW8tPX=SPY?.?/B%B/PZJXP[J]P\P]P^N7P_P`KsQAQIKA(B\ +$B4'QbQlQmQn:oA0B'DfQoR&DS{S|T23@T6T77?9$>kT9T:T;T8(B\ +$BJQTuTvTw7@AUU,0#0RU)0y4/U*;QLE18U-0(UX5RUa<<@kM(@lIu20;SU}V"(B\ +$BCk6.V5F=V44,9+?cDkM)EYVy2v7zG68LW9W?WAI'8eWLWNBTN'WK1e5^;WWc(B\ +$BBUE\WdWpW_2y2zWmWo91Wq3fWr:(WtWuWvWwWxY(Y<@'@1ZdKfZeZf[&[+[,[V1I(B\ +$B2M[H[I4;[K[L[M[N8O::Jb>H}b?b@8)bbGj8&:=:Ubfbg5@=K?@ADM4c;c<2J=)c>ICcW@`@|Tt(B\ +$Bcjci4Hcs6N7)Lbd~5*5i5j9He!Lse}f)H~BQLmfW0_0}8UfpfqfrB[C@fsft(B\ +$BGXGYfufvK&fw=-gLgM2W2XgpgqFQgrgsB]Cwgtgwgxgygz3}g{g|Njg~gogu(B\ +$B9S0+ApAqCc5TFz0:jI^'6^jRjSCojUjVMW7WD{k>IiIk50732`mjmkmlmmFv(B\ +$Bmn5UAwB`DIF(LB0j9YO:=6nD=EoY8Boyo{ozLL3Wpjpl2;JGIwHt?)%?0E/Eb14S.KiS/S(0"S}J`TBT1TT=(B\ +$B2FTxTyEeU3U.I1U/8dU0L,UbMFUq-V!6}E8(B\ +$BU~V72eV6=TV9EgJvJwV;V8:9;U@JBS5"8K:BDmW2=yELWkWl286263(B\ +$B7CWs=zB)CQWyNxWnX&1YWzW{8gW}W~X!X"DpG:X#X%X'X$@pY=5sYM7}YRYQ(B\ +$B0'YP:C?6DrA\A^B*YT;+HTJaD=ZCIRNAZSZTZUZVN94{Zg98Zh;~?8ZiZj;/(B\ +$B=q:sD?O/3|0F:y3J3K4<[Y5K[Z[[7K[\9;7e[^:,:O;7[_3t@r@s7,Em6MG_(B\ +$B7*[a[][b@4I0[c;DC^5?;^6^7^8^:IMIb1:(B\ +$BMa3=N.N^O2M0EsFB1(__Nu_`_^_]FC`E`FC,O5Gb7>`bI?>aUaVHhIBaWb(b.1Wb4bA??bCbDbEbFL2bB(B\ +$B6k:VEVbi5NGKK$EW9\c,c-c.c/c0c1G*>MHkc?c@>NGi?AAECacBcAcXclck(B\ +$BcmN55hct>Pcucvd$dc?hJ4L0dde"9I<`jQtQrI{(B\ +$B4*F0R(L3pUR7R6:|R?RNRTS17&>'S5BCS6BoS7S8S9LdM#S:S0S3S;S2(B\ +$BT"S~T!TA0h4p:kKY<9>}BOF2G]IVTDTCG8D[TmU4U6:'U7U8>+GLU9IXO,U:(B\ +$BU5UYUcFR4sV<33V=:jV@VAVBVC?rVDJxVGVFVEAcVhVi(B\ +$B>oD"0C9/MG=n6/D%W:WB:LD&I7IKWRWOWPF@WQ0-45<=M*0TX)X+9{;4>pX,(B\ +$BX.@KX/X0EiFWX1W|X~@LlCn=YU1f3]YV5E?xYW7!7G7~95:N9?dYY@\(B\ +$BA[-K>[e[jKq[`3#[d[f8h9<[g:-[h04[i>?(B\ +$B[kDt[l233a[o[pM|[qNB[r[u[tEn[n]7]8M_]K3L]\]]^F^I0|1UJ%^<^=^;(B\ +$B363i^>^?7L^A^B:.^C=B=J=_>D^D?<@6:Q^G^H^JC8E:MdEq^KNC^MNT^N^E(B\ +$B^L^@_X_aK#_bAV`38#`5`G`H`I`J`K`LCvLTNDN(5e8=M}`f`ia!a*ISa)E<(B\ +$B;:0[7Ma?I-N,a@a>AAaX:/<&aYaZ;)b)Epb6@9b54cbGD/bHbk:WIOcnpocw?ZcxcyBhczE+Idc|3^:{c}c{AFG4GtN37Pe%8>:0:Ye';g(B\ +$B=*>R?Be(AHe)D]e*e+N_e&8Sf7f8f9=,MbfDfSfXfY=Mf|5Sfzf{C&G>f}gN(B\ +$BBIgW8?A%gXGuh.h3h7h/h04Ph1h2h5h;2.h8G|gvhh6h4hOh9h:2[5F6](B\ +$B:ZCxJnK(Q]5uiT7ViWX5,;kk,@_kBkC5v7m>YkDK,Lul.FZlA2_4S@UlEHNIOlIlDlelflg6mmCE>(B\ +$BFpmDmtmsGgmumvmwmx?`my0)n%0o=5?JBa3T6?ETItM9?lnEnF!JgGnRPRO19?_3e1DSlBDDMDi(B\ +$BEHEcJsTHN]J=TN:ft!TeTdTf1|TzT{I2L;G^U;V#4(6wUfUgIY?RB:="B0EK(B\ +$B8YZYgIA0.1gYaYb494x(B\ +$BYdYeYfB7DsYhYiM,MHMIYc4:7I;6ZHFXZIHCHeIL;[ZX6G7J=k>=@2ZrCRHU(B\ +$BIaZs:GA=BX4|[.D+\&\"0X[v4=4}[w[y8![~\#\%?"?9@3\'DG\(Eo\*\+C*(B\ +$BK@LIL:OP\/?z3q\2\![|\,[x[}[s\1\.\0\)\-[{[z]:4>5=6V;u]L?#]M]W(B\ +$B]^]_^Y=m0/^O^P2912^R5t8:8P9A^U^V<"<>>E^W^XL+B,C9^Z^[EOEr^]^^(B\ +$B^_K~^a^bM/OQ^Q^\^T^S^cH.1k_cF>GA3L5J2_d`*GW`0:T`6`4G-`M`O(B\ +$BM1`P`NBv6W`hH|`kNV`jGJ1ya4aA>vHVaBaGABa[a\DKEwa]N!b$EPb*b+b/(B\ +$B]9CebIC;8'9E>KN2H#bmO=cC5)@GcDDxcYc[c\co=WcpF8H&c~6Zd":vd#d%(B\ +$Bd&C^EyEzE{H5I.d8dedg4!>Q0@didjdfdhe/3(5k7k0<9Je,e-e.e0e1@dE}(B\ +$Be3Mme2fEfFfOfZf~9P?UD1g"g#g$g%g&OSP0=XhHh?0`?{hA8VhBhC>ThDhE(B\ +$BhFhGhIEQhJhKhLhNMiI)hRF:h@hMh_0*GkArMUMn3?i\i]i^i_i`H:IHiaHZ(B\ +$Bib=039:[AuNvjeJdM5N#k)3PGAk-k8k9k:1SkEkF:>;l>Z>[?GAJkGBBkHCp(B\ +$BkII>kJ>]l:lF2l5.lGLcB_CyE=lHGcHqlJKGlLl_1[D6lclh5wliljlklllm(B\ +$Bm)U<2G7yU=<;U>U?(B\ +$BU@ULUZ42?2UvVL:7VMVNKZKkVm44V|NwW;WCHyWTX(0&0U466rX4;|L|X234XCXAXD?5XFXHXKXIXxY"@oYSEkYj7HYlYmYnYo@]A_B;YqYrYs(B\ +$BHB:q?tZP?7ZuZx0EZt2KZvZwCHPrG`\$\3\43Z4~6H6K\6\7Fj=]\8A?\:DX(B\ +$B\;\=FoIv\?\@ML\BO0FN\>\5\D\<\9\CBJ\A]<]=:PTLEB^d0n3j4A8;9B^e(B\ +$B^f^g^h=`^i^j^k^lBZE.^mGy^p^q^rLGMON/Bl^o1l_e_f_h_i_j>H@y_kGa(B\ +$B_lN{HQLlD-8%M21n`Q;b1M`l8j`n?p`p`q`v`m`oa3aCFmaDa^a_a`aaabCT(B\ +$Badaeacb,b7LAbJbKbL?gbMFDbNKSbdbpORbl37:l8k10Dvbobqbnc26Xc3cI(B\ +$B2RA5DwJ!6YL-CUcGI#NGcHcEcF7"C(d!d'd(d)d*d.@ad-d+d,dkdldmdne4(B\ +$B7Q8(e6e7B3e8e9e5f,7S:a=pCVf-f.5A72f:A"fT@;f[fifgfhg*g'xC_MViK6sN:ic2kidieB}ifigihiiijK*ilimikjKjfjcjdN":@jh(B\ +$B?~jijkMgjljm2r?(kK3:kL5M7X8XkM;m;nkN>\@?OMkOkPM@kQOCA'K-l6l;(B\ +$Bl3S:\mHmImJmRmdG@n!n"(B\ +$Bn#n$n&F[I/n'n(0c1s8/n@=7nIMonh1tninjnk8Z9[nlnm>`E4noH-npNknq(B\ +$Bnvo^o`o_p'p(p)3V2m;sp3p4p5p6EEp;MkNmLw7$pXG#pq4hprpsF\HRMBR,(B\ +$B0{];q,q+>~;tK0FkCZqlqvroH7rjrlsFsfE$8]AM(B" ; 13 + "$BQ&Q%6#Q'Q(Q)A|Q*KMN=Q>QP3DR<1^RQRRSR2ESSST>(SUSVSXSWT%T&TG6-(B\ +$BTO=NTP?PA}KOThTkTnT~T}C%UCUAUBCdUDUEU[UiUj2IUh;!G+UkUl\MUtAX(B\ +$BV:EhVOVPVQVnVo3GV~V}W!>4D'FAX@XBXEXGBVJiXJXN47XLXMXPXRXTXVXX(B\ +$BK}XYXSXUY#YkYt@"YvE&LNYwZJ064zD*JkZyNq\FO11]\G359=\I\J\K\L\N(B\ +$BMM?:\cAdDHKjt"\P\Q\R\TLO\V\W\X:g\U\E\H\S\O\Y2N]>Nr]N]Z^`^|1i(B\ +$B^t^v^w^xDRe?eBDVeCHlLJLV0=NPeEeFN}eGe@(B\ +$BenH3?ifGf]f\AoJ9f^H%Ieg,g-9QB\g.g/Klg0gIgJgPhZhc38hehfhgL,IG(B\ +$Bhi<,hj=/hlhmhnAsho3wLXhhhphkDUB"ioipiqirCXisitL*inO9jg@=jj3l(B\ +$BjnJ#jojpj|k.kRkSkT8l8mkU;okVkW@@@bFIG'kXM69kl>KFFx3RldlslrMY(B\ +$BltlumKmLmNJememzALn*t#n)B=AxE,nAnJ9Z9s;@nKnnnr6dns=FA,A-ntnu(B\ +$BFc;(<{@EpRpYpZ3sp\p]p[pp?|NN7[q%q&(B\ +$B0;1X6nBLG}qIqmH1qwqx3!:2FPK1LDVwsiI!sn(B" ; 14 + "$BQ+Q-2/57Q,Q.Q/JHQ[Qx7`Q|N-7.R=SY4oSZ13S\>|S]A91=S^S_J.3z2^TX(B\ +$BTRDFJ/TSTQTWUFUG4rUHUIUm?3N@F3MzVWVRVSVpVqH(J>VrW"W&W#>3W$W%(B\ +$BI@W'J@W<1FE00V7D7EXOXQXWM+M]N8X\A~X]X^X_F4XbXcJ0Ny5:Y$7bYuK`(B\ +$B;#@q;5F5E1YzG2GEY{IoKPY|Y}Yy3IZKE(I_;CK=\d\Z\[\l\k2#DP\\\]8"(B\ +$B\`\a>@\bAeCtHu\hI8\i3_\g\e\_\f\n\x]?4?C7]O]X5#^n^s^y_'_(_1DY(B\ +$B4B_$7i_%_&=a_)3c@x_*_,@!_-D,_._/_0_3_L_r=OG.`R`U`r`w`xM~5&ai(B\ +$BajakalAiamanb-b24FHWbRbSbTbwbv3Nbxbybzb{HXb|b}c5cK2T7N9FcLcM(B\ +$BJfcN5gMRc_d:d;H"d>@}H$d?JSd4efHfIf_g6g1I(g4Ifg2g3J^gTIqhyhQ0~16(B\ +$Bhqhsht>UhuhvhwhxL"JNK)WK+jrjsjtjuk;1Z2]5C?[kY=tC/@AkZBzCBCLD4k[HpNJO@k\k]l2(B\ +$Bl3l?;?;r>^lMNnpQ(B\ +$Bp^0Hp_p`pupvq-1Bq.M\L_2n6o2o6pqJqKqLqMCsqNq|qyq{I&qzq}r)r0r1(B\ +$BL%O%r7rnrmrprqF>sOsQ]`sUL[so(B" ; 15 + "$BmCEJITYJ3>n(B\ +$BUJU\UnVUVTW(W)60W4WUXZX[7F7{X`XaXdXe212{Xh48XjXkXnY%Z$Z!Y?Y~(B\ +$BZ"Z#A`Z%MJZ'@0ZZZ|ZzZ{Z}F^[!Z~["3r\m5!5L66AFK\rC.\s\t\u\v(B\ +$B\w\p\o\q]@]A]P]Q_7_5_2_47c_6By_8ECG;_9_:Eu_v1m_t_u_wG3_x_yNU(B\ +$B_s=C`W`V3M`e`yI;a.a/a0aJaoapaqb9b:bUbVc"b~c!Ka5z1P0,1O2:@QKT(B\ +$Bc`1.C[d@dAdDdEO6dBFFE|dudt0^ePeQh{OOh|>Vh}h~i!{?m;,dMjpwKKptpxF,q1;Aq/q04[qOqPqQqR3<(B\ +$Bqnq~r!r*r80>r9J+r:roiRYS[_z_{;8?$_|Ag_}<_`/5>`X4D9yar4basNE(B\ +$Batb;bWF7JMNFbXbY6:0kc#>Lc$c8c6cPcOcc3vRUdGg?g@g;gEZ*g]g\ge1ri&i'i(i)i*i,i-Fei/i0i2i1i3Lyi%iLj(j)(B\ +$Bj*j.j/j0Mfj3j+j2j1j,jqjwjxj{p7k1k2Mwkhko6`8,ki9Vkjao*CCo+EUIEo,o(0Gohojokolp,p.p-p1j-pD2bAz5Gpa4ZpyIQq'q3q2q4(B\ +$Bq5q6qEqS=YqTqU=9r=Knr>:z;-r?A/r@rw9crzr{r|r}r~sHsVBcsYsZs[sd(B\ +$Bsmc7spNps~(B" ; 17 + "$BLYAQShT^T]W3D(XpXsBWY'Z)Z2>qZ3Z4Z6Z1Z9ZMZRZY=l[$MK[/\j]#]$]%(B\ +$B[m]&]'](]C]E]R_G_C_D_E_FMt_H_I_n_~`!`"`Z`za1a2auJJL~avbZb[b\(B\ +$B=Vb]c&ACc'c%c9cR3O>wcQcacb4JdOdPdQdRNHeiecee?%A6efegebed=+f0(B\ +$BfKK]fc?&gAgBNWgQg^ONi6;'i4=ri5i7i8F#HMMuj5j4j6j=2(6_j}J$4Qk3(B\ +$Bk_nRnZo-3;(B\ +$Bo.:?AyDCo/DJo03yo1omonooF.RVp8?wFqpEkqpcpdJ\pb3[3\4ipz82p{Bj(B\ +$BN`q7q8qF53qV83qWA{qXqor"r+r2r3r4rArBrC8qrDrErFrGs!s"s$9t1-s%(B\ +$BL9s#s&sIK{s\sjsl(B" ; 18 + "$BSkSlTUT`TbUOUpC~W*XgXqZ5[%Gx6{]-]+O&])]*]TFTBm_+_J_KCuIN@%_M(B\ +$B_NGz`#`1`9`Y`\<%`{a"aEaFawb^c(G)cSdSdTdUHvJmN|dZejKzeh7R7+f2(B\ +$Bf1Mef=f?f@B!gDg`g_1pi:i;i9i.iAI(B\ +$Bi?i@iBiCiDiAj>j?j@k#k$k4k=l#5D8n>yk~l!l"lWlXm/m0m2m1m=m^nS>z(B\ +$BnTnYoEo<>bo=o>F*o?oAo@oqpGO*6Aq(q)qq[qZF-r,rQrSrTrU3brV(B\ +$BrWrXrYrRrZr\OLs-s.s/s*sDLMs^s]sqsrssst(B" ; 20 + "$BQ5Q6SoSpSqSrSsV$V[W+XuXvXwZ8Yp[(]/]0]2]S^u`%`}ayaza{a|cTc^d[(B\ +$Bd_dXdzetezerE;evesf#4Ogb]"]1bq?q@qAqBq\q]q^q_q`qpr#r5(B\ +$BKbr[r]IIr^0sr_r`s1Das2s3s4s5s0s8s6s7sMs_lZsusv(B" ; 21 + "$BQ7Q8StG9SuV\V]W>XtZ:ZN\^]D_SFgaHaIa}c:cUcfQ?d\d]dFd{euf$f4fe(B\ +$BO8gGgc=1k&k'k6l&;>l^m5m6m77%m`oILzoGoHpIpJpgp|6BqC6Cqaqbr$dx(B\ +$B3orM17rdC-rcrarbs9s:sxsws|(B" ; 22 + "$BV^Z;YxZ<]3a~d^d`eyewexiGjCjFl'l(=2m8mambn6oJ4UoKoLoMoTpTp}qc(B\ +$Bqdqsqrqqqtr%KpNZres;OIs:mN[sWs`pm(B" ; 23 + "$BSvSwZ0b!b`f%f3gfjDjEjMl*l)l+mAnVoNpMpKpLpNpiphp~qer&r6rfrgs?Bk(B\ +$BsE84sgsyszs{(B" ; 24 + "$BW,]4_Tdad|e{gHjGk+k7l,m:nWoPpOq!r'sTsh(B" ; 25 + "$B15bal-oQoRqfr-rhsa(B" ; 26 + "$Be|m9oSoUoVoXq"q#qgqhrisb(B" ; 27 + "$BoWqis@(B" ; 28 + "$B]6`&qk]5sA(B" ; 29 + "$BqjsB(B" ; 30 + ]) + +;; 92.7.24 by T.Shingu -- Completely modified. +;; 92.8.24 by T.Shingu -- Bug fixed. +;; 92.9.17 by K.Handa -- Now table contents are strings (not lists of strings) +(defun busyu-input () + (interactive) + (let ((loop1 t) + (loop2) + (loop3) + (val1) + (val2) + (busyuname) + (nbusyu (1- (length busyu-table))) + (kaku1) + (kaku2)) + (while (or loop1 loop2 loop3) + (if loop1 + (progn + (setq loop1 nil) + (setq kaku1 (string-to-int (read-from-minibuffer + (format "$BItuBV$r=i4|2=$9$k(B.") + +(defvar canna-inhibit-hankakukana nil + "*Non-nil $B$N;~!";z3Q$+$J$KJQ49$7$J$$(B") + +;;; +;;; $B%b!<%I%i%$%s$N=$@0(B +;;; + +(defvar canna:*kanji-mode-string* "[ $B$"(B ]") +(defvar canna:*alpha-mode-string* "$B$+$s$J(B") +(defvar canna:*saved-mode-string* "[ $B$"(B ]") + +(defvar mode-line-canna-mode canna:*alpha-mode-string*) +(defvar mode-line-canna-mode-in-minibuffer canna:*alpha-mode-string*) + +(defvar display-minibuffer-mode-in-minibuffer t) + +(make-variable-buffer-local 'mode-line-canna-mode) + +(defvar canna:minibuffer-preprompt-overlay nil + "Internal variable used to keep an overlay to show a preprompt string +in the minibuffer.") + +(defun canna:select-window-hook (old new) + (if (and (eq old (minibuffer-window)) + (not (eq new (minibuffer-window)))) + (save-excursion + (set-buffer (window-buffer (minibuffer-window))) + (if canna:minibuffer-preprompt-overlay + (delete-overlay canna:minibuffer-preprompt-overlay)) + (setq canna:minibuffer-preprompt-overlay nil + ;; minibuffer$B$N%G%U%)%k%H$O%"%k%U%!%Y%C%H%b!<%I(B + mode-line-canna-mode-in-minibuffer canna:*alpha-mode-string* + canna:*japanese-mode-in-minibuffer* nil))) + (if (eq new (minibuffer-window)) + (setq minibuffer-window-selected t) + (setq minibuffer-window-selected nil))) + +(defun canna:minibuffer-setup-hook () + (canna:select-window-hook nil (minibuffer-window))) + +(add-hook 'minibuffer-setup-hook 'canna:minibuffer-setup-hook) + +(defun canna:minibuffer-exit-hook () + (canna:select-window-hook (minibuffer-window) nil)) + +(add-hook 'minibuffer-exit-hook 'canna:minibuffer-exit-hook) + +(defun mode-line-canna-mode-update (str) + (if (eq (current-buffer) (window-buffer (minibuffer-window))) + (if display-minibuffer-mode-in-minibuffer + (progn + (or canna:minibuffer-preprompt-overlay + (setq canna:minibuffer-preprompt-overlay + (make-overlay (point-min) (point-min)))) + (overlay-put canna:minibuffer-preprompt-overlay + 'before-string str)) + ;else + (setq mode-line-canna-mode-in-minibuffer str)) + (setq mode-line-canna-mode str) ) + (set-buffer-modified-p (buffer-modified-p)) ) + +;; memq $B$r6/D4$9$k$J$i!"0J2<$@$,!"(B +;(defun canna:memq-recursive (a l) +; (or (eq a l) +; (and (consp l) +; (or (canna:memq-recursive a (car l)) +; (canna:memq-recursive a (cdr l)) )))) +;; $B]$N?'(B\", \"$BA*BrBP>]$N?'(B\" $B$N(B +$B%j%9%H$r@_Dj$9$k(B") +(defvar canna:color-p nil "$B?'$,;H$($k$+(B") +(defvar canna:attr-mode nil "$B8=:_$N%G%#%9%W%l%$%b!<%I(B") +(defvar canna:attr-yomi nil "$BFI$_$N?'B0@-(B") +(defvar canna:attr-taishou nil "$BJQ49BP>]ItJ,$N?'B0@-(B") +(defvar canna:attr-select nil + "$B%_%K%P%C%U%!J,N%;~$N%a%K%e!<$NA*BrBP>]HV9f$N?'B0@-(B") +(defvar canna-background-mode nil + "$B$+$s$JJQ49;~$NG[?'%;%C%H$r9uCOGX7JMQ$K$9$k>l9g$O(B 'dark $B$K$9$k(B") +(defvar canna:attribute-alist ;colored by tagu@ae.keio.ac.jp + '((yomi (normal . "red") + (reverse . "moccasin") + (nw . "blue/white") + (nw-rv . "yellow/black")) + (taishou (normal . "blue/lavender") + (reverse . "yellow/cadet blue") + (nw . "black/yellow") + (nw-rv . "yellow/blue")) + (select (normal . "DarkOliveGreen1/cadet blue") + (reverse . "light sea green/burlywood1") + (nw . "black/cyan") + (nw-rv . "black/cyan"))) + "$B$+$s$JJQ49;~$NG[?'$N(Balist +$B6/@)E*$K0E$$GX7J$NG[?'$rA*$S$?$$>l9g$OJQ?t(B canna-background-mode $B$K(B +$B%7%s%\%k(B 'dark $B$r%;%C%H$7$F$*$/!#(B") + +(make-variable-buffer-local (defvar canna:*yomi-overlay* nil)) +(make-variable-buffer-local (defvar canna:*henkan-overlay* nil)) +(make-variable-buffer-local (defvar canna:*select-overlay* nil)) + +;;; +;;; $B%-!<%^%C%W%F!<%V%k(B +;;; + +;; $B%U%'%s%9%b!<%I$G$N%m!<%+%k%^%C%W(B +(defvar canna-mode-map (make-sparse-keymap)) + +(let ((ch 0)) + (while (<= ch 127) + (define-key canna-mode-map (make-string 1 ch) 'canna-functional-insert-command) + (setq ch (1+ ch)))) + +(cond ((featurep 'xemacs) + (define-key canna-mode-map [up] "\C-p") + (define-key canna-mode-map [(shift up)] "\C-p") + (define-key canna-mode-map [(control up)] "\C-p") + (define-key canna-mode-map [down] "\C-n") + (define-key canna-mode-map [(shift down)] "\C-n") + (define-key canna-mode-map [(control down)] "\C-n") + (define-key canna-mode-map [right] "\C-f") + (define-key canna-mode-map [(shift right)] "\C-f") + (define-key canna-mode-map [(control right)] "\C-f") + (define-key canna-mode-map [left] "\C-b") + (define-key canna-mode-map [(shift left)] "\C-b") + (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 [backspace] "\C-h") + (define-key canna-mode-map [delete] "\C-h") + ) + (t + (define-key canna-mode-map [up] [?\C-p]) + (define-key canna-mode-map [S-up] [?\C-p]) + (define-key canna-mode-map [C-up] [?\C-p]) + (define-key canna-mode-map [down] [?\C-n]) + (define-key canna-mode-map [S-down] [?\C-n]) + (define-key canna-mode-map [C-down] [?\C-n]) + (define-key canna-mode-map [right] [?\C-f]) + (define-key canna-mode-map [S-right] [?\C-f]) + (define-key canna-mode-map [C-right] [?\C-f]) + (define-key canna-mode-map [left] [?\C-b]) + (define-key canna-mode-map [S-left] [?\C-b]) + (define-key canna-mode-map [C-left] [?\C-b]) + (define-key canna-mode-map [kanji] [? ]) + (define-key canna-mode-map [?\C- ] [?\C-@]) + (define-key canna-mode-map [backspace] [?\C-h]) + (define-key canna-mode-map [delete] [?\C-h]) + )) + +(or (assq 'canna:*fence-mode* minor-mode-map-alist) + (setq minor-mode-map-alist + (cons (cons 'canna:*fence-mode* canna-mode-map) + minor-mode-map-alist))) + +;; $B%_%K%P%C%U%!$K2?$+$rI=<($7$F$$$k;~$N%m!<%+%k%^%C%W(B +(defvar canna-minibuffer-mode-map (make-sparse-keymap)) + +(let ((ch 0)) + (while (<= ch 127) + (define-key canna-minibuffer-mode-map (make-string 1 ch) 'canna-minibuffer-insert-command) + (setq ch (1+ ch)))) + +(cond ((featurep 'xemacs) + (define-key canna-minibuffer-mode-map [up] "\C-p") + (define-key canna-minibuffer-mode-map [(shift up)] "\C-p") + (define-key canna-minibuffer-mode-map [(control up)] "\C-p") + (define-key canna-minibuffer-mode-map [down] "\C-n") + (define-key canna-minibuffer-mode-map [(shift down)] "\C-n") + (define-key canna-minibuffer-mode-map [(control down)] "\C-n") + (define-key canna-minibuffer-mode-map [right] "\C-f") + (define-key canna-minibuffer-mode-map [(shift right)] "\C-f") + (define-key canna-minibuffer-mode-map [(control right)] "\C-f") + (define-key canna-minibuffer-mode-map [left] "\C-b") + (define-key canna-minibuffer-mode-map [(shift left)] "\C-b") + (define-key canna-minibuffer-mode-map [(control left)] "\C-b") + (define-key canna-minibuffer-mode-map [kanji] " ") + (define-key canna-minibuffer-mode-map [(control space)] [(control @)]) + (define-key canna-minibuffer-mode-map [backspace] "\C-h") + (define-key canna-minibuffer-mode-map [delete] "\C-h") + ) + (t + (define-key canna-minibuffer-mode-map [up] [?\C-p]) + (define-key canna-minibuffer-mode-map [S-up] [?\C-p]) + (define-key canna-minibuffer-mode-map [C-up] [?\C-p]) + (define-key canna-minibuffer-mode-map [down] [?\C-n]) + (define-key canna-minibuffer-mode-map [S-down] [?\C-n]) + (define-key canna-minibuffer-mode-map [C-down] [?\C-n]) + (define-key canna-minibuffer-mode-map [right] [?\C-f]) + (define-key canna-minibuffer-mode-map [S-right] [?\C-f]) + (define-key canna-minibuffer-mode-map [C-right] [?\C-f]) + (define-key canna-minibuffer-mode-map [left] [?\C-b]) + (define-key canna-minibuffer-mode-map [S-left] [?\C-b]) + (define-key canna-minibuffer-mode-map [C-left] [?\C-b]) + (define-key canna-minibuffer-mode-map [kanji] [? ]) + (define-key canna-minibuffer-mode-map [?\C- ] [?\C-@]) + (define-key canna-minibuffer-mode-map [backspace] [?\C-h]) + (define-key canna-minibuffer-mode-map [delete] [?\C-h]) + )) + +(or (assq 'canna:*select-mode* minor-mode-map-alist) + (setq minor-mode-map-alist + (cons (cons 'canna:*select-mode* canna-minibuffer-mode-map) + minor-mode-map-alist))) + +;;; +;;; $B%0%m!<%P%k4X?t$N=q$-BX$((B +;;; + + +;; Keyboard quit + +;(if (not (fboundp 'canna-sys:keyboard-quit)) +; (fset 'canna-sys:keyboard-quit (symbol-function 'keyboard-quit)) ) + +;(defun canna:keyboard-quit () +; "See documents for canna-sys:keyboard-quit" +; (interactive) +; (if canna:*japanese-mode* +; (progn +;; (setq canna:*japanese-mode* nil) +; (setq canna:*fence-mode* nil) +; (if (boundp 'disable-undo) +; (setq disable-undo canna:*fence-mode*)) +; (canna:mode-line-display) )) +; (canna-sys:keyboard-quit) ) + +;; Abort recursive edit + +;(if (not (fboundp 'canna-sys:abort-recursive-edit)) +; (fset 'canna-sys:abort-recursive-edit +; (symbol-function 'abort-recursive-edit)) ) + +;(defun canna:abort-recursive-edit () +; "see documents for canna-sys:abort-recursive-edit" +; (interactive) +; (if canna:*japanese-mode* +; (progn +; (setq canna:*japanese-mode* nil) +; (setq canna:*fence-mode* nil) +; (if (boundp 'disable-undo) +; (setq disable-undo canna:*fence-mode*)) +; (canna:mode-line-display) )) +; (canna-sys:abort-recursive-edit) ) + +;; Exit-minibuffer + +(defun canna:exit-minibuffer () + "Exit minibuffer turning off canna Japanese mode. +See also document for canna:saved-exit-minibuffer." + (interactive) + (if canna-initialize-minibuffer-state-when-exit + (setq canna:*japanese-mode-in-minibuffer* nil + mode-line-canna-mode-in-minibuffer canna:*alpha-mode-string*)) + ) + +(add-hook 'minibuffer-exit-hook 'canna:exit-minibuffer) + +;; kill-emacs + +(add-hook 'kill-emacs-hook 'canna:finalize) + +;;; +;; for Emacs 20.3 or later +;;; +(defun canna-buffer-substring (start end) + (cond + ((and (fboundp 'encode-coding-string) (not (featurep 'xemacs))) + (encode-coding-string (buffer-substring start end) 'japanese-iso-8bit)) + (t (buffer-substring start end)))) +(defun canna-string-to-list (str) + (cond + ((fboundp 'string-to-list) (string-to-list str)) + ((fboundp 'string-to-char-list) (string-to-char-list str)))) + +;;; +;;; function for mini-buffer +;;; + +(defun adjust-minibuffer-mode () + (if (eq (current-buffer) (window-buffer (minibuffer-window))) + (progn + (setq canna:*japanese-mode* canna:*japanese-mode-in-minibuffer*) + t) + nil)) + +;;; +;;; keyboard input for japanese language +;;; + +(defun canna-functional-insert-command (arg) + "Use input character as a key of complex translation input such as +kana-to-kanji translation." + (interactive "*p") + (let ((ch)) + (cond ((integerp last-command-char) + (setq ch last-command-char)) + ((and (fboundp 'char-or-char-int-p) + (char-or-char-int-p arg) + (not (null last-command-char))) + (setq ch last-command-char)) + ((eq (event-key last-command-event) 'backspace) + (setq ch ?\010)) + ((eq (event-key last-command-event) 'delete) + (setq ch ?\177)) + (t + (setq ch (event-to-character last-command-event)))) + (canna:functional-insert-command2 ch arg))) + +(defun canna:functional-insert-command2 (ch arg) + "This function actually inserts a converted Japanese string." + ;; $B$3$N4X?t$OM?$($i$l$?J8;z$rF|K\8lF~NO$N$?$a$N%-!C$9!#(B + (progn + (canna:henkan-attr-off canna:*region-start* canna:*region-end*) + (canna:yomi-attr-off canna:*region-start* canna:*region-end*))) + (delete-region canna:*region-start* canna:*region-end*) + (setq canna:*last-kouho* 0) )))) + +(defun canna:insert-fixed (strs) + (if (and (fboundp 'encode-coding-string) (not (featurep 'xemacs)) + canna-kakutei-yomi) + (setq canna-kakutei-yomi + (encode-coding-string canna-kakutei-yomi 'japanese-iso-8bit))) + (cond ((> strs 0) + (cond ((and canna-kakutei-yomi + (or (null canna-save-undo-text-predicate) + (funcall canna-save-undo-text-predicate + (cons canna-kakutei-yomi + canna-kakutei-romaji) ))) + (setq canna:*undo-text-yomi* + + (cons canna-kakutei-yomi canna-kakutei-romaji)) + (set-marker canna:*spos-undo-text* (point)) +;; +;; update kbnes + (set-marker canna:*region-start* (point)) + (let ((list (canna-string-to-list canna-kakutei-string)) + ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B + ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B + (blink-matching-paren nil)) + (while list + ;(self-insert-internal (car list)) ;is obsoleted(yuuji) + (insert-char (car list) 1) + (setq list (cdr list)))) + (set-marker canna:*region-end* (point)) + ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B + ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B + (if (and canna-empty-info + (eq (char-syntax (char-before (point))) ?\)) ) + (blink-matching-open)) + +; (if overwrite-mode +; (let ((num strs) +; (kanji-compare 128)) +; (catch 'delete-loop +; (while (> num 0) +; (if (eolp) +; (throw 'delete-loop nil)) +; (if (>= (following-char) kanji-compare) +; (setq num (1- num))) +; (delete-char 1) +; (setq num (1- num)))))) +;; end kbnes +; (insert canna-kakutei-string) + (if (and (boundp 'self-insert-after-hook) + self-insert-after-hook) + (funcall self-insert-after-hook + canna:*region-start* canna:*region-end*)) + (canna:do-auto-fill) + (set-marker canna:*epos-undo-text* (point)) ) + (t +;; +;; update kbnes + (let ((list (canna-string-to-list canna-kakutei-string)) + ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B + ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B + (blink-matching-paren nil)) + (while list + ;(self-insert-internal (car list)) ;is obsoleted(yuuji) + (insert-char (car list) 1) + (setq list (cdr list)))) + ;; $BL$3NDj$NJ8;z$,$J$/!"3NDjJ8;zNs$N:G8e$,JD$83g8L$N(B + ;; $BN`$@$C$?$H$-$O(B blink $B$5$;$k!#(B + (if (and canna-empty-info + (eq (char-syntax (char-before (point))) ?\)) ) + (blink-matching-open)) + +; (if overwrite-mode +; (let ((num strs) +; (kanji-compare 128)) +; (catch 'delete-loop +; (while (> num 0) +; (if (eolp) +; (throw 'delete-loop nil)) +; (if (>= (following-char) kanji-compare) +; (setq num (1- num))) +; (delete-char 1) +; (setq num (1- num)))))) +;; end kbnes +; (insert canna-kakutei-string) + (if (and (boundp 'self-insert-after-hook) + self-insert-after-hook) + (funcall self-insert-after-hook + canna:*region-start* canna:*region-end*)) + (canna:do-auto-fill) )) + ) )) + +(defun canna:insert-preedit () + (let ((buffer-undo-list t)) + (cond ((> canna-henkan-length 0) + (set-marker canna:*region-start* (point)) + (if canna-with-fences + (progn + (insert "||") + (set-marker canna:*region-end* (point)) + (backward-char 1) + )) + (insert canna-henkan-string) + (if (not canna-with-fences) + (set-marker canna:*region-end* (point)) ) + (if canna-underline + (canna:yomi-attr-on canna:*region-start* canna:*region-end*)) + (setq canna:*last-kouho* canna-henkan-length) + )) + + ;; $B8uJdNN0h$G$O6/D4$7$?$$J8;zNs$,B8:_$9$k$b$N$H9M$($i(B + ;; $B$l$k!#6/D4$7$?$$J8;z$O(BEmacs$B$G$O%+!<%=%k%]%8%7%g%s$K$FI=<((B + ;; $B$9$k$3$H$H$9$k!#6/D4$7$?$$J8;z$,$J$$$N$G$"$l$P!"%+!<%=%k(B + ;; $B$O0lHV8e$NItJ,(B($BF~NO$,9T$o$l$k%]%$%s%H(B)$B$KCV$$$F$*$/!#(B + + ;; $B%+!<%=%k$r0\F0$9$k!#(B + (if (not canna-underline) + (backward-char + (- canna:*last-kouho* + ;; $B%+!<%=%k0LCV$O!"H?E>I=<(ItJ,$,B8:_$7$J$$$N$G$"$l$P!"(B + ;; $B8uJdJ8;zNs$N:G8e$NItJ,$H$7!"H?E>I=<(ItJ,$,B8:_$9$k$N(B + ;; $B$G$"$l$P!"$=$NItJ,$N;O$a$H$9$k!#(B + (cond ((zerop canna-henkan-revlen) + canna:*last-kouho*) + (t canna-henkan-revpos) )) ) + (if (and (> canna-henkan-revlen 0) + (> canna-henkan-length 0)) + ; $B8uJd$ND9$5$,(B0$B$G$J$/!"(B + ; $BH?E>I=<($ND9$5$,(B0$B$G$J$1$l$P!"(B + ; $B$=$NItJ,$rJQE>I=<($9$k!#(B + (let ((start (+ canna:*region-start* + (if canna-with-fences 1 0) + canna-henkan-revpos))) + (canna:henkan-attr-on start + (+ start canna-henkan-revlen))))))) + +(defun canna:display-candidates (strs) + (cond ((stringp strs) ; $B%(%i!<$,5/$3$C$?>l9g(B + (beep) + (message strs) ) + (canna-henkan-string + ;; $B$b$78uJdI=<($,A0$N7k2L$+$iJQ$o$C$F$$$J$/$J$$$H$-$O(B...... + + ;; $BC$9!#(B + (canna:delete-last-preedit) + + ;; $B3NDj$7$?J8;zNs$,$"$l$P$=$l$rA^F~$9$k!#(B + (canna:insert-fixed strs) + ;; $BpJs$rJ]B8(B + ;; $B$7$F$*$/!#(B + (setq canna:*previous-window* (selected-window)) +; (select-frame (window-frame (minibuffer-window))) + +;; $B<+J,$KMh$kA0$,%_%K%P%C%U%!$+$I$&$+$rJQ?t$K$G$b$$$l$F$*$$$?J}$,$$$$$J$"!#(B + + (if (not canna:*cursor-was-in-minibuffer*) + (progn + ;; $B%_%K%P%C%U%!$r%/%j%"$9$k!#(B +; (if (eq canna:*previous-window* (selected-window)) +; (progn +; (canna:henkan-attr-off (point-min) (point-max)) +; (canna:delete-last-preedit) )) + + ;; $B%_%K%P%C%U%!%&%#%s%I%&$K8uJd0lMwMQ$N%P%C%U%!$r3d$jEv$F$k!#(B + (setq canna:*saved-minibuffer* (window-buffer (minibuffer-window))) +; (set-window-buffer (minibuffer-window) +; (get-buffer-create canna:*menu-buffer*)) + (or (featurep 'xemacs) + (progn + (setq canna:*saved-redirection* (frame-focus (selected-frame))) + (redirect-frame-focus (selected-frame) + (window-frame (minibuffer-window))))) + )) + (select-window (minibuffer-window)) + (set-window-buffer (minibuffer-window) + (get-buffer-create canna:*menu-buffer*)) + + (setq canna:*select-mode* t) + +; (canna:yomi-attr-off (point-min) (point-max) ) +; (canna:henkan-attr-off (point-min) (point-max) ) + (canna:select-attr-off (point-min) (point-max) ) + (setq canna:*cursor-was-in-minibuffer* t) + (delete-region (point-min) (point-max)) + (if (not (eq canna:*previous-window* (selected-window))) + (setq minibuffer-window-selected nil)) + + (insert str) + + ;; $B%_%K%P%C%U%!$GH?E>I=<($9$k$Y$-J8;z$N$H$3$m$K%+!<%=%k$r0\F0$9$k!#(B + (cond ((> revlen 0) + (backward-char (- len revpos)) )) + ;;(message "%s" (selected-frame)) (sit-for 3) + (raise-frame (window-frame (minibuffer-window))) +; (select-frame (window-frame (minibuffer-window))) + (and canna:color-p (not (eobp)) + (canna:select-attr-on (point) + (save-excursion (forward-char 1) (point)))) + + ;; $B%_%K%P%C%U%!$KI=<($9$k$Y$-J8;zNs$,%L%kJ8;zNs$J$N$G$"$l$P!"A0$N%&%#(B + ;; $B%s%I%&$KLa$k!#(B + (if (or (zerop len) canna-empty-info) + (progn + (setq canna:*cursor-was-in-minibuffer* nil) + (setq canna:*select-mode* nil) + + ;; $B%_%K%P%C%U%!%&%#%s%I%&$N%P%C%U%!$r85$KLa$9!#(B + (set-window-buffer (minibuffer-window) canna:*saved-minibuffer*) +; (setq canna:*saved-minibuffer* nil) + (or (featurep 'xemacs) + (redirect-frame-focus (window-frame canna:*previous-window*) + canna:*saved-redirection*)) + ; $B%_%K%P%C%U%!$GF~NO$7$F$$$?$N$J$i0J2<$b$9$k!#(B +; (if (eq canna:*previous-window* (selected-window)) +; (progn +; (canna:insert-fixed nfixed) +; (canna:insert-preedit) )) + + (if (and canna-empty-info (> len 0)) + (progn +; (delete-region (point-min) (point-max)) + (message str) )) + (select-window canna:*previous-window*) )) + ) + +(defun canna-minibuffer-insert-command (arg) + "Use input character as a key of complex translation input such as\n\ +kana-to-kanji translation, even if you are in the minibuffer." + (interactive "p") + (setq canna:*select-mode* nil) + (set-window-buffer (minibuffer-window) canna:*saved-minibuffer*) + (select-window canna:*previous-window*) + ;-;(canna:functional-insert-command2 last-command-char arg) + (canna-functional-insert-command arg)) + +;;; +;;; $B$+$s$J%b!<%I$N= canna:*self-insert-non-undo-count* 20)) +; (setq canna:*self-insert-non-undo-count* 1) +; (cancel-undo-boundary) +; (setq canna:*self-insert-non-undo-count* +; (1+ canna:*self-insert-non-undo-count*))) + (if (and (eq last-command 'canna-self-insert-command) + (> last-command-char ? )) + (cancel-undo-boundary)) + (self-insert-command arg) +; (if canna-insert-after-hook +; (run-hooks 'canna-insert-after-hook)) + (if (and (boundp 'self-insert-after-hook) ; append by knak 97.10.21 + self-insert-after-hook) + (if (<= 1 arg) + (funcall self-insert-after-hook + (- (point) arg) (point))) + (if (= last-command-char ? ) (canna:do-auto-fill)))))) + +(defun canna-self-insert-string-2 (string) + (let ((len (length string)) + (i 0) + ;; $BA^F~$NESCf$G(B blink $B$,5/$-$k$H$&$C$H$*$7$$$N$G!"(B + ;; $B0l;~E*$K(B blink $B$rM^;_$9$k!#(B + (blink-matching-paren nil)) + (while (< i len) + (self-insert-internal (aref canna-kakutei-string i)) + (setq i (1+ i)) + ))) + +;; (cond +;; ((featurep 'xemacs) +;; (fset 'canna-self-insert-command 'canna-self-insert-string-2)) +;; ((string< "19" emacs-version) +;; (fset 'canna-self-insert-command 'canna-self-insert-string-1)) +;; (t +;; (fset 'canna-self-insert-command 'insert))) + +;; wire us into pending-delete +(put 'canna-self-insert-command 'pending-delete t) + +(defun canna-toggle-japanese-mode () + "Toggle canna japanese mode." + (interactive) + (let ((in-minibuffer (adjust-minibuffer-mode))) + (cond (canna:*japanese-mode* + (setq canna:*japanese-mode* nil) + (canna-abandon-undo-info) + (setq canna:*use-region-as-henkan-region* nil) + (setq canna:*saved-mode-string* mode-line-canna-mode) + (mode-line-canna-mode-update canna:*alpha-mode-string*) ) + (t + (setq canna:*japanese-mode* t) + (if (fboundp 'canna-query-mode) + (let ((new-mode (canna-query-mode))) + (if (string-equal new-mode "") + (setq canna:*kanji-mode-string* canna:*saved-mode-string*) + (setq canna:*kanji-mode-string* new-mode) + )) ) + (mode-line-canna-mode-update canna:*kanji-mode-string*) ) ) + (if in-minibuffer + (setq canna:*japanese-mode-in-minibuffer* canna:*japanese-mode*)) )) + +(defun canna:initialize () + (let ((init-val nil)) + (cond (canna:*initialized*) ; initialize $B$5$l$F$$$?$i2?$b$7$J$$(B + (t + (setq canna:*initialized* t) + (setq init-val (canna-initialize + (if canna-underline 0 1) + canna-server canna-file)) + (cond ((car (cdr (cdr init-val))) + (canna:output-warnings (car (cdr (cdr init-val)))) )) + (cond ((car (cdr init-val)) + (error (car (cdr init-val))) )) + ) ) + + (if (fboundp 'canna-query-mode) + (progn + (canna-change-mode canna-mode-alpha-mode) + (setq canna:*alpha-mode-string* (canna-query-mode)) )) + + (canna-do-function canna-func-japanese-mode) + + (if (fboundp 'canna-query-mode) + (setq canna:*kanji-mode-string* (canna-query-mode))) + + init-val)) + +(defun canna:finalize () + (cond ((null canna:*initialized*)) ; initialize $B$5$l$F$$$J$+$C$?$i2?$b$7$J$$(B + (t + (setq canna:*initialized* nil) + (let ((init-val (canna-finalize))) + (cond ((car (cdr (cdr init-val))) + (canna:output-warnings (car (cdr (cdr init-val)))) )) + (cond ((car (cdr init-val)) + (error (car (cdr init-val))) )) + ) + (message "$B!X$+$s$J!Y$N<-=q$r%;!<%V$7$^$9!#(B") + ))) + +(defun canna:enter-canna-mode () + (if (not canna:*initialized*) + (progn + (message "$B!X$+$s$J!Y$N=i4|2=$r9T$C$F$$$^$9(B....") + (canna:initialize) + (message "$B!X$+$s$J!Y$N=i4|2=$r9T$C$F$$$^$9(B....done") + )) + (canna-set-width (- (window-width (minibuffer-window)) + (minibuffer-prompt-width) + (if (and display-minibuffer-mode-in-minibuffer + (eq (selected-window) (minibuffer-window))) + (string-width + (let ((new-mode (canna-query-mode))) + (if (string-equal new-mode "") + canna:*saved-mode-string* + new-mode))) + 0))) + (setq canna:*fence-mode* t) + (if (not (featurep 'xemacs)) + (progn + (if (boundp 'buffer-disable-undo) ; append by knak 97.10.21 + (buffer-disable-undo (current-buffer))) ; append by knak 97.10.21 + (if (boundp 'disable-undo) + (set 'disable-undo canna:*fence-mode*))))) ; mew-1.93/patches/canna.el-19.34.patch + +(defun canna:enter-canna-mode-and-functional-insert () + (canna:enter-canna-mode) + (setq canna:*use-region-as-henkan-region* nil) + (setq unread-command-events (list last-command-event))) + +(defun canna:quit-canna-mode () + (cond (canna:*fence-mode* + (setq canna:*fence-mode* nil) + (if canna:*exit-japanese-mode* + (progn + (setq canna:*exit-japanese-mode* nil) + (setq canna-mode-string canna:*alpha-mode-string*) + (if canna:*japanese-mode* + (canna-toggle-japanese-mode) + (mode-line-canna-mode-update canna:*alpha-mode-string*) ))) + (if (not (featurep 'xemacs)) + (progn + (if (boundp 'buffer-disable-undo) ; append by knak 97.10.21 + (buffer-disable-undo (current-buffer))) ; append by knak 97.10.21 + (if (boundp 'disable-undo) + (set 'disable-undo canna:*fence-mode*)))))) + (set-marker canna:*region-start* nil) + (set-marker canna:*region-end* nil) + ) + +(defun canna-touroku () + "Register a word into a kana-to-kanji dictionary." + (interactive) + (if (not canna:*fence-mode*) + (progn + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates (canna-touroku-string "")) ) + (beep) + )) + +(defun canna-without-newline (start end) + (and (not (eq start end)) + (or + (and (<= end (point)) + (save-excursion + (beginning-of-line) + (<= (point) start) )) + (and (<= (point) start) + (save-excursion + (end-of-line) + (<= end (point)) )) + ))) + +(defun canna-touroku-region (start end) + "Register a word which is indicated by region into a kana-to-kanji\n\ +dictionary." + (interactive "r") + (if (canna-without-newline start end) + (if (not canna:*fence-mode*) + (progn + (setq canna:*use-region-as-henkan-region* nil) + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates + (canna-touroku-string (canna-buffer-substring start end))) )) + (message "$B%j!<%8%g%s$,IT@5$G$9!#%L%k%j!<%8%g%s$+!"2~9T$,4^$^$l$F$$$^$9!#(B") + )) + +(defun canna-extend-mode () + "To enter an extend-mode of Canna." + (interactive "*") +; (if (and (not (eq (window-frame (minibuffer-window)) (selected-frame))) +; (not canna:*fence-mode*)) + ;; $B%_%K%P%C%U%!$rJ,N%$7$F$$$k;~$O0l;~E*$K%U%'%s%9%b!<%I$KF~$k(B + ;; $B$=$&$7$J$$$H%a%K%e!<$rA*$Y$J$$(B + ;; (focus$B$,%_%K%P%C%U%!$K9T$+$J$$$+$i(B) + (if (not canna:*fence-mode*) + (progn + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates + (canna-do-function canna-func-extend-mode) )) + (beep))) + +(defun canna-kigou-mode () + "Enter symbol choosing mode." + (interactive "*") + (if (not canna:*fence-mode*) + (progn + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates (canna-change-mode canna-mode-kigo-mode)) ) + (beep) + )) + +(defun canna-hex-mode () + "Enter hex code entering mode." + (interactive "*") + (if (not canna:*fence-mode*) + (progn + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates (canna-change-mode canna-mode-hex-mode)) ) + (beep) + )) + +(defun canna-bushu-mode () + "Enter special mode to convert by BUSHU name." + (interactive "*") + (if (not canna:*fence-mode*) + (progn + (setq canna:*exit-japanese-mode* (not canna:*japanese-mode*)) + (canna:enter-canna-mode) + (canna:display-candidates (canna-change-mode canna-mode-bushu-mode)) ) + (beep) + )) + +(defun canna-reset () + (interactive) + (message "$B!X$+$s$J!Y$N<-=q$r%;!<%V$7$^$9!#(B"); + (canna:finalize) + (message "$B!X$+$s$J!Y$N:F=i4|2=$r9T$C$F$$$^$9(B....") + (canna:initialize) + (message "$B!X$+$s$J!Y$N:F=i4|2=$r9T$C$F$$$^$9(B....done") + ) + + +(defun canna () + (interactive) + (message "$B!X$+$s$J!Y$r=i4|2=$7$F$$$^$9(B....") + (let (init-val) + (cond ((and (fboundp 'canna-initialize) (fboundp 'canna-change-mode) ) + + ;; canna $B$,;H$($k;~$OuBV$G=i4|2=$9$kI,MW$,$"$k(B + (setq canna-underline (or canna:color-p canna-underline)) + (cond + (canna:color-p + (setq canna:attr-mode + (cond + (canna-background-mode + (if window-system + (if (eq canna-background-mode 'dark) + 'reverse 'normal) + (if (eq canna-background-mode 'dark) + 'nw-rv 'nw))) + ((eq 'dark + (cond + ((boundp 'hilit-background-mode) + (symbol-value 'hilit-background-mode)) + ((boundp 'frame-background-mode) + frame-background-mode) + ((fboundp 'get-frame-background-mode) + (get-frame-background-mode nil)))) + (if window-system 'reverse 'nw-rv)) + (window-system + (if (string-match + "on\\|t\\|yes" + (or (if (featurep 'xemacs) + (x-get-resource "ReverseVideo" + "reverseVideo" 'string) + (x-get-resource "ReverseVideo" "reverseVideo")) + "")) + 'reverse + 'normal)) + (t 'nw))) + (setq canna:attr-yomi + (if (listp canna-use-color) + (car canna-use-color) + (cdr (assq canna:attr-mode + (assq 'yomi canna:attribute-alist))))) + (setq canna:attr-taishou + (if (listp canna-use-color) + (car (cdr canna-use-color)) + (setq canna:attr-taishou + (cdr (assq + canna:attr-mode + (assq 'taishou canna:attribute-alist)))))) + (setq canna:attr-select + (if (listp canna-use-color) + (car (cdr (cdr canna-use-color))) + (setq canna:attr-select + (cdr (assq canna:attr-mode + (assq 'select canna:attribute-alist)))))) + ;;$B?'$E$1MQ(Bface$B$N:n@.(B + (condition-case err + (mapcar + (function + (lambda (face) + (let* ((color (symbol-value + (intern (concat "canna:" (symbol-name face))))) + backp) + (make-face face) + (if (stringp color) + (progn + (setq backp (string-match "/" color)) + (set-face-foreground + face (substring color 0 backp)) + (if backp + (set-face-background + face (substring color (1+ backp))))) + (copy-face color face))))) + '(attr-yomi attr-taishou attr-select)) + (error + (message "$BI,MW$J?'?t$,3NJ]$G$-$^$;$s$G$7$?(B") + (sit-for 1) + (setq canna-use-color nil canna-underline nil))) + )) + ;;$BG[?'@_Dj=*N;(B + + ;; $B!X$+$s$J!Y%7%9%F%`$N=i4|2=(B + + (setq init-val (canna:initialize)) + + ;; $B%-!<$N%P%$%s%G%#%s%0(B + + (let ((ch 32)) + (while (< ch 127) + (define-key global-map (make-string 1 ch) 'canna-self-insert-command) + (setq ch (1+ ch)) )) + + (cond ((let ((keys (car init-val)) (ok nil)) + (while keys + (cond ((< (car keys) 128) + (global-set-key + (make-string 1 (car keys)) + 'canna-toggle-japanese-mode) + (setq ok t) )) + (setq keys (cdr keys)) + ) ok)) + (t ; $B%G%U%)%k%H$N@_Dj(B + (global-set-key "\C-o" 'canna-toggle-japanese-mode) )) + + (if (not (keymapp (global-key-binding "\e["))) + (global-unset-key "\e[") ) + (global-set-key "\e[210z" 'canna-toggle-japanese-mode) ; XFER + (define-key global-map [kanji] 'canna-toggle-japanese-mode) + (if canna-do-keybind-for-functionkeys + (progn + (global-set-key "\e[28~" 'canna-extend-mode) ; HELP on EWS4800 + (global-set-key "\e[2~" 'canna-kigou-mode) ; INS on EWS4800 + (global-set-key "\e[11~" 'canna-kigou-mode) + (global-set-key "\e[12~" 'canna-hex-mode) + (global-set-key "\e[13~" 'canna-bushu-mode) + (define-key global-map [help] 'canna-extend-mode) + (define-key global-map [insert] 'canna-kigou-mode) + (define-key global-map [f1] 'canna-kigou-mode) + (define-key global-map [f2] 'canna-hex-mode) + (define-key global-map [f3] 'canna-bushu-mode) + )) + + (if canna-use-space-key-as-henkan-region + (progn + (global-set-key "\C-@" 'canna-set-mark-command) + ;; X Window $B$O(B C-@ $B$H(B C-SPC $B$r6hJL$9$k$N$G!"$3$l$,I,MW!#(B + (global-set-key [?\C-\ ] 'canna-set-mark-command) + (global-set-key " " 'canna-henkan-region-or-self-insert) )) + + ;; $B%b!<%I9T$N:n@.(B + + (canna:create-mode-line) + (mode-line-canna-mode-update canna:*alpha-mode-string*) + + ;; $B%7%9%F%`4X?t$N=q$-BX$((B + +; (fset 'abort-recursive-edit +; (symbol-function 'canna:abort-recursive-edit)) +; (fset 'keyboard-quit +; (symbol-function 'canna:keyboard-quit)) + + ) + + ((fboundp 'canna-initialize) + (beep) + (with-output-to-temp-buffer "*canna-warning*" + (princ "$B$3$N(B Mule $B$G$O(B new-canna $B$,;H$($^$;$s(B") + (terpri) + (print-help-return-message)) ) + + (t ; $B!X$+$s$J!Y%7%9%F%`$,;H$($J$+$C$?;~$N=hM}(B + (beep) + (with-output-to-temp-buffer "*canna-warning*" + (princ "$B$3$N(B Mule $B$G$O(B canna $B$,;H$($^$;$s(B") + (terpri) + (print-help-return-message)) + )) + (message "$B!X$+$s$J!Y$r=i4|2=$7$F$$$^$9(B....done") + ) ) + +;;; +;;; auto fill control (from egg) +;;; + +(defun canna:do-auto-fill () + (if (and auto-fill-function (not buffer-read-only) + (> (current-column) fill-column)) + (let ((ocolumn (current-column))) + (funcall auto-fill-function) + (while (and (< fill-column (current-column)) + (< (current-column) ocolumn)) + (setq ocolumn (current-column)) + (funcall auto-fill-function))))) + +(defun canna:output-warnings (mesg) + (with-output-to-temp-buffer "*canna-warning*" + (while mesg + (princ (car mesg)) + (terpri) + (setq mesg (cdr mesg)) ) + (print-help-return-message))) + +(defun canna-undo (&optional arg) + (interactive "*P") + (if (and canna:*undo-text-yomi* + (eq (current-buffer) (marker-buffer canna:*spos-undo-text*)) +; (canna-without-newline canna:*spos-undo-text* +; canna:*epos-undo-text*) + ) + (progn + (message "$BFI$_$KLa$7$^$9!*(B") +; (switch-to-buffer (marker-buffer canna:*spos-undo-text*)) + (goto-char canna:*spos-undo-text*) + (delete-region canna:*spos-undo-text* + canna:*epos-undo-text*) + + (if (null canna:*japanese-mode*) + (progn + (setq canna:*exit-japanese-mode* t) )) +; (canna-toggle-japanese-mode) )) + (if (not canna:*fence-mode*) + ;; $B%U%'%s%9%b!<%I$@$C$?$i$b$&0lEY%U%'%s%9%b!<%I$KF~$C$?$j$7(B + ;; $B$J$$!#(B + (canna:enter-canna-mode) ) + (canna:display-candidates + (let ((texts (canna-store-yomi + (if (and (not (featurep 'xemacs)) + (string< "20.2" emacs-version)) + (encode-coding-string (car canna:*undo-text-yomi*) + 'japanese-iso-8bit) + (car canna:*undo-text-yomi*)) + (cdr canna:*undo-text-yomi*) )) ) + (cond (canna-undo-hook + (funcall canna-undo-hook)) + (t texts) ))) + (canna-abandon-undo-info)) + (undo arg))) + +(defun canna-abandon-undo-info () + (interactive) + (setq canna:*undo-text-yomi* nil) + (set-marker canna:*spos-undo-text* nil) + (set-marker canna:*epos-undo-text* nil) ) + +(defun canna-henkan-region (start end) + "Convert a text which is indicated by region into a kanji text." + (interactive "*r") + (if (null canna:*japanese-mode*) + (progn + (setq canna:*exit-japanese-mode* t) )) + (let ((res nil)) + (setq res (canna-store-yomi (canna-buffer-substring start end))) + (delete-region start end) + (canna:enter-canna-mode) + (if (fboundp 'canna-do-function) + (setq res (canna-do-function canna-func-henkan))) + (canna:display-candidates res) )) + +;;; +;;; $B%^!<%/%3%^%s%I!$(Bcanna-henkan-region-or-self-insert $B$G;H$&$+$b(B +;;; + +(defun canna-set-mark-command (arg) + "Besides setting mark, set mark as a HENKAN region if it is in\n\ +the japanese mode." + (interactive "P") + (set-mark-command arg) + (if canna:*japanese-mode* + (progn + (setq canna:*use-region-as-henkan-region* t) + (message "Mark set($BJQ49NN0h3+;O(B)") ))) + +(defun canna-henkan-region-or-self-insert (arg) + "Do kana-to-kanji convert region if HENKAN region is defined,\n\ +self insert otherwise." + (interactive "*p") + (if (and canna:*use-region-as-henkan-region* +; (< (mark) (point)) +; (not (save-excursion (beginning-of-line) (< (mark) (point)))) ) + (canna-without-newline (region-beginning) (region-end))) + (progn + (setq canna:*use-region-as-henkan-region* nil) + (canna-henkan-region (region-beginning) (region-end))) + (canna-self-insert-command arg) )) + +;; +;; for C-mode +;; + +(eval-when-compile + (autoload 'electric-c-terminator "c-mode" nil t) + (autoload 'electric-c-semi "c-mode" nil t) + (autoload 'electric-c-brace "c-mode" nil t)) + +(defun canna-electric-c-terminator (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (electric-c-terminator arg) )) + +(defun canna-electric-c-semi (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (electric-c-semi arg) )) + +(defun canna-electric-c-brace (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (electric-c-brace arg) )) + +(defun canna-c-mode-hook () + (let ((map (symbol-value 'c-mode-map))) + (define-key map "{" 'canna-electric-c-brace) + (define-key map "}" 'canna-electric-c-brace) + (define-key map ";" 'canna-electric-c-semi) + (define-key map ":" 'canna-electric-c-terminator))) + +;; +;; for CC-mode +;; + +(eval-when-compile + (autoload 'c-electric-colon "cc-cmds" nil t) + (autoload 'c-electric-semi&comma "cc-cmds" nil t) + (autoload 'c-electric-brace "cc-cmds" nil t)) + +(defun canna-c-electric-colon (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (c-electric-colon arg))) + +(defun canna-c-electric-semi&comma (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (c-electric-semi&comma arg))) + +(defun canna-c-electric-brace (arg) + (interactive "P") + (if canna:*japanese-mode* + (canna-self-insert-command arg) + (c-electric-brace arg))) + +(defun canna-cc-mode-hook () + (let ((map (symbol-value 'c-mode-base-map))) + (define-key map "{" 'canna-c-electric-brace) + (define-key map "}" 'canna-c-electric-brace) + (define-key map ";" 'canna-c-electric-semi&comma) + (define-key map ":" 'canna-c-electric-colon))) + +(defun canna-set-fence-mode-format (fence sep underline) + (setq canna-with-fences fence) + (canna-set-bunsetsu-kugiri sep) + (setq canna-underline underline) +) + +;; $B%j!<%8%g%s$K$"$k%m!<%^;z$r!X$+$s$J!Y$K?)$o$9!#(B +;; $B7k2L$H$7$F!"!X$+$s$J!Y$NFI$_%b!<%I$K$J$k!#(B +;; $B%j!<%8%g%s$KB8:_$7$F$$$k6uGrJ8;z$H@)8fJ8;z$O ch ? ) + (setq res (canna-do-function canna-func-functional-insert ch)) )) + (setq i (1+ i)) ) + res)) + +(defun canna-rk-trans-region (start end) + "Insert alpha-numeric string as it is sent from keyboard." + (interactive "*r") + (let ((res)) + (setq res (canna-rk-region start end)) + (delete-region start end) + (if (null canna:*japanese-mode*) + (progn + (setq canna:*exit-japanese-mode* t) )) + (setq res (canna-do-function canna-func-henkan)) + (canna:enter-canna-mode) + (canna:display-candidates res) )) + +;; $B%+!<%=%k$N:8$K$"$k(B arg $B%o!<%I$N%m!<%^;z$r!X$+$s$J!Y$K?)$o$9!#(B + +(defun canna-rk-trans (arg) + (interactive "*p") + (let ((po (point))) + (skip-chars-backward "-a-zA-Z.,?!~") + (if (not (eq (point) po)) + (canna-rk-trans-region (point) po) ))) + +(defun canna-henkan-kakutei-and-self-insert (arg) + (interactive "*p") + (if canna:*japanese-mode* + (canna-functional-insert-command arg) + (progn + (setq unread-command-events (list last-command-event)) + (canna-kakutei-to-basic-stat)) )) + +(defun canna-kakutei-to-basic-stat () + (let ((res 0) + (kakutei canna-henkan-string)) + (while (not canna-empty-info) +; (setq res (canna-key-proc ?\C-m))) + (setq res (canna-do-function canna-func-kakutei))) + (setq canna-kakutei-string kakutei) + (canna:display-candidates (length canna-kakutei-string)) + (if (not canna:*japanese-mode*) + (mode-line-canna-mode-update canna:*alpha-mode-string*)) + )) + +(defun canna-minibuffer-henkan-kakutei-and-self-insert (arg) + (interactive "p") + (set-window-buffer (minibuffer-window) canna:*saved-minibuffer*) + (select-window canna:*previous-window*) + (if canna:*japanese-mode* + (canna:functional-insert-command2 last-command-event arg) + (progn + (setq unread-command-events (list last-command-event)) + (canna-kakutei-to-basic-stat)) )) + +(defun canna-setup-for-being-boiled () + (let ((ch (1+ ? ))) + (while (< ch 127) + (define-key canna-mode-map (make-string 1 ch) 'canna-henkan-kakutei-and-self-insert) + (define-key canna-minibuffer-mode-map (make-string 1 ch) 'canna-minibuffer-henkan-kakutei-and-self-insert) + (setq ch (1+ ch))))) + +(defvar rK-trans-key "\C-j" "for `boil' only") +(make-variable-buffer-local 'rK-trans-key) + +(defun canna-boil () + "`canna-boil' cooks `canna' as if `boil' does for `egg'." + (interactive) + (canna-setup-for-being-boiled) + (local-set-key rK-trans-key 'canna-rk-trans) + (message "boiled")) + +;; +;; $B?'$E$1$N$?$a$N4X?t(B +;; +(defun canna:yomi-attr-on (start end) + (if (overlayp canna:*yomi-overlay*) + (move-overlay canna:*yomi-overlay* start end) + (overlay-put (setq canna:*yomi-overlay* + (apply + 'make-overlay start end nil nil + (if (string< "20.2" emacs-version) (list t)))) + 'face + (if canna:color-p 'attr-yomi 'underline)))) + +(defun canna:yomi-attr-off (start end); + (and (overlayp canna:*yomi-overlay*) + (delete-overlay canna:*yomi-overlay*))) + +(defun canna:henkan-attr-on (start end) + (if (overlayp canna:*henkan-overlay*) + (move-overlay canna:*henkan-overlay* start end) + (overlay-put (setq canna:*henkan-overlay* + (apply + 'make-overlay start end nil nil + (if (string< "20.2" emacs-version) (list t)))) + 'face + (if canna:color-p 'attr-taishou 'region)))) + +(defun canna:henkan-attr-off (start end) + (and (overlayp canna:*henkan-overlay*) + (delete-overlay canna:*henkan-overlay*))) + +(defun canna:select-attr-on (start end) + (if (overlayp canna:*select-overlay*) + (move-overlay canna:*select-overlay* start end) + (overlay-put (setq canna:*select-overlay* + (apply + 'make-overlay start end nil nil + (if (string< "20.2" emacs-version) (list t)))) + 'face + 'attr-select))) + +(defun canna:select-attr-off (start end) + (and (overlayp canna:*select-overlay*) + (delete-overlay canna:*select-overlay*))) + +(if (fboundp 'eval-when-compile) + (eval-when-compile + (autoload 'picture-substitute "picture"))) +(if (featurep 'picture) + (progn + (picture-substitute 'self-insert-command 'canna-self-insert-command) + (picture-substitute 'completion-separator-self-insert-command + 'canna-self-insert-command) + (picture-substitute 'completion-separator-self-insert-autofilling + 'canna-self-insert-command))) + +(provide 'canna) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/egg-jsymbol.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,914 @@ +;; Japanese Character Input Package for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Mule (Multilingal Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;;; 92.10.18 modified for Mule Ver.0.9.6 by K.Handa +;;; Moved from egg.el +;;; 92.12.26 modified for Mule Ver.0.9.7 by T.Shingu +;;; JIS Hojo Kanji support. + +(provide 'egg-jsymbol) + +(defvar *ku1-alist* '( + ( "$B!!(B" . "$B!!(B") + ( "$B!"(B" . "$B!"(B") + ( "$B!#(B" . "$B!#(B") + ( "$B!$(B" . "$B!$(B") + ( "$B!%(B" . "$B!%(B") + ( "$B!&(B" . "$B!&(B") + ( "$B!'(B" . "$B!'(B") + ( "$B!((B" . "$B!((B") + ( "$B!)(B" . "$B!)(B") + ( "$B!*(B" . "$B!*(B") + ( "$B!+(B" . "$B!+(B") + ( "$B!,(B" . "$B!,(B") + ( "$B!-(B" . "$B!-(B") + ( "$B!.(B" . "$B!.(B") + ( "$B!/(B" . "$B!/(B") + ( "$B!0(B" . "$B!0(B") + ( "$B!1(B" . "$B!1(B") + ( "$B!2(B" . "$B!2(B") + ( "$B!3(B" . "$B!3(B") + ( "$B!4(B" . "$B!4(B") + ( "$B!5(B" . "$B!5(B") + ( "$B!6(B" . "$B!6(B") + ( "$B!7(B" . "$B!7(B") + ( "$B!8(B" . "$B!8(B") + ( "$B!9(B" . "$B!9(B") + ( "$B!:(B" . "$B!:(B") + ( "$B!;(B" . "$B!;(B") + ( "$B!<(B" . "$B!<(B") + ( "$B!=(B" . "$B!=(B") + ( "$B!>(B" . "$B!>(B") + ( "$B!?(B" . "$B!?(B") + ( "$B!@(B" . "$B!@(B") + ( "$B!A(B" . "$B!A(B") + ( "$B!B(B" . "$B!B(B") + ( "$B!C(B" . "$B!C(B") + ( "$B!D(B" . "$B!D(B") + ( "$B!E(B" . "$B!E(B") + ( "$B!F(B" . "$B!F(B") + ( "$B!G(B" . "$B!G(B") + ( "$B!H(B" . "$B!H(B") + ( "$B!I(B" . "$B!I(B") + ( "$B!J(B" . "$B!J(B") + ( "$B!K(B" . "$B!K(B") + ( "$B!L(B" . "$B!L(B") + ( "$B!M(B" . "$B!M(B") + ( "$B!N(B" . "$B!N(B") + ( "$B!O(B" . "$B!O(B") + ( "$B!P(B" . "$B!P(B") + ( "$B!Q(B" . "$B!Q(B") + ( "$B!R(B" . "$B!R(B") + ( "$B!S(B" . "$B!S(B") + ( "$B!T(B" . "$B!T(B") + ( "$B!U(B" . "$B!U(B") + ( "$B!V(B" . "$B!V(B") + ( "$B!W(B" . "$B!W(B") + ( "$B!X(B" . "$B!X(B") + ( "$B!Y(B" . "$B!Y(B") + ( "$B!Z(B" . "$B!Z(B") + ( "$B![(B" . "$B![(B") + ( "$B!\(B" . "$B!\(B") + ( "$B!](B" . "$B!](B") + ( "$B!^(B" . "$B!^(B") + ( "$B!_(B" . "$B!_(B") + ( "$B!`(B" . "$B!`(B") + ( "$B!a(B" . "$B!a(B") + ( "$B!b(B" . "$B!b(B") + ( "$B!c(B" . "$B!c(B") + ( "$B!d(B" . "$B!d(B") + ( "$B!e(B" . "$B!e(B") + ( "$B!f(B" . "$B!f(B") + ( "$B!g(B" . "$B!g(B") + ( "$B!h(B" . "$B!h(B") + ( "$B!i(B" . "$B!i(B") + ( "$B!j(B" . "$B!j(B") + ( "$B!k(B" . "$B!k(B") + ( "$B!l(B" . "$B!l(B") + ( "$B!m(B" . "$B!m(B") + ( "$B!n(B" . "$B!n(B") + ( "$B!o(B" . "$B!o(B") + ( "$B!p(B" . "$B!p(B") + ( "$B!q(B" . "$B!q(B") + ( "$B!r(B" . "$B!r(B") + ( "$B!s(B" . "$B!s(B") + ( "$B!t(B" . "$B!t(B") + ( "$B!u(B" . "$B!u(B") + ( "$B!v(B" . "$B!v(B") + ( "$B!w(B" . "$B!w(B") + ( "$B!x(B" . "$B!x(B") + ( "$B!y(B" . "$B!y(B") + ( "$B!z(B" . "$B!z(B") + ( "$B!{(B" . "$B!{(B") + ( "$B!|(B" . "$B!|(B") + ( "$B!}(B" . "$B!}(B") + ( "$B!~(B" . "$B!~(B") +)) +(defvar *ku2-alist* '( + ( "$B"!(B" . "$B"!(B") + ( "$B""(B" . "$B""(B") + ( "$B"#(B" . "$B"#(B") + ( "$B"$(B" . "$B"$(B") + ( "$B"%(B" . "$B"%(B") + ( "$B"&(B" . "$B"&(B") + ( "$B"'(B" . "$B"'(B") + ( "$B"((B" . "$B"((B") + ( "$B")(B" . "$B")(B") + ( "$B"*(B" . "$B"*(B") + ( "$B"+(B" . "$B"+(B") + ( "$B",(B" . "$B",(B") + ( "$B"-(B" . "$B"-(B") + ( "$B".(B" . "$B".(B") +; ( "$B"/(B" . "$B"/(B") +; ( "$B"0(B" . "$B"0(B") +; ( "$B"1(B" . "$B"1(B") +; ( "$B"2(B" . "$B"2(B") +; ( "$B"3(B" . "$B"3(B") +; ( "$B"4(B" . "$B"4(B") +; ( "$B"5(B" . "$B"5(B") +; ( "$B"6(B" . "$B"6(B") +; ( "$B"7(B" . "$B"7(B") +; ( "$B"8(B" . "$B"8(B") +; ( "$B"9(B" . "$B"9(B") + ( "$B":(B" . "$B":(B") + ( "$B";(B" . "$B";(B") + ( "$B"<(B" . "$B"<(B") + ( "$B"=(B" . "$B"=(B") + ( "$B">(B" . "$B">(B") + ( "$B"?(B" . "$B"?(B") + ( "$B"@(B" . "$B"@(B") + ( "$B"A(B" . "$B"A(B") +; ( "$B"B(B" . "$B"B(B") +; ( "$B"C(B" . "$B"C(B") +; ( "$B"D(B" . "$B"D(B") +; ( "$B"E(B" . "$B"E(B") +; ( "$B"F(B" . "$B"F(B") +; ( "$B"G(B" . "$B"G(B") +; ( "$B"H(B" . "$B"H(B") +; ( "$B"I(B" . "$B"I(B") + ( "$B"J(B" . "$B"J(B") + ( "$B"K(B" . "$B"K(B") + ( "$B"L(B" . "$B"L(B") + ( "$B"M(B" . "$B"M(B") + ( "$B"N(B" . "$B"N(B") + ( "$B"O(B" . "$B"O(B") + ( "$B"P(B" . "$B"P(B") +; ( "$B"Q(B" . "$B"Q(B") +; ( "$B"R(B" . "$B"R(B") +; ( "$B"S(B" . "$B"S(B") +; ( "$B"T(B" . "$B"T(B") +; ( "$B"U(B" . "$B"U(B") +; ( "$B"V(B" . "$B"V(B") +; ( "$B"W(B" . "$B"W(B") +; ( "$B"X(B" . "$B"X(B") +; ( "$B"Y(B" . "$B"Y(B") +; ( "$B"Z(B" . "$B"Z(B") +; ( "$B"[(B" . "$B"[(B") + ( "$B"\(B" . "$B"\(B") + ( "$B"](B" . "$B"](B") + ( "$B"^(B" . "$B"^(B") + ( "$B"_(B" . "$B"_(B") + ( "$B"`(B" . "$B"`(B") + ( "$B"a(B" . "$B"a(B") + ( "$B"b(B" . "$B"b(B") + ( "$B"c(B" . "$B"c(B") + ( "$B"d(B" . "$B"d(B") + ( "$B"e(B" . "$B"e(B") + ( "$B"f(B" . "$B"f(B") + ( "$B"g(B" . "$B"g(B") + ( "$B"h(B" . "$B"h(B") + ( "$B"i(B" . "$B"i(B") + ( "$B"j(B" . "$B"j(B") +; ( "$B"k(B" . "$B"k(B") +; ( "$B"l(B" . "$B"l(B") +; ( "$B"m(B" . "$B"m(B") +; ( "$B"n(B" . "$B"n(B") +; ( "$B"o(B" . "$B"o(B") +; ( "$B"p(B" . "$B"p(B") +; ( "$B"q(B" . "$B"q(B") + ( "$B"r(B" . "$B"r(B") + ( "$B"s(B" . "$B"s(B") + ( "$B"t(B" . "$B"t(B") + ( "$B"u(B" . "$B"u(B") + ( "$B"v(B" . "$B"v(B") + ( "$B"w(B" . "$B"w(B") + ( "$B"x(B" . "$B"x(B") + ( "$B"y(B" . "$B"y(B") +; ( "$B"z(B" . "$B"z(B") +; ( "$B"{(B" . "$B"{(B") +; ( "$B"|(B" . "$B"|(B") +; ( "$B"}(B" . "$B"}(B") + ( "$B"~(B" . "$B"~(B") +)) + +(defvar egg:*symbol-alist* (append *ku1-alist* *ku2-alist*)) + +(defvar *ku3-alist* '( +;I ( "$B#!(B" . "$B#!(B") +;II ( "$B#"(B" . "$B#"(B") +;III ( "$B##(B" . "$B##(B") +;IV ( "$B#$(B" . "$B#$(B") +;V ( "$B#%(B" . "$B#%(B") +;VI ( "$B#&(B" . "$B#&(B") +;VII ( "$B#'(B" . "$B#'(B") +;VIII ( "$B#((B" . "$B#((B") +;IX ( "$B#)(B" . "$B#)(B") +;X ( "$B#*(B" . "$B#*(B") +;XI ( "$B#+(B" . "$B#+(B") +;XII ( "$B#,(B" . "$B#,(B") +;XIII ( "$B#-(B" . "$B#-(B") +;XIV ( "$B#.(B" . "$B#.(B") +;XV ( "$B#/(B" . "$B#/(B") + ( "$B#0(B" . "$B#0(B") + ( "$B#1(B" . "$B#1(B") + ( "$B#2(B" . "$B#2(B") + ( "$B#3(B" . "$B#3(B") + ( "$B#4(B" . "$B#4(B") + ( "$B#5(B" . "$B#5(B") + ( "$B#6(B" . "$B#6(B") + ( "$B#7(B" . "$B#7(B") + ( "$B#8(B" . "$B#8(B") + ( "$B#9(B" . "$B#9(B") +;1/2 ( "$B#:(B" . "$B#:(B") +;1/3 ( "$B#;(B" . "$B#;(B") +;1/4 ( "$B#<(B" . "$B#<(B") +;2/3 ( "$B#=(B" . "$B#=(B") +;3/4 ( "$B#>(B" . "$B#>(B") +; ( "$B#?(B" . "$B#?(B") +; ( "$B#@(B" . "$B#@(B") + ( "$B#A(B" . "$B#A(B") + ( "$B#B(B" . "$B#B(B") + ( "$B#C(B" . "$B#C(B") + ( "$B#D(B" . "$B#D(B") + ( "$B#E(B" . "$B#E(B") + ( "$B#F(B" . "$B#F(B") + ( "$B#G(B" . "$B#G(B") + ( "$B#H(B" . "$B#H(B") + ( "$B#I(B" . "$B#I(B") + ( "$B#J(B" . "$B#J(B") + ( "$B#K(B" . "$B#K(B") + ( "$B#L(B" . "$B#L(B") + ( "$B#M(B" . "$B#M(B") + ( "$B#N(B" . "$B#N(B") + ( "$B#O(B" . "$B#O(B") + ( "$B#P(B" . "$B#P(B") + ( "$B#Q(B" . "$B#Q(B") + ( "$B#R(B" . "$B#R(B") + ( "$B#S(B" . "$B#S(B") + ( "$B#T(B" . "$B#T(B") + ( "$B#U(B" . "$B#U(B") + ( "$B#V(B" . "$B#V(B") + ( "$B#W(B" . "$B#W(B") + ( "$B#X(B" . "$B#X(B") + ( "$B#Y(B" . "$B#Y(B") + ( "$B#Z(B" . "$B#Z(B") +; ( "$B#[(B" . "$B#[(B") +; ( "$B#\(B" . "$B#\(B") +; ( "$B#](B" . "$B#](B") +; ( "$B#^(B" . "$B#^(B") +; ( "$B#_(B" . "$B#_(B") +; ( "$B#`(B" . "$B#`(B") + ( "$B#a(B" . "$B#a(B") + ( "$B#b(B" . "$B#b(B") + ( "$B#c(B" . "$B#c(B") + ( "$B#d(B" . "$B#d(B") + ( "$B#e(B" . "$B#e(B") + ( "$B#f(B" . "$B#f(B") + ( "$B#g(B" . "$B#g(B") + ( "$B#h(B" . "$B#h(B") + ( "$B#i(B" . "$B#i(B") + ( "$B#j(B" . "$B#j(B") + ( "$B#k(B" . "$B#k(B") + ( "$B#l(B" . "$B#l(B") + ( "$B#m(B" . "$B#m(B") + ( "$B#n(B" . "$B#n(B") + ( "$B#o(B" . "$B#o(B") + ( "$B#p(B" . "$B#p(B") + ( "$B#q(B" . "$B#q(B") + ( "$B#r(B" . "$B#r(B") + ( "$B#s(B" . "$B#s(B") + ( "$B#t(B" . "$B#t(B") + ( "$B#u(B" . "$B#u(B") + ( "$B#v(B" . "$B#v(B") + ( "$B#w(B" . "$B#w(B") + ( "$B#x(B" . "$B#x(B") + ( "$B#y(B" . "$B#y(B") + ( "$B#z(B" . "$B#z(B") +; ( "$B#{(B" . "$B#{(B") +; ( "$B#|(B" . "$B#|(B") +; ( "$B#}(B" . "$B#}(B") +; ( "$B#~(B" . "$B#~(B") +)) + +(defvar egg:*alphanumeric-alist* *ku3-alist*) + +(defvar *ku4-alist* '( + + ( "$B$!(B" . "$B$!(B") + ( "$B$"(B" . "$B$"(B") + ( "$B$#(B" . "$B$#(B") + ( "$B$$(B" . "$B$$(B") + ( "$B$%(B" . "$B$%(B") + ( "$B$&(B" . "$B$&(B") + ( "$B$'(B" . "$B$'(B") + ( "$B$((B" . "$B$((B") + ( "$B$)(B" . "$B$)(B") + ( "$B$*(B" . "$B$*(B") + ( "$B$+(B" . "$B$+(B") + ( "$B$,(B" . "$B$,(B") + ( "$B$-(B" . "$B$-(B") + ( "$B$.(B" . "$B$.(B") + ( "$B$/(B" . "$B$/(B") + ( "$B$0(B" . "$B$0(B") + ( "$B$1(B" . "$B$1(B") + ( "$B$2(B" . "$B$2(B") + ( "$B$3(B" . "$B$3(B") + ( "$B$4(B" . "$B$4(B") + ( "$B$5(B" . "$B$5(B") + ( "$B$6(B" . "$B$6(B") + ( "$B$7(B" . "$B$7(B") + ( "$B$8(B" . "$B$8(B") + ( "$B$9(B" . "$B$9(B") + ( "$B$:(B" . "$B$:(B") + ( "$B$;(B" . "$B$;(B") + ( "$B$<(B" . "$B$<(B") + ( "$B$=(B" . "$B$=(B") + ( "$B$>(B" . "$B$>(B") + ( "$B$?(B" . "$B$?(B") + ( "$B$@(B" . "$B$@(B") + ( "$B$A(B" . "$B$A(B") + ( "$B$B(B" . "$B$B(B") + ( "$B$C(B" . "$B$C(B") + ( "$B$D(B" . "$B$D(B") + ( "$B$E(B" . "$B$E(B") + ( "$B$F(B" . "$B$F(B") + ( "$B$G(B" . "$B$G(B") + ( "$B$H(B" . "$B$H(B") + ( "$B$I(B" . "$B$I(B") + ( "$B$J(B" . "$B$J(B") + ( "$B$K(B" . "$B$K(B") + ( "$B$L(B" . "$B$L(B") + ( "$B$M(B" . "$B$M(B") + ( "$B$N(B" . "$B$N(B") + ( "$B$O(B" . "$B$O(B") + ( "$B$P(B" . "$B$P(B") + ( "$B$Q(B" . "$B$Q(B") + ( "$B$R(B" . "$B$R(B") + ( "$B$S(B" . "$B$S(B") + ( "$B$T(B" . "$B$T(B") + ( "$B$U(B" . "$B$U(B") + ( "$B$V(B" . "$B$V(B") + ( "$B$W(B" . "$B$W(B") + ( "$B$X(B" . "$B$X(B") + ( "$B$Y(B" . "$B$Y(B") + ( "$B$Z(B" . "$B$Z(B") + ( "$B$[(B" . "$B$[(B") + ( "$B$\(B" . "$B$\(B") + ( "$B$](B" . "$B$](B") + ( "$B$^(B" . "$B$^(B") + ( "$B$_(B" . "$B$_(B") + ( "$B$`(B" . "$B$`(B") + ( "$B$a(B" . "$B$a(B") + ( "$B$b(B" . "$B$b(B") + ( "$B$c(B" . "$B$c(B") + ( "$B$d(B" . "$B$d(B") + ( "$B$e(B" . "$B$e(B") + ( "$B$f(B" . "$B$f(B") + ( "$B$g(B" . "$B$g(B") + ( "$B$h(B" . "$B$h(B") + ( "$B$i(B" . "$B$i(B") + ( "$B$j(B" . "$B$j(B") + ( "$B$k(B" . "$B$k(B") + ( "$B$l(B" . "$B$l(B") + ( "$B$m(B" . "$B$m(B") + ( "$B$n(B" . "$B$n(B") + ( "$B$o(B" . "$B$o(B") + ( "$B$p(B" . "$B$p(B") + ( "$B$q(B" . "$B$q(B") + ( "$B$r(B" . "$B$r(B") + ( "$B$s(B" . "$B$s(B") +; ( "$B$t(B" . "$B$t(B") +; ( "$B$u(B" . "$B$u(B") +; ( "$B$v(B" . "$B$v(B") +; ( "$B$w(B" . "$B$w(B") +; ( "$B$x(B" . "$B$x(B") +; ( "$B$y(B" . "$B$y(B") +; ( "$B$z(B" . "$B$z(B") +; ( "$B${(B" . "$B${(B") +; ( "$B$|(B" . "$B$|(B") +; ( "$B$}(B" . "$B$}(B") +; ( "$B$~(B" . "$B$~(B") +)) + +(defvar egg:*hiragana-alist* *ku4-alist*) + +(defvar *ku5-alist* '( + ( "$B%!(B" . "$B%!(B") + ( "$B%"(B" . "$B%"(B") + ( "$B%#(B" . "$B%#(B") + ( "$B%$(B" . "$B%$(B") + ( "$B%%(B" . "$B%%(B") + ( "$B%&(B" . "$B%&(B") + ( "$B%'(B" . "$B%'(B") + ( "$B%((B" . "$B%((B") + ( "$B%)(B" . "$B%)(B") + ( "$B%*(B" . "$B%*(B") + ( "$B%+(B" . "$B%+(B") + ( "$B%,(B" . "$B%,(B") + ( "$B%-(B" . "$B%-(B") + ( "$B%.(B" . "$B%.(B") + ( "$B%/(B" . "$B%/(B") + ( "$B%0(B" . "$B%0(B") + ( "$B%1(B" . "$B%1(B") + ( "$B%2(B" . "$B%2(B") + ( "$B%3(B" . "$B%3(B") + ( "$B%4(B" . "$B%4(B") + ( "$B%5(B" . "$B%5(B") + ( "$B%6(B" . "$B%6(B") + ( "$B%7(B" . "$B%7(B") + ( "$B%8(B" . "$B%8(B") + ( "$B%9(B" . "$B%9(B") + ( "$B%:(B" . "$B%:(B") + ( "$B%;(B" . "$B%;(B") + ( "$B%<(B" . "$B%<(B") + ( "$B%=(B" . "$B%=(B") + ( "$B%>(B" . "$B%>(B") + ( "$B%?(B" . "$B%?(B") + ( "$B%@(B" . "$B%@(B") + ( "$B%A(B" . "$B%A(B") + ( "$B%B(B" . "$B%B(B") + ( "$B%C(B" . "$B%C(B") + ( "$B%D(B" . "$B%D(B") + ( "$B%E(B" . "$B%E(B") + ( "$B%F(B" . "$B%F(B") + ( "$B%G(B" . "$B%G(B") + ( "$B%H(B" . "$B%H(B") + ( "$B%I(B" . "$B%I(B") + ( "$B%J(B" . "$B%J(B") + ( "$B%K(B" . "$B%K(B") + ( "$B%L(B" . "$B%L(B") + ( "$B%M(B" . "$B%M(B") + ( "$B%N(B" . "$B%N(B") + ( "$B%O(B" . "$B%O(B") + ( "$B%P(B" . "$B%P(B") + ( "$B%Q(B" . "$B%Q(B") + ( "$B%R(B" . "$B%R(B") + ( "$B%S(B" . "$B%S(B") + ( "$B%T(B" . "$B%T(B") + ( "$B%U(B" . "$B%U(B") + ( "$B%V(B" . "$B%V(B") + ( "$B%W(B" . "$B%W(B") + ( "$B%X(B" . "$B%X(B") + ( "$B%Y(B" . "$B%Y(B") + ( "$B%Z(B" . "$B%Z(B") + ( "$B%[(B" . "$B%[(B") + ( "$B%\(B" . "$B%\(B") + ( "$B%](B" . "$B%](B") + ( "$B%^(B" . "$B%^(B") + ( "$B%_(B" . "$B%_(B") + ( "$B%`(B" . "$B%`(B") + ( "$B%a(B" . "$B%a(B") + ( "$B%b(B" . "$B%b(B") + ( "$B%c(B" . "$B%c(B") + ( "$B%d(B" . "$B%d(B") + ( "$B%e(B" . "$B%e(B") + ( "$B%f(B" . "$B%f(B") + ( "$B%g(B" . "$B%g(B") + ( "$B%h(B" . "$B%h(B") + ( "$B%i(B" . "$B%i(B") + ( "$B%j(B" . "$B%j(B") + ( "$B%k(B" . "$B%k(B") + ( "$B%l(B" . "$B%l(B") + ( "$B%m(B" . "$B%m(B") + ( "$B%n(B" . "$B%n(B") + ( "$B%o(B" . "$B%o(B") + ( "$B%p(B" . "$B%p(B") + ( "$B%q(B" . "$B%q(B") + ( "$B%r(B" . "$B%r(B") + ( "$B%s(B" . "$B%s(B") + ( "$B%t(B" . "$B%t(B") + ( "$B%u(B" . "$B%u(B") + ( "$B%v(B" . "$B%v(B") +; ( "$B%w(B" . "$B%w(B") +; ( "$B%x(B" . "$B%x(B") +; ( "$B%y(B" . "$B%y(B") +; ( "$B%z(B" . "$B%z(B") +; ( "$B%{(B" . "$B%{(B") +; ( "$B%|(B" . "$B%|(B") +; ( "$B%}(B" . "$B%}(B") +; ( "$B%~(B" . "$B%~(B") +)) + +(defvar egg:*katakana-alist* *ku5-alist*) + +(defvar *ku6-alist* '( + ( "$B&!(B" . "$B&!(B") + ( "$B&"(B" . "$B&"(B") + ( "$B&#(B" . "$B&#(B") + ( "$B&$(B" . "$B&$(B") + ( "$B&%(B" . "$B&%(B") + ( "$B&&(B" . "$B&&(B") + ( "$B&'(B" . "$B&'(B") + ( "$B&((B" . "$B&((B") + ( "$B&)(B" . "$B&)(B") + ( "$B&*(B" . "$B&*(B") + ( "$B&+(B" . "$B&+(B") + ( "$B&,(B" . "$B&,(B") + ( "$B&-(B" . "$B&-(B") + ( "$B&.(B" . "$B&.(B") + ( "$B&/(B" . "$B&/(B") + ( "$B&0(B" . "$B&0(B") + ( "$B&1(B" . "$B&1(B") + ( "$B&2(B" . "$B&2(B") + ( "$B&3(B" . "$B&3(B") + ( "$B&4(B" . "$B&4(B") + ( "$B&5(B" . "$B&5(B") + ( "$B&6(B" . "$B&6(B") + ( "$B&7(B" . "$B&7(B") + ( "$B&8(B" . "$B&8(B") +; ( "$B&9(B" . "$B&9(B") +; ( "$B&:(B" . "$B&:(B") +; ( "$B&;(B" . "$B&;(B") +; ( "$B&<(B" . "$B&<(B") +; ( "$B&=(B" . "$B&=(B") +; ( "$B&>(B" . "$B&>(B") +; ( "$B&?(B" . "$B&?(B") +; ( "$B&@(B" . "$B&@(B") + ( "$B&A(B" . "$B&A(B") + ( "$B&B(B" . "$B&B(B") + ( "$B&C(B" . "$B&C(B") + ( "$B&D(B" . "$B&D(B") + ( "$B&E(B" . "$B&E(B") + ( "$B&F(B" . "$B&F(B") + ( "$B&G(B" . "$B&G(B") + ( "$B&H(B" . "$B&H(B") + ( "$B&I(B" . "$B&I(B") + ( "$B&J(B" . "$B&J(B") + ( "$B&K(B" . "$B&K(B") + ( "$B&L(B" . "$B&L(B") + ( "$B&M(B" . "$B&M(B") + ( "$B&N(B" . "$B&N(B") + ( "$B&O(B" . "$B&O(B") + ( "$B&P(B" . "$B&P(B") + ( "$B&Q(B" . "$B&Q(B") + ( "$B&R(B" . "$B&R(B") + ( "$B&S(B" . "$B&S(B") + ( "$B&T(B" . "$B&T(B") + ( "$B&U(B" . "$B&U(B") + ( "$B&V(B" . "$B&V(B") + ( "$B&W(B" . "$B&W(B") + ( "$B&X(B" . "$B&X(B") +; ( "$B&Y(B" . "$B&Y(B") +; ( "$B&Z(B" . "$B&Z(B") +; ( "$B&[(B" . "$B&[(B") +; ( "$B&\(B" . "$B&\(B") +; ( "$B&](B" . "$B&](B") +; ( "$B&^(B" . "$B&^(B") +; ( "$B&_(B" . "$B&_(B") +; ( "$B&`(B" . "$B&`(B") +;(a) ( "$B&a(B" . "$B&a(B") +;(b) ( "$B&b(B" . "$B&b(B") +;(c) ( "$B&c(B" . "$B&c(B") +;(d) ( "$B&d(B" . "$B&d(B") +;(e) ( "$B&e(B" . "$B&e(B") +;(f) ( "$B&f(B" . "$B&f(B") +;(g) ( "$B&g(B" . "$B&g(B") +;(h) ( "$B&h(B" . "$B&h(B") +;(i) ( "$B&i(B" . "$B&i(B") +;(j) ( "$B&j(B" . "$B&j(B") +;(k) ( "$B&k(B" . "$B&k(B") +;(l) ( "$B&l(B" . "$B&l(B") +;(m) ( "$B&m(B" . "$B&m(B") +;(n) ( "$B&n(B" . "$B&n(B") +;(o) ( "$B&o(B" . "$B&o(B") +;(p) ( "$B&p(B" . "$B&p(B") +;(q) ( "$B&q(B" . "$B&q(B") +;(r) ( "$B&r(B" . "$B&r(B") +;(s) ( "$B&s(B" . "$B&s(B") +;(t) ( "$B&t(B" . "$B&t(B") +;(u) ( "$B&u(B" . "$B&u(B") +;(v) ( "$B&v(B" . "$B&v(B") +;(w) ( "$B&w(B" . "$B&w(B") +;(x) ( "$B&x(B" . "$B&x(B") +;(y) ( "$B&y(B" . "$B&y(B") +;(z) ( "$B&z(B" . "$B&z(B") +; ( "$B&{(B" . "$B&{(B") +; ( "$B&|(B" . "$B&|(B") +; ( "$B&}(B" . "$B&}(B") +; ( "$B&~(B" . "$B&~(B") +)) + +(defvar egg:*greek-alist* *ku6-alist*) + +(defvar *ku7-alist* '( + ( "$B'!(B" . "$B'!(B") + ( "$B'"(B" . "$B'"(B") + ( "$B'#(B" . "$B'#(B") + ( "$B'$(B" . "$B'$(B") + ( "$B'%(B" . "$B'%(B") + ( "$B'&(B" . "$B'&(B") + ( "$B''(B" . "$B''(B") + ( "$B'((B" . "$B'((B") + ( "$B')(B" . "$B')(B") + ( "$B'*(B" . "$B'*(B") + ( "$B'+(B" . "$B'+(B") + ( "$B',(B" . "$B',(B") + ( "$B'-(B" . "$B'-(B") + ( "$B'.(B" . "$B'.(B") + ( "$B'/(B" . "$B'/(B") + ( "$B'0(B" . "$B'0(B") + ( "$B'1(B" . "$B'1(B") + ( "$B'2(B" . "$B'2(B") + ( "$B'3(B" . "$B'3(B") + ( "$B'4(B" . "$B'4(B") + ( "$B'5(B" . "$B'5(B") + ( "$B'6(B" . "$B'6(B") + ( "$B'7(B" . "$B'7(B") + ( "$B'8(B" . "$B'8(B") + ( "$B'9(B" . "$B'9(B") + ( "$B':(B" . "$B':(B") + ( "$B';(B" . "$B';(B") + ( "$B'<(B" . "$B'<(B") + ( "$B'=(B" . "$B'=(B") + ( "$B'>(B" . "$B'>(B") + ( "$B'?(B" . "$B'?(B") + ( "$B'@(B" . "$B'@(B") + ( "$B'A(B" . "$B'A(B") +;(1) ( "$B'B(B" . "$B'B(B") +;(2) ( "$B'C(B" . "$B'C(B") +;(3) ( "$B'D(B" . "$B'D(B") +;(4) ( "$B'E(B" . "$B'E(B") +;(5) ( "$B'F(B" . "$B'F(B") +;(6) ( "$B'G(B" . "$B'G(B") +;(7) ( "$B'H(B" . "$B'H(B") +;(8) ( "$B'I(B" . "$B'I(B") +;(9) ( "$B'J(B" . "$B'J(B") +;(10) ( "$B'K(B" . "$B'K(B") +;(11) ( "$B'L(B" . "$B'L(B") +;(12) ( "$B'M(B" . "$B'M(B") +;(13) ( "$B'N(B" . "$B'N(B") +;(14) ( "$B'O(B" . "$B'O(B") +;(15) ( "$B'P(B" . "$B'P(B") + ( "$B'Q(B" . "$B'Q(B") + ( "$B'R(B" . "$B'R(B") + ( "$B'S(B" . "$B'S(B") + ( "$B'T(B" . "$B'T(B") + ( "$B'U(B" . "$B'U(B") + ( "$B'V(B" . "$B'V(B") + ( "$B'W(B" . "$B'W(B") + ( "$B'X(B" . "$B'X(B") + ( "$B'Y(B" . "$B'Y(B") + ( "$B'Z(B" . "$B'Z(B") + ( "$B'[(B" . "$B'[(B") + ( "$B'\(B" . "$B'\(B") + ( "$B'](B" . "$B'](B") + ( "$B'^(B" . "$B'^(B") + ( "$B'_(B" . "$B'_(B") + ( "$B'`(B" . "$B'`(B") + ( "$B'a(B" . "$B'a(B") + ( "$B'b(B" . "$B'b(B") + ( "$B'c(B" . "$B'c(B") + ( "$B'd(B" . "$B'd(B") + ( "$B'e(B" . "$B'e(B") + ( "$B'f(B" . "$B'f(B") + ( "$B'g(B" . "$B'g(B") + ( "$B'h(B" . "$B'h(B") + ( "$B'i(B" . "$B'i(B") + ( "$B'j(B" . "$B'j(B") + ( "$B'k(B" . "$B'k(B") + ( "$B'l(B" . "$B'l(B") + ( "$B'm(B" . "$B'm(B") + ( "$B'n(B" . "$B'n(B") + ( "$B'o(B" . "$B'o(B") + ( "$B'p(B" . "$B'p(B") + ( "$B'q(B" . "$B'q(B") +;i ( "$B'r(B" . "$B'r(B") +;ii ( "$B's(B" . "$B's(B") +;iii ( "$B't(B" . "$B't(B") +;iv ( "$B'u(B" . "$B'u(B") +;v ( "$B'v(B" . "$B'v(B") +;vi ( "$B'w(B" . "$B'w(B") +;vii ( "$B'x(B" . "$B'x(B") +;viii ( "$B'y(B" . "$B'y(B") +;ix ( "$B'z(B" . "$B'z(B") +;x ( "$B'{(B" . "$B'{(B") +;| ( "$B'|(B" . "$B'|(B") +;' ( "$B'}(B" . "$B'}(B") +;'' ( "$B'~(B" . "$B'~(B") +)) + +(defvar egg:*russian-alist* *ku7-alist*) + +(defvar *ku8-alist* '( + ( "$B(!(B" . "$B(!(B") + ( "$B("(B" . "$B("(B") + ( "$B(#(B" . "$B(#(B") + ( "$B($(B" . "$B($(B") + ( "$B(%(B" . "$B(%(B") + ( "$B(&(B" . "$B(&(B") + ( "$B('(B" . "$B('(B") + ( "$B(((B" . "$B(((B") + ( "$B()(B" . "$B()(B") + ( "$B(*(B" . "$B(*(B") + ( "$B(+(B" . "$B(+(B") + ( "$B(,(B" . "$B(,(B") + ( "$B(-(B" . "$B(-(B") + ( "$B(.(B" . "$B(.(B") + ( "$B(/(B" . "$B(/(B") + ( "$B(0(B" . "$B(0(B") + ( "$B(1(B" . "$B(1(B") + ( "$B(2(B" . "$B(2(B") + ( "$B(3(B" . "$B(3(B") + ( "$B(4(B" . "$B(4(B") + ( "$B(5(B" . "$B(5(B") + ( "$B(6(B" . "$B(6(B") + ( "$B(7(B" . "$B(7(B") + ( "$B(8(B" . "$B(8(B") + ( "$B(9(B" . "$B(9(B") + ( "$B(:(B" . "$B(:(B") + ( "$B(;(B" . "$B(;(B") + ( "$B(<(B" . "$B(<(B") + ( "$B(=(B" . "$B(=(B") + ( "$B(>(B" . "$B(>(B") + ( "$B(?(B" . "$B(?(B") + ( "$B(@(B" . "$B(@(B") +; ( "$B(A(B" . "$B(A(B") +; ( "$B(B(B" . "$B(B(B") +; ( "$B(C(B" . "$B(C(B") +; ( "$B(D(B" . "$B(D(B") +; ( "$B(E(B" . "$B(E(B") +;* ( "$B(F(B" . "$B(F(B") +;* ( "$B(G(B" . "$B(G(B") +;* ( "$B(H(B" . "$B(H(B") +;* ( "$B(I(B" . "$B(I(B") +;* ( "$B(J(B" . "$B(J(B") +;* ( "$B(K(B" . "$B(K(B") +;* ( "$B(L(B" . "$B(L(B") +;* ( "$B(M(B" . "$B(M(B") +;* ( "$B(N(B" . "$B(N(B") +;* ( "$B(O(B" . "$B(O(B") +;* ( "$B(P(B" . "$B(P(B") +;* ( "$B(Q(B" . "$B(Q(B") +;* ( "$B(R(B" . "$B(R(B") +;* ( "$B(S(B" . "$B(S(B") +;* ( "$B(T(B" . "$B(T(B") +;* ( "$B(U(B" . "$B(U(B") +;* ( "$B(V(B" . "$B(V(B") +;* ( "$B(W(B" . "$B(W(B") +;* ( "$B(X(B" . "$B(X(B") +;* ( "$B(Y(B" . "$B(Y(B") +;* ( "$B(Z(B" . "$B(Z(B") +;* ( "$B([(B" . "$B([(B") +;* ( "$B(\(B" . "$B(\(B") +;* ( "$B(](B" . "$B(](B") +;* ( "$B(^(B" . "$B(^(B") +;* ( "$B(_(B" . "$B(_(B") +;* ( "$B(`(B" . "$B(`(B") +;* ( "$B(a(B" . "$B(a(B") +;* ( "$B(b(B" . "$B(b(B") +;* ( "$B(c(B" . "$B(c(B") +;* ( "$B(d(B" . "$B(d(B") +;* ( "$B(e(B" . "$B(e(B") +;* ( "$B(f(B" . "$B(f(B") +;* ( "$B(g(B" . "$B(g(B") +;* ( "$B(h(B" . "$B(h(B") +;* ( "$B(i(B" . "$B(i(B") +;* ( "$B(j(B" . "$B(j(B") +;* ( "$B(k(B" . "$B(k(B") +;* ( "$B(l(B" . "$B(l(B") +;* ( "$B(m(B" . "$B(m(B") +;* ( "$B(n(B" . "$B(n(B") +;* ( "$B(o(B" . "$B(o(B") +;* ( "$B(p(B" . "$B(p(B") +;* ( "$B(q(B" . "$B(q(B") +;* ( "$B(r(B" . "$B(r(B") +;* ( "$B(s(B" . "$B(s(B") +;* ( "$B(t(B" . "$B(t(B") +;* ( "$B(u(B" . "$B(u(B") +;* ( "$B(v(B" . "$B(v(B") +;* ( "$B(w(B" . "$B(w(B") +;* ( "$B(x(B" . "$B(x(B") +;* ( "$B(y(B" . "$B(y(B") +;* ( "$B(z(B" . "$B(z(B") +; ( "$B({(B" . "$B({(B") +; ( "$B(|(B" . "$B(|(B") +; ( "$B(}(B" . "$B(}(B") +; ( "$B(~(B" . "$B(~(B") +)) + +(defvar egg:*keisen-alist* *ku8-alist*) + +(defun make-all-jis-code-alist () + (let ((result nil) (ku 116)) + (while (< 32 ku) + (let ((ten 126)) + (while (< 32 ten) + (setq result (cons + (let ((str (make-string 1 0))) + (aset str 0 (make-char 'japanese-jisx0208 ku ten)) + (cons str str)) + result)) + (setq ten (1- ten)))) + (setq ku (1- ku))) + result)) + +(defun make-jis-first-level-code-alist () + (let ((result nil) (ku 79)) + (while (<= 48 ku) + (let ((ten 126)) + (while (<= 33 ten) + (setq result (cons + (let ((str (make-string 1 0))) + (aset str 0 (make-char 'japanese-jisx0208 ku ten)) + (cons str str)) + result)) + (setq ten (1- ten)))) + (setq ku (1- ku))) + result)) + +(defun make-jis-second-level-code-alist () + (let ((result nil) (ku 116)) + (while (<= 80 ku) + (let ((ten 126)) + (while (<= 33 ten) + (setq result (cons + (let ((str (make-string 1 0))) + (aset str 0 (make-char 'japanese-jisx0208 ku ten)) + (cons str str)) + result)) + (setq ten (1- ten)))) + (setq ku (1- ku))) + result)) + +(defun make-jis-hojo-kanji-code-alist () + (let ((result nil) (ku 109)) + (while (<= 34 ku) + (let ((ten 126)) + (while (<= 33 ten) + (setq result (cons + (let ((str (make-string 1 0))) ; by T.Shingu + (aset str 0 (make-char 'japanese-jisx0212 ku ten)) + (cons str str)) + result)) + (setq ten (1- ten)))) + (setq ku (1- ku))) + result)) + +;;;(defvar egg:*all-jis-code-alist* (make-all-jis-code-alist)) + +(defvar egg:*first-level-alist* (make-jis-first-level-code-alist)) +(defvar egg:*second-level-alist* (make-jis-second-level-code-alist)) +(defvar egg:*hojo-kanji-alist* (make-jis-hojo-kanji-code-alist)) + +(defvar *symbol-input-menu* + (list 'menu "$B5-9fF~NO(B:" + (list + (cons "JIS$BF~NO(B" + '(jis-code-input)) + (cons "$B5-9f(B" + (list 'menu "$B5-9f(B:" egg:*symbol-alist*)) + (cons "$B1Q?t;z(B" + (list 'menu "$B1Q?t;z(B:" egg:*alphanumeric-alist*)) + (cons "$B$R$i$,$J(B" + (list 'menu "$B$R$i$,$J(B:" egg:*hiragana-alist*)) + (cons "$B%+%?%+%J(B" + (list 'menu "$B%+%?%+%J(B:" egg:*katakana-alist*)) + (cons "$B%.%j%7%cJ8;z(B" + (list 'menu "$B%.%j%7%cJ8;z(B:" egg:*greek-alist*)) + (cons "$B%m%7%"J8;z(B" + (list 'menu "$B%m%7%"J8;z(B:" egg:*russian-alist*)) + (cons "$B7S@~(B" + (list 'menu "$B7S@~(B:" egg:*keisen-alist*)) + ;; 92.7.8 by T.Shingu + (cons "$BIt/$7;~4V$,3]$+$j$^$9!#!K(B" + ;; (list 'menu "$BA4%3!<%I(B:" egg:*all-jis-code-alist*)) + ))) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/egg-keymap.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,118 @@ +;; Usefull key binding for Sun Function keys +;; Coded by Yutaka Ishikawa at ETL (yisikawa@etl.junet) + +;; This file is part of Egg on Mule (Multilingual Environment) + +;; Egg is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with Mule; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; 92.4.16 modified for Mule Ver.0.9.3 by K.Handa + +;; +;; Table of Function key codes: +;; +;;; x11term xterm +;;; +;;; XK_F1: [f1] "\e[11~" +;;; XK_F2: [f2] "\e[12~" +;;; XK_F3: [f3] "\e[13~" +;;; XK_F4: [f4] "\e[14~" +;;; XK_F5: [f5] "\e[15~" +;;; XK_F6: [f5] "\e[17~" +;;; XK_F7: [f7] "\e[18~" +;;; XK_F8: [f8] "\e[19~" +;;; XK_F9: [f9] "\e[20~" +;;; +;;; XK_F10: [f10] "\e[21~" +;;; XK_F11: [f11] "\e[23~" +;;; XK_F12: [f12] "\e[24~" +;;; XK_F13: [f13] "\e[25~" +;;; XK_F14: [f14] "\e[26~" +;;; XK_F15: [f15] "\e[28~" +;;; XK_Help: [help] "\e[28~" +;;; XK_F16: [f16] "\e[29~" +;;; XK_Menu: ??? "\e[29~" +;;; XK_F17: [f17] "\e[31~" +;;; XK_F18: [f18] "\e[32~" +;;; XK_F19: [f19] "\e[33~" +;;; XK_F20: [f20] "\e[34~" +;;; +;;; XK_Find : [find] "\e[1~" +;;; XK_Insert: [insert] "\e[2~" +;;; XK_Delete: [delete] "\e[3~" +;;; XK_Select: ??? "\e[4~" +;;; XK_Prior: [prior] "\e[5~" +;;; XK_Next: [next] "\e[6~" +;;; +;;; XK_Left: [left] "\eOC"(XK_R12) +;;; XK_Right: [right] "\eOD"(XK_R10) +;;; XK_Up: [up] "\eOA"(XK_R8) +;;; XK_Down: [down] "\eOB"(XK_R10) +;;; + +;;; +;;; Key bindings for X11 terminals(x11term) +;;; + +(define-key global-map [f1] 'set-buffer-file-coding-system) +(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] '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 global-map [f12] 'insert-file) +(define-key global-map [f13] 'eval-region) +(define-key global-map [f14] 'eval-current-buffer) +(define-key global-map [f15] 'enlarge-window) +(define-key global-map [f16] 'shrink-window) +(define-key global-map [f17] 'revert-buffer) +(define-key global-map [f18] 'revert-buffer) +(define-key global-map [f19] 'beginning-of-buffer) +(define-key global-map [f20] 'end-of-buffer) + +;;; +;;; Key bindings for non X11 terminal([kx]term) +;;; + +(defvar sun-fkeymap (make-keymap)) +(fset 'sun-fprefix sun-fkeymap) + +(define-key global-map "\e[" 'sun-fprefix) +(define-key sun-fkeymap "[" 'backward-paragraph) ; old "\e[" assignment +(define-key sun-fkeymap "11~" + 'set-buffer-file-coding-system) ; F1 92.4.16 by K.Handa +(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~" '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 +(define-key sun-fkeymap "24~" 'insert-file) ; F12 or L2 +(define-key sun-fkeymap "25~" 'eval-region) ; F13 or L3 +(define-key sun-fkeymap "26~" 'eval-current-buffer) ; F14 or L4 +(define-key sun-fkeymap "28~" 'enlarge-window) ; F15 or Help or L5 +(define-key sun-fkeymap "29~" 'shrink-window) ; F16 or Menu or L6 +(define-key sun-fkeymap "31~" 'revert-buffer) ; F17 or L7 +(define-key sun-fkeymap "32~" 'revert-buffer) ; F18 or L8 +(define-key sun-fkeymap "33~" 'beginning-of-buffer) ; F19 or L9 +(define-key sun-fkeymap "34~" 'end-of-buffer) ; F20 or L10 --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/egg.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,2843 @@ +;; Japanese Character Input Package for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Mule (Multilingal Environment) + +;; Egg is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;;================================================================== +;;; +;;; $BF|K\8l4D6-(B $B!V$?$^$4!W(B $BBh#3HG(B +;;; +;;;=================================================================== + +;;; +;;;$B!V$?$^$4!W$O%M%C%H%o!<%/$+$J4A;zJQ49%5!<%P$rMxMQ$7!"(BMule $B$G$NF|K\(B +;;; $B8l4D6-$rDs6!$9$k%7%9%F%`$G$9!#!V$?$^$4!WBh#2HG$G$O(B Wnn V3 $B$*$h$S(B +;;; Wnn V4 $B$N$+$J4A;zJQ49%5!<%P$r;HMQ$7$F$$$^$9!#(B +;;; + +;;; $BL>A0$O(B $B!VBt;3(B/$BBT$?$;$F(B/$B$4$a$s$J$5$$!W$N3FJ8@a$N@hF,#12;$G$"$k!V$?!W(B +;;; $B$H!V$^!W$H!V$4!W$r$K0M$k$b$N$G$9!#(Begg $B$O!V$?$^$4!W$N1QLu$G$9!#(B + +;;; +;;; $B;HMQK!$O(B info/egg-jp $B$r8+$F2<$5$$!#(B +;;; + +;;; +;;; $B!V$?$^$4!W$K4X$9$kDs0F!"Cn>pJs$O(B tomura@etl.go.jp $B$K$*Aw$j2<$5$$!#(B +;;; + +;;; +;;; $B")(B 305 $B0q>k8)$D$/$P;TG_1`(B1-1-4 +;;; $BDL;:>J9)6H5;=Q1!EE;R5;=QAm9g8&5f=j(B +;;; $B>pJs%"!<%-%F%/%A%cIt8@8l%7%9%F%`8&5f<<(B +;;; +;;; $B8MB<(B $BE/(B + +;;; +;;; ($BCm0U(B)$B$3$N%U%!%$%k$O4A;z%3!<%I$r4^$s$G$$$^$9!#(B +;;; +;;; $BBh#3HG(B $B#1#9#9#1G/#27n(B $B#4F|(B +;;; $BBh#2HG(B $B#1#9#8#9G/#67n(B $B#1F|(B +;;; $BBh#1HG(B $B#1#9#8#8G/#77n#1#4F|(B +;;; $B;CDjHG(B $B#1#9#8#8G/#67n#2#4F|(B + +;;;=================================================================== +;;; +;;; (eval-when (load) (require 'wnn-client)) +;;; + +(defvar egg-version "3.09" "Version number of this version of Egg. ") +;;; Last modified date: Fri Sep 25 12:59:00 1992 + +;;;; $B=$@5MW5a%j%9%H(B + +;;;; read-hiragana-string, read-kanji-string $B$G;HMQ$9$kJ?2>L>F~NO%^%C%W$r(B roma-kana $B$K8GDj$7$J$$$GM_$7$$!%(B + +;;;; $B=$@5%a%b(B + +;;; 95.6.5 modified by S.Tomura +;;; $BJQ49D>8e$KO"B3$7$FJQ49$9$k>l9g$rG'<1$9$k$?$a$K!"(B"-in-cont" $B$K4XO"$7$?(B +;;; $BItJ,$rDI2C$7$?!#!J$3$NItJ,$O>-Mh:F=$@5$9$kM=Dj!#!K(B + +;;; 93.6.19 modified by T.Shingu +;;; egg:*in-fence-mode* should be buffer local. + +;;; 93.6.4 modified by T.Shingu +;;; In its-defrule**, length is called instead of chars-in-string. + +;;; 93.3.15 modified by T.Enami +;;; egg-self-insert-command simulates the original more perfectly. + +;;; 92.12.20 modified by S.Tomura +;;; In its:simulate-input, sref is called instead of aref. + +;;; 92.12.20 modified by T.Enami +;;; egg-self-insert-command calls cancel-undo-boundary to simulate original. + +;;; 92.11.4 modified by M.Higashida +;;; read-hiragana-string sets minibuffer-preprompt correctly. + +;;; 92.10.26, 92.10.30 modified by T.Saneto sanewo@pdp.crl.sony.co.jp +;;; typo fixed. + +;;; 92.10.18 modified by K. Handa +;;; special-symbol-input $BMQ$N%F!<%V%k$r(B autoload $B$K!#(B +;;; busyu.el $B$N(B autoload $B$N;XDj$r(B mule-init.el $B$+$i(B egg.el $B$K0\$9!#(B + +;;; 92.9.20 modified by S. Tomura +;;;; hiragana-region $B$NCn$N=$@5(B + +;;;; 92.9.19 modified by Y. Kawabe +;;;; some typos + +;;;; 92.9.19 modified by Y. Kawabe +;;;; menu $B$NI=<(4X78$N(B lenght $B$r(B string-width $B$KCV$-49$($k!%(B + +;;; 92.8.19 modified for Mule Ver.0.9.6 by K.Handa +;;;; menu:select-from-menu calls string-width instead of length. + +;;;; 92.8.1 modified by S. Tomura +;;;; internal mode $B$rDI2C!%(Bits:*internal-mode-alist* $BDI2C!%(B + +;;;; 92.7.31 modified by S. Tomura +;;;; its-mode-map $B$,(B super mode map $B$r;}$D$h$&$KJQ99$7$?!%$3$l$K$h$j(B +;;;; mode map $B$,6&M-$G$-$k!%(B its-define-mode, get-next-map $B$J$I$rJQ99!%(B +;;;; get-next-map-locally $B$rDI2C!%(Bits-defrule** $B$rJQ99!%(B + +;;;; 92.7.31 modified by S. Tomura +;;;; its:make-kanji-buffer , its:*kanji* $B4XO"%3!<%I$r:o=|$7$?!%(B + +;;;; 92.7.31 modified by S. Tomura +;;;; egg:select-window-hook $B$r=$@5$7!$(Bminibuffer $B$+$i(B exit $B$9$k$H$-$K!$(B +;;;; $B3F +;;; Attribute bold can be used. +;;; Unnecessary '*' in comments of variables deleted. +;;; 92.7.8 modified for Mule Ver.0.9.5 by Y.Kawabe +;;; special-symbol-input keeps the position selected last. +;;; 92.7.8 modified for Mule Ver.0.9.5 by T.Shingu +;;; busyu-input and kakusuu-input are added in *symbol-input-menu*. +;;; 92.7.7 modified for Mule Ver.0.9.5 by K.Handa +;;; In egg:quit-mode, overwrite-mode is supported correctly. +;;; egg:*overwrite-mode-deleted-chars* is not used now. +;;; 92.6.26 modified for Mule Ver.0.9.5 by K.Handa +;;; Funtion dump-its-mode-map gets obsolete. +;;; 92.6.26 modified for Mule Ver.0.9.5 by M.Shikida +;;; Backquote ` is registered in *hankaku-alist* and *zenkaku-alist*. +;;; 92.6.17 modified for Mule Ver.0.9.5 by T.Shingu +;;; Bug in make-jis-second-level-code-alist fixed. +;;; 92.6.14 modified for Mule Ver.0.9.5 by T.Enami +;;; menu:select-from-menu is replaced with new version. +;;; 92.5.18 modified for Mule Ver.0.9.4 by T.Shingu +;;; lisp/wnn-egg.el is devided into two parts: this file and wnn*-egg.el. + +;;;; +;;;; Mule Ver.0.9.3 $B0JA0(B +;;;; + +;;;; April-15-92 for Mule Ver.0.9.3 +;;;; by T.Enami and K.Handa +;;;; notify-internal calls 'message' with correct argument. + +;;;; April-11-92 for Mule Ver.0.9.3 +;;;; by T.Enami and K.Handa +;;;; minibuffer $B$+$iH4$1$k;~(B egg:select-window-hook $B$G(B egg:*input-mode* $B$r(B +;;;; t $B$K$9$k!#(Bhook $B$N7A$rBgI}=$@5!#(B + +;;;; April-3-92 for Mule Ver.0.9.2 by T.Enami +;;;; minibuffer $B$+$iH4$1$k;~(B egg:select-window-hook $B$,(B new-buffer $B$N(B +;;;; egg:*mode-on* $B$J$I$r(B nil $B$K$7$F$$$k$N$r=$@5!#(B + +;;;; Mar-22-92 by K.Handa +;;;; etags $B$,:n$k(B TAGS $B$KITI,MW$J$b$N$rF~$l$J$$$h$&$K$9$k$?$a4X?tL>JQ99(B +;;;; define-its-mode -> its-define-mode, defrule -> its-defrule + +;;;; Mar-16-92 by K.Handa +;;;; global-map $B$X$N(B define-key $B$r(B mule-keymap $B$KJQ99!#(B + +;;;; Mar-13-92 by K.Handa +;;;; Language specific part $B$r(B japanese.el,... $B$K0\$7$?!#(B + +;;;; Feb-*-92 by K. Handa +;;;; nemacs 4 $B$G$O(B minibuffer-window-selected $B$,GQ;_$K$J$j!$4XO"$9$k%3!<%I$r:o=|$7$?!%(B + +;;;; Jan-13-92 by S. Tomura +;;;; mc-emacs or nemacs 4 $BBP1~:n6H3+;O!%(B + +;;;; Aug-9-91 by S. Tomura +;;;; ?\^ $B$r(B ?^ $B$K=$@5!%(B + +;;;; menu $B$r(B key map $B$r8+$k$h$&$K$9$k!%(B + +;;;; Jul-6-91 by S. Tomura +;;;; setsysdict $B$N(B error $B%a%C%;!<%8$rJQ99!%(B + +;;;; Jun-11-91 by S. Tomura +;;;; its:*defrule-verbose* $B$rDI2C!%(B +;;;; + +;;;; Mar-25-91 by S. Tomura +;;;; reset-its-mode $B$rGQ;_(B + +;;;; Mar-23-91 by S. Tomura +;;;; read-hiragana-string $B$r=$@5!$(B read-kanji-string $B$rDI2C!$(B +;;;; isearch:read-kanji-string $B$r@_Dj!%(B + +;;;; Mar-22-91 by S. Tomura +;;;; defrule-conditional, defrule-select-mode-temporally $B$rDI2C!#(B +;;;; for-each $B$N4J0WHG$H$7$F(B dolist $B$rDI2C!#(B +;;;; enable-double-n-syntax $B$r3hMQ!%$[$+$K(B use-kuten-for-comma, use-touten-for-period $B$rDI2C(B + +;;;; Mar-5-91 by S. Tomura +;;;; roma-kana-word, henkan-word, roma-kanji-word $B$rDI2C$7$?!%(B + +;;;; Jan-14-91 by S. Tomura +;;;; $BF~NOJ8;zJQ497O(B ITS(Input character Translation System) $B$r2~B$$9$k!%(B +;;;; $BJQ49$O:G:8:GD9JQ49$r9T$J$$!$JQ49$N$J$$$b$N$O$b$H$N$^$^$H$J$k!%(B +;;;; $B2~B$$NF05!$ON)LZ!w7D1~$5$s$N%O%s%0%kJ8;z$NF~NOMW5a$G$"$k!%(B +;;;; its:* $B$rDI2C$7$?!%$^$?=>Mh(B fence-self-insert-command $B$H(B roma-kana-region +;;;; $BFs2U=j$K$o$+$l$F$$$?%3!<%I$r(B its:translate-region $B$K$h$C$F0lK\2=$7$?!%(B + +;;;; July-30-90 by S. Tomura +;;;; henkan-region $B$r(Boverwrite-mode $B$KBP1~$5$;$k!%JQ?t(B +;;;; egg:*henkan-fence-mode*, egg:*overwrite-mode-deleted-chars* +;;;; $B$rDI2C$7!$(Bhenkan-fence-region, henkan-region-internal, +;;;; quit-egg-mode $B$rJQ99$9$k!%(B + +;;;; Mar-4-90 by K.Handa +;;;; New variable alphabet-mode-indicator, transparent-mode-indicator, +;;;; and henkan-mode-indicator. + +;;;; Feb-27-90 by enami@ptgd.sony.co.jp +;;;; menu:select-from-menu $B$G#22U=j$"$k(B ((and (<= ?0 ch) (<= ch ?9)... +;;;; $B$N0lJ}$r(B ((and (<= ?0 ch) (<= ch ?9)... $B$K=$@5(B + +;;;; Feb-07-89 +;;;; bunsetu-length-henko $B$NCf$N(B egg:*attribute-off $B$N0LCV$r(B KKCP $B$r8F$VA0$K(B +;;;; $BJQ99$9$k!#(B wnn-client $B$G$O(B KKCP $B$r8F$V$HJ8@a>pJs$,JQ2=$9$k!#(B + +;;;; Feb-01-89 +;;;; henkan-goto-kouho $B$N(B egg:set-bunsetu-attribute $B$N0z?t(B +;;;; $B$N=gHV$,4V0c$C$F$$$?$N$r=$@5$7$?!#!J(Btoshi@isvax.isl.melco.co.jp +;;;; (Toshiyuki Ito)$B$N;XE&$K$h$k!#!K(B + +;;;; Dec-25-89 +;;;; meta-flag t $B$N>l9g$NBP1~$r:F=$@5$9$k!#(B +;;;; overwrite-mode $B$G$N(B undo $B$r2~A1$9$k!#(B + +;;;; Dec-21-89 +;;;; bug fixed by enami@ptdg.sony.co.jp +;;;; (fboundp 'minibuffer-window-selected ) +;;;; -->(boundp 'minibuffer-window-selected ) +;;;; self-insert-after-hook $B$r(B buffer local $B$K$7$FDj5A$r(B kanji.el $B$X0\F0!#(B + +;;;; Dec-15-89 +;;;; kill-all-local-variables $B$NDj5A$r(B kanji.el $B$X0\F0$9$k!#(B + +;;;; Dec-14-89 +;;;; meta-flag t $B$N>l9g$N=hM}$r=$@5$9$k(B +;;;; overwrite-mode $B$KBP1~$9$k!#(B + +;;;; Dec-12-89 +;;;; egg:*henkan-open*, egg:*henkan-close* $B$rDI2C!#(B +;;;; egg:*henkan-attribute* $B$rDI2C(B +;;;; set-egg-fence-mode-format, set-egg-henkan-mode-format $B$rDI2C(B + +;;;; Dec-12-89 +;;;; *bunpo-code* $B$K(B 1000: "$B$=$NB>(B" $B$rDI2C(B + +;;;; Dec-11-89 +;;;; egg:*fence-attribute* $B$r?7@_(B +;;;; egg:*bunsetu-attribute* $B$r?7@_(B + +;;;; Dec-11-89 +;;;; attribute-*-region $B$rMxMQ$9$k$h$&$KJQ99$9$k!#(B +;;;; menu:make-selection-list $B$O(B width $B$,>.$5$$;~$K(Bloop $B$9$k!#$3$l$r=$@5$7$?!#(B + +;;;; Dec-10-89 +;;;; set-marker-type $B$rMxMQ$9$kJ}<0$KJQ99!#(B + +;;;; Dec-07-89 +;;;; egg:search-path $B$rDI2C!#(B +;;;; egg-default-startup-file $B$rDI2C$9$k!#(B + +;;;; Nov-22-89 +;;;; egg-startup-file $B$rDI2C$9$k!#(B +;;;; eggrc-search-path $B$r(B egg-startup-file-search-path $B$KL>A0JQ99!#(B + +;;;; Nov-21-89 +;;;; Nemacs 3.2 $B$KBP1~$9$k!#(Bkanji-load* $B$rGQ;_$9$k!#(B +;;;; wnnfns.c $B$KBP1~$7$?=$@5$r2C$($k!#(B +;;;; *Notification* buffer $B$r8+$($J$/$9$k!#(B + +;;;; Oct-2-89 +;;;; *zenkaku-alist* $B$N(B $BJ8;zDj?t$N=q$-J}$,4V0c$C$F$$$?!#(B + +;;;; Sep-19-89 +;;;; toggle-egg-mode $B$N=$@5!J(Bkanji-flag$B!K(B +;;;; egg-self-insert-command $B$N=$@5(B $B!J(Bkanji-flag$B!K(B + +;;;; Sep-18-89 +;;;; self-insert-after-hook $B$NDI2C(B + +;;;; Sep-15-89 +;;;; EGG:open-wnn bug fix +;;;; provide wnn-egg feature + +;;;; Sep-13-89 +;;;; henkan-kakutei-before-point $B$r=$@5$7$?!#(B +;;;; enter-fence-mode $B$NDI2C!#(B +;;;; egg-exit-hook $B$NDI2C!#(B +;;;; henkan-region-internal $B$NDI2C!#(Bhenkan-region$B$O(B point $B$r(Bmark $B$9$k!#(B +;;;; eggrc-search-path $B$NDI2C!#(B + +;;;; Aug-30-89 +;;;; kanji-kanji-1st $B$rD{@5$7$?!#(B + +;;;; May-30-89 +;;;; EGG:open-wnn $B$O(B get-wnn-host-name $B$,(B nil $B$N>l9g!"(B(system-name) $B$r;HMQ$9$k!#(B + +;;;; May-9-89 +;;;; KKCP:make-directory added. +;;;; KKCP:file-access bug fixed. +;;;; set-default-usr-dic-directory modified. + +;;;; Mar-16-89 +;;;; minibuffer-window-selected $B$r;H$C$F(B minibuffer $B$N(B egg-mode$BI=<(5!G=DI2C(B + +;;;; Mar-13-89 +;;;; mode-line-format changed. + +;;;; Feb-27-89 +;;;; henkan-saishou-bunsetu added +;;;; henkan-saichou-bunsetu added +;;;; M-< henkan-saishou-bunsetu +;;;; M-> henkan-saichou-bunsetu + +;;;; Feb-14-89 +;;;; C-h in henkan mode: help-command added + +;;;; Feb-7-89 +;;;; egg-insert-after-hook is added. + +;;;; M-h fence-hiragana +;;;; M-k fence-katakana +;;;; M-> fence-zenkaku +;;;; M-< fence-hankaku + +;;;; Dec-19-88 henkan-hiragana, henkan-katakara$B$rDI2C!'(B +;;;; M-h henkan-hiragana +;;;; M-k henkan-katakana + +;;;; Ver. 2.00 kana2kanji.c $B$r;H$o$:(B wnn-client.el $B$r;HMQ$9$k$h$&$KJQ99!#(B +;;;; $B4XO"$7$F0lIt4X?t$rJQ99(B + +;;;; Dec-2-88 special-symbol-input $B$rDI2C!((B +;;;; C-^ special-symbol-input + +;;;; Nov-18-88 henkan-mode-map $B0lItJQ99!((B +;;;; M-i henkan-inspect-bunsetu +;;;; M-s henkan-select-kouho +;;;; C-g henkan-quit + +;;;; Nov-18-88 jserver-henkan-kakutei $B$N;EMMJQ99$KH<$$!"(Bkakutei $B$N%3!<(B +;;;; $B%I$rJQ99$7$?!#(B + +;;;; Nov-17-88 kakutei-before-point $B$G(B point $B0J9_$N4V0c$C$?ItJ,$NJQ49(B +;;;; $B$,IQEY>pJs$KEPO?$5$l$J$$$h$&$K=$@5$7$?!#$3$l$K$O(BKKCC:henkan-end +;;;; $B$N0lIt;EMM$HBP1~$9$k(Bkana2kanji.c$B$bJQ99$7$?!#(B + +;;;; Nov-17-88 henkan-inspect-bunsetu $B$rDI2C$7$?!#(B + +;;;; Nov-17-88 $B?7$7$$(B kana2kanji.c $B$KJQ99$9$k!#(B + +;;;; Sep-28-88 defrule$B$,CM$H$7$F(Bnil$B$rJV$9$h$&$KJQ99$7$?!#(B + +;;;; Aug-25-88 $BJQ493X=,$r@5$7$/9T$J$&$h$&$KJQ99$7$?!#(B +;;;; KKCP:henkan-kakutei$B$O(BKKCP:jikouho-list$B$r8F$s$@J8@a$KBP$7$F$N$_E,(B +;;;; $BMQ$G$-!"$=$l0J30$N>l9g$N7k2L$OJ]>Z$5$l$J$$!#$3$N>r7o$rK~$?$9$h$&(B +;;;; $B$K(BKKCP:jikouho-list$B$r8F$s$G$$$J$$J8@a$KBP$7$F$O(B +;;;; KKCP:henkan-kakutei$B$r8F$P$J$$$h$&$K$7$?!#(B + +;;;; Aug-25-88 egg:do-auto-fill $B$r=$@5$7!"J#?t9T$K$o$?$k(Bauto-fill$B$r@5(B +;;;; $B$7$/9T$J$&$h$&$K=$@5$7$?!#(B + +;;;; Aug-25-88 menu command$B$K(B\C-l: redraw $B$rDI2C$7$?!#(B + +;;;; Aug-25-88 toroku-region$B$GEPO?$9$kJ8;zNs$+$i(Bno graphic character$B$r(B +;;;; $B<+F0E*$K=|$/$3$H$K$7$?!#(B + +(eval-when-compile (require 'egg-jsymbol)) + +;;;---------------------------------------------------------------------- +;;; +;;; Version control routine +;;; +;;;---------------------------------------------------------------------- + +(and (equal (user-full-name) "Satoru Tomura") + (defun egg-version-update (arg) + (interactive "P") + (if (equal (buffer-name (current-buffer)) "wnn-egg.el") + (save-excursion + (goto-char (point-min)) + (re-search-forward "(defvar egg-version \"[0-9]+\\.") + (let ((point (point)) + (minor)) + (search-forward "\"") + (backward-char 1) + (setq minor (string-to-int (buffer-substring point (point)))) + (delete-region point (point)) + (if (<= minor 8) (insert "0")) + (insert (int-to-string (1+ minor))) + (search-forward "Egg last modified date: ") + (kill-line) + (insert (current-time-string))) + (save-buffer) + (if arg (byte-compile-file (buffer-file-name))) + ))) + ) +;;; +;;;---------------------------------------------------------------------- +;;; +;;; Utilities +;;; +;;;---------------------------------------------------------------------- + +;;; +;;;; + +(defun characterp (form) + (numberp form)) + +(defun coerce-string (form) + (cond((stringp form) form) + ((characterp form) (char-to-string form)))) + +(defun coerce-internal-string (form) + (cond((stringp form) + (if (= (length form) 1) + (string-to-char form) + form)) + ((characterp form) form))) + +;;; kill-all-local-variables $B$+$iJ]8n$9$k(B local variables$B!#(B +(put 'egg:*input-mode* 'permanent-local t) +(put 'egg:*mode-on* 'permanent-local t) +(put 'its:*current-map* 'permanent-local t) +(put 'mode-line-egg-mode 'permanent-local t) + +;; undo functions for Emacs-20 +(make-variable-buffer-local + (defvar egg-buffer-undo-list nil)) +(make-variable-buffer-local + (defvar egg-buffer-modified-flag nil)) + +(defun suspend-undo () + (setq egg-buffer-undo-list buffer-undo-list) + (setq egg-buffer-modified-flag (buffer-modified-p)) + ;;(setq buffer-undo-list t) + ) + +(defun resume-undo-list () + (setq buffer-undo-list egg-buffer-undo-list) + (if (not egg-buffer-modified-flag) + (let ((time (visited-file-modtime))) + (if (eq time 0) (setq time '(0 . 0))) + (set 'buffer-undo-list + (cons (cons t time) + buffer-undo-list))))) + +;;;---------------------------------------------------------------------- +;;; +;;; 16$B?JI=8=$N(BJIS $B4A;z%3!<%I$r(B minibuffer $B$+$iFI$_9~$`(B +;;; +;;;---------------------------------------------------------------------- + +;;; +;;; User entry: jis-code-input +;;; + +(defun jis-code-input () + (interactive) + (insert-jis-code-from-minibuffer "JIS $B4A;z%3!<%I(B(16$B?J?tI=8=(B): ")) + +(defun insert-jis-code-from-minibuffer (prompt) + (let ((str (read-from-minibuffer prompt)) val) + (while (null (setq val (read-jis-code-from-string str))) + (beep) + (setq str (read-from-minibuffer prompt str))) + (insert (make-char 'japanese-jisx0208 (car val) (cdr val))))) + +(defun hexadigit-value (ch) + (cond((and (<= ?0 ch) (<= ch ?9)) + (- ch ?0)) + ((and (<= ?a ch) (<= ch ?f)) + (+ (- ch ?a) 10)) + ((and (<= ?A ch) (<= ch ?F)) + (+ (- ch ?A) 10)))) + +(defun read-jis-code-from-string (str) + (if (and (= (length str) 4) + (<= 2 (hexadigit-value (aref str 0))) + (hexadigit-value (aref str 1)) + (<= 2 (hexadigit-value (aref str 2))) + (hexadigit-value (aref str 3))) + (cons (+ (* 16 (hexadigit-value (aref str 0))) + (hexadigit-value (aref str 1))) + (+ (* 16 (hexadigit-value (aref str 2))) + (hexadigit-value (aref str 3)))))) + +;;;---------------------------------------------------------------------- +;;; +;;; $B!V$?$^$4!W(B Notification System +;;; +;;;---------------------------------------------------------------------- + +(defconst *notification-window* " *Notification* ") + +;;;(defmacro notify (str &rest args) +;;; (list 'notify-internal +;;; (cons 'format (cons str args)))) + +(defun notify (str &rest args) + (notify-internal (apply 'format (cons str args)))) + +(defun notify-internal (message &optional noerase) + (save-excursion + (let ((notify-buff (get-buffer-create *notification-window*))) + (set-buffer notify-buff) + (goto-char (point-max)) + (setq buffer-read-only nil) + (insert (substring (current-time-string) 4 19) ":: " message ?\n ) + (setq buffer-read-only t) + (bury-buffer notify-buff) + (message "%s" message) ; 92.4.15 by T.Enami + (if noerase nil + (sleep-for 1) (message ""))))) + +;;;(defmacro notify-yes-or-no-p (str &rest args) +;;; (list 'notify-yes-or-no-p-internal +;;; (cons 'format (cons str args)))) + +(defun notify-yes-or-no-p (str &rest args) + (notify-yes-or-no-p-internal (apply 'format (cons str args)))) + +(defun notify-yes-or-no-p-internal (message) + (save-window-excursion + (pop-to-buffer *notification-window*) + (goto-char (point-max)) + (setq buffer-read-only nil) + (insert (substring (current-time-string) 4 19) ":: " message ?\n ) + (setq buffer-read-only t) + (yes-or-no-p "$B$$$$$G$9$+!)(B"))) + +(defun notify-y-or-n-p (str &rest args) + (notify-y-or-n-p-internal (apply 'format (cons str args)))) + +(defun notify-y-or-n-p-internal (message) + (save-window-excursion + (pop-to-buffer *notification-window*) + (goto-char (point-max)) + (setq buffer-read-only nil) + (insert (substring (current-time-string) 4 19) ":: " message ?\n ) + (setq buffer-read-only t) + (y-or-n-p "$B$$$$$G$9$+!)(B"))) + +(defun select-notification () + (interactive) + (pop-to-buffer *notification-window*) + (setq buffer-read-only t)) + +;;;---------------------------------------------------------------------- +;;; +;;; Minibuffer Menu System +;;; +;;;---------------------------------------------------------------------- + +;;; user-customizable variables +(defvar menu:*display-item-value* nil + "*Non-nil means values of items are displayed in minibuffer menu") + +;;; The following will be localized, added only to pacify the compiler. +(defvar menu:*cur-menu*) +(defvar menu:*cur-selection*) +(defvar menu:*cur-selections*) +(defvar menu:*cur-element-no*) +(defvar menu:*cur-selection-no*) +(defvar menu:*cur-element-points*) +(defvar menu:*menu-stack*) + +(defvar minibuffer-local-menu-map + (append '(keymap (t . undefined) + (?\C-x keymap (t . undefined)) + (?\e keymap (t . undefined))) + function-key-map)) + +(dolist (elem '((" " next-element) + ("\C-a" beginning-of-selection) + ("\C-b" previous-element) + ("\C-d" previous-element) + ("\C-e" end-of-selection) + ("\C-f" next-element) + ("\C-g" quit) + ("\C-h" previous-element) + ("\C-i" next-element) + ("\C-j" select) + ("\C-l" refresh) + ("\C-m" select) + ("\C-n" next-selection) + ("\C-p" previous-selection) + ([backspace] previous-element) + ([clear] quit) + ([delete] previous-element) + ([down] next-selection) + ([left] previous-element) + ([next] next-selection) + ([prior] previous-selection) + ([return] select) + ([right] next-element) + ([tab] next-element) + ([up] previous-selection))) + (define-key minibuffer-local-menu-map + (car elem) (intern (format "menu:%s" (car (cdr elem)))))) +;;; 0 .. 9 A .. Z a .. z +(dolist (char + (append + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + nil)) + (define-key minibuffer-local-menu-map (vector char) 'menu:goto-nth-element)) + +;;; +;;; predicates and selectors for menu +;;; +;; ::= ( menu ) +;; ::= ( ... ) +;; ::= ( . ) | +;; | ( . ) | +;; :: = | +;; +(defun menu:menup (value) + (and (listp value) + (eq (car value) 'menu))) + +(defun menu:menu-prompt (&optional menu) + (car (cdr (or menu menu:*cur-menu*)))) + +(defun menu:menu-items (&optional menu) + (car (cdr (cdr (or menu menu:*cur-menu*))))) + +(defun menu:menu-nth-item (n &optional menu) + (nth n (menu:menu-items menu))) + +(defun menu:item-string (item) + (cond ((stringp item) item) + ((numberp item) (char-to-string item)) + ((consp item) + (let ((str (cond ((stringp (car item)) (car item)) + ((numberp (car item)) (char-to-string (car item))) + (t "")))) + (if menu:*display-item-value* + (format "%s [%s]" str (cdr item)) + str))) + (t ""))) + +(defun menu:item-value (item) + (cond ((stringp item) item) + ((numberp item) (char-to-string item)) + ((consp item) (cdr item)) + (t ""))) + +(defun menu:select-submenu (submenu) + "Save the current selection state, and select a new menu." + (setq menu:*menu-stack* + (cons (list menu:*cur-selection* menu:*cur-selections* + menu:*cur-element-no* menu:*cur-selection-no* + menu:*cur-menu* menu:*cur-element-points*) + menu:*menu-stack*)) + (setq menu:*cur-menu* submenu)) + +(defun menu:select-saved-menu () + "Restore the most recently stored selection state." + (let ((save (car menu:*menu-stack*))) + (setq menu:*menu-stack* + (cdr menu:*menu-stack*)) + (setq menu:*cur-selection* (nth 0 save);92.10.26 by T.Saneto + menu:*cur-selections* (nth 1 save) + menu:*cur-element-no* (nth 2 save) + menu:*cur-selection-no* (nth 3 save) + menu:*cur-menu* (nth 4 save) + menu:*cur-element-points* (nth 5 save)))) + +;;; +;;; constructors and selector for selection +;;; +;; ::= ( . ) +;; ... integer that means the absolute position in menu items +;; ::= ( ... ) +;; +(defsubst menu:make-selection (pos elements) + (cons pos elements)) + +(defsubst menu:selection-pos (&optional selection) + (car (or selection menu:*cur-selection*))) + +(defsubst menu:selection-elements (&optional selection) + (cdr (or selection menu:*cur-selection*))) + +(defsubst menu:selection-nth-element (&optional n selection) + (nth (or n menu:*cur-element-no*) + (menu:selection-elements selection))) + +(defsubst menu:selection-element-length (&optional selection) + (length (menu:selection-elements selection))) + +(defun menu:make-selections (items width) + "Make selection list from ITEMS so that each selection can fit with WIDTH." + (let ((headpos 0) (pos 0) (size 0) + revselections revelems + item-string item-width) + (while items + (setq item-string (menu:item-string (car items))) + (setq item-width (string-width item-string)) + ;;; 92.9.19 by Y. Kawabe + (cond ((and revelems (<= width (+ size 4 item-width))) + (setq revselections + (cons (menu:make-selection headpos (nreverse revelems)) + revselections)) + (setq revelems nil) + (setq size 0) + (setq headpos pos)) + ((or (null (cdr items)) (<= width (+ size 4 item-width))) + (setq revselections + (cons + (menu:make-selection + headpos (nreverse (cons item-string revelems))) + revselections)) + (setq size 0) + (setq headpos pos) + (setq items (cdr items)) + (setq pos (1+ pos))) + (t + ;;; 92.9.19 by Y. Kawabe + (setq revelems (cons item-string revelems)) + (setq size (+ size 4 item-width)) + (setq items (cdr items)) + (setq pos (1+ pos))))) + (nreverse revselections))) + +(defun menu:setup-selections (window-width initpos) + (setq menu:*cur-selections* + (menu:make-selections (menu:menu-items) + (- window-width + ;;; 92.8.19 by K.Handa + (string-width + (menu:menu-prompt))))) + (if initpos + (let ((selections menu:*cur-selections*) + finished) + (setq menu:*cur-selection-no* 0) + (while (and (cdr selections) + (< (menu:selection-pos (car (cdr selections))) + initpos)) + (setq menu:*cur-selection-no* (1+ menu:*cur-selection-no*)) + (setq selections (cdr selections))) + (setq menu:*cur-element-no* + (- initpos (menu:selection-pos (car selections))))))) + +;;; utility +(defun menu:check-number-range (i min max) + (cond ((eq i 'max) max) + ((eq i 'min) min) + ((< i min) max) + ((< max i) min) + (t i))) + +;;; +;;; main part of menu +;;; +(defun menu:select-from-menu (menu &optional initial position) + "Display menu in minibuffer and return the selected value. +If INITIAL is non-nil integer list, it behaves as menu is selected +using the path specified by INITIAL in advance. +If POSITION is non-nil value, return value is a pair of the selected +value and the chosen path (represented by an integer list)." + (let ((menu:*cur-menu* menu) + (menu:*window-width* (window-width (minibuffer-window))) + menu:*cur-selection* menu:*cur-selections* + menu:*cur-element-no* + menu:*cur-selection-no* + menu:*cur-element-points* + menu:*menu-stack* menu:*select-positions* + (menu:*window-width* (window-width (minibuffer-window))) + (pos 0) value finished) + (if initial + (progn + (if (numberp initial) + (setq initial (list initial))) + (while (cdr initial) + (setq value (menu:item-value (menu:menu-nth-item (car initial)))) + (if (menu:menup value) + (progn + (menu:setup-selections menu:*window-width* (car initial)) + (menu:select-submenu value))) + (setq menu:*select-positions* + (cons (car initial) menu:*select-positions*)) + (setq initial (cdr initial))) + (setq pos (car initial)))) + (while (not finished) + (menu:setup-selections menu:*window-width* pos) + (add-hook 'minibuffer-setup-hook 'menu:minibuffer-setup) + (unwind-protect + (setq pos (read-from-minibuffer "" nil minibuffer-local-menu-map + t 'menu:*select-positions*)) + (remove-hook 'minibuffer-setup-hook 'menu:minibuffer-setup) + (if quit-flag + (setq pos nil + quit-flag nil))) + (cond (pos ; element selected + (setcar menu:*select-positions* pos) + (setq value (menu:item-value (menu:menu-nth-item pos))) + (if (menu:menup value) + (progn (menu:select-submenu value) + (setq pos 0)) + (setq finished t))) + (menu:*menu-stack* ; quit (restore menu) + (if (string= (car menu:*select-positions*) "nil") + (setq menu:*select-positions* (cdr menu:*select-positions*))) + (setq menu:*select-positions* (cdr menu:*select-positions*)) + (menu:select-saved-menu)) + (t ; really quit + (setq quit-flag t) + (setq menu:*select-positions* nil) + (setq finished t)))) + (if position + (cons value (nreverse menu:*select-positions*)) + value))) + +(defun menu:minibuffer-setup () + (if (eq (current-local-map) minibuffer-local-menu-map) + (menu:goto-selection))) + +(defun menu:goto-selection (&optional sel-no elem-no) + (setq menu:*cur-selection-no* + (menu:check-number-range (or sel-no menu:*cur-selection-no*) + 0 (1- (length menu:*cur-selections*)))) + (setq menu:*cur-selection* + (nth menu:*cur-selection-no* menu:*cur-selections*)) + (erase-buffer) + (insert (menu:menu-prompt)) + (let ((elements (menu:selection-elements)) + (i 0) + revpoints) + (while elements + (setq revpoints (cons (+ (point) 2) revpoints)) + (insert (if (<= i 9) (format " %d." i) + (format " %c." (+ (- i 10) ?a))) + (car elements)) + (setq elements (cdr elements) + i (1+ i))) + (setq menu:*cur-element-points* (nreverse revpoints))) + (menu:goto-element elem-no)) + +(defun menu:goto-element (&optional elem-no) + (setq menu:*cur-element-no* + (menu:check-number-range (or elem-no menu:*cur-element-no*) + 0 (1- (menu:selection-element-length)))) + (goto-char (nth menu:*cur-element-no* menu:*cur-element-points*))) + +(defun menu:beginning-of-selection () + (interactive) + (menu:goto-element 0)) + +(defun menu:end-of-selection () + (interactive) + (menu:goto-element (1- (menu:selection-element-length)))) + +(defun menu:next-selection () + (interactive) + (menu:goto-selection (1+ menu:*cur-selection-no*))) + +(defun menu:previous-selection () + (interactive) + (menu:goto-selection (1- menu:*cur-selection-no*))) + +(defun menu:next-element () + (interactive) + (if (< menu:*cur-element-no* (1- (menu:selection-element-length))) + (menu:goto-element (1+ menu:*cur-element-no*)) + (menu:goto-selection (1+ menu:*cur-selection-no*) 0))) + +(defun menu:previous-element () + (interactive) + (if (< 0 menu:*cur-element-no*) + (menu:goto-element (1- menu:*cur-element-no*)) + (menu:goto-selection (1- menu:*cur-selection-no*) 'max))) + +(defun menu:goto-nth-element () + (interactive) + (let ((ch (if (integerp last-command-event) + last-command-event + ;; Convert kp-0 .. kp-9 to chars. + (get last-command-event 'ascii-character))) + (elem-no-max (1- (menu:selection-element-length)))) + (if ch + (cond + ((and (<= ?0 ch) (<= ch ?9) + (<= ch (+ ?0 elem-no-max))) + (menu:goto-element (- ch ?0))) + ((and (<= ?a ch) (<= ch ?z) + (<= (+ 10 ch) (+ ?a elem-no-max))) + (menu:goto-element (+ 10 (- ch ?a)))) + ((and (<= ?A ch) (<= ch ?Z) + (<= (+ 10 ch) (+ ?A elem-no-max))) + (menu:goto-element (+ 10 (- ch ?A)))))))) + +(defun menu:refresh () + (interactive) + (menu:goto-selection)) + +(defun menu:select () + (interactive) + (erase-buffer) + (prin1 (+ (menu:selection-pos) menu:*cur-element-no*) (current-buffer)) + (exit-minibuffer)) + +(defun menu:quit () + (interactive) + (erase-buffer) + (prin1 nil (current-buffer)) + (exit-minibuffer)) + +;;;---------------------------------------------------------------------- +;;; +;;; $B0l3g7?JQ495!G=(B +;;; +;;;---------------------------------------------------------------------- + +;;; +;;; $B$R$i$,$JJQ49(B +;;; + +(defun hiragana-paragraph () + "hiragana paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (japanese-hiragana-region (point) end )))) + +(defun hiragana-sentence () + "hiragana sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (japanese-hiragana-region (point) end )))) + +;;; +;;; $B%+%?%+%JJQ49(B +;;; + +(defun katakana-paragraph () + "katakana paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (japanese-katakana-region (point) end )))) + +(defun katakana-sentence () + "katakana sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (japanese-katakana-region (point) end )))) + +;;; +;;; $BH>3QJQ49(B +;;; + +(defun hankaku-paragraph () + "hankaku paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (japanese-hankaku-region (point) end )))) + +(defun hankaku-sentence () + "hankaku sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (japanese-hankaku-region (point) end )))) + +(defun hankaku-word (arg) + (interactive "p") + (let ((start (point))) + (forward-word arg) + (japanese-hankaku-region start (point)))) + +;;; +;;; $BA43QJQ49(B +;;; + +(defun zenkaku-paragraph () + "zenkaku paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (japanese-zenkaku-region (point) end )))) + +(defun zenkaku-sentence () + "zenkaku sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (japanese-zenkaku-region (point) end )))) + +(defun zenkaku-word (arg) + (interactive "p") + (let ((start (point))) + (forward-word arg) + (japanese-zenkaku-region start (point)))) + +;;; +;;; $B%m!<%^;z$+$JJQ49(B +;;; + +(defun roma-kana-region (start end ) + (interactive "r") + (its:translate-region start end nil (its:get-mode-map "roma-kana"))) + +(defun roma-kana-paragraph () + "roma-kana paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (roma-kana-region (point) end )))) + +(defun roma-kana-sentence () + "roma-kana sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (roma-kana-region (point) end )))) + +(defun roma-kana-word () + "roma-kana word at or after point." + (interactive) + (save-excursion + (re-search-backward "\\b\\w" nil t) + (let ((start (point))) + (re-search-forward "\\w\\b" nil t) + (roma-kana-region start (point))))) + +;;; +;;; $B%m!<%^;z4A;zJQ49(B +;;; + +(defun roma-kanji-region (start end) + (interactive "r") + (roma-kana-region start end) + (save-restriction + (narrow-to-region start (point)) + (goto-char (point-min)) + (replace-regexp "\\($B!!(B\\| \\)" "") + (goto-char (point-max))) + (henkan-region-internal start (point))) + +(defun roma-kanji-paragraph () + "roma-kanji paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (roma-kanji-region (point) end )))) + +(defun roma-kanji-sentence () + "roma-kanji sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (roma-kanji-region (point) end )))) + +(defun roma-kanji-word () + "roma-kanji word at or after point." + (interactive) + (save-excursion + (re-search-backward "\\b\\w" nil t) + (let ((start (point))) + (re-search-forward "\\w\\b" nil t) + (roma-kanji-region start (point))))) + + +;;;---------------------------------------------------------------------- +;;; +;;; $B!V$?$^$4!WF~NOJ8;zJQ497O(B ITS +;;; +;;;---------------------------------------------------------------------- + +(defun egg:member (elt list) + (while (not (or (null list) (equal elt (car list)))) + (setq list (cdr list))) + list) + +;;; +;;; Mode name --> map +;;; +;;; ITS mode name: string + +(defvar its:*mode-alist* nil) +(defvar its:*internal-mode-alist* nil) + +(defun its:get-mode-map (name) + (or (cdr (assoc name its:*mode-alist*)) + (cdr (assoc name its:*internal-mode-alist*)))) + +(defun its:set-mode-map (name map &optional internalp) + (let ((place (assoc name + (if internalp its:*internal-mode-alist* + its:*mode-alist*)))) + (if place (let ((mapplace (cdr place))) + (setcar mapplace (car map)) + (setcdr mapplace (cdr map))) + (progn (setq place (cons name map)) + (if internalp + (setq its:*internal-mode-alist* + (append its:*internal-mode-alist* (list place))) + (setq its:*mode-alist* + (append its:*mode-alist* (list place)))))))) + +;;; +;;; ITS mode indicators +;;; Mode name --> indicator +;;; + +(defun its:get-mode-indicator (name) + (let ((map (its:get-mode-map name))) + (if map (map-indicator map) + name))) + +(defun its:set-mode-indicator (name indicator) + (let ((map (its:get-mode-map name))) + (if map + (map-set-indicator map indicator) + (its-define-mode name indicator)))) + +;;; +;;; ITS mode declaration +;;; + +(defvar its:*processing-map* nil) + +(defun its-define-mode (name &optional indicator reset supers internalp) + "its-mode NAME $B$rDj5AA*Br$9$k!%B>$N(B its-mode $B$,A*Br$5$l$k$^$G$O(B +its-defrule $B$J$I$O(B NAME $B$KBP$7$F5,B'$rDI2C$9$k!%(BINDICATOR $B$,(B non-nil +$B$N;~$K$O(B its-mode NAME $B$rA*Br$9$k$H(B mode-line $B$KI=<($5$l$k!%(BRESET $B$,(B +non-nil $B$N;~$K$O(B its-mode $B$NDj5A$,6u$K$J$k!%(BSUPERS $B$O>e0L$N(B its-mode +$BL>$r%j%9%H$G;XDj$9$k!%(BINTERNALP $B$O(B mode name $B$rFbItL>$H$9$k!%(B +its-defrule, its-defrule-conditional, defule-select-mode-temporally $B$r(B +$B;2>H(B" + + (if (null(its:get-mode-map name)) + (progn + (setq its:*processing-map* + (make-map nil (or indicator name) nil (mapcar 'its:get-mode-map supers))) + (its:set-mode-map name its:*processing-map* internalp) + ) + (progn (setq its:*processing-map* (its:get-mode-map name)) + (if indicator + (map-set-indicator its:*processing-map* indicator)) + (if reset + (progn + (map-set-state its:*processing-map* nil) + (map-set-alist its:*processing-map* nil) + )) + (if supers + (progn + (map-set-supers its:*processing-map* (mapcar 'its:get-mode-map supers)))))) + nil) + +;;; +;;; defrule +;;; + +(defun its:make-standard-action (output next) + "OUTPUT $B$H(B NEXT $B$+$i$J$k(B standard-action $B$r:n$k!%(B" + + (if (and (stringp output) (string-equal output "")) + (setq output nil)) + (if (and (stringp next) (string-equal next "")) + (setq next nil)) + (cond((null output) + (cond ((null next) nil) + (t (list nil next)))) + ((consp output) + ;;; alternative output + (list (cons 0 output) next)) + ((null next) output) + (t + (list output next)))) + +(defun its:standard-actionp (action) + "ACITION $B$,(B standard-action $B$G$"$k$+$I$&$+$rH=Dj$9$k!%(B" + (or (stringp action) + (and (consp action) + (or (stringp (car action)) + (and (consp (car action)) + (numberp (car (car action)))) + (null (car action))) + (or (null (car (cdr action))) + (stringp (car (cdr action))))))) + +(defvar its:make-terminal-state 'its:default-make-terminal-state + "$B=*C<$N>uBV$G$NI=<($r:n@.$9$k4X?t$r;XDj$9$k(B. $B4X?t$O(B map input +action state $B$r0z?t$H$7$F8F$P$l!$>uBVI=<($NJ8;zNs$rJV$9!%(B") + +(defun its:default-make-terminal-state (map input action state) + (cond(state state) + (t input))) + +(defun its:make-terminal-state-hangul (map input action state) + (cond((its:standard-actionp action) (action-output action)) + (t nil))) + +(defvar its:make-non-terminal-state 'its:default-make-standard-non-terminal-state + "$BHs=*C<$N>uBV$G$NI=<($r:n@.$9$k4X?t$r;XDj$9$k!%4X?t$O(B map input $B$r(B +$B0z?t$H$7$F8F$P$l!$>uBVI=<($NJ8;zNs$rJV$9(B" ) + +(defun its:default-make-standard-non-terminal-state (map input) + " ****" + (concat + (map-state-string map) + (char-to-string (aref input (1- (length input)))))) + +(defun its-defrule (input output &optional next state map) + + "INPUT $B$,F~NO$5$l$k$H(B OUTPUT $B$KJQ49$9$k!%(BNEXT $B$,(B nil $B$G$J$$$H$-$OJQ(B +$B49$7$?8e$K(B NEXT $B$,F~NO$5$l$?$h$&$KJQ49$rB3$1$k!%(BINPUT$B$,F~NO$5$l$?;~E@(B +$B$GJQ49$,3NDj$7$F$$$J$$;~$O(B STATE $B$r%U%'%s%9>e$KI=<($9$k!%JQ49$,3NDj$7(B +$B$F$$$J$$;~$KI=<($9$kJ8;zNs$OJQ?t(B its:make-terminal-state $B$*$h$S(B $BJQ?t(B +its:make-non-terminal-state $B$K;X<($5$l$?4X?t$K$h$C$F@8@.$5$l$k!%JQ495,(B +$BB'$O(B MAP $B$G;XDj$5$l$?JQ49I=$KEPO?$5$l$k!%(BMAP $B$,(B nil $B$N>l9g$O$b$C$H$b:G(B +$B6a$K(B its-define-mode $B$5$l$?JQ49I=$KEPO?$5$l$k!%$J$*(B OUTPUT $B$,(B nil $B$N>l(B +$B9g$O(B INPUT $B$KBP$9$kJQ495,B'$,:o=|$5$l$k!%(B" + + (its-defrule* input + (its:make-standard-action output next) state + (if (stringp map) map + its:*processing-map*))) + +(defmacro its-defrule-conditional (input &rest conds) + "(its-defrule-conditional INPUT ((COND1 OUTPUT1) ... (CONDn OUTPUTn)))$B$O(B +INPUT $B$,F~NO$5$l$?;~$K>r7o(B CONDi $B$r=guBV(B STATE $B$rI=<($7!$>r7o(B CONDi $B$r(B +$B=gl9g(B, its-defrule $B$N7Y9p$rM^@)$9$k(B") + +(defun its-defrule** (i input action state map) + (cond((= (length input) i) ;93.6.4 by T.Shingu + (map-set-state + map + (coerce-internal-string + (funcall its:make-terminal-state map input action state))) + (if (and its:*defrule-verbose* (map-action map)) + (if action + (notify "(its-defrule \"%s\" \"%s\" ) $B$r:FDj5A$7$^$7$?!%(B" + input action) + (notify "(its-defrule \"%s\" \"%s\" )$B$r:o=|$7$^$7$?!%(B" + input (map-action map)))) + (if (and (null action) (map-terminalp map)) nil + (progn (map-set-action map action) + map))) + (t + (let((newmap + (or (get-next-map-locally map (aref input i)) + (make-map (funcall its:make-non-terminal-state + map + (substring input 0 (1+ i))))))) + (set-next-map map (aref input i) + (its-defrule** (1+ i) input action state newmap))) + (if (and (null (map-action map)) + (map-terminalp map)) + nil + map)))) + +;;; +;;; map: +;;; +;;; ::= ( ( . ) ... ) +;;; ::= ( nil ) +;;; ::= ( .... ) +;;; ::= ( ) +;;; ::= | ( ) .... + +(defun make-map (&optional state action alist supers) + (list state action alist supers)) + +(defun map-topmap-p (map) + (null (map-state map))) + +(defun map-supers (map) + (nth 3 map)) + +(defun map-set-supers (map val) + (setcar (nthcdr 3 map) val)) + +(defun map-terminalp (map) + (null (map-alist map))) + +(defun map-state (map) + (nth 0 map)) + +(defun map-state-string (map) + (coerce-string (map-state map))) + +(defun map-set-state (map val) + (setcar (nthcdr 0 map) val)) + +(defun map-indicator (map) + (map-action map)) +(defun map-set-indicator (map indicator) + (map-set-action map indicator)) + +(defun map-action (map) + (nth 1 map)) +(defun map-set-action (map val) + (setcar (nthcdr 1 map) val)) + +(defun map-alist (map) + (nth 2 map)) + +(defun map-set-alist (map alist) + (setcar (nthcdr 2 map) alist)) + +(defun get-action (map) + (if (null map) nil + (let ((action (map-action map))) + (cond((its:standard-actionp action) + action) + ((symbolp action) (condition-case nil + (funcall action) + (error nil))) + (t (condition-case nil + (eval action) + (error nil))))))) + +(defun action-output (action) + (cond((stringp action) action) + (t (car action)))) + +(defun action-next (action) + (cond((stringp action) nil) + (t (car (cdr action))))) + +(defun get-next-map (map ch) + (or (cdr (assq ch (map-alist map))) + (if (map-topmap-p map) + (let ((supers (map-supers map)) + (result nil)) + (while supers + (setq result (get-next-map (car supers) ch)) + (if result + (setq supers nil) + (setq supers (cdr supers)))) + result)))) + +(defun get-next-map-locally (map ch) + (cdr (assq ch (map-alist map)))) + +(defun set-next-map (map ch val) + (let ((place (assq ch (map-alist map)))) + (if place + (if val + (setcdr place val) + (map-set-alist map (delq place (map-alist map)))) + (if val + (map-set-alist map (cons (cons ch val) + (map-alist map))) + val)))) + +(defun its:simple-actionp (action) + (stringp action)) + +(defun collect-simple-action (map) + (if (map-terminalp map) + (if (its:simple-actionp (map-action map)) + (list (map-action map)) + nil) + (let ((alist (map-alist map)) + (result nil)) + (while alist + (setq result + ;;; 92.9.19 by Y. Kawabe + (append (collect-simple-action (cdr (car alist))) + result)) + (setq alist (cdr alist))) + result))) + +;;;---------------------------------------------------------------------- +;;; +;;; Runtime translators +;;; +;;;---------------------------------------------------------------------- + +(defun its:simulate-input (i j input map) + (while (<= i j) + (setq map (get-next-map map (aref input i))) ;92.12.26 by S.Tomura + (setq i (1+ i))) ;92.12.26 by S.Tomura + map) + +;;; meta-flag $B$,(B on $B$N;~$K$O!"F~NO%3!<%I$K(B \200 $B$r(B or $B$7$?$b$N$,F~NO$5(B +;;; $B$l$k!#$3$NItJ,$N;XE&$OEl9)Bg$NCf@n(B $B5.G7$5$s$K$h$k!#(B +;;; pointted by nakagawa@titisa.is.titech.ac.jp Dec-11-89 +;;; +;;; emacs $B$G$O(B $BJ8;z%3!<%I$O(B 0-127 $B$G07$&!#(B +;;; + +(defvar its:*buff-s* (make-marker)) +(defvar its:*buff-e* (make-marker)) +(set-marker-insertion-type its:*buff-e* t) + +;;; STATE unread +;;; |<-s p->|<- e ->| +;;; s : ch0 state0 map0 +;;; +1: ch1 state1 map1 +;;; .... +;;; (point): + +;;; longest matching region : [s m] +;;; suspending region: [m point] +;;; unread region : [point e] + + +(defvar its:*maxlevel* 10) +(defvar its:*maps* (make-vector its:*maxlevel* nil)) +(defvar its:*actions* (make-vector its:*maxlevel* nil)) +(defvar its:*inputs* (make-vector its:*maxlevel* 0)) +(defvar its:*level* 0) + +(defun its:resize (size) + (if (<= its:*maxlevel* size) + (setq its:*maxlevel* size + its:*maps* (make-vector size nil) + its:*actions* (make-vector size nil) + its:*inputs* (make-vector size 0)))) + +(defun its:reset-maps (&optional init) + (setq its:*level* 0) + (if init + (aset its:*maps* its:*level* init))) + +(defun its:current-map () (aref its:*maps* its:*level*)) +(defun its:previous-map () (aref its:*maps* (max 0 (1- its:*level*)))) + +(defun its:level () its:*level*) + +(defun its:enter-newlevel (map ch output) + (setq its:*level* (1+ its:*level*)) + (aset its:*maps* its:*level* map) + (aset its:*inputs* its:*level* ch) + (aset its:*actions* its:*level* output)) + +(defvar its:*char-from-buff* nil) +(defvar its:*interactive* t) + +(defun its:reset-input () + (setq its:*char-from-buff* nil)) + +(defun its:flush-input-before-point (from) + (save-excursion + (while (<= from its:*level*) + (its:insert-char (aref its:*inputs* from)) + (setq from (1+ from))))) + +(defun its:peek-char () + (if (= (point) its:*buff-e*) + (if its:*interactive* + (setq unread-command-events (list (read-event))) + nil) + (following-char))) + +(defun its:read-char () + (if (= (point) its:*buff-e*) + (progn + (setq its:*char-from-buff* nil) + (if its:*interactive* + (read-char-exclusive) + nil)) + (let ((ch (following-char))) + (setq its:*char-from-buff* t) + (delete-char 1) + ch))) + +(defun its:push-char (ch) + (if its:*char-from-buff* + (save-excursion + (its:insert-char ch)) + (if ch (setq unread-command-events (list ch))))) + +(defun its:insert-char (ch) + (insert ch)) + +(defun its:ordinal-charp (ch) + (and (numberp ch) (<= 0 ch) (<= ch 127) + (eq (lookup-key fence-mode-map (char-to-string ch)) 'fence-self-insert-command))) + +(defun its:delete-charp (ch) + (and (numberp ch) (<= 0 ch) (<= ch 127) + (eq (lookup-key fence-mode-map (char-to-string ch)) 'fence-backward-delete-char))) + +(defun fence-self-insert-command () + (interactive) + (cond((or (not egg:*input-mode*) + (null (get-next-map its:*current-map* last-command-event))) + (insert last-command-event)) + (t + (insert last-command-event) + (its:translate-region (1- (point)) (point) t)))) + +;;; +;;; its: completing-read system +;;; + +(defun its:all-completions (string alist &optional pred) + "A variation of all-completions.\n\ +Arguments are STRING, ALIST and optional PRED. ALIST must be no obarray." + (let ((tail alist) (allmatches nil)) + (while tail + (let* ((elt (car tail)) + (eltstring (car elt))) + (setq tail (cdr tail)) + (if (and (stringp eltstring) + (<= (length string) (length eltstring)) + ;;;(not (= (aref eltstring 0) ? )) + (string-equal string (substring eltstring 0 (length string)))) + (if (or (and pred + (if (eq pred 'commandp) + (commandp elt) + (funcall pred elt))) + (null pred)) + (setq allmatches (cons elt allmatches)))))) + (nreverse allmatches))) + +(defun its:temp-echo-area-contents (message) + (let ((inhibit-quit inhibit-quit) + (point-max (point-max))) + (goto-char point-max) + (insert message) + (goto-char point-max) + (setq inhibit-quit t) + (sit-for 2 nil) + ;;; 92.9.19 by Y. Kawabe, 92.10.30 by T.Saneto + (delete-region (point) (point-max)) + (if quit-flag + (progn + (setq quit-flag nil) + (setq unread-command-events (list ?\^G)))))) + +(defun car-string-lessp (item1 item2) + (string-lessp (car item1) (car item2))) + +(defun its:minibuffer-completion-help () + "Display a list of possible completions of the current minibuffer contents." + (interactive) + (let ((completions)) + (message "Making completion list...") + (setq completions (its:all-completions (buffer-string) + minibuffer-completion-table + minibuffer-completion-predicate)) + (if (null completions) + (progn + ;;; 92.9.19 by Y. Kawabe + (beep) + (its:temp-echo-area-contents " [No completions]")) + (with-output-to-temp-buffer " *Completions*" + (display-completion-list + (sort completions 'car-string-lessp)))) + nil)) + +(defconst its:minibuffer-local-completion-map + (copy-keymap minibuffer-local-completion-map)) +(define-key its:minibuffer-local-completion-map "?" 'its:minibuffer-completion-help) +(define-key its:minibuffer-local-completion-map " " 'its:minibuffer-completion-help) + +(defconst its:minibuffer-local-must-match-map + (copy-keymap minibuffer-local-must-match-map)) +(define-key its:minibuffer-local-must-match-map "?" 'its:minibuffer-completion-help) +(define-key its:minibuffer-local-must-match-map " " 'its:minibuffer-completion-help) + +;;(fset 'si:all-completions (symbol-function 'all-completions)) +;;(fset 'si:minibuffer-completion-help (symbol-function 'minibuffer-completion-help)) + +(defun its:completing-read (prompt table &optional predicate require-match initial-input) + "See completing-read" + (let ((minibuffer-local-completion-map its:minibuffer-local-completion-map) + (minibuffer-local-must-match-map its:minibuffer-local-must-match-map) + (completion-auto-help nil)) + (completing-read prompt table predicate t initial-input))) + +(defvar its:*completing-input-menu* '(menu "Which?" nil)) ;92.10.26 by T.Saneto + +(defun its:completing-input (map) + ;;; + (let ((action (get-action map))) + (cond((and (null action) + (= (length (map-alist map)) 1)) + (its:completing-input (cdr (nth 0 (map-alist map))))) + (t + (setcar (nthcdr 2 its:*completing-input-menu*) + (map-alist map)) + (let ((values + (menu:select-from-menu its:*completing-input-menu* + 0 t))) + (cond((consp values) + ;;; get input char from menu + ) + (t + (its:completing-input map)))))))) + +(defvar its:*make-menu-from-map-result* nil) + +(defun its:make-menu-from-map (map) + (let ((its:*make-menu-from-map-result* nil)) + (its:make-menu-from-map* map "") + (list 'menu "Which?" (reverse its:*make-menu-from-map-result*) ))) + +(defun its:make-menu-from-map* (map string) + (let ((action (get-action map))) + (if action + (setq its:*make-menu-from-map-result* + (cons (format "%s[%s]" string (action-output action)) + its:*make-menu-from-map-result*))) + (let ((alist (map-alist map))) + (while alist + (its:make-menu-from-map* + (cdr (car alist)) + (concat string (char-to-string (car (car alist))))) + (setq alist (cdr alist)))))) + +(defvar its:*make-alist-from-map-result* nil) + +(defun its:make-alist-from-map (map &optional string) + (let ((its:*make-alist-from-map-result* nil)) + (its:make-alist-from-map* map (or string "")) + (reverse its:*make-alist-from-map-result*))) + +(defun its:make-alist-from-map* (map string) + (let ((action (get-action map))) + (if action + (setq its:*make-alist-from-map-result* + (cons (list string + (let ((action-output (action-output action))) + (cond((and (consp action-output) + (numberp (car action-output))) + (format "%s..." + (nth (car action-output) (cdr action-output)))) + ((stringp action-output) + action-output) + (t + (format "%s" action-output))))) + its:*make-alist-from-map-result*))) + (let ((alist (map-alist map))) + (while alist + (its:make-alist-from-map* + (cdr (car alist)) + (concat string (char-to-string (car (car alist))))) + (setq alist (cdr alist)))))) + +(defvar its:*select-alternative-output-menu* '(menu "Which?" nil)) + +(defun its:select-alternative-output (action-output) + ;;;; action-output : (pos item1 item2 item3 ....) + (let ((point (point)) + (output (cdr action-output)) + (ch 0)) + (while (not (eq ch ?\^L)) + (insert "<" (nth (car action-output)output) ">") + (setq ch (read-event)) + (cond ((eq ch ?\^N) + (setcar action-output + (mod (1+ (car action-output)) (length output)))) + ((eq ch ?\^P) + (setcar action-output + (if (= 0 (car action-output)) + (1- (length output)) + (1- (car action-output))))) + ((eq ch ?\^M) + (setcar (nthcdr 2 its:*select-alternative-output-menu* ) + output) + (let ((values + (menu:select-from-menu its:*select-alternative-output-menu* + (car action-output) + t))) + (cond((consp values) + (setcar action-output (nth 1 values)) + (setq ch ?\^L))))) + ((eq ch ?\^L) + ) + (t + (beep) + )) + (delete-region point (point))) + (if its:*insert-output-string* + (funcall its:*insert-output-string* (nth (car action-output) output)) + (insert (nth (car action-output) output))))) + + + +;;; translate until +;;; interactive --> not ordinal-charp +;;; or +;;; not interactive --> end of input + +(defvar its:*insert-output-string* nil) +(defvar its:*display-status-string* nil) + +(defun its:translate-region (start end its:*interactive* &optional topmap) + (set-marker its:*buff-s* start) + (set-marker its:*buff-e* end) + (its:reset-input) + (goto-char its:*buff-s*) + (let ((topmap (or topmap its:*current-map*)) + (map nil) + (ch nil) + (action nil) + (newmap nil) + (inhibit-quit t) + (its-quit-flag nil) + (echo-keystrokes 0)) + (setq map topmap) + (its:reset-maps topmap) + (while (not its-quit-flag) + (setq ch (its:read-char)) + (setq newmap (get-next-map map ch)) + (setq action (get-action newmap)) + + (cond + ((and its:*interactive* (not its:*char-from-buff*) (numberp ch) (= ch ?\^@)) + (delete-region its:*buff-s* (point)) + (let ((i 1)) + (while (<= i its:*level*) + (insert (aref its:*inputs* i)) + (setq i (1+ i)))) + (let ((inputs (its:completing-read "ITS:>" + (its:make-alist-from-map topmap) + nil + t + (buffer-substring its:*buff-s* (point))))) + (delete-region its:*buff-s* (point)) + (save-excursion (insert inputs)) + (its:reset-maps) + (setq map topmap) + )) + ((or (null newmap) + (and (map-terminalp newmap) + (null action))) + + (cond((and its:*interactive* (its:delete-charp ch)) + (delete-region its:*buff-s* (point)) + (cond((= its:*level* 0) + (setq its-quit-flag t)) + ((= its:*level* 1) + (its:insert-char (aref its:*inputs* 1)) + (setq its-quit-flag t)) + (t + (its:flush-input-before-point (1+ its:*level*)) + (setq its:*level* (1- its:*level*)) + (setq map (its:current-map)) + (if (and its:*interactive* + its:*display-status-string*) + (funcall its:*display-status-string* (map-state map)) + (insert (map-state map))) + ))) + + (t + (let ((output nil)) + (let ((i its:*level*) (newlevel (1+ its:*level*))) + (aset its:*inputs* newlevel ch) + (while (and (< 0 i) (null output)) + (if (and (aref its:*actions* i) + (its:simulate-input (1+ i) newlevel its:*inputs* topmap)) + (setq output i)) + (setq i (1- i))) + (if (null output) + (let ((i its:*level*)) + (while (and (< 0 i) (null output)) + (if (aref its:*actions* i) + (setq output i)) + (setq i (1- i))))) + + (cond(output + (delete-region its:*buff-s* (point)) + (cond((its:standard-actionp (aref its:*actions* output)) + (let ((action-output (action-output (aref its:*actions* output)))) + (if (and (not its:*interactive*) + (consp action-output)) + (setq action-output (nth (car action-output) (cdr action-output)))) + (cond((stringp action-output) + (if (and its:*interactive* + its:*insert-output-string*) + (funcall its:*insert-output-string* action-output) + (insert action-output))) + ((consp action-output) + (its:select-alternative-output action-output) + ) + (t + (beep) (beep) + ))) + (set-marker its:*buff-s* (point)) + (its:push-char ch) + (its:flush-input-before-point (1+ output)) + (if (action-next (aref its:*actions* output)) + (save-excursion + (insert (action-next (aref its:*actions* output))))) + ) + ((symbolp (aref its:*actions* output)) + (its:push-char ch) + (funcall (aref its:*actions* output)) + (its:reset-maps its:*current-map*) + (setq topmap its:*current-map*) + (set-marker its:*buff-s* (point))) + (t + (its:push-char ch) + ;92.10.26 by T.Saneto + (eval (aref its:*actions* output)) + (its:reset-maps its:*current-map*) + (setq topmap its:*current-map*) + (set-marker its:*buff-s* (point)) + )) + ) + ((= 0 its:*level*) + (cond ((or (its:ordinal-charp ch) + its:*char-from-buff*) + (its:insert-char ch)) + (t (setq its-quit-flag t)))) + + ((< 0 its:*level*) + (delete-region its:*buff-s* (point)) + (its:insert-char (aref its:*inputs* 1)) + (set-marker its:*buff-s* (point)) + (its:push-char ch) + (its:flush-input-before-point 2))))) + + (cond((null ch) + (setq its-quit-flag t)) + ((not its-quit-flag) + (its:reset-maps) + (set-marker its:*buff-s* (point)) + (setq map topmap)))))) + + ((map-terminalp newmap) + (its:enter-newlevel (setq map newmap) ch action) + (delete-region its:*buff-s* (point)) + (let ((output nil) (m nil) (i (1- its:*level*))) + (while (and (< 0 i) (null output)) + (if (and (aref its:*actions* i) + (setq m (its:simulate-input (1+ i) its:*level* its:*inputs* topmap)) + (not (map-terminalp m))) + (setq output i)) + (setq i (1- i))) + + (cond((null output) + (cond ((its:standard-actionp action) + (let ((action-output (action-output action))) + (if (and (not its:*interactive*) + (consp action-output)) + (setq action-output (nth (car action-output) (cdr action-output)))) + (cond((stringp action-output) + (if (and its:*interactive* + its:*insert-output-string*) + (funcall its:*insert-output-string* action-output) + (insert action-output))) + ((consp action-output) + (its:select-alternative-output action-output) + ) + (t + (beep) (beep) + ))) + (cond((null (action-next action)) + (cond ((and (= (point) its:*buff-e*) + its:*interactive* + (its:delete-charp (its:peek-char))) + nil) + (t + (set-marker its:*buff-s* (point)) + (its:reset-maps) + (setq map topmap) + ))) + (t + (save-excursion (insert (action-next action))) + (set-marker its:*buff-s* (point)) + (its:reset-maps) + (setq map topmap)))) + ((symbolp action) + (funcall action) + (its:reset-maps its:*current-map*) + (setq topmap its:*current-map*) + (setq map topmap) + (set-marker its:*buff-s* (point))) + (t + (eval action) + (its:reset-maps its:*current-map*) + (setq topmap its:*current-map*) + (setq map topmap) + (set-marker its:*buff-s* (point))))) + (t + (if (and its:*interactive* + its:*display-status-string*) + (funcall its:*display-status-string* (map-state map)) + (insert (map-state map))))))) + + ((null action) + (delete-region its:*buff-s* (point)) + (if (and its:*interactive* + its:*display-status-string*) + (funcall its:*display-status-string* (map-state newmap)) + (insert (map-state newmap))) + (its:enter-newlevel (setq map newmap) + ch action)) + + (t + (its:enter-newlevel (setq map newmap) ch action) + (delete-region its:*buff-s* (point)) + (if (and its:*interactive* + its:*display-status-string*) + (funcall its:*display-status-string* (map-state map)) + (insert (map-state map)))))) + + (set-marker its:*buff-s* nil) + (set-marker its:*buff-e* nil) + (if (and its:*interactive* ch) (setq unread-command-events (list ch))) + )) + +;;;---------------------------------------------------------------------- +;;; +;;; ITS-map dump routine: +;;; +;;;---------------------------------------------------------------------- + +;;;;; +;;;;; User entry: dump-its-mode-map +;;;;; + +;; 92.6.26 by K.Handa +(defun dump-its-mode-map (name filename) + "Obsolete." + (interactive) + (message "This function is obsolete in the current version of Mule.")) +;;; +;;; EGG mode variables +;;; + +(defvar egg:*mode-on* nil "T if egg mode is on.") +(make-variable-buffer-local 'egg:*mode-on*) +(set-default 'egg:*mode-on* nil) + +(defvar egg:*input-mode* t "T if egg map is active.") +(make-variable-buffer-local 'egg:*input-mode*) +(set-default 'egg:*input-mode* t) + +(defvar egg:*in-fence-mode* nil "T if in fence mode.") +(make-variable-buffer-local 'egg:*in-fence-mode*) +(set-default 'egg:*in-fence-mode* nil) + +;;(load-library "its-dump/roma-kana") ;;;(define-its-mode "roma-kana" " a$B$"(B") +;;(load-library "its-dump/roma-kata") ;;;(define-its-mode "roma-kata" " a$B%"(B") +;;(load-library "its-dump/downcase") ;;;(define-its-mode "downcase" " a a") +;;(load-library "its-dump/upcase") ;;;(define-its-mode "upcase" " a A") +;;(load-library "its-dump/zenkaku-downcase") ;;;(define-its-mode "zenkaku-downcase" " a$B#a(B") +;;(load-library "its-dump/zenkaku-upcase") ;;;(define-its-mode "zenkaku-upcase" " a$B#A(B") +;; 92.3.13 by K.Handa +;; (load "its-hira") +;; (load-library "its-kata") +;; (load-library "its-hankaku") +;; (load-library "its-zenkaku") + + +(defvar its:*current-map* nil) +(make-variable-buffer-local 'its:*current-map*) +;; 92.3.13 by K.Handa +;; moved to each language specific setup files (japanese.el, ...) +;; (setq-default its:*current-map* (its:get-mode-map "roma-kana")) + +(defvar its:*previous-map* nil) +(make-variable-buffer-local 'its:*previous-map*) +(setq-default its:*previous-map* nil) + +;;;---------------------------------------------------------------------- +;;; +;;; Mode line control functions; +;;; +;;;---------------------------------------------------------------------- + +(defconst mode-line-egg-mode "--") +(make-variable-buffer-local 'mode-line-egg-mode) + +(defvar mode-line-egg-mode-in-minibuffer "--" "global variable") + +(defun egg:find-symbol-in-tree (item tree) + (if (consp tree) + (or (egg:find-symbol-in-tree item (car tree)) + (egg:find-symbol-in-tree item (cdr tree))) + (equal item tree))) + +;;; +;;; nemacs Ver. 3.0 $B$G$O(B Fselect_window $B$,JQ99$K$J$j!"(Bminibuffer-window +;;; $BB>$N(B window $B$H$N4V$G=PF~$j$,$"$k$H!"(Bmode-line $B$N99?7$r9T$J$$!"JQ?t(B +;;; minibuffer-window-selected $B$NCM$,99?7$5$l$k(B +;;; + +;;; nemacs Ver. 4 $B$G$O(B Fselect_window $B$,JQ99$K$J$j!$(Bselect-window-hook +;;; $B$,Dj5A$5$l$?!%$3$l$K$H$b$J$$=>Mh!$:FDj5A$7$F$$$?(B select-window, +;;; other-window, keyborad-quit, abort-recursive-edit, exit-minibuffer +;;; $B$r:o=|$7$?!%(B + +(defvar display-minibuffer-mode-in-minibuffer t) + +(defvar minibuffer-window-selected nil) + +(defun egg:select-window-hook (old new) + (if (and (eq old (minibuffer-window)) + (not (eq new (minibuffer-window)))) + (save-excursion + (set-buffer (window-buffer (minibuffer-window))) + (setq ;;minibuffer-preprompt nil + egg:*mode-on* (default-value 'egg:*mode-on*) + egg:*input-mode* (default-value 'egg:*input-mode*) + egg:*in-fence-mode* (default-value 'egg:*in-fence-mode*)))) + (if (eq new (minibuffer-window)) + (setq minibuffer-window-selected t) + (setq minibuffer-window-selected nil))) + +(defvar mode-line-egg-mode-in-minibuffer-as-before "--" + "Internal variable used to keep the value of +`mode-line-egg-mode-in-minibuffer' as it was before entering the +minibuffer.") + +(defvar egg:minibuffer-preprompt-overlay nil + "Internal variable used to keep an overlay to show a preprompt string +in the minibuffer.") + +(defun egg:minibuffer-setup-function () + (setq minibuffer-window-selected t + mode-line-egg-mode-in-minibuffer-as-before + mode-line-egg-mode-in-minibuffer)) +(add-hook 'minibuffer-setup-hook 'egg:minibuffer-setup-function) + +(defun egg:minibuffer-exit-function () + (if egg:minibuffer-preprompt-overlay + (delete-overlay egg:minibuffer-preprompt-overlay)) + (setq egg:minibuffer-preprompt-overlay nil + ;;minibuffer-preprompt nil + minibuffer-window-selected nil + ;; reset the value of each variables in minibuffer + egg:*mode-on* (default-value 'egg:*mode-on*) + egg:*input-mode* (default-value 'egg:*input-mode*) + egg:*in-fence-mode* (default-value 'egg:*in-fence-mode*) + display-minibuffer-mode nil + mode-line-egg-mode-in-minibuffer + mode-line-egg-mode-in-minibuffer-as-before)) +(add-hook 'minibuffer-exit-hook 'egg:minibuffer-exit-function) + +;(setq select-window-hook 'egg:select-window-hook) + +;;; +;;; +;;; + +(defvar its:*reset-mode-line-format* nil) + +(if its:*reset-mode-line-format* + (setq-default mode-line-format + (cdr mode-line-format))) + +(if (not (egg:find-symbol-in-tree 'mode-line-egg-mode mode-line-format)) + (setq-default + mode-line-format + (cons (list ;'mc-flag + (list 'display-minibuffer-mode-in-minibuffer + ;;; minibuffer mode in minibuffer + (list + (list 'its:*previous-map* "<" "[") + 'mode-line-egg-mode + (list 'its:*previous-map* ">" "]") + ) + ;;;; minibuffer mode in mode line + (list + (list 'minibuffer-window-selected + (list 'display-minibuffer-mode + "m" + " ") + " ") + (list 'its:*previous-map* "<" "[") + (list 'minibuffer-window-selected + (list 'display-minibuffer-mode + 'mode-line-egg-mode-in-minibuffer + 'mode-line-egg-mode) + 'mode-line-egg-mode) + (list 'its:*previous-map* ">" "]") + ))) + mode-line-format))) + +;;; +;;; minibuffer $B$G$N%b!<%II=<($r$9$k$?$a$K(B nemacs 4 $B$GDj5A$5$l$?(B +;;; minibuffer-preprompt $B$rMxMQ$9$k!%(B +;;; + +;; Emcws chage: Since Emacs 20+ does not supprt `minibuffer-preprompt', +;; we will use overlays in the minibuffer. + +(defvar egg:minibuffer-preprompt '("[" nil "]")) + +(defun mode-line-egg-mode-update (str) + (if (eq (current-buffer) (window-buffer (minibuffer-window))) + (if display-minibuffer-mode-in-minibuffer + (progn + (aset (nth 0 egg:minibuffer-preprompt) 0 + (if its:*previous-map* ?\< ?\[)) + (setcar (nthcdr 1 egg:minibuffer-preprompt) + str) + (aset (nth 2 egg:minibuffer-preprompt) 0 + (if its:*previous-map* ?\> ?\])) + ;;(setq minibuffer-preprompt egg:minibuffer-preprompt) + (or egg:minibuffer-preprompt-overlay + (setq egg:minibuffer-preprompt-overlay + (make-overlay (point-min) (point-min)))) + (overlay-put egg:minibuffer-preprompt-overlay 'before-string + (apply 'concat egg:minibuffer-preprompt))) + (setq display-minibuffer-mode t + mode-line-egg-mode-in-minibuffer str)) + (setq display-minibuffer-mode nil + mode-line-egg-mode str)) + ;;; nemacs 4 only(update-mode-lines) + (set-buffer-modified-p (buffer-modified-p))) + +(mode-line-egg-mode-update mode-line-egg-mode) + +;;; +;;; egg mode line display +;;; + +(defvar alphabet-mode-indicator "aA") +(defvar transparent-mode-indicator "--") + +(defun egg:mode-line-display () + (mode-line-egg-mode-update + (cond((and egg:*in-fence-mode* (not egg:*input-mode*)) + alphabet-mode-indicator) + ((and egg:*mode-on* egg:*input-mode*) + (map-indicator its:*current-map*)) + (t transparent-mode-indicator)))) + +(defun egg:toggle-egg-mode-on-off () + (interactive) + (setq egg:*mode-on* (not egg:*mode-on*)) + (egg:mode-line-display)) + +(defun its:select-mode (name) + (interactive (list (completing-read "ITS mode: " its:*mode-alist*))) + (if (its:get-mode-map name) + (progn + (setq its:*current-map* (its:get-mode-map name)) + (egg:mode-line-display)) + (beep)) + ) + +(defvar its:*select-mode-menu* '(menu "Mode:" nil)) + +(defun its:select-mode-from-menu () + (interactive) + (setcar (nthcdr 2 its:*select-mode-menu*) its:*mode-alist*) + (setq its:*current-map* (menu:select-from-menu its:*select-mode-menu*)) + (egg:mode-line-display)) + +(defvar its:*standard-modes* nil + "List of standard mode-map of EGG." + ;; 92.3.13 by K.Handa + ;; moved to each language specific setup files (japanese.el, ...) + ;; (list (its:get-mode-map "roma-kana") + ;; (its:get-mode-map "roma-kata") + ;; (its:get-mode-map "downcase") + ;; (its:get-mode-map "upcase") + ;; (its:get-mode-map "zenkaku-downcase") + ;; (its:get-mode-map "zenkaku-upcase")) + ) + +(defun its:find (map list) + (let ((n 0)) + (while (and list (not (eq map (car list)))) + (setq list (cdr list) + n (1+ n))) + (if list n nil))) + +(defun its:next-mode () + (interactive) + (let ((pos (its:find its:*current-map* its:*standard-modes*))) + (setq its:*current-map* + (nth (% (1+ pos) (length its:*standard-modes*)) + its:*standard-modes*)) + (egg:mode-line-display))) + +(defun its:previous-mode () + (interactive) + (let ((pos (its:find its:*current-map* its:*standard-modes*))) + (setq its:*current-map* + (nth (1- (if (= pos 0) (length its:*standard-modes*) pos)) + its:*standard-modes*)) + (egg:mode-line-display))) + +(defun its:select-hiragana () (interactive) (its:select-mode "roma-kana")) +(defun its:select-katakana () (interactive) (its:select-mode "roma-kata")) +(defun its:select-downcase () (interactive) (its:select-mode "downcase")) +(defun its:select-upcase () (interactive) (its:select-mode "upcase")) +(defun its:select-zenkaku-downcase () (interactive) (its:select-mode "zenkaku-downcase")) +(defun its:select-zenkaku-upcase () (interactive) (its:select-mode "zenkaku-upcase")) + +(defun its:select-mode-temporally (name) + (interactive (list (completing-read "ITS mode: " its:*mode-alist*))) + (let ((map (its:get-mode-map name))) + (if map + (progn + (if (null its:*previous-map*) + (setq its:*previous-map* its:*current-map*)) + (setq its:*current-map* map) + (egg:mode-line-display)) + (beep)))) + +(defun its:select-previous-mode () + (interactive) + (if (null its:*previous-map*) + (beep) + (setq its:*current-map* its:*previous-map* + its:*previous-map* nil) + (egg:mode-line-display))) + + +(defun toggle-egg-mode () + (interactive) + (if t ;mc-flag + (if egg:*mode-on* (fence-toggle-egg-mode) + (progn + (setq egg:*mode-on* t) + (egg:mode-line-display))))) + +(defun fence-toggle-egg-mode () + (interactive) + (if its:*current-map* + (progn + (setq egg:*input-mode* (not egg:*input-mode*)) + (egg:mode-line-display)) + (beep))) + +;;; +;;; Changes on Global map +;;; + +(defvar si:*global-map* (copy-keymap global-map)) + +(substitute-key-definition 'self-insert-command + 'egg-self-insert-command + global-map) + +;;; +;;; Currently entries C-\ and C-^ at global-map are undefined. +;;; + +(define-key global-map "\C-\\" 'toggle-egg-mode) +(define-key global-map "\C-x " 'henkan-region) + +;; 92.3.16 by K.Handa +;; global-map => mule-keymap +(define-key mule-keymap "m" 'its:select-mode-from-menu) +(define-key mule-keymap ">" 'its:next-mode) +(define-key mule-keymap "<" 'its:previous-mode) +(define-key mule-keymap "h" 'its:select-hiragana) +(define-key mule-keymap "k" 'its:select-katakana) +(define-key mule-keymap "q" 'its:select-downcase) +(define-key mule-keymap "Q" 'its:select-upcase) +(define-key mule-keymap "z" 'its:select-zenkaku-downcase) +(define-key mule-keymap "Z" 'its:select-zenkaku-upcase) + +;;; +;;; auto fill controll +;;; + +(defun egg:do-auto-fill () + (if (and auto-fill-function (not buffer-read-only) + (> (current-column) fill-column)) + (let ((ocolumn (current-column))) + (funcall auto-fill-function) + (while (and (< fill-column (current-column)) + (< (current-column) ocolumn)) + (setq ocolumn (current-column)) + (funcall auto-fill-function))))) + +;;;---------------------------------------------------------------------- +;;; +;;; Egg fence mode +;;; +;;;---------------------------------------------------------------------- + +(defconst egg:*fence-open* "|" "*$B%U%'%s%9$N;OE@$r<($9J8;zNs(B") +(defconst egg:*fence-close* "|" "*$B%U%'%s%9$N=*E@$r<($9J8;zNs(B") +(defconst egg:*fence-face* nil "*$B%U%'%s%9I=<($KMQ$$$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*fence-overlay* nil "$B%U%'%s%9I=<(MQ(B overlay")) + +(defvar egg:*face-alist* + '(("nil" . nil) + ("highlight" . highlight) ("modeline" . modeline) + ("inverse" . modeline) ("underline" . underline) ("bold" . bold) + ("region" . region))) + +(defun set-egg-fence-mode-format (open close &optional face) + "fence mode $B$NI=<(J}K!$r@_Dj$9$k!#(BOPEN $B$O%U%'%s%9$N;OE@$r<($9J8;zNs$^$?$O(B nil$B!#(B\n\ +CLOSE$B$O%U%'%s%9$N=*E@$r<($9J8;zNs$^$?$O(B nil$B!#(B\n\ +$BBh(B3$B0z?t(B FACE $B$,;XDj$5$l$F(B nil $B$G$J$1$l$P!"%U%'%s%96h4V$NI=<($K$=$l$r;H$&!#(B" + (interactive (list (read-string "$B%U%'%s%93+;OJ8;zNs(B: ") + (read-string "$B%U%'%s%9=*N;J8;zNs(B: ") + (cdr (assoc (completing-read "$B%U%'%s%9I=<(B0@-(B: " egg:*face-alist*) + egg:*face-alist*)))) + + (if (and (or (stringp open) (null open)) + (or (stringp close) (null close)) + (or (null face) (memq face (face-list)))) + (progn + (setq egg:*fence-open* (or open "") + egg:*fence-close* (or close "") + egg:*fence-face* face) + (if (overlayp egg:*fence-overlay*) + (overlay-put egg:*fence-overlay* 'face egg:*fence-face*)) + t) + (error "Wrong type of argument: %s %s %s" open close face))) + +;(defconst egg:*region-start* (make-marker)) +;(defconst egg:*region-end* (make-marker)) +;(set-marker-insertion-type egg:*region-end* t) +(defvar egg:*region-start* nil) +(defvar egg:*region-end* nil) +(make-variable-buffer-local 'egg:*region-start*) +(make-variable-buffer-local 'egg:*region-end*) +(set-default 'egg:*region-start* nil) +(set-default 'egg:*region-end* nil) + +;;; +;;; (defvar disable-undo nil "*Compatibility for Nemacs") +;;; +;;; Moved to kanji.el +;;; (defvar self-insert-after-hook nil +;;; "Hook to run when extended self insertion command exits. Should take +;;; two arguments START and END correspoding to character position.") +(defvar self-insert-after-hook nil + "Hook to run when extended self insertion command exits. Should take +two arguments START and END correspoding to character position.") + +(defvar egg:*self-insert-non-undo-count* 0 + "counter to hold repetition of egg-self-insert-command.") + +(defun egg:cancel-undo-boundary () + "Cancel undo boundary for egg-self-insert-command" + (if (eq last-command 'egg-self-insert-command) + (if (and (consp buffer-undo-list) + ;; if car is nil. + (null (car buffer-undo-list)) + (< egg:*self-insert-non-undo-count* 20)) + ;; treat consecutive 20 self-insert commands as a single undo chunk. + ;; `20' is a magic number copied from keyboard.c + (setq buffer-undo-list (cdr buffer-undo-list) + egg:*self-insert-non-undo-count* + (1+ egg:*self-insert-non-undo-count*)) + (setq egg:*self-insert-non-undo-count* 1)))) + +(defun egg-self-insert-command (arg) + (interactive "p") + (if (and (not buffer-read-only) +; mc-flag + egg:*mode-on* egg:*input-mode* + (not egg:*in-fence-mode*) ;;; inhibit recursive fence mode + (not (= last-command-event ? ))) + (egg:enter-fence-mode-and-self-insert) + (progn + (if (and (eq last-command 'egg-self-insert-command) + (> last-command-char ? )) + (egg:cancel-undo-boundary)) + (self-insert-command arg) + (if egg-insert-after-hook + (run-hooks 'egg-insert-after-hook)) + (if self-insert-after-hook + (if (<= 1 arg) + (funcall self-insert-after-hook + (- (point) arg) (point))) + (if (= last-command-event ? ) (egg:do-auto-fill)))))) + +;; +;; $BA03NDjJQ49=hM}4X?t(B +;; +(defvar egg:*fence-open-backup* nil) +(defvar egg:*fence-close-backup* nil) +(defvar egg:*fence-face-backup* nil) + +(defconst egg:*fence-open-in-cont* "+" "*$BA03NDj>uBV$G$N(B *fence-open*") +(defconst egg:*fence-close-in-cont* t "*$BA03NDj>uBV$G$N(B *fence-close*") +(defconst egg:*fence-face-in-cont* t + "*$BA03NDj>uBV$G$N(B *fence-face*") + +(defun set-egg-fence-mode-format-in-cont (open close face) + "$BA03NDj>uBV$G$N(B fence mode $B$NI=<(J}K!$r@_Dj$9$k!#(BOPEN $B$O%U%'%s%9$N;OE@$r<($9J8(B +$B;zNs!"(Bt $B$^$?$O(B nil$B!#(B\n\ +CLOSE$B$O%U%'%s%9$N=*E@$r<($9J8;zNs!"(Bt $B$^$?$O(B nil$B!#(B\n\ +FACE $B$O(B nil $B$G$J$1$l$P!"%U%'%s%96h4V$NI=<($K$=$l$r;H$&!#(B\n\ +$B$=$l$>$l$NCM$,(B t $B$N>l9g!"DL>o$N(B egg:*fence-open* $BEy$NCM$r0z$-7Q$0!#(B" + (interactive (list (read-string "$B%U%'%s%93+;OJ8;zNs(B: ") + (read-string "$B%U%'%s%9=*N;J8;zNs(B: ") + (cdr (assoc (completing-read "$B%U%'%s%9I=<(B0@-(B: " egg:*face +-alist*) + egg:*face-alist*)))) + + (if (and (or (stringp open) (eq open t) (null open)) + (or (stringp close) (eq close t) (null close)) + (or (null face) (eq face t) (memq face (face-list)))) + (progn + (setq egg:*fence-open-in-cont* (or open "") + egg:*fence-close-in-cont* (or close "") + egg:*fence-face-in-cont* face) + (if (overlayp egg:*fence-overlay*) + (overlay-put egg:*fence-overlay* 'face egg:*fence-face*)) + t) + (error "Wrong type of argument: %s %s %s" open close face))) + +(defvar *in-cont-flag* nil + "$BD>A0$KJQ49$7$?D>8e$NF~NO$+$I$&$+$r<($9!#(B") + +(defvar *in-cont-backup-flag* nil) + +(defun egg:check-fence-in-cont () + (if *in-cont-flag* + (progn + (setq *in-cont-backup-flag* t) + (setq egg:*fence-open-backup* egg:*fence-open*) + (setq egg:*fence-close-backup* egg:*fence-close*) + (setq egg:*fence-face-backup* egg:*fence-face*) + (or (eq egg:*fence-open-in-cont* t) + (setq egg:*fence-open* egg:*fence-open-in-cont*)) + (or (eq egg:*fence-close-in-cont* t) + (setq egg:*fence-close* egg:*fence-close-in-cont*)) + (or (eq egg:*fence-face-in-cont* t) + (setq egg:*fence-face* egg:*fence-face-in-cont*))))) + +(defun egg:restore-fence-in-cont () + "Restore egg:*fence-open* and egg:*fence-close*" + (if *in-cont-backup-flag* + (progn + (setq egg:*fence-open* egg:*fence-open-backup*) + (setq egg:*fence-close* egg:*fence-close-backup*) + (setq egg:*fence-face* egg:*fence-face-backup*))) + (setq *in-cont-backup-flag* nil) + ) + +(defun egg:enter-fence-mode-and-self-insert () + (setq *in-cont-flag* + (memq last-command '(henkan-kakutei henkan-kakutei-and-self-insert))) + (enter-fence-mode) + (setq unread-command-events (list last-command-event))) + +(defun egg:fence-face-on () + (if egg:*fence-face* + (progn + (or (overlayp egg:*fence-overlay*) + (setq egg:*fence-overlay* (make-overlay 1 1 nil nil t))) + (if egg:*fence-face* + (or (eq egg:*fence-face* + (overlay-get egg:*fence-overlay* 'face)) + (overlay-put egg:*fence-overlay* 'face egg:*fence-face*))) + (move-overlay egg:*fence-overlay* egg:*region-start* egg:*region-end*)))) + +(defun egg:fence-face-off () + (and egg:*fence-face* + (overlayp egg:*fence-overlay*) + (delete-overlay egg:*fence-overlay*) )) + +(defun enter-fence-mode () + ;;;(buffer-flush-undo (current-buffer)) + (suspend-undo) + ;;;(and (boundp 'disable-undo) (setq disable-undo t)) + (setq egg:*in-fence-mode* t) + (egg:mode-line-display) + (egg:check-fence-in-cont) ; for Wnn6 + (insert egg:*fence-open*) + (or (markerp egg:*region-start*) (setq egg:*region-start* (make-marker))) + (set-marker egg:*region-start* (point)) + (insert egg:*fence-close*) + (or (markerp egg:*region-end*) + (progn + (setq egg:*region-end* (make-marker)) + (set-marker-insertion-type egg:*region-end* t))) + (set-marker egg:*region-end* egg:*region-start*) + (egg:fence-face-on) + (goto-char egg:*region-start*) + ) + +(defun henkan-fence-region-or-single-space () + (interactive) + (if egg:*input-mode* + (henkan-fence-region) + (insert ? ))) + +(defvar egg:*henkan-fence-mode* nil) + +(defun henkan-fence-region () + (interactive) + (setq egg:*henkan-fence-mode* t) + (egg:fence-face-off) + (henkan-region-internal egg:*region-start* egg:*region-end* )) + +(defun fence-katakana () + (interactive) + (japanese-katakana-region egg:*region-start* egg:*region-end* )) + +(defun fence-hiragana () + (interactive) + (japanese-hiragana-region egg:*region-start* egg:*region-end*)) + +(defun fence-hankaku () + (interactive) + (japanese-hankaku-region egg:*region-start* egg:*region-end*)) + +(defun fence-zenkaku () + (interactive) + (japanese-zenkaku-region egg:*region-start* egg:*region-end*)) + +(defun fence-backward-char () + (interactive) + (if (< egg:*region-start* (point)) + (backward-char) + (beep))) + +(defun fence-forward-char () + (interactive) + (if (< (point) egg:*region-end*) + (forward-char) + (beep))) + +(defun fence-beginning-of-line () + (interactive) + (goto-char egg:*region-start*)) + +(defun fence-end-of-line () + (interactive) + (goto-char egg:*region-end*)) + +(defun fence-transpose-chars (arg) + (interactive "P") + (if (and (< egg:*region-start* (point)) + (< (point) egg:*region-end*)) + (transpose-chars arg) + (beep))) + +(defun egg:exit-if-empty-region () + (if (= egg:*region-start* egg:*region-end*) + (fence-exit-mode))) + +(defun fence-delete-char () + (interactive) + (if (< (point) egg:*region-end*) + (progn + (delete-char 1) + (egg:exit-if-empty-region)) + (beep))) + +(defun fence-backward-delete-char () + (interactive) + (if (< egg:*region-start* (point)) + (progn + (delete-char -1) + (egg:exit-if-empty-region)) + (beep))) + +(defun fence-kill-line () + (interactive) + (delete-region (point) egg:*region-end*) + (egg:exit-if-empty-region)) + +(defun fence-exit-mode () + (interactive) + (egg:fence-face-off) + (setq egg:*in-fence-mode* nil) + (let ((kakutei-string (buffer-substring egg:*region-start* egg:*region-end*))) + (delete-region (- egg:*region-start* (length egg:*fence-open*)) egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*fence-close*))) + (goto-char egg:*region-start*) + (resume-undo-list) + (insert kakutei-string)) + (if its:*previous-map* + (setq its:*current-map* its:*previous-map* + its:*previous-map* nil)) + (egg:quit-egg-mode)) + +(defun delete-text-in-column (from to) + "Delete the text between column FROM and TO (exclusive) of the current line. +Nil of FORM or TO means the current column. +If there's a charcter across the borders, the character is replaced with +the same width of spaces before deleting." + (save-excursion + (let (p1 p2) + (if from + (progn + (setq p1 (move-to-column from)) + (if (> p1 from) + (progn + (delete-char -1) + (insert-char ? (- p1 (current-column))) + (forward-char (- from p1)))))) + (setq p1 (point)) + (if to + (progn + (setq p2 (move-to-column to)) + (if (> p2 to) + (progn + (delete-char -1) + (insert-char ? (- p2 (current-column))) + (forward-char (- to p2)))))) + (setq p2 (point)) + (delete-region p1 p2)))) + +(defvar egg-insert-after-hook nil) +(make-variable-buffer-local 'egg-insert-after-hook) + +(defvar egg-exit-hook nil + "Hook to run when egg exits. Should take two arguments START and END +correspoding to character position.") + +(defun egg:quit-egg-mode () + (egg:mode-line-display) + (if overwrite-mode + (let ((str (buffer-substring egg:*region-end* egg:*region-start*))) + (delete-text-in-column nil (+ (current-column) (string-width str))))) + (egg:restore-fence-in-cont) ; for Wnn6 + (setq egg:*henkan-fence-mode* nil) + (if self-insert-after-hook + (funcall self-insert-after-hook egg:*region-start* egg:*region-end*) + (if egg-exit-hook + (funcall egg-exit-hook egg:*region-start* egg:*region-end*) + (if (not (= egg:*region-start* egg:*region-end*)) + (egg:do-auto-fill)))) + (set-marker egg:*region-start* nil) + (set-marker egg:*region-end* nil) + ;;;(buffer-enable-undo) + ;;;(undo-boundary) + ;;;(and (boundp 'disable-undo) (setq disable-undo nil)) + (if egg-insert-after-hook + (run-hooks 'egg-insert-after-hook)) + ) + +(defun fence-cancel-input () + (interactive) + (delete-region egg:*region-start* egg:*region-end*) + (fence-exit-mode)) + +(defun fence-mode-help-command () + "Display documentation for fence-mode." + (interactive) + (let ((buf "*Help*")) + (if (eq (get-buffer buf) (current-buffer)) + (henkan-quit) + (with-output-to-temp-buffer buf + (princ (substitute-command-keys "The keys that are defined for the fence mode here are:\\{fence-mode-map}")) + (print-help-return-message))))) + +(defvar fence-mode-map (append '(keymap (t . undefined) + (?\C-x keymap (t . undefined))) + function-key-map)) + +(defvar fence-mode-esc-map + (or (lookup-key fence-mode-map (vector meta-prefix-char)) + (lookup-key fence-mode-map [escape]) + (make-sparse-keymap))) + +(or (lookup-key fence-mode-map (vector meta-prefix-char)) + (define-key fence-mode-map (vector meta-prefix-char) fence-mode-esc-map)) +(or (lookup-key fence-mode-map [escape]) + (define-key fence-mode-map [escape] fence-mode-esc-map)) + +(substitute-key-definition 'egg-self-insert-command + 'fence-self-insert-command + fence-mode-map global-map) + +(dolist (elem '((" " henkan-fence-region-or-single-space) + ("\177" fence-backward-delete-char) + ("\C-@" henkan-fence-region) + ("\C-\ " henkan-fence-region) + ("\C-\\" fence-toggle-egg-mode) + ("\C-_" jis-code-input) + ("\C-a" fence-beginning-of-line) + ("\C-b" fence-backward-char) + ("\C-c" fence-cancel-input) + ("\C-d" fence-delete-char) + ("\C-e" fence-end-of-line) + ("\C-f" fence-forward-char) + ("\C-g" fence-cancel-input) + ("\C-h" fence-mode-help-command) + ("\C-k" fence-kill-line) + ("\C-l" fence-exit-mode) + ("\C-m" fence-exit-mode) + ("\C-q" its:select-previous-mode) + ("\C-t" fence-transpose-chars) + ("\C-w" henkan-fence-region) + ("\C-z" eval-expression) + + ([backspace] fence-backward-delete-char) + ([clear] fence-cancel-input) + ([delete] fence-backward-delete-char) + ([help] fence-mode-help-command) + ([left] fence-backward-char) + ([return] fence-exit-mode) + ([right] fence-forward-char))) + (apply 'define-key fence-mode-map elem)) + +(dolist (elem '(([t] undefined);; default binding + ("<" fence-hankaku) + (">" fence-zenkaku) + ("Q" its:select-upcase) + ("Z" its:select-zenkaku-upcase) + ("\C-h" its:select-hiragana) + ("\C-k" its:select-katakana) + ("h" fence-hiragana) + ("k" fence-katakana) + ("q" its:select-downcase) + ("z" its:select-zenkaku-downcase))) + (apply 'define-key fence-mode-esc-map elem)) + + +(or (assq 'egg:*in-fence-mode* minor-mode-map-alist) + (setq minor-mode-map-alist + (cons (cons 'egg:*in-fence-mode* fence-mode-map) + minor-mode-map-alist))) + +;;;---------------------------------------------------------------------- +;;; +;;; Read hiragana from minibuffer +;;; +;;;---------------------------------------------------------------------- + +(defvar egg:*minibuffer-local-hiragana-map* + (append '(keymap (?\C-x keymap (t . undefined)) + (?\e keymap (t . undefined))) + minibuffer-local-map)) + +(substitute-key-definition 'egg-self-insert-command + 'fence-self-insert-command + egg:*minibuffer-local-hiragana-map* + global-map) + +(substitute-key-definition 'toggle-egg-mode 'ignore + egg:*minibuffer-local-hiragana-map* + global-map) + +(defun egg:read-hiragana-string (prompt &optional initial-input) + (let (minibuffer-setup-hook minibuffer-setup-hook) + (add-hook 'minibuffer-setup-hook + `(lambda nil + (mode-line-egg-mode-update + ,(nth 1 (its:get-mode-indicator its:*current-map*))))) + (read-from-minibuffer prompt initial-input + egg:*minibuffer-local-hiragana-map*))) + +(defun egg:read-kanji-string (prompt &optional initial-input) + (let ((its:*current-map* (its:get-mode-map "roma-kana")) + (minibuffer-setup-hook minibuffer-setup-hook)) + (add-hook 'minibuffer-setup-hook + (lambda nil + (setq egg:*input-mode* t + egg:*mode-on* t) + (mode-line-egg-mode-update + (its:get-mode-indicator "roma-kana")))) + (read-from-minibuffer prompt initial-input))) + +(defconst isearch:read-kanji-string 'read-kanji-string) + +;;; $B5-9fF~NO(B + +(defvar special-symbol-input-point nil) + +(defun special-symbol-input () + (interactive) + (require 'egg-jsymbol) + ;; 92.7.8 by Y.Kawabe + (let ((item (menu:select-from-menu + *symbol-input-menu* special-symbol-input-point t)) + (code t)) + (and (listp item) + (setq code (car item) special-symbol-input-point (cdr item))) + ;; end of patch + (cond((stringp code) (insert code)) + ((consp code) (eval code)) + ))) + +(define-key global-map "\C-^" 'special-symbol-input) + +(autoload 'busyu-input "busyu" nil t) ;92.10.18 by K.Handa +(autoload 'kakusuu-input "busyu" nil t) ;92.10.18 by K.Handa + +(provide 'egg) + +;;; egg.el ends here --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/eggrc-sj3 2003-02-12 06:55:49 +0000 @@ -0,0 +1,23 @@ +;;; +;;; Standard Start Up File for EGG +;;; Version 1.0 +;;; Copyright 1990 Kiyoji Ishii +;;; + +(set-default-sys-dic-directory "/usr/sony/dict/sj3") +(set-default-usr-dic-directory "/usr/sony/dict/sj3/user/$USER") + +;;; +;;; System Dictionary +;;; + +(setsysdic "sj3main.dic") + +;;; +;;; Private Dictionary +;;; + +(setusrdic "private.dic") +(setusrstdy "study.dat") + + --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/eggrc-v41 2003-02-12 06:55:49 +0000 @@ -0,0 +1,127 @@ +;; -*-Emacs-Lisp-*- +;; Standard Start Up File for EGG +;; Copyright (C) 1992 Free Software Foundation, Inc. +;; This file is part of Mule (MULtilingual Enhancement of GNU Emacs). + +;; Mule is free software distributed in the form of patches to GNU Emacs. +;; You can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 1, or (at your option) +;; any later version. + +;; Mule is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Version 1.0 +;;; Written by Satoru.Tomura@etl.jp 1988 +;;; modified for LUNA'default ryuji@nfa.ncl.omron.junet +;;; +;;; modified for Wnn V4 - Use compatible library of Wnn v3 +;;; Copyright 1989 OMRON Tateisi Electronics, Co. +;;; 1989 7/12 by H.Kuribayashi kuri@frf.oron.junet + +;;; 92.5.19 modified for Wnn V4 by T.Shingu +;;; Use non compatible library. +;;; 93.1.8 file names of frequency and private dictionary ware adjusted +;;; to Wnn version 4.1. +;;; 93.4.2 dictianary, frequency files are set up on normal/reverse +;;; environment individually. +;;; 93.6.30 specifying default user directory to make customize easily +;;; suggested by K.Sakai + +;(defvar wnn-usr-dic-dir "usr/$USER") +(defvar wnn-usr-dic-dir (concat "usr/" (user-login-name))) + +(cond ((eq wnn-server-type 'jserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "pubdic/full.fzk") + (add-wnn-dict "pubdic/kihon.dic" (concat wnn-usr-dic-dir "/kihon.h") 5 nil t) + (add-wnn-dict "pubdic/setsuji.dic" (concat wnn-usr-dic-dir "/setsuji.h") 5 nil t) + (add-wnn-dict "pubdic/koyuu.dic" (concat wnn-usr-dic-dir "/koyuu.h") 1 nil t) + (add-wnn-dict "pubdic/chimei.dic" (concat wnn-usr-dic-dir "/chimei.h") 1 nil t) + (add-wnn-dict "pubdic/jinmei.dic" (concat wnn-usr-dic-dir "/jinmei.h") 1 nil t) + (add-wnn-dict "pubdic/special.dic" (concat wnn-usr-dic-dir "/special.h") 5 nil t) + (add-wnn-dict "pubdic/computer.dic" (concat wnn-usr-dic-dir "/computer.h") 5 nil t) + (add-wnn-dict "pubdic/symbol.dic" (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) + (add-wnn-dict "pubdic/tankan.dic" "" 1 nil nil) + (add-wnn-dict "pubdic/bio.dic" (concat wnn-usr-dic-dir "/bio.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict "wnncons/tankan2.dic" "" 1 nil nil) +; (add-wnn-dict "wnncons/tankan3.dic" "" 1 nil nil) + (set-wnn-param 2 10 2 45 5 80 5 1 40 0 400 -100 400 80 200 2 200) + (set-wnn-reverse t) + (set-wnn-fuzokugo "pubdic/full.fzk") + (add-wnn-dict "pubdic/kihon.dic" (concat wnn-usr-dic-dir "/kihon.h") 5 nil t) + (add-wnn-dict "pubdic/setsuji.dic" (concat wnn-usr-dic-dir "/setsuji.h") 5 nil t) + (add-wnn-dict "pubdic/koyuu.dic" (concat wnn-usr-dic-dir "/koyuu.h") 1 nil t) + (add-wnn-dict "pubdic/chimei.dic" (concat wnn-usr-dic-dir "/chimei.h") 1 nil t) + (add-wnn-dict "pubdic/jinmei.dic" (concat wnn-usr-dic-dir "/jinmei.h") 1 nil t) + (add-wnn-dict "pubdic/special.dic" (concat wnn-usr-dic-dir "/special.h") 5 nil t) + (add-wnn-dict "pubdic/computer.dic" (concat wnn-usr-dic-dir "/computer.h") 5 nil t) +; (add-wnn-dict "pubdic/symbol.dic" (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) + (add-wnn-dict "pubdic/tankan.dic" "" 1 nil nil) + (add-wnn-dict "pubdic/bio.dic" (concat wnn-usr-dic-dir "/bio.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict "wnncons/tankan2.dic" "" 1 nil nil) +; (add-wnn-dict "wnncons/tankan3.dic" "" 1 nil nil) + (set-wnn-param 2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200) + + ) + ((eq wnn-server-type 'cserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/level_1.dic" (concat wnn-usr-dic-dir "/level_1.h") 4 nil t) + (add-wnn-dict "sys/level_2.dic" (concat wnn-usr-dic-dir "/level_2.h") 1 nil t) + (add-wnn-dict "sys/basic.dic" (concat wnn-usr-dic-dir "/basic.h") 7 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/level_1.dic" (concat wnn-usr-dic-dir "/level_1.h") 4 nil t) + (add-wnn-dict "sys/level_2.dic" (concat wnn-usr-dic-dir "/level_2.h") 1 nil t) + (add-wnn-dict "sys/basic.dic" (concat wnn-usr-dic-dir "/basic.h") 7 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) + ((eq wnn-server-type 'tserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/cns_ch.dic" (concat wnn-usr-dic-dir "/cns_ch.h") 4 nil t) + (add-wnn-dict "sys/cns_wd.dic" (concat wnn-usr-dic-dir "/cns_wd.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/cns_ch.dic" (concat wnn-usr-dic-dir "/cns_ch.h") 4 nil t) + (add-wnn-dict "sys/cns_wd.dic" (concat wnn-usr-dic-dir "/cns_wd.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) + ((eq wnn-server-type 'kserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.fzk") +; (add-wnn-dict "sys/hword.dic" (concat wnn-usr-dic-dir "/hword.h") 4 nil t) + (add-wnn-dict "sys/single.dic" (concat wnn-usr-dic-dir "/single.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict (concat wnn-usr-dic-dir "/hangul") "" 5 t t) +; (add-wnn-dict (concat wnn-usr-dic-dir "/fuzokugo") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.fzk") +; (add-wnn-dict "sys/hword.dic" (concat wnn-usr-dic-dir "/hword.h") 4 nil t) + (add-wnn-dict "sys/single.dic" (concat wnn-usr-dic-dir "/single.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict (concat wnn-usr-dic-dir "/hangul") "" 5 t t) +; (add-wnn-dict (concat wnn-usr-dic-dir "/fuzokugo") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) +) + +;; N nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt suuji kana eisuu kigou toji_kakko fuzokogo kaikakko + --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/eggrc-wnn 2003-02-12 06:55:49 +0000 @@ -0,0 +1,286 @@ +;; -*-Emacs-Lisp-*- +;; Standard Start Up File for EGG +;; Copyright (C) 1992 Free Software Foundation, Inc. +;; This file is part of Mule (MULtilingual Enhancement of GNU Emacs). + +;; Mule is free software distributed in the form of patches to GNU Emacs. +;; You can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 1, or (at your option) +;; any later version. + +;; Mule is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Version 1.0 +;;; Written by Satoru.Tomura@etl.jp 1988 +;;; modified for LUNA'default ryuji@nfa.ncl.omron.junet +;;; +;;; modified for Wnn V4 - Use compatible library of Wnn v3 +;;; Copyright 1989 OMRON Tateisi Electronics, Co. +;;; 1989 7/12 by H.Kuribayashi kuri@frf.oron.junet + +;;; 92.5.19 modified for Wnn V4 by T.Shingu +;;; Use non compatible library. +;;; 93.1.8 file names of frequency and private dictionary ware adjusted +;;; to Wnn version 4.1. +;;; 93.4.2 dictianary, frequency files are set up on normal/reverse +;;; environment individually. +;;; 93.6.30 specifying default user directory to make customize easily +;;; suggested by K.Sakai + +;(defvar wnn-usr-dic-dir "usr/$USER") +(defvar wnn-usr-dic-dir (concat "usr/" (user-login-name))) + +(defun wnn7-jserver-setup () + (set-wnn-reverse nil) + ;; maindic + (set-wnn-fuzokugo "system/kougo.fzk") + (add-wnn-fisys-dict "system/fisd" + (concat wnn-usr-dic-dir "/fisd.h") t) + (add-wnn-fiusr-dict (concat wnn-usr-dic-dir "/fiud") "" t nil) + (add-wnn-dict "system/kihon.dic" + (concat wnn-usr-dic-dir "/kihon.h") 6 nil t) + (add-wnn-dict "system/symbol.dic" + (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) +; (add-wnn-dict "system/symbol_noat.dic" +; (concat wnn-usr-dic-dir "/symbol_noat.h") 1 nil t) + (add-wnn-dict "system/tel.dic" + (concat wnn-usr-dic-dir "/tel.h") 1 nil t) + (add-wnn-dict "system/zip.dic" + (concat wnn-usr-dic-dir "/zip.h") 1 nil t) + (add-wnn-dict "system/tankan.dic" "" 1 nil nil) + (add-wnn-dict "system/tankan2.dic" "" 1 nil nil) + (add-wnn-dict "system/ikeiji.dic" "" 1 nil nil) + (add-wnn-dict "system/rensou.dic" "" 1 nil nil) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 15 t t) + + ;; optiondic + (add-wnn-dict "option/jinmei.dic" + (concat wnn-usr-dic-dir "/jinmei.h") 1 nil t) + (add-wnn-dict "option/chimei.dic" + (concat wnn-usr-dic-dir "/chimei.h") 1 nil t) + (add-wnn-dict "option/address.dic" + (concat wnn-usr-dic-dir "/address.h") 1 nil t) + (add-wnn-dict "option/station.dic" + (concat wnn-usr-dic-dir "/station.h") 1 nil t) + (add-wnn-dict "option/kana_english.dic" + (concat wnn-usr-dic-dir "/kana_english.h") 1 nil t) + (add-wnn-dict "option/enterprise.dic" + (concat wnn-usr-dic-dir "/enterprise.h") 1 nil t) + (add-wnn-dict "option/airport.dic" + (concat wnn-usr-dic-dir "/airport.h") 1 nil t) + (add-wnn-dict "option/university.dic" + (concat wnn-usr-dic-dir "/university.h") 1 nil t) + (add-wnn-dict "option/zoo.dic" + (concat wnn-usr-dic-dir "/zoo.h") 1 nil t) + (add-wnn-dict "option/botanical_garden.dic" + (concat wnn-usr-dic-dir "/botanical_garden.h") 1 nil t) + (add-wnn-dict "option/aquarium.dic" + (concat wnn-usr-dic-dir "/aquarium.h") 1 nil t) + (add-wnn-dict "option/conveni.dic" + (concat wnn-usr-dic-dir "/conveni.h") 1 nil t) + (add-wnn-dict "option/amusement.dic" + (concat wnn-usr-dic-dir "/amusement.h") 1 nil t) + + ;; computerdic 2001/12/07 + (add-wnn-dict "option/computer.dic" + (concat wnn-usr-dic-dir "/computer.h") 1 nil t) + + (set-wnn-param 5 10 2 45 0 80 5 1 20 0 400 -100 400 80 200 2 200) + + (add-wnn-notrans-dict (concat wnn-usr-dic-dir "/muhenkan") 15 t) + (add-wnn-bmodify-dict (concat wnn-usr-dic-dir "/bunsetsu") 15 t) + + (set-last-is-first-mode t) + (set-okuri-learn-mode t) + (set-complex-conv-mode nil) + (set-okuri-flag -1) + (set-prefix-flag 0) + (set-prefix-learn-mode t) + (set-suffix-learn-mode t) + (set-common-learn-mode t) + (set-freq-func-mode 4) + (set-numeric-mode -12) + (set-alphabet-mode -30) + (set-symbol-mode -40) + (set-yuragi-mode nil) + (wnn7-set-boin-kabusoku t) + (wnn7-set-n-choka t) + (wnn7-set-shiin-choka t) + (wnn7-set-nihongo-kosei t) + + (set-wnn-reverse t) + (set-wnn-fuzokugo "system/kougo.fzk") + (add-wnn-dict "system/kihonR.dic" "" 1 nil nil) + (add-wnn-dict "system/telR.dic" "" 1 nil nil) + (add-wnn-dict "system/zipR.dic" "" 1 nil nil) + (add-wnn-dict "system/tankanR.dic" "" 1 nil nil) + (add-wnn-dict "system/tankan2R.dic" "" 1 nil nil) + (add-wnn-dict "option/jinmeiR.dic" "" 1 nil nil) + (add-wnn-dict "option/chimeiR.dic" "" 1 nil nil) + (add-wnn-dict "option/addressR.dic" "" 1 nil nil) +; (add-wnn-dict "option/stationR.dic" "" 1 nil nil) +; (add-wnn-dict "option/enterpriseR.dic" "" 1 nil nil) +; (add-wnn-dict "option/airportR.dic" "" 1 nil nil) +; (add-wnn-dict "option/universityR.dic" "" 1 nil nil) +; (add-wnn-dict "option/zooR.dic" "" 1 nil nil) +; (add-wnn-dict "option/botanical_gardenR.dic" "" 1 nil nil) +; (add-wnn-dict "option/aquariumR.dic" "" 1 nil nil) +; (add-wnn-dict "option/conveniR.dic" "" 1 nil nil) +; (add-wnn-dict "option/amusementR.dic" "" 1 nil nil) +; (add-wnn-dict "option/computerR.dic" "" 1 nil nil) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 15 t t) + (set-wnn-param 2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200) + ) + +(defun wnn6-jserver-setup () + (set-wnn-reverse nil) + (set-wnn-fuzokugo "iwanami/kougo.fzk") + (add-wnn-fisys-dict "iwanami/fisd" + (concat wnn-usr-dic-dir "/fisd.h") t) + (add-wnn-fiusr-dict (concat wnn-usr-dic-dir "/fiud") "" t nil) + (add-wnn-dict "iwanami/kihon.dic" + (concat wnn-usr-dic-dir "/kihon.h") 6 nil t) + (add-wnn-dict "iwanami/symbol.dic" + (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) + (add-wnn-dict "iwanami/tankan.dic" "" 1 nil nil) + (add-wnn-dict "iwanami/tankan2.dic" "" 1 nil nil) + (add-wnn-dict "iwanami/tel.dic" "" 1 nil nil) + (add-wnn-dict "iwanami/zip.dic" "" 1 nil nil) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 15 t t) +; (add-wnn-dict "wnncons/tankan2.dic" "" 1 nil nil) +; (add-wnn-dict "wnncons/tankan3.dic" "" 1 nil nil) + (set-wnn-param 5 10 2 45 0 80 5 1 20 0 400 -100 400 80 200 2 200) + + (add-wnn-notrans-dict (concat wnn-usr-dic-dir "/katakana") 15 t) + (add-wnn-bmodify-dict (concat wnn-usr-dic-dir "/bunsetsu") 15 t) + + (set-last-is-first-mode t) + (set-complex-conv-mode nil) +; (set-okuri-flag -1) + (set-prefix-flag 0) + + (set-okuri-learn-mode t) + (set-prefix-learn-mode t) + (set-suffix-learn-mode t) + (set-common-learn-mode t) + (set-yuragi-mode nil) + + (set-freq-func-mode 4) + +; (set-numeric-mode -12) +; (set-alphabet-mode -30) +; (set-symbol-mode -40) + + (set-wnn-reverse t) + (set-wnn-fuzokugo "iwanami/kougo.fzk") + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 15 t t) + (set-wnn-param 2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200) + + ) + + +(defun wnn4-jserver-setup () + (set-wnn-reverse nil) + (set-wnn-fuzokugo "pubdic/full.fzk") + (add-wnn-dict "pubdic/kihon.dic" (concat wnn-usr-dic-dir "/kihon.h") 5 nil t) + (add-wnn-dict "pubdic/setsuji.dic" (concat wnn-usr-dic-dir "/setsuji.h") 5 nil t) + (add-wnn-dict "pubdic/koyuu.dic" (concat wnn-usr-dic-dir "/koyuu.h") 1 nil t) + (add-wnn-dict "pubdic/chimei.dic" (concat wnn-usr-dic-dir "/chimei.h") 1 nil t) + (add-wnn-dict "pubdic/jinmei.dic" (concat wnn-usr-dic-dir "/jinmei.h") 1 nil t) + (add-wnn-dict "pubdic/special.dic" (concat wnn-usr-dic-dir "/special.h") 5 nil t) + (add-wnn-dict "pubdic/computer.dic" (concat wnn-usr-dic-dir "/computer.h") 5 nil t) + (add-wnn-dict "pubdic/symbol.dic" (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) + (add-wnn-dict "pubdic/tankan.dic" "" 1 nil nil) + (add-wnn-dict "pubdic/bio.dic" (concat wnn-usr-dic-dir "/bio.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict "wnncons/tankan2.dic" "" 1 nil nil) +; (add-wnn-dict "wnncons/tankan3.dic" "" 1 nil nil) + (set-wnn-param 2 10 2 45 5 80 5 1 40 0 400 -100 400 80 200 2 200) + (set-wnn-reverse t) + (set-wnn-fuzokugo "pubdic/full.fzk") + (add-wnn-dict "pubdic/kihon.dic" (concat wnn-usr-dic-dir "/kihon.h") 5 nil t) + (add-wnn-dict "pubdic/setsuji.dic" (concat wnn-usr-dic-dir "/setsuji.h") 5 nil t) + (add-wnn-dict "pubdic/koyuu.dic" (concat wnn-usr-dic-dir "/koyuu.h") 1 nil t) + (add-wnn-dict "pubdic/chimei.dic" (concat wnn-usr-dic-dir "/chimei.h") 1 nil t) + (add-wnn-dict "pubdic/jinmei.dic" (concat wnn-usr-dic-dir "/jinmei.h") 1 nil t) + (add-wnn-dict "pubdic/special.dic" (concat wnn-usr-dic-dir "/special.h") 5 nil t) + (add-wnn-dict "pubdic/computer.dic" (concat wnn-usr-dic-dir "/computer.h") 5 nil t) +; (add-wnn-dict "pubdic/symbol.dic" (concat wnn-usr-dic-dir "/symbol.h") 1 nil t) + (add-wnn-dict "pubdic/tankan.dic" "" 1 nil nil) + (add-wnn-dict "pubdic/bio.dic" (concat wnn-usr-dic-dir "/bio.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) +; (add-wnn-dict "wnncons/tankan2.dic" "" 1 nil nil) +; (add-wnn-dict "wnncons/tankan3.dic" "" 1 nil nil) + (set-wnn-param 2 10 2 45 1 80 5 1 50 -20 400 -10 100 -100 200 0 200) + +) + +(cond ((eq wnn-server-type 'jserver) + (cond ((and (fboundp 'is-wnn7-server) + (is-wnn7-server)) + (wnn7-jserver-setup)) + ((and (fboundp 'is-wnn6-server) + (is-wnn6-server)) + (wnn6-jserver-setup)) + (t + (wnn4-jserver-setup)))) + ((eq wnn-server-type 'cserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/level_1.dic" (concat wnn-usr-dic-dir "/level_1.h") 4 nil t) + (add-wnn-dict "sys/level_2.dic" (concat wnn-usr-dic-dir "/level_2.h") 1 nil t) + (add-wnn-dict "sys/basic.dic" (concat wnn-usr-dic-dir "/basic.h") 7 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/level_1.dic" (concat wnn-usr-dic-dir "/level_1.h") 4 nil t) + (add-wnn-dict "sys/level_2.dic" (concat wnn-usr-dic-dir "/level_2.h") 1 nil t) + (add-wnn-dict "sys/basic.dic" (concat wnn-usr-dic-dir "/basic.h") 7 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) + ((eq wnn-server-type 'tserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/cns_ch.dic" (concat wnn-usr-dic-dir "/cns_ch.h") 4 nil t) + (add-wnn-dict "sys/cns_wd.dic" (concat wnn-usr-dic-dir "/cns_wd.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.con") + (add-wnn-dict "sys/cns_ch.dic" (concat wnn-usr-dic-dir "/cns_ch.h") 4 nil t) + (add-wnn-dict "sys/cns_wd.dic" (concat wnn-usr-dic-dir "/cns_wd.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) + ((eq wnn-server-type 'kserver) + (set-wnn-reverse nil) + (set-wnn-fuzokugo "sys/full.fzk") + ; (add-wnn-dict "sys/hword.dic" (concat wnn-usr-dic-dir "/hword.h") 4 nil t) + (add-wnn-dict "sys/single.dic" (concat wnn-usr-dic-dir "/single.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + ; (add-wnn-dict (concat wnn-usr-dic-dir "/hangul") "" 5 t t) + ; (add-wnn-dict (concat wnn-usr-dic-dir "/fuzokugo") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + (set-wnn-reverse t) + (set-wnn-fuzokugo "sys/full.fzk") + ; (add-wnn-dict "sys/hword.dic" (concat wnn-usr-dic-dir "/hword.h") 4 nil t) + (add-wnn-dict "sys/single.dic" (concat wnn-usr-dic-dir "/single.h") 1 nil t) + (add-wnn-dict (concat wnn-usr-dic-dir "/ud") "" 5 t t) + ; (add-wnn-dict (concat wnn-usr-dic-dir "/hangul") "" 5 t t) + ; (add-wnn-dict (concat wnn-usr-dic-dir "/fuzokugo") "" 5 t t) + (set-wnn-param 1 5 2 750 10 80 10 5 1000 50 0 -200 0 0 0 16 0) + ) + ) + +;; N nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt suuji kana eisuu kigou toji_kakko fuzokogo kaikakko + --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/isearch-ext.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,287 @@ +;;; isearch-ext.el --- incremental search with front-end inputting method + +;; Author: SAKAI Kiyotaka +;; Keywords: search + +;; $Id: isearch-ext.el,v 1.41 1994/12/16 15:33:34 ksakai Exp $ + +;; This file is part of Mule. + +;; Mule is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; Mule is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Commentary: + +;; This program is extension of isearch.el to support multi-lingal +;; incremental search with front-end input method. +;; +;; If you want to use this program, simply put C-\ or C-o or C-[ when +;; doing incremental search, and you can input search words with +;; inputting method. +;; +;; For backward compatibility with mule-1.x, you can also use C-k, but +;; isearch-edit-string may be more suitable for this use. If you +;; think so, put the following code in your .emacs. +;; +;; (define-key isearch-mode-map "\C-k" 'isearch-edit-string) +;; + +;; Following people contributed modifications to isearch-ext.el: +;; Kenichi Handa +;; YAMAMOTO Mitsuharu +;; A. Sasaki +;; Atsuo Ohki + +;;; Code: + +;;(eval-when-compile (require 'quail)) + + +;;;###autoload +(defvar search-string-char-prompt "*Enter string... ") + +(defvar isearch-fep-prompt "" "Prompt for isearch-fep mode.") +(defvar isearch-fep-mode nil "If t, isearch-fep-mode is invoked.") + +(defconst isearch-fep-table + '((isearch-fep-string isearch-fep-prompt-string isearch-fep-read-string) + (isearch-fep-egg isearch-fep-prompt-egg isearch-fep-read-egg) + (isearch-fep-canna isearch-fep-prompt-canna isearch-fep-read-canna) + (isearch-fep-quail isearch-fep-prompt-quail isearch-fep-read-quail))) + +(define-key isearch-mode-map "\C-k" 'isearch-fep-string) +(define-key isearch-mode-map "\C-\\" 'isearch-fep-egg) +(define-key isearch-mode-map "\M-k" 'isearch-fep-egg) +(define-key isearch-mode-map "\C-o" 'isearch-fep-canna) +(define-key isearch-mode-map "\C-\]" 'isearch-fep-quail) + +(defun isearch-fep-mode () + (let ((command this-command) + (isearch-fep-mode t) + table str) + (while isearch-fep-mode + (setq table (assq command isearch-fep-table)) + (setq isearch-fep-prompt (funcall (car (cdr table)))) + (message "%s%s" isearch-fep-prompt (isearch-message)) + (if (eq command 'isearch-fep-string) ;; \C-k + (progn + (setq str (funcall (nth 2 table))) + (setq isearch-fep-mode nil) + (isearch-process-search-string str str)) + (let* ((keys (read-key-sequence nil)) + (current-command (key-binding keys t))) + (setq isearch-fep-mode (not (eq command current-command))) + (if isearch-fep-mode + (if (assq current-command isearch-fep-table) + (setq command current-command) + (cond ((eq current-command 'isearch-printing-char) + (setq str (funcall (nth 2 table) keys)) + (isearch-process-search-string str str)) + ((or (eq current-command 'isearch-other-control-char) + (eq current-command 'isearch-other-meta-char)) + (call-interactively current-command) + (setq isearch-fep-mode nil)) + ((eq current-command 'isearch-exit) + (setq isearch-fep-mode nil) + (message "%s%s" + (isearch-message-prefix) isearch-message)) + (t + (call-interactively current-command)))) + (setq isearch-fep-prompt nil) + (message "%s%s" (isearch-message-prefix) isearch-message))))))) + +;; +;; Read string from minibuffer for incremental search. +;; + +;;;###autoload +(defun isearch-fep-string () + "Read string from minibuffer for incremental search." + (interactive) + (isearch-fep-mode)) + +(defun isearch-fep-prompt-string () + search-string-char-prompt) + +(defun exit-minibuffer-and-isearch-backward () + (interactive) + (setq unread-command-events '(?\C-r ?\C-r)) + (exit-minibuffer)) + +(defun isearch-fep-read-string () + (let ((minibuffer-local-map (cons 'keymap minibuffer-local-map))) + ;; Some program overwrites "\C-m"'s default binding. + (define-key minibuffer-local-map "\C-m" 'exit-minibuffer) + (define-key minibuffer-local-map "\C-s" 'exit-minibuffer) + (define-key minibuffer-local-map "\C-r" + 'exit-minibuffer-and-isearch-backward) + (condition-case condition + ;; isearch.el of GNU Emacs 19.28 used overriding-local-map. + ;; isearch.el of GNU Emacs 19.29, 19.30 (which is latest at + ;; this point) uses overriding-terminal-local-map. Disable + ;; isearch keymap with binding it to nil. We bind the map + ;; here so that isearch-abort (actually, by isearch-done) + ;; can set it to nil. + (let ((overriding-terminal-local-map nil)) + (read-from-minibuffer (concat isearch-fep-prompt (isearch-message)))) + (quit + ;; Also, this isearch-abort should be called in original + ;; buffer, because the variable which always has buffer-local + ;; binding (at least isearch-mode is such variable) should be + ;; bound in right environment. + (isearch-abort))))) + + +;; +;; For EGG +;; + +;;;###autoload +(defun isearch-fep-egg () + "Read string for incremental search by using egg." + (interactive) + (isearch-fep-mode)) + +(defun isearch-fep-prompt-egg () + (if (featurep 'egg) + (format "[%s]" (map-indicator its:*current-map*)) + (setq isearch-fep-mode nil) + (message "No EGG!! ") + (sit-for 1) + "")) + +(defun isearch-exit-minibuffer-egg (from to) + (exit-minibuffer)) + +;; these variables are used to pass current-buffer's value of some +;; buffer-local variable to minibuffer +(defvar isearch-fep-egg-its-map nil) +(defvar isearch-fep-egg-server-type nil) + +(defun isearch-minibuffer-setup-egg () + ;; setup buffer-local variables for minibuffer + (setq its:*current-map* isearch-fep-egg-its-map) + (setq wnn-server-type isearch-fep-egg-server-type) + (setq egg:*input-mode* t) + (setq egg:*mode-on* t)) + +(defun isearch-minibuffer-exit-egg () + (setq egg:henkan-mode-in-use nil) + (set 'disable-undo nil)) + +(defun isearch-fep-read-egg (first-str) + (if (and (featurep 'egg) (= (minibuffer-depth) 0)) + (let ((display-minibuffer-mode-in-minibuffer t) + (isearch-fep-egg-its-map its:*current-map*) + (isearch-fep-egg-server-type wnn-server-type) + ;; In GNU Emacs 19.29 or later, isearch.el doesn't + ;; make overriding-terminal-local-map buffer local. + ;; So we must bind explicitly it to nil to disable it + ;; while reading from minibuffer. + (overriding-terminal-local-map nil) + (self-insert-after-hook 'isearch-exit-minibuffer-egg)) + (setq unread-command-events (listify-key-sequence first-str)) + (unwind-protect + (progn + (add-hook 'minibuffer-setup-hook 'isearch-minibuffer-setup-egg) + (add-hook 'minibuffer-exit-hook 'isearch-minibuffer-exit-egg) + (read-from-minibuffer (isearch-message))) + (remove-hook 'minibuffer-setup-hook 'isearch-minibuffer-setup-egg) + (remove-hook 'minibuffer-exit-hook 'isearch-minibuffer-exit-egg))) + "")) + + +;; +;; For Canna +;; + +;;;###autoload +(defun isearch-fep-canna () + "Read string for incremental search by using canna." + (interactive) + (unwind-protect + (isearch-fep-mode) + (canna:quit-canna-mode))) + +(defun isearch-fep-prompt-canna () + (if (and (featurep 'canna) canna:*initialized*) + (format "%s" canna:*kanji-mode-string*) + (setq isearch-fep-mode nil) + (message "No Canna!! ") + (sit-for 1) + "")) + +(defun isearch-exit-minibuffer-canna (from to) + (exit-minibuffer)) + +(defun isearch-minibuffer-setup-canna () + ;; setup buffer-local variables for minibuffer. + (setq canna:*japanese-mode* t + canna:*japanese-mode-in-minibuffer* t + canna:*fence-mode* nil)) + +(defun isearch-minibuffer-exit-canna () + (set 'disable-undo nil)) + +(defun isearch-fep-read-canna (first-str) + (if (and (featurep 'canna) (= (minibuffer-depth) 0)) + (let ((display-minibuffer-mode-in-minibuffer t) + ;; See comment in isearch-fep-read-egg. + (overriding-terminal-local-map nil) + (self-insert-after-hook 'isearch-exit-minibuffer-canna)) + (setq unread-command-events (listify-key-sequence first-str)) + (unwind-protect + (progn + (add-hook 'minibuffer-setup-hook 'isearch-minibuffer-setup-canna) + (add-hook 'minibuffer-exit-hook 'isearch-minibuffer-exit-canna) + (read-from-minibuffer (isearch-message))) + (remove-hook 'minibuffer-setup-hook 'isearch-minibuffer-setup-canna) + (remove-hook 'minibuffer-exit-hook 'isearch-minibuffer-exit-canna))) + "")) + + +;; +;; For QUAIL +;; + +;;;###autoload +(defun isearch-fep-quail () + "Read string for incremental search by using quail." + (interactive) + (require 'quail) + (isearch-fep-mode)) + +(defun isearch-fep-prompt-quail () + "[QUAIL]") + +(defun isearch-exit-minibuffer-quail () + (if (or (symbol-value 'quail-current-key) + (symbol-value 'quail-current-str)) + nil + (exit-minibuffer))) + +(defun isearch-fep-read-quail (first-str) + (let ((quail-self-insert-after-hook 'isearch-exit-minibuffer-quail) + ;; See comment in isearch-fep-read-egg. + (overriding-terminal-local-map nil)) + (setq unread-command-events (cons ?\C-\] (listify-key-sequence first-str))) + (unwind-protect + (read-from-minibuffer + (concat isearch-fep-prompt (isearch-message))) + (set 'disable-undo nil)))) + + +(provide 'isearch-ext) +;;; isearch-ext.el ends here + --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/han-kata.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,287 @@ +;; Basic Roma-to-HankakuKana (jisx0201) Translation Table for Egg + +;; This file is part of Egg on Mule (Japanese Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;;; 92.9.24 created for Mule Ver.0.9.6 by K.Shibata + +(require 'japan-util) + +(its-define-mode "roma-han-kata" "(I1'(B" t) + +(dolist (aa '("k" "s" "t" "h" "y" "r" "w" "g" "z" "d" "b" + "p" "c" "f" "j" "v")) + (its-defrule (concat aa aa) "(I/(B" aa)) + +(its-defrule "tch" "(I/(B" "ch") + +(dolist (q1 '("b" "m" "p")) + (its-defrule (concat "m" q1) "(I](B" q1)) + +(its-defrule "N" "(I](B") + +(defvar enable-double-n-syntax nil "*Enable \"nn\" input for \"(I](B\" ") + +(its-defrule-conditional "n" + ((not enable-double-n-syntax) "(I](B") + (t nil)) +(its-defrule-conditional "nn" + ( enable-double-n-syntax "(I](B") + (t nil)) + +(its-defrule "n'" "(I](B") + +(let ((small '"x" )) + (its-defrule (concat small "a") "(I'(B") + (its-defrule (concat small "i") "(I((B") + (its-defrule (concat small "u") "(I)(B") + (its-defrule (concat small "e") "(I*(B") + (its-defrule (concat small "o") "(I+(B") + (its-defrule (concat small "ya") "(I,(B") + (its-defrule (concat small "yu") "(I-(B") + (its-defrule (concat small "yo") "(I.(B") + (its-defrule (concat small "tu") "(I/(B") + (its-defrule (concat small "tsu") "(I/(B") + ) + + +(its-defrule "a" "(I1(B") +(its-defrule "i" "(I2(B") +(its-defrule "u" "(I3(B") +(its-defrule "e" "(I4(B") +(its-defrule "o" "(I5(B") +(its-defrule "ka" "(I6(B") +(its-defrule "ki" "(I7(B") +(its-defrule "ku" "(I8(B") +(its-defrule "ke" "(I9(B") +(its-defrule "ko" "(I:(B") +(its-defrule "kya" "(I7,(B") +(its-defrule "kyu" "(I7-(B") +(its-defrule "kye" "(I7*(B") +(its-defrule "kyo" "(I7.(B") +(its-defrule "sa" "(I;(B") +(its-defrule "si" "(I<(B") +(its-defrule "su" "(I=(B") +(its-defrule "se" "(I>(B") +(its-defrule "so" "(I?(B") +(its-defrule "sya" "(I<,(B") +(its-defrule "syu" "(I<-(B") +(its-defrule "sye" "(I<*(B") +(its-defrule "syo" "(I<.(B") +(its-defrule "sha" "(I<,(B") +(its-defrule "shi" "(I<(B") +(its-defrule "shu" "(I<-(B") +(its-defrule "she" "(I<*(B") +(its-defrule "sho" "(I<.(B") +(its-defrule "ta" "(I@(B") +(its-defrule "ti" "(IA(B") +(its-defrule "tu" "(IB(B") +(its-defrule "te" "(IC(B") +(its-defrule "to" "(ID(B") +(its-defrule "tya" "(IA,(B") +(its-defrule "tyi" "(IC((B") +(its-defrule "tyu" "(IA-(B") +(its-defrule "tye" "(IA*(B") +(its-defrule "tyo" "(IA.(B") +(its-defrule "tsu" "(IB(B") +(its-defrule "cha" "(IA,(B") +(its-defrule "chi" "(IA(B") +(its-defrule "chu" "(IA-(B") +(its-defrule "che" "(IA*(B") +(its-defrule "cho" "(IA.(B") +(its-defrule "na" "(IE(B") +(its-defrule "ni" "(IF(B") +(its-defrule "nu" "(IG(B") +(its-defrule "ne" "(IH(B") +(its-defrule "no" "(II(B") +(its-defrule "nya" "(IF,(B") +(its-defrule "nyu" "(IF-(B") +(its-defrule "nye" "(IF*(B") +(its-defrule "nyo" "(IF.(B") +(its-defrule "ha" "(IJ(B") +(its-defrule "hi" "(IK(B") +(its-defrule "hu" "(IL(B") +(its-defrule "he" "(IM(B") +(its-defrule "ho" "(IN(B") +(its-defrule "hya" "(IK,(B") +(its-defrule "hyu" "(IK-(B") +(its-defrule "hye" "(IK*(B") +(its-defrule "hyo" "(IK.(B") +(its-defrule "fa" "(IL'(B") +(its-defrule "fi" "(IL((B") +(its-defrule "fu" "(IL(B") +(its-defrule "fe" "(IL*(B") +(its-defrule "fo" "(IL+(B") +(its-defrule "ma" "(IO(B") +(its-defrule "mi" "(IP(B") +(its-defrule "mu" "(IQ(B") +(its-defrule "me" "(IR(B") +(its-defrule "mo" "(IS(B") +(its-defrule "mya" "(IP,(B") +(its-defrule "myu" "(IP-(B") +(its-defrule "mye" "(IP*(B") +(its-defrule "myo" "(IP.(B") +(its-defrule "ya" "(IT(B") +(its-defrule "yi" "(I2(B") +(its-defrule "yu" "(IU(B") +(its-defrule "ye" "(I2*(B") +(its-defrule "yo" "(IV(B") +(its-defrule "ra" "(IW(B") +(its-defrule "ri" "(IX(B") +(its-defrule "ru" "(IY(B") +(its-defrule "re" "(IZ(B") +(its-defrule "ro" "(I[(B") +(its-defrule "la" "(IW(B") +(its-defrule "li" "(IX(B") +(its-defrule "lu" "(IY(B") +(its-defrule "le" "(IZ(B") +(its-defrule "lo" "(I[(B") +(its-defrule "rya" "(IX,(B") +(its-defrule "ryu" "(IX-(B") +(its-defrule "rye" "(IX*(B") +(its-defrule "ryo" "(IX.(B") +(its-defrule "lya" "(IX,(B") +(its-defrule "lyu" "(IX-(B") +(its-defrule "lye" "(IX*(B") +(its-defrule "lyo" "(IX.(B") +(its-defrule "wa" "(I\(B") +(its-defrule "wu" "(I3(B") +(its-defrule "wo" "(I&(B") +(its-defrule "ga" "(I6^(B") +(its-defrule "gi" "(I7^(B") +(its-defrule "gu" "(I8^(B") +(its-defrule "ge" "(I9^(B") +(its-defrule "go" "(I:^(B") +(its-defrule "gya" "(I7^,(B") +(its-defrule "gyu" "(I7^-(B") +(its-defrule "gye" "(I7^*(B") +(its-defrule "gyo" "(I7^.(B") +(its-defrule "za" "(I;^(B") +(its-defrule "zi" "(I<^(B") +(its-defrule "zu" "(I=^(B") +(its-defrule "ze" "(I>^(B") +(its-defrule "zo" "(I?^(B") +(its-defrule "zya" "(I<^,(B") +(its-defrule "zyu" "(I<^-(B") +(its-defrule "zye" "(I<^*(B") +(its-defrule "zyo" "(I<^.(B") +(its-defrule "ja" "(I<^,(B") +(its-defrule "ji" "(I<^(B") +(its-defrule "ju" "(I<^-(B") +(its-defrule "je" "(I<^*(B") +(its-defrule "jo" "(I<^.(B") +(its-defrule "da" "(I@^(B") +(its-defrule "di" "(IA^(B") +(its-defrule "du" "(IB^(B") +(its-defrule "de" "(IC^(B") +(its-defrule "do" "(ID^(B") +(its-defrule "dya" "(IA^,(B") +(its-defrule "dyi" "(IA^((B") +(its-defrule "dyu" "(IA^-(B") +(its-defrule "dye" "(IA^*(B") +(its-defrule "dyo" "(IA^.(B") +(its-defrule "ba" "(IJ^(B") +(its-defrule "bi" "(IK^(B") +(its-defrule "bu" "(IL^(B") +(its-defrule "be" "(IM^(B") +(its-defrule "bo" "(IN^(B") +(its-defrule "va" "(I3^'(B") +(its-defrule "vi" "(I3^((B") +(its-defrule "vu" "(I3^(B") +(its-defrule "ve" "(I3^*(B") +(its-defrule "vo" "(I3^+(B") +(its-defrule "bya" "(IK^,(B") +(its-defrule "byu" "(IK^-(B") +(its-defrule "bye" "(IK^*(B") +(its-defrule "byo" "(IK^.(B") +(its-defrule "pa" "(IJ_(B") +(its-defrule "pi" "(IK_(B") +(its-defrule "pu" "(IL_(B") +(its-defrule "pe" "(IM_(B") +(its-defrule "po" "(IN_(B") +(its-defrule "pya" "(IK_,(B") +(its-defrule "pyu" "(IK_-(B") +(its-defrule "pye" "(IK_*(B") +(its-defrule "pyo" "(IK_.(B") +(its-defrule "kwi" "(I8((B") +(its-defrule "kwu" "(I8(B") +(its-defrule "kwe" "(I8*(B") +(its-defrule "kwo" "(I8+(B") +(its-defrule "gwi" "(I8^((B") +(its-defrule "gwu" "(I8^(B") +(its-defrule "gwe" "(I8^*(B") +(its-defrule "gwo" "(I8^+(B") +(its-defrule "tsa" "(IB'(B") +(its-defrule "tsi" "(IB((B") +(its-defrule "tse" "(IB*(B") +(its-defrule "tso" "(IB+(B") +(its-defrule "xka" "(I6(B") +(its-defrule "xke" "(I9(B") +(its-defrule "xti" "(IC((B") +(its-defrule "xdi" "(IA^((B") +(its-defrule "xdu" "(ID^)(B") +(its-defrule "xde" "(IA^*(B") +(its-defrule "xdo" "(ID^+(B") +(its-defrule "xwi" "(I3((B") +(its-defrule "xwe" "(I3*(B") +(its-defrule "xwo" "(I3+(B") + +(its-defrule "-" "(I0(B") +(its-defrule "[" "(I"(B") +(its-defrule "]" "(I#(B") +(its-defrule "z/" "(I%(B") + +(defvar use-kuten-for-period t "*(IK_X5D^$B$r6gE@$KJQ49$9$k(B") +(defvar use-touten-for-comma t "*(I:]O$B$rFIE@$KJQ49$9$k(B") + +(its-defrule-conditional "." + (use-kuten-for-period "(I!(B") + (t ".")) + +(its-defrule-conditional "," + (use-touten-for-comma "(I$(B") + (t ",")) + +(its-defrule (concat zenkaku-escape ",") "$B!$(B") +(its-defrule (concat zenkaku-escape ".") "$B!%(B") + +(defun its:select-hankaku-katakana () + (interactive) + (its:select-mode "roma-han-kata")) + +(define-key mule-keymap "x" 'its:select-hankaku-katakana) +(define-key fence-mode-map "\e\C-x" 'its:select-hankaku-katakana) + +;;; +;;; JISX 0201 fence mode +;;; + +(defun fence-hankaku-katakana () + (interactive) + (japanese-katakana-region egg:*region-start* egg:*region-end* t)) + +(defun fence-katakana () + (interactive) + (japanese-katakana-region egg:*region-start* egg:*region-end*)) + +(defun fence-hiragana () + (interactive) + (japanese-katakana-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) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/hankaku.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,86 @@ +;; Basic Roma-to-Kana Translation Table for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Nemacs (Japanese Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;; 92.3.16 modified for Mule Ver.0.9.1 by K.Handa +;; 92.3.23 modified for Mule Ver.0.9.1 by K.Handa +;; defrule -> its-defrule, define-its-mode -> its-define-mode + +(defvar digit-characters + '( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" )) + +(defvar symbol-characters + '( " " "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" + "-" "=" "`" "\\" "|" "_" "+" "~" "[" "]" "{" "}" + ":" ";" "\"" "'" "<" ">" "?" "/" "," "." )) + +(defvar downcase-alphabets + '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" + "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")) + +(defvar upcase-alphabets + '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" + "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")) + +;;;; +;;;; +;;;; + +;; 92.3.16 by K.Handa +;;(define-its-mode "downcase" " a a" t) +(its-define-mode "downcase" "aa" t) + +(dolist (digit digit-characters) + (its-defrule digit digit)) + +(dolist (symbol symbol-characters) + (its-defrule symbol symbol)) + +(dolist (downcase downcase-alphabets) + (its-defrule downcase downcase)) + +(dolist (upcase upcase-alphabets) + (its-defrule upcase upcase)) + +;;;; +;;;; +;;;; + +(defun upcase-character (ch) + (if (and (<= ?a ch) (<= ch ?z)) + (+ ?A (- ch ?a)) + ch)) + +;; 92.3.16 by K.Handa +;;(define-its-mode "upcase" " a A" t) +(its-define-mode "upcase" "aA" t);;; 93.7.21 by S.Tomura + +(dolist (digit digit-characters) + (its-defrule digit digit)) + +(dolist (symbol symbol-characters) + (its-defrule symbol symbol)) + +(dolist (downcase downcase-alphabets) + (its-defrule downcase (char-to-string (upcase-character (string-to-char downcase))))) + +(dolist (upcase upcase-alphabets) + (its-defrule upcase upcase)) + --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/hira.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,528 @@ +;; Basic Roma-to-Kana Translation Table for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Nemacs (Japanese Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;; 90.3.2 modified for Nemacs Ver.3.3.1 +;; by jiro@math.keio.ac.jp (TANAKA Jiro) +;; proposal of keybinding for JIS symbols +;; 92.3.23 modified for Mule Ver.0.9.1 by K.Handa +;; defrule -> its-defrule, define-its-mode -> its-define-mode +;; 92.7.6 modified for Mule Ver.0.9.5 by K.Handa +;; New rules added. + +(its-define-mode "roma-kana" "$B$"(B" t) + +(its-defrule-select-mode-temporally "q" "downcase") +(its-defrule-select-mode-temporally "Q" "zenkaku-downcase") + +;;; $B!V$C!W$NF~NO(B + +(dolist (aa '("k" "s" "t" "h" "y" "r" "w" "g" "z" "d" "b" + "p" "c" "f" "j" "v")) + (its-defrule (concat aa aa) "$B$C(B" aa)) + +(its-defrule "tch" "$B$C(B" "ch") + +;;; $B!V$s!W$NF~NO(B + +(dolist (q1 '("b" "m" "p")) + (its-defrule (concat "m" q1) "$B$s(B" q1)) + +(its-defrule "N" "$B$s(B") + +(its-defrule "n'" "$B$s(B") + +(defvar enable-double-n-syntax nil "*\"nn\"$B$r(B\"$B$s(B\"$B$KJQ49$9$k(B") + +(its-defrule "n" "$B$s(B") +(its-defrule-conditional* "nn" "$B$s(B" nil + (enable-double-n-syntax "$B$s(B") + (t nil)) + +;; 92.7.6 by Y.Kawabe +;;(dolist (aa '("k" "s" "t" "c" "h" "f" "m" "y" "r" "l" +;; "w" "g" "z" "j" "d" "b" "v" "p" "x")) +;; (its-defrule (concat "n" aa) "$B$s(B" aa)) +;; end of patch + +(let ((small '"x" )) + (its-defrule (concat small "a") "$B$!(B") + (its-defrule (concat small "i") "$B$#(B") + (its-defrule (concat small "u") "$B$%(B") + (its-defrule (concat small "e") "$B$'(B") + (its-defrule (concat small "o") "$B$)(B") + (its-defrule (concat small "ya") "$B$c(B") + (its-defrule (concat small "yu") "$B$e(B") + (its-defrule (concat small "yo") "$B$g(B") + (its-defrule (concat small "tu") "$B$C(B") + (its-defrule (concat small "tsu") "$B$C(B") + (its-defrule (concat small "wa") "$B$n(B") + ) + +(its-defrule "a" "$B$"(B") +(its-defrule "i" "$B$$(B") +(its-defrule "u" "$B$&(B") +(its-defrule "e" "$B$((B") +(its-defrule "o" "$B$*(B") +(its-defrule "ka" "$B$+(B") +(its-defrule "ki" "$B$-(B") +(its-defrule "ku" "$B$/(B") +(its-defrule "ke" "$B$1(B") +(its-defrule "ko" "$B$3(B") +(its-defrule "kya" "$B$-$c(B") +(its-defrule "kyu" "$B$-$e(B") +(its-defrule "kye" "$B$-$'(B") +(its-defrule "kyo" "$B$-$g(B") +(its-defrule "sa" "$B$5(B") +(its-defrule "si" "$B$7(B") +(its-defrule "su" "$B$9(B") +(its-defrule "se" "$B$;(B") +(its-defrule "so" "$B$=(B") +(its-defrule "sya" "$B$7$c(B") +(its-defrule "syu" "$B$7$e(B") +(its-defrule "sye" "$B$7$'(B") +(its-defrule "syo" "$B$7$g(B") +(its-defrule "sha" "$B$7$c(B") +(its-defrule "shi" "$B$7(B") +(its-defrule "shu" "$B$7$e(B") +(its-defrule "she" "$B$7$'(B") +(its-defrule "sho" "$B$7$g(B") +(its-defrule "ta" "$B$?(B") +(its-defrule "ti" "$B$A(B") +(its-defrule "tu" "$B$D(B") +(its-defrule "te" "$B$F(B") +(its-defrule "to" "$B$H(B") +(its-defrule "tya" "$B$A$c(B") +(its-defrule "tyi" "$B$F$#(B") +(its-defrule "tyu" "$B$A$e(B") +(its-defrule "tye" "$B$A$'(B") +(its-defrule "tyo" "$B$A$g(B") +(its-defrule "tsu" "$B$D(B") +(its-defrule "cha" "$B$A$c(B") +(its-defrule "chi" "$B$A(B") +(its-defrule "chu" "$B$A$e(B") +(its-defrule "che" "$B$A$'(B") +(its-defrule "cho" "$B$A$g(B") +(its-defrule "na" "$B$J(B") +(its-defrule "ni" "$B$K(B") +(its-defrule "nu" "$B$L(B") +(its-defrule "ne" "$B$M(B") +(its-defrule "no" "$B$N(B") +(its-defrule "nya" "$B$K$c(B") +(its-defrule "nyu" "$B$K$e(B") +(its-defrule "nye" "$B$K$'(B") +(its-defrule "nyo" "$B$K$g(B") +(its-defrule "ha" "$B$O(B") +(its-defrule "hi" "$B$R(B") +(its-defrule "hu" "$B$U(B") +(its-defrule "he" "$B$X(B") +(its-defrule "ho" "$B$[(B") +(its-defrule "hya" "$B$R$c(B") +(its-defrule "hyu" "$B$R$e(B") +(its-defrule "hye" "$B$R$'(B") +(its-defrule "hyo" "$B$R$g(B") +(its-defrule "fa" "$B$U$!(B") +(its-defrule "fi" "$B$U$#(B") +(its-defrule "fu" "$B$U(B") +(its-defrule "fe" "$B$U$'(B") +(its-defrule "fo" "$B$U$)(B") +(its-defrule "ma" "$B$^(B") +(its-defrule "mi" "$B$_(B") +(its-defrule "mu" "$B$`(B") +(its-defrule "me" "$B$a(B") +(its-defrule "mo" "$B$b(B") +(its-defrule "mya" "$B$_$c(B") +(its-defrule "myu" "$B$_$e(B") +(its-defrule "mye" "$B$_$'(B") +(its-defrule "myo" "$B$_$g(B") +(its-defrule "ya" "$B$d(B") +(its-defrule "yi" "$B$$(B") +(its-defrule "yu" "$B$f(B") +(its-defrule "ye" "$B$$$'(B") +(its-defrule "yo" "$B$h(B") +(its-defrule "ra" "$B$i(B") +(its-defrule "ri" "$B$j(B") +(its-defrule "ru" "$B$k(B") +(its-defrule "re" "$B$l(B") +(its-defrule "ro" "$B$m(B") +(its-defrule "la" "$B$i(B") +(its-defrule "li" "$B$j(B") +(its-defrule "lu" "$B$k(B") +(its-defrule "le" "$B$l(B") +(its-defrule "lo" "$B$m(B") +(its-defrule "rya" "$B$j$c(B") +(its-defrule "ryu" "$B$j$e(B") +(its-defrule "rye" "$B$j$'(B") +(its-defrule "ryo" "$B$j$g(B") +(its-defrule "lya" "$B$j$c(B") +(its-defrule "lyu" "$B$j$e(B") +(its-defrule "lye" "$B$j$'(B") +(its-defrule "lyo" "$B$j$g(B") +(its-defrule "wa" "$B$o(B") +(its-defrule "wi" "$B$p(B") +(its-defrule "wu" "$B$&(B") +(its-defrule "we" "$B$q(B") +(its-defrule "wo" "$B$r(B") +(its-defrule "ga" "$B$,(B") +(its-defrule "gi" "$B$.(B") +(its-defrule "gu" "$B$0(B") +(its-defrule "ge" "$B$2(B") +(its-defrule "go" "$B$4(B") +(its-defrule "gya" "$B$.$c(B") +(its-defrule "gyu" "$B$.$e(B") +(its-defrule "gye" "$B$.$'(B") +(its-defrule "gyo" "$B$.$g(B") +(its-defrule "za" "$B$6(B") +(its-defrule "zi" "$B$8(B") +(its-defrule "zu" "$B$:(B") +(its-defrule "ze" "$B$<(B") +(its-defrule "zo" "$B$>(B") +(its-defrule "zya" "$B$8$c(B") +(its-defrule "zyu" "$B$8$e(B") +(its-defrule "zye" "$B$8$'(B") +(its-defrule "zyo" "$B$8$g(B") +(its-defrule "ja" "$B$8$c(B") +(its-defrule "ji" "$B$8(B") +(its-defrule "ju" "$B$8$e(B") +(its-defrule "je" "$B$8$'(B") +(its-defrule "jo" "$B$8$g(B") +;; 92.7.6 by Y.Kawabe +(its-defrule "jya" "$B$8$c(B") +(its-defrule "jyu" "$B$8$e(B") +(its-defrule "jye" "$B$8$'(B") +(its-defrule "jyo" "$B$8$g(B") +;; end of patch +(its-defrule "da" "$B$@(B") +(its-defrule "di" "$B$B(B") +(its-defrule "du" "$B$E(B") +(its-defrule "de" "$B$G(B") +(its-defrule "do" "$B$I(B") +(its-defrule "dya" "$B$B$c(B") +(its-defrule "dyi" "$B$G$#(B") +(its-defrule "dyu" "$B$B$e(B") +(its-defrule "dye" "$B$B$'(B") +(its-defrule "dyo" "$B$B$g(B") +(its-defrule "ba" "$B$P(B") +(its-defrule "bi" "$B$S(B") +(its-defrule "bu" "$B$V(B") +(its-defrule "be" "$B$Y(B") +(its-defrule "bo" "$B$\(B") +(its-defrule "va" "$B%t$!(B") +(its-defrule "vi" "$B%t$#(B") +(its-defrule "vu" "$B%t(B") +(its-defrule "ve" "$B%t$'(B") +(its-defrule "vo" "$B%t$)(B") +(its-defrule "bya" "$B$S$c(B") +(its-defrule "byu" "$B$S$e(B") +(its-defrule "bye" "$B$S$'(B") +(its-defrule "byo" "$B$S$g(B") +(its-defrule "pa" "$B$Q(B") +(its-defrule "pi" "$B$T(B") +(its-defrule "pu" "$B$W(B") +(its-defrule "pe" "$B$Z(B") +(its-defrule "po" "$B$](B") +(its-defrule "pya" "$B$T$c(B") +(its-defrule "pyu" "$B$T$e(B") +(its-defrule "pye" "$B$T$'(B") +(its-defrule "pyo" "$B$T$g(B") +(its-defrule "kwa" "$B$/$n(B") +(its-defrule "kwi" "$B$/$#(B") +(its-defrule "kwu" "$B$/(B") +(its-defrule "kwe" "$B$/$'(B") +(its-defrule "kwo" "$B$/$)(B") +(its-defrule "gwa" "$B$0$n(B") +(its-defrule "gwi" "$B$0$#(B") +(its-defrule "gwu" "$B$0(B") +(its-defrule "gwe" "$B$0$'(B") +(its-defrule "gwo" "$B$0$)(B") +(its-defrule "tsa" "$B$D$!(B") +(its-defrule "tsi" "$B$D$#(B") +(its-defrule "tse" "$B$D$'(B") +(its-defrule "tso" "$B$D$)(B") +(its-defrule "xka" "$B%u(B") +(its-defrule "xke" "$B%v(B") +(its-defrule "xti" "$B$F$#(B") +(its-defrule "xdi" "$B$G$#(B") +(its-defrule "xdu" "$B$I$%(B") +(its-defrule "xde" "$B$G$'(B") +(its-defrule "xdo" "$B$I$)(B") +(its-defrule "xwi" "$B$&$#(B") +(its-defrule "xwe" "$B$&$'(B") +(its-defrule "xwo" "$B$&$)(B") + +;;; Zenkaku Symbols + +(its-defrule "1" "$B#1(B") +(its-defrule "2" "$B#2(B") +(its-defrule "3" "$B#3(B") +(its-defrule "4" "$B#4(B") +(its-defrule "5" "$B#5(B") +(its-defrule "6" "$B#6(B") +(its-defrule "7" "$B#7(B") +(its-defrule "8" "$B#8(B") +(its-defrule "9" "$B#9(B") +(its-defrule "0" "$B#0(B") + +;;(its-defrule " " "$B!!(B") +(its-defrule "!" "$B!*(B") +(its-defrule "@" "$B!w(B") +(its-defrule "#" "$B!t(B") +(its-defrule "$" "$B!p(B") +(its-defrule "%" "$B!s(B") +(its-defrule "^" "$B!0(B") +(its-defrule "&" "$B!u(B") +(its-defrule "*" "$B!v(B") +(its-defrule "(" "$B!J(B") +(its-defrule ")" "$B!K(B") +(its-defrule "-" "$B!<(B") ;;; JIS 213c ;;;(its-defrule "-" "$B!](B") +(its-defrule "=" "$B!a(B") +(its-defrule "`" "$B!.(B") +(its-defrule "\\" "$B!o(B") +(its-defrule "|" "$B!C(B") +(its-defrule "_" "$B!2(B") +(its-defrule "+" "$B!\(B") +(its-defrule "~" "$B!1(B") +(its-defrule "[" "$B!V(B") ;;(its-defrule "[" "$B!N(B") +(its-defrule "]" "$B!W(B") ;;(its-defrule "]" "$B!O(B") +(its-defrule "{" "$B!P(B") +(its-defrule "}" "$B!Q(B") +(its-defrule ":" "$B!'(B") +(its-defrule ";" "$B!((B") +(its-defrule "\"" "$B!I(B") +(its-defrule "'" "$B!G(B") +(its-defrule "<" "$B!c(B") +(its-defrule ">" "$B!d(B") +(its-defrule "?" "$B!)(B") +(its-defrule "/" "$B!?(B") + +(defvar use-kuten-for-period t "*$B%T%j%*%I$r6gE@$KJQ49$9$k(B") +(defvar use-touten-for-comma t "*$B%3%s%^$rFIE@$KJQ49$9$k(B") + +(its-defrule-conditional "." + (use-kuten-for-period "$B!#(B") + (t "$B!%(B")) + +(its-defrule-conditional "," + (use-touten-for-comma "$B!"(B") + (t "$B!$(B")) + +;;; Escape character to Zenkaku inputs + +(defvar zenkaku-escape "Z") + +;;; Escape character to Hankaku inputs + +(defvar hankaku-escape "~") +;;; +;;; Zenkaku inputs +;;; + +(its-defrule (concat zenkaku-escape "0") "$B#0(B") +(its-defrule (concat zenkaku-escape "1") "$B#1(B") +(its-defrule (concat zenkaku-escape "2") "$B#2(B") +(its-defrule (concat zenkaku-escape "3") "$B#3(B") +(its-defrule (concat zenkaku-escape "4") "$B#4(B") +(its-defrule (concat zenkaku-escape "5") "$B#5(B") +(its-defrule (concat zenkaku-escape "6") "$B#6(B") +(its-defrule (concat zenkaku-escape "7") "$B#7(B") +(its-defrule (concat zenkaku-escape "8") "$B#8(B") +(its-defrule (concat zenkaku-escape "9") "$B#9(B") + +(its-defrule (concat zenkaku-escape "A") "$B#A(B") +(its-defrule (concat zenkaku-escape "B") "$B#B(B") +(its-defrule (concat zenkaku-escape "C") "$B#C(B") +(its-defrule (concat zenkaku-escape "D") "$B#D(B") +(its-defrule (concat zenkaku-escape "E") "$B#E(B") +(its-defrule (concat zenkaku-escape "F") "$B#F(B") +(its-defrule (concat zenkaku-escape "G") "$B#G(B") +(its-defrule (concat zenkaku-escape "H") "$B#H(B") +(its-defrule (concat zenkaku-escape "I") "$B#I(B") +(its-defrule (concat zenkaku-escape "J") "$B#J(B") +(its-defrule (concat zenkaku-escape "K") "$B#K(B") +(its-defrule (concat zenkaku-escape "L") "$B#L(B") +(its-defrule (concat zenkaku-escape "M") "$B#M(B") +(its-defrule (concat zenkaku-escape "N") "$B#N(B") +(its-defrule (concat zenkaku-escape "O") "$B#O(B") +(its-defrule (concat zenkaku-escape "P") "$B#P(B") +(its-defrule (concat zenkaku-escape "Q") "$B#Q(B") +(its-defrule (concat zenkaku-escape "R") "$B#R(B") +(its-defrule (concat zenkaku-escape "S") "$B#S(B") +(its-defrule (concat zenkaku-escape "T") "$B#T(B") +(its-defrule (concat zenkaku-escape "U") "$B#U(B") +(its-defrule (concat zenkaku-escape "V") "$B#V(B") +(its-defrule (concat zenkaku-escape "W") "$B#W(B") +(its-defrule (concat zenkaku-escape "X") "$B#X(B") +(its-defrule (concat zenkaku-escape "Y") "$B#Y(B") +(its-defrule (concat zenkaku-escape "Z") "$B#Z(B") + +(its-defrule (concat zenkaku-escape "a") "$B#a(B") +(its-defrule (concat zenkaku-escape "b") "$B#b(B") +(its-defrule (concat zenkaku-escape "c") "$B#c(B") +(its-defrule (concat zenkaku-escape "d") "$B#d(B") +(its-defrule (concat zenkaku-escape "e") "$B#e(B") +(its-defrule (concat zenkaku-escape "f") "$B#f(B") +(its-defrule (concat zenkaku-escape "g") "$B#g(B") +(its-defrule (concat zenkaku-escape "h") "$B#h(B") +(its-defrule (concat zenkaku-escape "i") "$B#i(B") +(its-defrule (concat zenkaku-escape "j") "$B#j(B") +(its-defrule (concat zenkaku-escape "k") "$B#k(B") +(its-defrule (concat zenkaku-escape "l") "$B#l(B") +(its-defrule (concat zenkaku-escape "m") "$B#m(B") +(its-defrule (concat zenkaku-escape "n") "$B#n(B") +(its-defrule (concat zenkaku-escape "o") "$B#o(B") +(its-defrule (concat zenkaku-escape "p") "$B#p(B") +(its-defrule (concat zenkaku-escape "q") "$B#q(B") +(its-defrule (concat zenkaku-escape "r") "$B#r(B") +(its-defrule (concat zenkaku-escape "s") "$B#s(B") +(its-defrule (concat zenkaku-escape "t") "$B#t(B") +(its-defrule (concat zenkaku-escape "u") "$B#u(B") +(its-defrule (concat zenkaku-escape "v") "$B#v(B") +(its-defrule (concat zenkaku-escape "w") "$B#w(B") +(its-defrule (concat zenkaku-escape "x") "$B#x(B") +(its-defrule (concat zenkaku-escape "y") "$B#y(B") +(its-defrule (concat zenkaku-escape "z") "$B#z(B") + +(its-defrule (concat zenkaku-escape " ") "$B!!(B") +(its-defrule (concat zenkaku-escape "!") "$B!*(B") +(its-defrule (concat zenkaku-escape "@") "$B!w(B") +(its-defrule (concat zenkaku-escape "#") "$B!t(B") +(its-defrule (concat zenkaku-escape "$") "$B!p(B") +(its-defrule (concat zenkaku-escape "%") "$B!s(B") +(its-defrule (concat zenkaku-escape "^") "$B!0(B") +(its-defrule (concat zenkaku-escape "&") "$B!u(B") +(its-defrule (concat zenkaku-escape "*") "$B!v(B") +(its-defrule (concat zenkaku-escape "(") "$B!J(B") +(its-defrule (concat zenkaku-escape ")") "$B!K(B") +(its-defrule (concat zenkaku-escape "-") "$B!](B") +(its-defrule (concat zenkaku-escape "=") "$B!a(B") +(its-defrule (concat zenkaku-escape "`") "$B!.(B") +(its-defrule (concat zenkaku-escape "\\") "$B!o(B") +(its-defrule (concat zenkaku-escape "|") "$B!C(B") +(its-defrule (concat zenkaku-escape "_") "$B!2(B") +(its-defrule (concat zenkaku-escape "+") "$B!\(B") +(its-defrule (concat zenkaku-escape "~") "$B!1(B") +(its-defrule (concat zenkaku-escape "[") "$B!N(B") +(its-defrule (concat zenkaku-escape "]") "$B!O(B") +(its-defrule (concat zenkaku-escape "{") "$B!P(B") +(its-defrule (concat zenkaku-escape "}") "$B!Q(B") +(its-defrule (concat zenkaku-escape ":") "$B!'(B") +(its-defrule (concat zenkaku-escape ";") "$B!((B") +(its-defrule (concat zenkaku-escape "\"") "$B!I(B") +(its-defrule (concat zenkaku-escape "'") "$B!G(B") +(its-defrule (concat zenkaku-escape "<") "$B!c(B") +(its-defrule (concat zenkaku-escape ">") "$B!d(B") +(its-defrule (concat zenkaku-escape "?") "$B!)(B") +(its-defrule (concat zenkaku-escape "/") "$B!?(B") +(its-defrule (concat zenkaku-escape ",") "$B!$(B") +(its-defrule (concat zenkaku-escape ".") "$B!%(B") + +;;; +;;; Hankaku inputs +;;; + +;;(defvar escd '("-" "," "." "/" ";" ":" "[" "\\" "]" "^" "~")) +;;(its-defrule '("x" escd) '(escd)) + + +(defvar digit-characters + '( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" )) + +(defvar symbol-characters + '( " " "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" + "-" "=" "`" "\\" "|" "_" "+" "~" "[" "]" "{" "}" + ":" ";" "\"" "'" "<" ">" "?" "/" "," "." )) + +(defvar downcase-alphabets + '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" + "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")) + +(defvar upcase-alphabets + '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" + "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")) + +(dolist (digit digit-characters) + (its-defrule (concat hankaku-escape digit) digit)) + +(dolist (symbol symbol-characters) + (its-defrule (concat hankaku-escape symbol) symbol)) + +(dolist (downcase downcase-alphabets) + (its-defrule (concat hankaku-escape downcase) downcase)) + +(dolist (upcase upcase-alphabets) + (its-defrule (concat hankaku-escape upcase) upcase)) + +;;; proposal key bindings for JIS symbols +;;; 90.3.2 by jiro@math.keio.ac.jp (TANAKA Jiro) + +(its-defrule "z1" "$B!{(B") (its-defrule "z!" "$B!|(B") +(its-defrule "z2" "$B"&(B") (its-defrule "z@" "$B"'(B") +(its-defrule "z3" "$B"$(B") (its-defrule "z#" "$B"%(B") +(its-defrule "z4" "$B""(B") (its-defrule "z$" "$B"#(B") +(its-defrule "z5" "$B!~(B") (its-defrule "z%" "$B"!(B") +(its-defrule "z6" "$B!y(B") (its-defrule "z^" "$B!z(B") +(its-defrule "z7" "$B!}(B") (its-defrule "z&" "$B!r(B") +(its-defrule "z8" "$B!q(B") (its-defrule "z*" "$B!_(B") +(its-defrule "z9" "$B!i(B") (its-defrule "z(" "$B!Z(B") +(its-defrule "z0" "$B!j(B") (its-defrule "z)" "$B![(B") +(its-defrule "z-" "$B!A(B") (its-defrule "z_" "$B!h(B") ; z- +(its-defrule "z=" "$B!b(B") (its-defrule "z+" "$B!^(B") +(its-defrule "z\\" "$B!@(B") (its-defrule "z|" "$B!B(B") +(its-defrule "z`" "$B!-(B") (its-defrule "z~" "$B!/(B") + +(its-defrule "zq" "$B!T(B") (its-defrule "zQ" "$B!R(B") +(its-defrule "zw" "$B!U(B") (its-defrule "zW" "$B!S(B") +; e +(its-defrule "zr" "$B!9(B") (its-defrule "zR" "$B!8(B") ; zr +(its-defrule "zt" "$B!:(B") (its-defrule "zT" "$B!x(B") +; y u i o +(its-defrule "zp" "$B")(B") (its-defrule "zP" "$B",(B") ; zp +(its-defrule "z[" "$B!X(B") (its-defrule "z{" "$B!L(B") ; z[ +(its-defrule "z]" "$B!Y(B") (its-defrule "z}" "$B!M(B") ; z] + +; a +(its-defrule "zs" "$B!3(B") (its-defrule "zS" "$B!4(B") +(its-defrule "zd" "$B!5(B") (its-defrule "zD" "$B!6(B") +(its-defrule "zf" "$B!7(B") (its-defrule "zF" "$B"*(B") +(its-defrule "zg" "$B!>(B") (its-defrule "zG" "$B!=(B") +(its-defrule "zh" "$B"+(B") +(its-defrule "zj" "$B"-(B") +(its-defrule "zk" "$B",(B") +(its-defrule "zl" "$B"*(B") +(its-defrule "z;" "$B!+(B") (its-defrule "z:" "$B!,(B") +(its-defrule "z\'" "$B!F(B") (its-defrule "z\"" "$B!H(B") + +; z +(its-defrule "zx" ":-") (its-defrule "zX" ":-)") +(its-defrule "zc" "$B!;(B") (its-defrule "zC" "$B!n(B") ; zc +(its-defrule "zv" "$B"((B") (its-defrule "zV" "$B!`(B") +(its-defrule "zb" "$B!k(B") (its-defrule "zB" "$B"+(B") +(its-defrule "zn" "$B!l(B") (its-defrule "zN" "$B"-(B") +(its-defrule "zm" "$B!m(B") (its-defrule "zM" "$B".(B") +(its-defrule "z," "$B!E(B") (its-defrule "z<" "$B!e(B") +(its-defrule "z." "$B!D(B") (its-defrule "z>" "$B!f(B") ; z. +(its-defrule "z/" "$B!&(B") (its-defrule "z?" "$B!g(B") ; z/ + +;;; Commented out by K.Handa. Already defined in a different way. +;(its-defrule "va" "$B%t%!(B") +;(its-defrule "vi" "$B%t%#(B") +;(its-defrule "vu" "$B%t(B") +;(its-defrule "ve" "$B%t%'(B") +;(its-defrule "vo" "$B%t%)(B") --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/kanainput.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,193 @@ +;; Basic translation table to input KANA with ASCII keyboard +;; Created by DEMIZU Norotishi on 1994.1.26 +;; $Id: kanainput.el,v 1.2 1994/02/04 13:19:38 nori-d Exp nori-d $ + +;; +;; $BG[I[>r7o$O(B GNU GENERAL PUBLIC LICENSE $B$K=>$$$^$9!#(B +;; +;; $B$3$l$O(B ASCII $BG[Ns$N%-!<%\!<%I$G$+$JF~NO$G2>L>4A;zJQ49$r$9$k$?$a$N(B +;; $BJQ49%k!<%k$r5-$7$?(B lisp $B$G$9!#;H$$J}$O3QJ8;z!"(BJIS $B5-9fF~NO$NItJ,$O(B its/hira.el $B$HF1$8$K$7$^$7$?!#(B +;; $BF~NO$N$?$a$N(B prefix $B$O0J2<$NDL$j!#(B +;; Q: $BA43QF~NO(B (Quote $B$H3P$($k(B) ; k-zenkaku-escape $B$GDj5A2DG=(B +;; A: $BH>3QF~NO(B (Ascii $B$H3P$($k(B) ; k-hankaku-escape $B$GDj5A2DG=(B +;; S: $B5-9fF~NO(B (Symbol $B$H3P$($k(B) ; k-symbols-escape $B$GDj5A2DG=(B +;; +;;$B!V$+$JF~NO;~$NG[Ns!W(B +;; $B$L!*(B $B$U!w(B $B$"$!(B $B$&$%(B $B$($'(B $B$*$)(B $B$d$c(B $B$f$e(B $B$h$g(B $B$o$r(B $B$[$m(B $B$X!\(B $B! 90.3.2) +;; $B!{!|(B $B"&"'(B $B"$"%(B $B"""#(B $B!~"!(B $B!y!z(B $B!}!r(B $B!q!_(B $B!i!Z(B $B!j![(B $B!A!h(B $B!b!^(B $B!-!/(B +;; $B!T!R(B $B!U!S(B ____ $B!9!8(B $B!:!x(B $B!o(B__ ____ ____ ____ $B")",(B $B!X!L(B $B!Y!M(B +;; ____$B!3!4(B $B!5!6(B $B!7"*(B $B!>!=(B $B"+(B__ $B"-!2(B $B",!1(B $B"*(B__ $B!+!,(B $B!F!H(B $B!@!B(B +;; ____ :-:-)$B!;!n(B $B"(!`(B $B!k"+(B $B!l"-(B $B!m".(B $B!E!e(B $B!D!f(B $B!&!g(B +;; +;;$B!VA[Dj$7$F$$$k(B ASCII $B%-!<%\!<%I$NG[Ns!W(B($BH>3Q!"A43QF~NO;~$b(B) +;; 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ `~ +;; qQ wW eE rR tT yY uU iI oO pP [{ ]} +;; aA sS dD fF gG hH jJ kK lL ;: '" \| +;; zZ xX cC vV bB nN mM ,< .> /? +;; +;; kanainput.el 1.1 -> 1.2: +;; o $B5-9fF~NO(B prefix $B$r(B "X" $B$+$i(B "S" $B$K$7$?!#(B +;; o $B0J2<$NF~NOJ}K!$r4JC1$K$9$k$?$aJQ99$7$?!#(B +;; $B!V$p!W(B "W4E" --> "WE" +;; $B!V$q!W(B "W4%" --> "W%" +;; $B!V%t!W(B "W4[" --> "W[" +;; o $B0J2<$NF~NO7k2L$rJQ99$7$?!#K\J*$N(B Quote $B$K$9$k$?$a!#(B +;; "Q\\" $B!V!o!W(B-->$B!V!@!W(B +;; "Q~" $B!V!1!W(B-->$B!V!A!W(B +;; o $B0J2<$N%k!<%k$rDI2C$7$?!#(B +;; "Sy" -->$B!V!o!W(B +;; "SJ" -->$B!V!2!W(B +;; "Sk" -->$B!V!1!W(B +;; o $B3F%k!<%k$K$D$$$F(B its-defrule $B$r=q$$$F$$$?$N$r!"(B +;; $B4JC1$N$?$aI=%Y!<%9$K$7$?!#(B +;; + +(its-define-mode "kanainput" "$B$+(B" t) +(defvar k-zenkaku-escape "Q") ; $BA43QF~NO$N(B prefix +(defvar k-hankaku-escape "A") ; $BH>3QF~NO$N(B prefix +(defvar k-symbols-escape "S") ; $B5-9fF~NO$N(B prefix + + +(defun its:make-terminal-state-kanainput (map input action state) + (cond((its:standard-actionp action) (action-output action)) + (t nil))) + +(let ((its:make-terminal-state 'its:make-terminal-state-kanainput)) + ;; $B$+$JF~NOMQ(B + (dolist (normal-pair + '( + ;; $B@62;(B + ("3" "$B$"(B") ("e" "$B$$(B") ("4" "$B$&(B") ("5" "$B$((B") ("6" "$B$*(B") + ("t" "$B$+(B") ("g" "$B$-(B") ("h" "$B$/(B") ("'" "$B$1(B") ("b" "$B$3(B") + ("x" "$B$5(B") ("d" "$B$7(B") ("r" "$B$9(B") ("p" "$B$;(B") ("c" "$B$=(B") + ("q" "$B$?(B") ("a" "$B$A(B") ("z" "$B$D(B") ("w" "$B$F(B") ("s" "$B$H(B") + ("u" "$B$J(B") ("i" "$B$K(B") ("1" "$B$L(B") ("," "$B$M(B") ("k" "$B$N(B") + ("f" "$B$O(B") ("v" "$B$R(B") ("2" "$B$U(B") ("=" "$B$X(B") ("-" "$B$[(B") + ("j" "$B$^(B") ("n" "$B$_(B") ("\\" "$B$`(B") ("/" "$B$a(B") ("m" "$B$b(B") + ("7" "$B$d(B") ("8" "$B$f(B") ("9" "$B$h(B") + ("o" "$B$i(B") ("l" "$B$j(B") ("." "$B$k(B") (";" "$B$l(B") ("|" "$B$m(B") + ("0" "$B$o(B") ("WE" "$B$p(B") ("W%" "$B$q(B") (")" "$B$r(B") + ("y" "$B$s(B") + ;; $BBy2;(B + ("t[" "$B$,(B") ("g[" "$B$.(B") ("h[" "$B$0(B") ("'[" "$B$2(B") ("b[" "$B$4(B") + ("x[" "$B$6(B") ("d[" "$B$8(B") ("r[" "$B$:(B") ("p[" "$B$<(B") ("c[" "$B$>(B") + ("q[" "$B$@(B") ("a[" "$B$B(B") ("z[" "$B$E(B") ("w[" "$B$G(B") ("s[" "$B$I(B") + ("f[" "$B$P(B") ("v[" "$B$S(B") ("2[" "$B$V(B") ("=[" "$B$Y(B") ("-[" "$B$\(B") + ;; $BH>By2;(B + ("f]" "$B$Q(B") ("v]" "$B$T(B") ("2]" "$B$W(B") ("=]" "$B$Z(B") ("-]" "$B$](B") + ;; $B>.$5$J;z(B + ("#" "$B$!(B") ("E" "$B$#(B") ("$" "$B$%(B") ("%" "$B$'(B") ("^" "$B$)(B") + ("&" "$B$c(B") ("*" "$B$e(B") ("(" "$B$g(B") + ("T" "$B%u(B") ("\"" "$B%v(B") ("Z" "$B$C(B") ("W0" "$B$n(B") ("W#" "$B$n(B") + ;; $B$=$NB>(B + ("W[" "$B%t(B") ("W" "$B$&(B") + ;; $B5-9f(B + ("<" "$B!"(B") (">" "$B!#(B") (":" "$B!&(B") ("?" "$B!)(B") + ("{" "$B!V(B") ("}" "$B!W(B") ("[" "$B!+(B") ("]" "$B!,(B") ("`" "$B!<(B") + ;; $B%7%U%H%-!<2!2<;~$N07$$(B + ("G" "$B$-(B") ("H" "$B$/(B") ("B" "$B$3(B") + ("X" "$B$5(B") ("D" "$B$7(B") ("R" "$B$9(B") ("P" "$B$;(B") ("C" "$B$=(B") + ("U" "$B$J(B") ("I" "$B$K(B") ("K" "$B$N(B") + ("F" "$B$O(B") ("V" "$B$R(B") + ("J" "$B$^(B") ("N" "$B$_(B") ("M" "$B$b(B") + ("O" "$B$i(B") ("L" "$B$j(B") + ("Y" "$B$s(B") + ("!" "$B!*(B") ("@" "$B!w(B") ("+" "$B!\(B") ("~" "$B!A(B") + ("_" "$B$m(B");;; $B!V$m!W$,$"$k%-!<%\!<%IMQ(B + )) + (its-defrule (car normal-pair) (car (cdr normal-pair)))) + + ;; $BA43QF~NO(B + (dolist (zenkaku-pair + '( + (" " "$B!!(B") ("!" "$B!*(B") ("\"" "$B!I(B") ("#" "$B!t(B") ; 20--24 + ("$" "$B!p(B") ("%" "$B!s(B") ("&" "$B!u(B") ("'" "$B!G(B") ; 25--27 + ("(" "$B!J(B") (")" "$B!K(B") ("*" "$B!v(B") ("+" "$B!\(B") ; 28--2b + ("," "$B!$(B") ("-" "$B!](B") ("." "$B!%(B") ("/" "$B!?(B") ; 2c--2f + ("0" "$B#0(B") ("1" "$B#1(B") ("2" "$B#2(B") ("3" "$B#3(B") ; 30--33 + ("4" "$B#4(B") ("5" "$B#5(B") ("6" "$B#6(B") ("7" "$B#7(B") ; 34--37 + ("8" "$B#8(B") ("9" "$B#9(B") (":" "$B!'(B") (";" "$B!((B") ; 38--3b + ("<" "$B!c(B") ("=" "$B!a(B") (">" "$B!d(B") ("?" "$B!)(B") ; 3c--3f + ("@" "$B!w(B") ("A" "$B#A(B") ("B" "$B#B(B") ("C" "$B#C(B") ; 40--43 + ("D" "$B#D(B") ("E" "$B#E(B") ("F" "$B#F(B") ("G" "$B#G(B") ; 44--47 + ("H" "$B#H(B") ("I" "$B#I(B") ("J" "$B#J(B") ("K" "$B#K(B") ; 48--4b + ("L" "$B#L(B") ("M" "$B#M(B") ("N" "$B#N(B") ("O" "$B#O(B") ; 4c--4f + ("P" "$B#P(B") ("Q" "$B#Q(B") ("R" "$B#R(B") ("S" "$B#S(B") ; 50--53 + ("T" "$B#T(B") ("U" "$B#U(B") ("V" "$B#V(B") ("W" "$B#W(B") ; 54--57 + ("X" "$B#X(B") ("Y" "$B#Y(B") ("Z" "$B#Z(B") ("[" "$B!N(B") ; 58--5a + ("\\" "$B!@(B") ("]" "$B!O(B") ("^" "$B!0(B") ("_" "$B!2(B") ; 5b--5f + ("`" "$B!.(B") ("a" "$B#a(B") ("b" "$B#b(B") ("c" "$B#c(B") ; 60--63 + ("d" "$B#d(B") ("e" "$B#e(B") ("f" "$B#f(B") ("g" "$B#g(B") ; 64--67 + ("h" "$B#h(B") ("i" "$B#i(B") ("j" "$B#j(B") ("k" "$B#k(B") ; 68--6b + ("l" "$B#l(B") ("m" "$B#m(B") ("n" "$B#n(B") ("o" "$B#o(B") ; 6c--6f + ("p" "$B#p(B") ("q" "$B#q(B") ("r" "$B#r(B") ("s" "$B#s(B") ; 70--73 + ("t" "$B#t(B") ("u" "$B#u(B") ("v" "$B#v(B") ("w" "$B#w(B") ; 74--77 + ("x" "$B#x(B") ("y" "$B#y(B") ("z" "$B#z(B") ("{" "$B!P(B") ; 78--7b + ("|" "$B!C(B") ("}" "$B!Q(B") ("~" "$B!A(B") ; 7c--7e + )) + (its-defrule (concat k-zenkaku-escape (car zenkaku-pair)) + (car (cdr zenkaku-pair)))) + + ;; $BH>3QF~NO(B + (dolist (character + '( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" + " " "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" + "-" "=" "`" "\\" "|" "_" "+" "~" "[" "]" "{" "}" + ":" ";" "\"" "'" "<" ">" "?" "/" "," "." + "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" + "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" + "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" + "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")) + (its-defrule (concat k-hankaku-escape character) character)) + + ;;; proposal key bindings for JIS symbols + ;;; 90.3.2 by jiro@math.keio.ac.jp (TANAKA Jiro) + ;;; $B!V!o!W!"!V!1!W!"!V!2!W(B are added + ;;; 94.2.4 by nori-d@is.aist-nara.ac.jp (DEMIZU Noritoshi) + (dolist (symbols-pair + '( + ("1" "$B!{(B") ("2" "$B"&(B") ("3" "$B"$(B") ("4" "$B""(B") ("5" "$B!~(B") + ("6" "$B!y(B") ("7" "$B!}(B") ("8" "$B!q(B") ("9" "$B!i(B") ("0" "$B!j(B") + ("-" "$B!A(B") ("=" "$B!b(B") ("\\" "$B!@(B") ("`" "$B!-(B") + ("!" "$B!|(B") ("@" "$B"'(B") ("#" "$B"%(B") ("$" "$B"#(B") ("%" "$B"!(B") + ("^" "$B!z(B") ("&" "$B!r(B") ("*" "$B!_(B") ("(" "$B!Z(B") (")" "$B![(B") + ("_" "$B!h(B") ("+" "$B!^(B") ("|" "$B!B(B") ("~" "$B!/(B") + ("q" "$B!T(B") ("w" "$B!U(B") ("r" "$B!9(B") ("t" "$B!:(B") ("y" "$B!o(B") + ("Q" "$B!R(B") ("W" "$B!S(B") ("R" "$B!8(B") ("T" "$B!x(B") + ("p" "$B")(B") ("[" "$B!X(B") ("]" "$B!Y(B") + ("P" "$B",(B") ("{" "$B!L(B") ("}" "$B!M(B") + ("s" "$B!3(B") ("d" "$B!5(B") ("f" "$B!7(B") ("g" "$B!>(B") + ("S" "$B!4(B") ("D" "$B!6(B") ("F" "$B"*(B") ("G" "$B!=(B") + ("h" "$B"+(B") ("j" "$B"-(B") ("k" "$B",(B") ("l" "$B"*(B") + ("J" "$B!2(B") ("K" "$B!1(B") + (";" "$B!+(B") (":" "$B!,(B") ("\'" "$B!F(B") ("\"" "$B!H(B") + ("x" ":-") ("c" "$B!;(B") ("v" "$B"((B") ("b" "$B!k(B") ("n" "$B!l(B") + ("X" ":-)") ("C" "$B!n(B") ("V" "$B!`(B") ("B" "$B"+(B") ("N" "$B"-(B") + ("m" "$B!m(B") ("," "$B!E(B") ("." "$B!D(B") ("/" "$B!&(B") + ("M" "$B".(B") ("<" "$B!e(B") (">" "$B!f(B") ("?" "$B!g(B") + )) + (its-defrule (concat k-symbols-escape (car symbols-pair)) + (car (cdr symbols-pair)))) +) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/kata.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,513 @@ +;; Basic Roma-to-KataKana Translation Table for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Nemacs (Japanese Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;; 90.3.2 modified for Nemacs Ver.3.3.1 +;; by jiro@math.keio.ac.jp (TANAKA Jiro) +;; proposal of keybinding for JIS symbols +;; 92.3.16 modified for Mule Ver.0.9.1 by K.Handa +;; 92.3.23 modified for Mule Ver.0.9.1 by K.Handa +;; defrule -> its-defrule, define-its-mode -> its-define-mode + +;; 92.3.16 by K.Handa +;;(define-its-mode "roma-kata" " a$B%"(B" t) +(its-define-mode "roma-kata" "$B%"(B" t) + +(dolist (aa '("k" "s" "t" "h" "y" "r" "w" "g" "z" "d" "b" + "p" "c" "f" "j" "v")) + (its-defrule (concat aa aa) "$B%C(B" aa)) + +(its-defrule "tch" "$B%C(B" "ch") + +(dolist (q1 '("b" "m" "p")) + (its-defrule (concat "m" q1) "$B%s(B" q1)) + +(its-defrule "N" "$B%s(B") + +(defvar enable-double-n-syntax nil "*Enable \"nn\" input for \"$B%s(B\" ") + +(its-defrule-conditional "n" + ((not enable-double-n-syntax) "$B%s(B") + (t nil)) +(its-defrule-conditional "nn" + ( enable-double-n-syntax "$B%s(B") + (t nil)) + +(its-defrule "n'" "$B%s(B") + +(let ((small '"x" )) + (its-defrule (concat small "a") "$B%!(B") + (its-defrule (concat small "i") "$B%#(B") + (its-defrule (concat small "u") "$B%%(B") + (its-defrule (concat small "e") "$B%'(B") + (its-defrule (concat small "o") "$B%)(B") + (its-defrule (concat small "ya") "$B%c(B") + (its-defrule (concat small "yu") "$B%e(B") + (its-defrule (concat small "yo") "$B%g(B") + (its-defrule (concat small "tu") "$B%C(B") + (its-defrule (concat small "tsu") "$B%C(B") + (its-defrule (concat small "wa") "$B%n(B") + ) + +(its-defrule "a" "$B%"(B") +(its-defrule "i" "$B%$(B") +(its-defrule "u" "$B%&(B") +(its-defrule "e" "$B%((B") +(its-defrule "o" "$B%*(B") +(its-defrule "ka" "$B%+(B") +(its-defrule "ki" "$B%-(B") +(its-defrule "ku" "$B%/(B") +(its-defrule "ke" "$B%1(B") +(its-defrule "ko" "$B%3(B") +(its-defrule "kya" "$B%-%c(B") +(its-defrule "kyu" "$B%-%e(B") +(its-defrule "kye" "$B%-%'(B") +(its-defrule "kyo" "$B%-%g(B") +(its-defrule "sa" "$B%5(B") +(its-defrule "si" "$B%7(B") +(its-defrule "su" "$B%9(B") +(its-defrule "se" "$B%;(B") +(its-defrule "so" "$B%=(B") +(its-defrule "sya" "$B%7%c(B") +(its-defrule "syu" "$B%7%e(B") +(its-defrule "sye" "$B%7%'(B") +(its-defrule "syo" "$B%7%g(B") +(its-defrule "sha" "$B%7%c(B") +(its-defrule "shi" "$B%7(B") +(its-defrule "shu" "$B%7%e(B") +(its-defrule "she" "$B%7%'(B") +(its-defrule "sho" "$B%7%g(B") +(its-defrule "ta" "$B%?(B") +(its-defrule "ti" "$B%A(B") +(its-defrule "tu" "$B%D(B") +(its-defrule "te" "$B%F(B") +(its-defrule "to" "$B%H(B") +(its-defrule "tya" "$B%A%c(B") +(its-defrule "tyi" "$B%F%#(B") +(its-defrule "tyu" "$B%A%e(B") +(its-defrule "tye" "$B%A%'(B") +(its-defrule "tyo" "$B%A%g(B") +(its-defrule "tsu" "$B%D(B") +(its-defrule "cha" "$B%A%c(B") +(its-defrule "chi" "$B%A(B") +(its-defrule "chu" "$B%A%e(B") +(its-defrule "che" "$B%A%'(B") +(its-defrule "cho" "$B%A%g(B") +(its-defrule "na" "$B%J(B") +(its-defrule "ni" "$B%K(B") +(its-defrule "nu" "$B%L(B") +(its-defrule "ne" "$B%M(B") +(its-defrule "no" "$B%N(B") +(its-defrule "nya" "$B%K%c(B") +(its-defrule "nyu" "$B%K%e(B") +(its-defrule "nye" "$B%K%'(B") +(its-defrule "nyo" "$B%K%g(B") +(its-defrule "ha" "$B%O(B") +(its-defrule "hi" "$B%R(B") +(its-defrule "hu" "$B%U(B") +(its-defrule "he" "$B%X(B") +(its-defrule "ho" "$B%[(B") +(its-defrule "hya" "$B%R%c(B") +(its-defrule "hyu" "$B%R%e(B") +(its-defrule "hye" "$B%R%'(B") +(its-defrule "hyo" "$B%R%g(B") +(its-defrule "fa" "$B%U%!(B") +(its-defrule "fi" "$B%U%#(B") +(its-defrule "fu" "$B%U(B") +(its-defrule "fe" "$B%U%'(B") +(its-defrule "fo" "$B%U%)(B") +(its-defrule "ma" "$B%^(B") +(its-defrule "mi" "$B%_(B") +(its-defrule "mu" "$B%`(B") +(its-defrule "me" "$B%a(B") +(its-defrule "mo" "$B%b(B") +(its-defrule "mya" "$B%_%c(B") +(its-defrule "myu" "$B%_%e(B") +(its-defrule "mye" "$B%_%'(B") +(its-defrule "myo" "$B%_%g(B") +(its-defrule "ya" "$B%d(B") +(its-defrule "yi" "$B%$(B") +(its-defrule "yu" "$B%f(B") +(its-defrule "ye" "$B%$%'(B") +(its-defrule "yo" "$B%h(B") +(its-defrule "ra" "$B%i(B") +(its-defrule "ri" "$B%j(B") +(its-defrule "ru" "$B%k(B") +(its-defrule "re" "$B%l(B") +(its-defrule "ro" "$B%m(B") +(its-defrule "la" "$B%i(B") +(its-defrule "li" "$B%j(B") +(its-defrule "lu" "$B%k(B") +(its-defrule "le" "$B%l(B") +(its-defrule "lo" "$B%m(B") +(its-defrule "rya" "$B%j%c(B") +(its-defrule "ryu" "$B%j%e(B") +(its-defrule "rye" "$B%j%'(B") +(its-defrule "ryo" "$B%j%g(B") +(its-defrule "lya" "$B%j%c(B") +(its-defrule "lyu" "$B%j%e(B") +(its-defrule "lye" "$B%j%'(B") +(its-defrule "lyo" "$B%j%g(B") +(its-defrule "wa" "$B%o(B") +(its-defrule "wi" "$B%p(B") +(its-defrule "wu" "$B%&(B") +(its-defrule "we" "$B%q(B") +(its-defrule "wo" "$B%r(B") +(its-defrule "ga" "$B%,(B") +(its-defrule "gi" "$B%.(B") +(its-defrule "gu" "$B%0(B") +(its-defrule "ge" "$B%2(B") +(its-defrule "go" "$B%4(B") +(its-defrule "gya" "$B%.%c(B") +(its-defrule "gyu" "$B%.%e(B") +(its-defrule "gye" "$B%.%'(B") +(its-defrule "gyo" "$B%.%g(B") +(its-defrule "za" "$B%6(B") +(its-defrule "zi" "$B%8(B") +(its-defrule "zu" "$B%:(B") +(its-defrule "ze" "$B%<(B") +(its-defrule "zo" "$B%>(B") +(its-defrule "zya" "$B%8%c(B") +(its-defrule "zyu" "$B%8%e(B") +(its-defrule "zye" "$B%8%'(B") +(its-defrule "zyo" "$B%8%g(B") +(its-defrule "ja" "$B%8%c(B") +(its-defrule "ji" "$B%8(B") +(its-defrule "ju" "$B%8%e(B") +(its-defrule "je" "$B%8%'(B") +(its-defrule "jo" "$B%8%g(B") +(its-defrule "da" "$B%@(B") +(its-defrule "di" "$B%B(B") +(its-defrule "du" "$B%E(B") +(its-defrule "de" "$B%G(B") +(its-defrule "do" "$B%I(B") +(its-defrule "dya" "$B%B%c(B") +(its-defrule "dyi" "$B%G%#(B") +(its-defrule "dyu" "$B%B%e(B") +(its-defrule "dye" "$B%B%'(B") +(its-defrule "dyo" "$B%B%g(B") +(its-defrule "ba" "$B%P(B") +(its-defrule "bi" "$B%S(B") +(its-defrule "bu" "$B%V(B") +(its-defrule "be" "$B%Y(B") +(its-defrule "bo" "$B%\(B") +(its-defrule "va" "$B%t%!(B") +(its-defrule "vi" "$B%t%#(B") +(its-defrule "vu" "$B%t(B") +(its-defrule "ve" "$B%t%'(B") +(its-defrule "vo" "$B%t%)(B") +(its-defrule "bya" "$B%S%c(B") +(its-defrule "byu" "$B%S%e(B") +(its-defrule "bye" "$B%S%'(B") +(its-defrule "byo" "$B%S%g(B") +(its-defrule "pa" "$B%Q(B") +(its-defrule "pi" "$B%T(B") +(its-defrule "pu" "$B%W(B") +(its-defrule "pe" "$B%Z(B") +(its-defrule "po" "$B%](B") +(its-defrule "pya" "$B%T%c(B") +(its-defrule "pyu" "$B%T%e(B") +(its-defrule "pye" "$B%T%'(B") +(its-defrule "pyo" "$B%T%g(B") +(its-defrule "kwa" "$B%/%n(B") +(its-defrule "kwi" "$B%/%#(B") +(its-defrule "kwu" "$B%/(B") +(its-defrule "kwe" "$B%/%'(B") +(its-defrule "kwo" "$B%/%)(B") +(its-defrule "gwa" "$B%0%n(B") +(its-defrule "gwi" "$B%0%#(B") +(its-defrule "gwu" "$B%0(B") +(its-defrule "gwe" "$B%0%'(B") +(its-defrule "gwo" "$B%0%)(B") +(its-defrule "tsa" "$B%D%!(B") +(its-defrule "tsi" "$B%D%#(B") +(its-defrule "tse" "$B%D%'(B") +(its-defrule "tso" "$B%D%)(B") +(its-defrule "xka" "$B%u(B") +(its-defrule "xke" "$B%v(B") +(its-defrule "xti" "$B%F%#(B") +(its-defrule "xdi" "$B%G%#(B") +(its-defrule "xdu" "$B%I%%(B") +(its-defrule "xde" "$B%G%'(B") +(its-defrule "xdo" "$B%I%)(B") +;(its-defrule "xwa" "$B%n(B") +(its-defrule "xwi" "$B%&%#(B") +(its-defrule "xwe" "$B%&%'(B") +(its-defrule "xwo" "$B%&%)(B") + +;;; Zenkaku Symbols + +(its-defrule "1" "$B#1(B") +(its-defrule "2" "$B#2(B") +(its-defrule "3" "$B#3(B") +(its-defrule "4" "$B#4(B") +(its-defrule "5" "$B#5(B") +(its-defrule "6" "$B#6(B") +(its-defrule "7" "$B#7(B") +(its-defrule "8" "$B#8(B") +(its-defrule "9" "$B#9(B") +(its-defrule "0" "$B#0(B") + +;;;(its-defrule " " "$B!!(B") +(its-defrule "!" "$B!*(B") +(its-defrule "@" "$B!w(B") +(its-defrule "#" "$B!t(B") +(its-defrule "$" "$B!p(B") +(its-defrule "%" "$B!s(B") +(its-defrule "^" "$B!0(B") +(its-defrule "&" "$B!u(B") +(its-defrule "*" "$B!v(B") +(its-defrule "(" "$B!J(B") +(its-defrule ")" "$B!K(B") +(its-defrule "-" "$B!<(B") ;;; JIS 213c ;;;(its-defrule "-" "$B!](B") +(its-defrule "=" "$B!a(B") +(its-defrule "`" "$B!.(B") +(its-defrule "\\" "$B!o(B") +(its-defrule "|" "$B!C(B") +(its-defrule "_" "$B!2(B") +(its-defrule "+" "$B!\(B") +(its-defrule "~" "$B!1(B") +(its-defrule "[" "$B!V(B") ;;(its-defrule "[" "$B!N(B") +(its-defrule "]" "$B!W(B") ;;(its-defrule "]" "$B!O(B") +(its-defrule "{" "$B!P(B") +(its-defrule "}" "$B!Q(B") +(its-defrule ":" "$B!'(B") +(its-defrule ";" "$B!((B") +(its-defrule "\"" "$B!I(B") +(its-defrule "'" "$B!G(B") +(its-defrule "<" "$B!c(B") +(its-defrule ">" "$B!d(B") +(its-defrule "?" "$B!)(B") +(its-defrule "/" "$B!?(B") + +(defvar use-kuten-for-period t "*$B%T%j%*%I$r6gE@$KJQ49$9$k(B") +(defvar use-touten-for-comma t "*$B%3%s%^$rFIE@$KJQ49$9$k(B") + +(its-defrule-conditional "." + (use-kuten-for-period "$B!#(B") + (t "$B!%(B")) + +(its-defrule-conditional "," + (use-touten-for-comma "$B!"(B") + (t "$B!$(B")) + +;;; Escape character to Zenkaku inputs + +(defvar zenkaku-escape "Z") + +;;; Escape character to Hankaku inputs + +(defvar hankaku-escape "~") +;;; +;;; Zenkaku inputs +;;; + +(its-defrule (concat zenkaku-escape "0") "$B#0(B") +(its-defrule (concat zenkaku-escape "1") "$B#1(B") +(its-defrule (concat zenkaku-escape "2") "$B#2(B") +(its-defrule (concat zenkaku-escape "3") "$B#3(B") +(its-defrule (concat zenkaku-escape "4") "$B#4(B") +(its-defrule (concat zenkaku-escape "5") "$B#5(B") +(its-defrule (concat zenkaku-escape "6") "$B#6(B") +(its-defrule (concat zenkaku-escape "7") "$B#7(B") +(its-defrule (concat zenkaku-escape "8") "$B#8(B") +(its-defrule (concat zenkaku-escape "9") "$B#9(B") + +(its-defrule (concat zenkaku-escape "A") "$B#A(B") +(its-defrule (concat zenkaku-escape "B") "$B#B(B") +(its-defrule (concat zenkaku-escape "C") "$B#C(B") +(its-defrule (concat zenkaku-escape "D") "$B#D(B") +(its-defrule (concat zenkaku-escape "E") "$B#E(B") +(its-defrule (concat zenkaku-escape "F") "$B#F(B") +(its-defrule (concat zenkaku-escape "G") "$B#G(B") +(its-defrule (concat zenkaku-escape "H") "$B#H(B") +(its-defrule (concat zenkaku-escape "I") "$B#I(B") +(its-defrule (concat zenkaku-escape "J") "$B#J(B") +(its-defrule (concat zenkaku-escape "K") "$B#K(B") +(its-defrule (concat zenkaku-escape "L") "$B#L(B") +(its-defrule (concat zenkaku-escape "M") "$B#M(B") +(its-defrule (concat zenkaku-escape "N") "$B#N(B") +(its-defrule (concat zenkaku-escape "O") "$B#O(B") +(its-defrule (concat zenkaku-escape "P") "$B#P(B") +(its-defrule (concat zenkaku-escape "Q") "$B#Q(B") +(its-defrule (concat zenkaku-escape "R") "$B#R(B") +(its-defrule (concat zenkaku-escape "S") "$B#S(B") +(its-defrule (concat zenkaku-escape "T") "$B#T(B") +(its-defrule (concat zenkaku-escape "U") "$B#U(B") +(its-defrule (concat zenkaku-escape "V") "$B#V(B") +(its-defrule (concat zenkaku-escape "W") "$B#W(B") +(its-defrule (concat zenkaku-escape "X") "$B#X(B") +(its-defrule (concat zenkaku-escape "Y") "$B#Y(B") +(its-defrule (concat zenkaku-escape "Z") "$B#Z(B") + +(its-defrule (concat zenkaku-escape "a") "$B#a(B") +(its-defrule (concat zenkaku-escape "b") "$B#b(B") +(its-defrule (concat zenkaku-escape "c") "$B#c(B") +(its-defrule (concat zenkaku-escape "d") "$B#d(B") +(its-defrule (concat zenkaku-escape "e") "$B#e(B") +(its-defrule (concat zenkaku-escape "f") "$B#f(B") +(its-defrule (concat zenkaku-escape "g") "$B#g(B") +(its-defrule (concat zenkaku-escape "h") "$B#h(B") +(its-defrule (concat zenkaku-escape "i") "$B#i(B") +(its-defrule (concat zenkaku-escape "j") "$B#j(B") +(its-defrule (concat zenkaku-escape "k") "$B#k(B") +(its-defrule (concat zenkaku-escape "l") "$B#l(B") +(its-defrule (concat zenkaku-escape "m") "$B#m(B") +(its-defrule (concat zenkaku-escape "n") "$B#n(B") +(its-defrule (concat zenkaku-escape "o") "$B#o(B") +(its-defrule (concat zenkaku-escape "p") "$B#p(B") +(its-defrule (concat zenkaku-escape "q") "$B#q(B") +(its-defrule (concat zenkaku-escape "r") "$B#r(B") +(its-defrule (concat zenkaku-escape "s") "$B#s(B") +(its-defrule (concat zenkaku-escape "t") "$B#t(B") +(its-defrule (concat zenkaku-escape "u") "$B#u(B") +(its-defrule (concat zenkaku-escape "v") "$B#v(B") +(its-defrule (concat zenkaku-escape "w") "$B#w(B") +(its-defrule (concat zenkaku-escape "x") "$B#x(B") +(its-defrule (concat zenkaku-escape "y") "$B#y(B") +(its-defrule (concat zenkaku-escape "z") "$B#z(B") + +(its-defrule (concat zenkaku-escape " ") "$B!!(B") +(its-defrule (concat zenkaku-escape "!") "$B!*(B") +(its-defrule (concat zenkaku-escape "@") "$B!w(B") +(its-defrule (concat zenkaku-escape "#") "$B!t(B") +(its-defrule (concat zenkaku-escape "$") "$B!p(B") +(its-defrule (concat zenkaku-escape "%") "$B!s(B") +(its-defrule (concat zenkaku-escape "^") "$B!0(B") +(its-defrule (concat zenkaku-escape "&") "$B!u(B") +(its-defrule (concat zenkaku-escape "*") "$B!v(B") +(its-defrule (concat zenkaku-escape "(") "$B!J(B") +(its-defrule (concat zenkaku-escape ")") "$B!K(B") +(its-defrule (concat zenkaku-escape "-") "$B!](B") +(its-defrule (concat zenkaku-escape "=") "$B!a(B") +(its-defrule (concat zenkaku-escape "`") "$B!.(B") +(its-defrule (concat zenkaku-escape "\\") "$B!o(B") +(its-defrule (concat zenkaku-escape "|") "$B!C(B") +(its-defrule (concat zenkaku-escape "_") "$B!2(B") +(its-defrule (concat zenkaku-escape "+") "$B!\(B") +(its-defrule (concat zenkaku-escape "~") "$B!1(B") +(its-defrule (concat zenkaku-escape "[") "$B!N(B") +(its-defrule (concat zenkaku-escape "]") "$B!O(B") +(its-defrule (concat zenkaku-escape "{") "$B!P(B") +(its-defrule (concat zenkaku-escape "}") "$B!Q(B") +(its-defrule (concat zenkaku-escape ":") "$B!'(B") +(its-defrule (concat zenkaku-escape ";") "$B!((B") +(its-defrule (concat zenkaku-escape "\"") "$B!I(B") +(its-defrule (concat zenkaku-escape "'") "$B!G(B") +(its-defrule (concat zenkaku-escape "<") "$B!c(B") +(its-defrule (concat zenkaku-escape ">") "$B!d(B") +(its-defrule (concat zenkaku-escape "?") "$B!)(B") +(its-defrule (concat zenkaku-escape "/") "$B!?(B") +(its-defrule (concat zenkaku-escape ",") "$B!$(B") +(its-defrule (concat zenkaku-escape ".") "$B!%(B") + +;;; +;;; Hankaku inputs +;;; + +;;(defvar escd '("-" "," "." "/" ";" ":" "[" "\\" "]" "^" "~")) +;;(its-defrule '("x" escd) '(escd)) + + +(defvar digit-characters + '( "1" "2" "3" "4" "5" "6" "7" "8" "9" "0" )) + +(defvar symbol-characters + '( " " "!" "@" "#" "$" "%" "^" "&" "*" "(" ")" + "-" "=" "`" "\\" "|" "_" "+" "~" "[" "]" "{" "}" + ":" ";" "\"" "'" "<" ">" "?" "/" "," "." )) + +(defvar downcase-alphabets + '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" + "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")) + +(defvar upcase-alphabets + '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" + "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")) + +(dolist (digit digit-characters) + (its-defrule (concat hankaku-escape digit) digit)) + +(dolist (symbol symbol-characters) + (its-defrule (concat hankaku-escape symbol) symbol)) + +(dolist (downcase downcase-alphabets) + (its-defrule (concat hankaku-escape downcase) downcase)) + +(dolist (upcase upcase-alphabets) + (its-defrule (concat hankaku-escape upcase) upcase)) + +;;; proposal key bindings for JIS symbols +;;; 90.3.2 by jiro@math.keio.ac.jp (TANAKA Jiro) + +(its-defrule "z1" "$B!{(B") (its-defrule "z!" "$B!|(B") +(its-defrule "z2" "$B"&(B") (its-defrule "z@" "$B"'(B") +(its-defrule "z3" "$B"$(B") (its-defrule "z#" "$B"%(B") +(its-defrule "z4" "$B""(B") (its-defrule "z$" "$B"#(B") +(its-defrule "z5" "$B!~(B") (its-defrule "z%" "$B"!(B") +(its-defrule "z6" "$B!y(B") (its-defrule "z^" "$B!z(B") +(its-defrule "z7" "$B!}(B") (its-defrule "z&" "$B!r(B") +(its-defrule "z8" "$B!q(B") (its-defrule "z*" "$B!_(B") +(its-defrule "z9" "$B!i(B") (its-defrule "z(" "$B!Z(B") +(its-defrule "z0" "$B!j(B") (its-defrule "z)" "$B![(B") +(its-defrule "z-" "$B!A(B") (its-defrule "z_" "$B!h(B") ; z- +(its-defrule "z=" "$B!b(B") (its-defrule "z+" "$B!^(B") +(its-defrule "z\\" "$B!@(B") (its-defrule "z|" "$B!B(B") +(its-defrule "z`" "$B!-(B") (its-defrule "z~" "$B!/(B") + +(its-defrule "zq" "$B!T(B") (its-defrule "zQ" "$B!R(B") +(its-defrule "zw" "$B!U(B") (its-defrule "zW" "$B!S(B") +; e +(its-defrule "zr" "$B!9(B") (its-defrule "zR" "$B!8(B") ; zr +(its-defrule "zt" "$B!:(B") (its-defrule "zT" "$B!x(B") +; y u i o +(its-defrule "zp" "$B")(B") (its-defrule "zP" "$B",(B") ; zp +(its-defrule "z[" "$B!X(B") (its-defrule "z{" "$B!L(B") ; z[ +(its-defrule "z]" "$B!Y(B") (its-defrule "z}" "$B!M(B") ; z] + +; a +(its-defrule "zs" "$B!3(B") (its-defrule "zS" "$B!4(B") +(its-defrule "zd" "$B!5(B") (its-defrule "zD" "$B!6(B") +(its-defrule "zf" "$B!7(B") (its-defrule "zF" "$B"*(B") +(its-defrule "zg" "$B!>(B") (its-defrule "zG" "$B!=(B") +(its-defrule "zh" "$B"+(B") +(its-defrule "zj" "$B"-(B") +(its-defrule "zk" "$B",(B") +(its-defrule "zl" "$B"*(B") +(its-defrule "z;" "$B!+(B") (its-defrule "z:" "$B!,(B") +(its-defrule "z\'" "$B!F(B") (its-defrule "z\"" "$B!H(B") + +; z +(its-defrule "zx" ":-") (its-defrule "zX" ":-)") +(its-defrule "zc" "$B!;(B") (its-defrule "zC" "$B!n(B") ; zc +(its-defrule "zv" "$B"((B") (its-defrule "zV" "$B!`(B") +(its-defrule "zb" "$B!k(B") (its-defrule "zB" "$B"+(B") +(its-defrule "zn" "$B!l(B") (its-defrule "zN" "$B"-(B") +(its-defrule "zm" "$B!m(B") (its-defrule "zM" "$B".(B") +(its-defrule "z," "$B!E(B") (its-defrule "z<" "$B!e(B") +(its-defrule "z." "$B!D(B") (its-defrule "z>" "$B!f(B") ; z. +(its-defrule "z/" "$B!&(B") (its-defrule "z?" "$B!g(B") ; z/ + +;;; Commented out by K.Handa. Already defined in a different way. +;(its-defrule "va" "$B%t%!(B") +;(its-defrule "vi" "$B%t%#(B") +;(its-defrule "vu" "$B%t(B") +;(its-defrule "ve" "$B%t%'(B") +;(its-defrule "vo" "$B%t%)(B") --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/its/zenkaku.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,236 @@ +;; Basic Roma-to-Kana Translation Table for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Nemacs (Japanese Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;; 92.3.16 modified for Mule Ver.0.9.1 by K.Handa +;; 92.3.23 modified for Mule Ver.0.9.1 by K.Handa +;; defrule -> its-defrule, define-its-mode -> its-define-mode +;;; 92.12.31 modified for Mule Ver.0.9.7.1 +;;; by A.Tanaka +;;; Mode indicator of "zenkaku-upcase" fixed. + +;; 92.3.16 by K.Handa +;;(define-its-mode "zenkaku-downcase" " a$B#a(B" t) +(its-define-mode "zenkaku-downcase" "$B#a(B" t) + +(its-defrule "0" "$B#0(B") +(its-defrule "1" "$B#1(B") +(its-defrule "2" "$B#2(B") +(its-defrule "3" "$B#3(B") +(its-defrule "4" "$B#4(B") +(its-defrule "5" "$B#5(B") +(its-defrule "6" "$B#6(B") +(its-defrule "7" "$B#7(B") +(its-defrule "8" "$B#8(B") +(its-defrule "9" "$B#9(B") + +(its-defrule "A" "$B#A(B") +(its-defrule "B" "$B#B(B") +(its-defrule "C" "$B#C(B") +(its-defrule "D" "$B#D(B") +(its-defrule "E" "$B#E(B") +(its-defrule "F" "$B#F(B") +(its-defrule "G" "$B#G(B") +(its-defrule "H" "$B#H(B") +(its-defrule "I" "$B#I(B") +(its-defrule "J" "$B#J(B") +(its-defrule "K" "$B#K(B") +(its-defrule "L" "$B#L(B") +(its-defrule "M" "$B#M(B") +(its-defrule "N" "$B#N(B") +(its-defrule "O" "$B#O(B") +(its-defrule "P" "$B#P(B") +(its-defrule "Q" "$B#Q(B") +(its-defrule "R" "$B#R(B") +(its-defrule "S" "$B#S(B") +(its-defrule "T" "$B#T(B") +(its-defrule "U" "$B#U(B") +(its-defrule "V" "$B#V(B") +(its-defrule "W" "$B#W(B") +(its-defrule "X" "$B#X(B") +(its-defrule "Y" "$B#Y(B") +(its-defrule "Z" "$B#Z(B") + +(its-defrule "a" "$B#a(B") +(its-defrule "b" "$B#b(B") +(its-defrule "c" "$B#c(B") +(its-defrule "d" "$B#d(B") +(its-defrule "e" "$B#e(B") +(its-defrule "f" "$B#f(B") +(its-defrule "g" "$B#g(B") +(its-defrule "h" "$B#h(B") +(its-defrule "i" "$B#i(B") +(its-defrule "j" "$B#j(B") +(its-defrule "k" "$B#k(B") +(its-defrule "l" "$B#l(B") +(its-defrule "m" "$B#m(B") +(its-defrule "n" "$B#n(B") +(its-defrule "o" "$B#o(B") +(its-defrule "p" "$B#p(B") +(its-defrule "q" "$B#q(B") +(its-defrule "r" "$B#r(B") +(its-defrule "s" "$B#s(B") +(its-defrule "t" "$B#t(B") +(its-defrule "u" "$B#u(B") +(its-defrule "v" "$B#v(B") +(its-defrule "w" "$B#w(B") +(its-defrule "x" "$B#x(B") +(its-defrule "y" "$B#y(B") +(its-defrule "z" "$B#z(B") + +(its-defrule " " "$B!!(B") +(its-defrule "!" "$B!*(B") +(its-defrule "@" "$B!w(B") +(its-defrule "#" "$B!t(B") +(its-defrule "$" "$B!p(B") +(its-defrule "%" "$B!s(B") +(its-defrule "^" "$B!0(B") +(its-defrule "&" "$B!u(B") +(its-defrule "*" "$B!v(B") +(its-defrule "(" "$B!J(B") +(its-defrule ")" "$B!K(B") +(its-defrule "-" "$B!](B") +(its-defrule "=" "$B!a(B") +(its-defrule "`" "$B!.(B") +(its-defrule "\\" "$B!o(B") +(its-defrule "|" "$B!C(B") +(its-defrule "_" "$B!2(B") +(its-defrule "+" "$B!\(B") +(its-defrule "~" "$B!1(B") +(its-defrule "[" "$B!N(B") +(its-defrule "]" "$B!O(B") +(its-defrule "{" "$B!P(B") +(its-defrule "}" "$B!Q(B") +(its-defrule ":" "$B!'(B") +(its-defrule ";" "$B!((B") +(its-defrule "\"" "$B!I(B") +(its-defrule "'" "$B!G(B") +(its-defrule "<" "$B!c(B") +(its-defrule ">" "$B!d(B") +(its-defrule "?" "$B!)(B") +(its-defrule "/" "$B!?(B") +(its-defrule "," "$B!$(B") +(its-defrule "." "$B!%(B") + +;;; +;;; +;;; + +(its-define-mode "zenkaku-upcase" "$B#A(B" t) ;92.12.31 by A.Tanaka + +(its-defrule "0" "$B#0(B") +(its-defrule "1" "$B#1(B") +(its-defrule "2" "$B#2(B") +(its-defrule "3" "$B#3(B") +(its-defrule "4" "$B#4(B") +(its-defrule "5" "$B#5(B") +(its-defrule "6" "$B#6(B") +(its-defrule "7" "$B#7(B") +(its-defrule "8" "$B#8(B") +(its-defrule "9" "$B#9(B") + +(its-defrule "A" "$B#A(B") +(its-defrule "B" "$B#B(B") +(its-defrule "C" "$B#C(B") +(its-defrule "D" "$B#D(B") +(its-defrule "E" "$B#E(B") +(its-defrule "F" "$B#F(B") +(its-defrule "G" "$B#G(B") +(its-defrule "H" "$B#H(B") +(its-defrule "I" "$B#I(B") +(its-defrule "J" "$B#J(B") +(its-defrule "K" "$B#K(B") +(its-defrule "L" "$B#L(B") +(its-defrule "M" "$B#M(B") +(its-defrule "N" "$B#N(B") +(its-defrule "O" "$B#O(B") +(its-defrule "P" "$B#P(B") +(its-defrule "Q" "$B#Q(B") +(its-defrule "R" "$B#R(B") +(its-defrule "S" "$B#S(B") +(its-defrule "T" "$B#T(B") +(its-defrule "U" "$B#U(B") +(its-defrule "V" "$B#V(B") +(its-defrule "W" "$B#W(B") +(its-defrule "X" "$B#X(B") +(its-defrule "Y" "$B#Y(B") +(its-defrule "Z" "$B#Z(B") + +(its-defrule "a" "$B#A(B") +(its-defrule "b" "$B#B(B") +(its-defrule "c" "$B#C(B") +(its-defrule "d" "$B#D(B") +(its-defrule "e" "$B#E(B") +(its-defrule "f" "$B#F(B") +(its-defrule "g" "$B#G(B") +(its-defrule "h" "$B#H(B") +(its-defrule "i" "$B#I(B") +(its-defrule "j" "$B#J(B") +(its-defrule "k" "$B#K(B") +(its-defrule "l" "$B#L(B") +(its-defrule "m" "$B#M(B") +(its-defrule "n" "$B#N(B") +(its-defrule "o" "$B#O(B") +(its-defrule "p" "$B#P(B") +(its-defrule "q" "$B#Q(B") +(its-defrule "r" "$B#R(B") +(its-defrule "s" "$B#S(B") +(its-defrule "t" "$B#T(B") +(its-defrule "u" "$B#U(B") +(its-defrule "v" "$B#V(B") +(its-defrule "w" "$B#W(B") +(its-defrule "x" "$B#X(B") +(its-defrule "y" "$B#Y(B") +(its-defrule "z" "$B#Z(B") + +(its-defrule " " "$B!!(B") +(its-defrule "!" "$B!*(B") +(its-defrule "@" "$B!w(B") +(its-defrule "#" "$B!t(B") +(its-defrule "$" "$B!p(B") +(its-defrule "%" "$B!s(B") +(its-defrule "^" "$B!0(B") +(its-defrule "&" "$B!u(B") +(its-defrule "*" "$B!v(B") +(its-defrule "(" "$B!J(B") +(its-defrule ")" "$B!K(B") +(its-defrule "-" "$B!](B") +(its-defrule "=" "$B!a(B") +(its-defrule "`" "$B!.(B") +(its-defrule "\\" "$B!o(B") +(its-defrule "|" "$B!C(B") +(its-defrule "_" "$B!2(B") +(its-defrule "+" "$B!\(B") +(its-defrule "~" "$B!1(B") +(its-defrule "[" "$B!N(B") +(its-defrule "]" "$B!O(B") +(its-defrule "{" "$B!P(B") +(its-defrule "}" "$B!Q(B") +(its-defrule ":" "$B!'(B") +(its-defrule ";" "$B!((B") +(its-defrule "\"" "$B!I(B") +(its-defrule "'" "$B!G(B") +(its-defrule "<" "$B!c(B") +(its-defrule ">" "$B!d(B") +(its-defrule "?" "$B!)(B") +(its-defrule "/" "$B!?(B") +(its-defrule "," "$B!$(B") +(its-defrule "." "$B!%(B") + --- emacs-21.2/lisp/loadup.el~ 2001-07-15 16:15:34 +0000 +++ emacs-21.2/lisp/loadup.el 2003-02-12 06:55:49 +0000 @@ -108,6 +108,28 @@ (load "language/misc-lang") (update-coding-systems-internal) +;; Mule default configuration file +;; EGG specific setup +(if (boundp 'EGG) + (progn + (setq wnn-server-type 'jserver) + (load "egg") +; (load "its/han-kata") + (load "its/hira") + (load "its/kata") + (load "its/hankaku") + (load "its/zenkaku") + (setq-default its:*current-map* (its:get-mode-map "roma-kana")) + (setq its:*standard-modes* + (append + (list (its:get-mode-map "roma-kana") + (its:get-mode-map "roma-kata") + (its:get-mode-map "downcase") + (its:get-mode-map "upcase") + (its:get-mode-map "zenkaku-downcase") + (its:get-mode-map "zenkaku-upcase")) + its:*standard-modes*)))) + (load "indent") (load "window") (load "frame") @@ -123,6 +145,7 @@ (load "scroll-bar")) (load "select"))) (load "isearch") +(load "isearch-ext") (message "%s" (garbage-collect)) (load "menu-bar") @@ -171,6 +194,27 @@ (load "vc-hooks") (load "ediff-hook") + +;;; 87.7.15, 88.6.20, 89.3.22, 91.11.4, 92.10.19 modified by K.Handa +(if (boundp 'EGG) ;; For EGG user only + (progn ; 92.5.19 by T.Shingu + ;(load "egg") + (cond ((boundp 'WNN) ; 92.7.8 by K.Handa and Y.Kawabe + ; 95.6.1 by S.Tomura + (load "wnn-egg") ; 95.6.1 by S.Tomura + (setq egg-default-startup-file "eggrc-wnn")) ; 95.6.1 by S.Tomura + ((boundp 'SJ3) + (load "sj3-client") + (load "sj3-egg") + (setq egg-default-startup-file "eggrc-sj3")) + (t (error + "You should define WNN4 or SJ3 in mconfig.h."))) + (garbage-collect))) +(if (boundp 'CANNA) + (progn + (autoload 'canna "canna" nil t nil) + (garbage-collect))) + (message "%s" (garbage-collect)) ;If you want additional libraries to be preloaded and their --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/mule-inst.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,109 @@ +;; Loaded while creating/installing Mule. +;; Copyright (C) 1992 Free Software Foundation, Inc. +;; This file is part of Mule (MULtilingual Enhancement of GNU Emacs). + +;; Mule is free software distributed in the form of patches to GNU Emacs. +;; You can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 1, or (at your option) +;; any later version. + +;; Mule is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; 92.3.16 created for Mule Ver.0.9.0 by K.Handa +;;; 92.4.6 modified for Mule Ver.0.9.3 by K.Handa +;;; Files to be byte-compiled are supplied by command line args. +;;; Load .el file instead of .elc file if it is patched. +;;; 92.7.27 modified for Mule Ver.0.9.5 by K.Handa +;;; purify-flag is set to nil. +;;; 92.11.22 modified for Mule Ver.0.9.7 by K.Handa +;;; Original mule-bytecomp.el and dump-charsets (in mult-util.el) +;;; is merged into this file. +;;; 93.2.11 modified for Mule Ver.0.9.7.1 by S.Tatsukawa +;;; version.el is loaded for bytecompe 2.05. + +;; Byte compile all files which are patched or created for Mule + +(defun load-necessary-files () + (message "Loading necessary files for byte-compile...") + (load "byte-run") + (load "subr") + (load "version") + (load "custom") + (garbage-collect) + (setq purify-flag nil) + ;; deocde-format should be defined before relace `load'. it uses + ;; insert-file-contents. + (load "international/mule") + (load "international/mule-conf.el") ;Don't get confused if someone compiled this by mistake. + (load "format") + (load "emacs-lisp/backquote") + (load "bindings") + (load "emacs-lisp/cl") + (load "simple") + (load "help") + (load "files") + ;; minibuffer-local-isearch-map is needed to byte-compile x-win.el. + ;(load "isearch") + (garbage-collect) + ;; Info-default-directory-list is needed to byte-compile informat.el + (load "paths.el") ;Don't get confused if someone compiled paths by mistake. + ;; text-mode-map is needed to byte-compile informat.el + (load "textmodes/text-mode") + (load "derived") + (load "replace.el") + (load "emacs-lisp/lisp" nil) + (load "textmodes/page" nil) + (load "textmodes/paragraphs" nil) + (load "emacs-lisp/lisp-mode" nil) + (load "emacs-lisp/cl-macs" nil) + (load "emacs-lisp/bytecomp.el" nil) + (load "emacs-lisp/byte-opt" nil) + (load "international/mule-cmds") + (load "language/english") + (load "language/european") + (setq load-source-file-function 'load-with-code-conversion) + (let ((coding-system-for-read 'iso-2022-7bit)) + (load "language/japanese.el") + (load "language/japan-util.el")) + (set-language-environment 'japanese) + ;; the following 2 files are needed to byte-compile isearch-ext.el. + (load "timer") + (load "frame") + (garbage-collect) + ) + +;(setq purify-flag nil) + +(let ((args command-line-args) + (command-line-args-left nil)) + (while (and args (null (string-match "mule-inst" (car args)))) + (setq args (cdr args))) + (setq args (cdr args)) + (while args + (let ((el (car args)) elc) + (if (string-match "\\.elc$" el) + (setq elc el el (substring el 0 -1)) + (if (string-match "quail/.*\\.el$" el) + (setq elc (concat el "c")))) + (if (and elc (file-newer-than-file-p el elc)) + (progn + ;;(if (and (file-exists-p elc) (file-writable-p elc)) + ;; Removing this in advance is safer if ELC is a link. + ;;(delete-file elc)) + (setq command-line-args-left + (cons el command-line-args-left))))) + (setq args (cdr args))) + (if (null command-line-args-left) + (kill-emacs 0) + (load-necessary-files) + (setq command-line-args-left (nreverse command-line-args-left)) + (let ((byte-compile-warnings nil)) + (batch-byte-compile)))) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/sj3-client.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,1295 @@ +;; Sj3 server interface for Egg +;; Coded by K.Ishii, Sony Corp. (kiyoji@sm.sony.co.jp) + +;; This file is part of Egg on Mule (Multilingual Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;;; 1998-10-02 Ported to Emacs 20.3.90. +;;; 1998-10-10 Revised. + +;;; +;;; Mule - Sj3 server interface in elisp +;;; + +(provide 'sj3-client) + +;;;; $B=$@5%a%b!(!((B + +;;; Aug-4-94 by K.Ishii +;;; Bug fixed in sj3-put-kata. + +;;; Apr-6-94 by N.Tanaka +;;; Add version 2(japanese EUC) protocol + +;;; Jun-16-93 by H.Shirasaki +;;; In sj3-bunsetu-yomi-equal, typo fixed. + +;;; Apr-6-93 by T.Saneto +;;; Bug fixed in sj3-bunsetu-yomi-equal. + +;;; Mar-19-93 by K.Ishii +;;; Changed sj3-server-dict-info for edit-dict + +;;; Aug-6-92 by K.Ishii +;;; $BF|K\8lH=Dj$K(B lc-jp $B$r;H$&$h$&$KJQ99(B + +;;; Jul-30-92 by K.Ishii +;;; $BD9$$J8>O$rJQ49$9$k$H$-$K5/$3$k(B "Args out of range" $B%(%i!<$N=$@5(B +;;; $BEPO?$7$?F0;l$N:o=|$,$G$-$k$h$&$K(B sj3-server-dict-info $B$N=$@5(B +;;; sj3serv $B$KEO$9%W%m%0%i%`L>$NJQ99(B + +;;; Jun-2-92 by K.Ishii +;;; Mule $BMQ$KJQ99(B + +;;; Dec-12-91 by K.Ishii +;;; $BJ8@a3X=,$,$&$^$/$G$-$J$$$3$H$,$"$k$?$a!"(Bsj3-result-buffer $B$rJQ99(B +;;; +;;; sj3-get-stdy $B$G(B "Count exceed." $B%(%i!<$rNI$/5/$3$9$N$G:o=|(B + +;;; Nov-26-91 by K.Ishii +;;; sj3-server-open $B$G(B host_name $B$H(B user_name $B$rEO$9=gHV$N=$@5(B +;;; +;;; sj3-server-henkan-next $B$rl9g(B +;;; $B$K5/$3$k%P%0$N=$@5(B($B$3$l$KH<$$J8@a3X=,(B sj3-server-b-study $B$N=$@5(B) + +;;; +;;; Sj3 deamon command constants +;;; + +(defconst SJ3_OPEN 1 "$BMxMQ= c 10) (progn (sit-for 0) (setq c 0))) ;;; delete error + (setq c (1+ c))) + (goto-char (+ point sj3-stdy-size)) + (buffer-substring point (point)))) + +;;; +;;; Sj3 Server Command Primitives +;;; + +(defun sj3-command-start (command) + (set-buffer sj3-command-buffer) + (goto-char (point-min)) + (if (not (= (point-max) (+ sj3-command-tail-position 1024))) + (error "sj3 command start error")) + (delete-region (point-min) sj3-command-tail-position) + (sj3-put-4byte command)) + +(defun sj3-command-reset () + (save-excursion + (set-process-coding-system sj3-server-process 'binary 'binary) + (set-buffer sj3-command-buffer) + (buffer-disable-undo sj3-command-buffer) + (erase-buffer) + (setq sj3-command-tail-position (point-min)) + (let ((max 1024) (i 0)) + (while (< i max) + (insert 0) + (setq i (1+ i)))))) + +(defun sj3-command-end () + (set-buffer sj3-server-buffer) + (erase-buffer) + (set-buffer sj3-command-buffer) + (setq sj3-command-tail-position (point)) +;; (process-send-region sj3-server-process (point-min) +;; (+ (point-min) (lsh (1+ (lsh (- (point) (point-min)) -10)) 10))) + (process-send-region sj3-server-process (point-min) (1+ (point))) + ) + +;;; +;;; Sj3 Server Reply primitives +;;; + +(defun sj3-get-result () + (set-buffer sj3-server-buffer) + (condition-case () + (accept-process-output sj3-server-process) + (error nil)) + (goto-char (point-min))) + +(defun sj3-get-return-code () + (setq sj3-return-code (sj3-get-4byte)) + (setq sj3-error-code (if (= sj3-return-code 0) nil + (sj3-error-symbol sj3-return-code))) + (if sj3-error-code nil + sj3-return-code)) + +;;; +;;; Sj3 Server Interface: sj3-server-open +;;; + +;(defvar *sj3-server-max-kana-string-length* 1000) +;(defvar *sj3-server-max-bunsetu-suu* 1000) + +(defvar *sj3-server-version* 2) +(setq *sj3-server-version* 2) +(defvar *sj3-program-name* "sj3-egg-m") +(defvar *sj3-service-name* "sj3") + +(defun sj3-server-open (server-host-name login-name) + (if (sj3-server-active-p) t + (let ((server_version *sj3-server-version*) + (sj3serv_name + (if (or (null server-host-name) + (equal server-host-name "") + (equal server-host-name "unix")) + (system-name) + server-host-name)) + (user_name + (if (or (null login-name) (equal login-name "")) + (user-login-name) + login-name)) + (host_name (system-name)) + (program_name + (format "%d.%s" + (string-to-int (substring (make-temp-name "") 1 6)) + *sj3-program-name*))) + (setq sj3-server-buffer (get-buffer-create " [Sj3 Output Buffer] ")) + (setq sj3-server-process + (condition-case var + (open-network-stream "Sj3" sj3-server-buffer + sj3serv_name *sj3-service-name* ) + (error + (cond((string-match "Unknown host" (car (cdr var))) + (setq sj3-error-code (list ':SJ3_UNKNOWN_HOST + sj3serv_name))) + ((string-match "Unknown service" (car (cdr var))) + (setq sj3-error-code (list ':SJ3_UNKNOWN_SERVICE + *sj3-service-name*))) + (t ;;; "Host ... not respoding" + (setq sj3-error-code ':SJ3_SOCK_OPEN_FAIL))) + nil))) + (if (null sj3-server-process) + (progn + (kill-buffer sj3-server-buffer) + nil) + (process-kill-without-query sj3-server-process) + (setq sj3-command-buffer (get-buffer-create " [Sj3 Command Buffer] ")) + (setq sj3-result-buffer (get-buffer-create " [Sj3 Result Buffer] ")) + + (save-excursion + (set-process-coding-system + sj3-server-process 'binary 'binary) + (progn + (set-buffer sj3-server-buffer) + (set-buffer-multibyte nil) + (buffer-disable-undo sj3-server-buffer) + ) + (progn + (set-buffer sj3-result-buffer) + (set-buffer-multibyte t) + (buffer-disable-undo sj3-result-buffer)) + (progn + (set-buffer sj3-command-buffer) + (set-buffer-multibyte nil) + (buffer-disable-undo sj3-command-buffer) + (erase-buffer) + (setq sj3-command-tail-position (point-min)) + (let ((max 1024) (i 0)) + (while (< i max) + (insert 0) + (setq i (1+ i))))) + (sj3-clear-dict-list) + (sj3-command-start SJ3_OPEN) + (sj3-put-4byte server_version) + (sj3-put-string host_name) + (sj3-put-string user_name) + (sj3-put-string program_name) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (= sj3-return-code SJ3_DifferentVersion) + (progn (sj3-command-start SJ3_OPEN) + (sj3-put-4byte 1) + (sj3-put-string host_name) + (sj3-put-string user_name) + (sj3-put-string program_name) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (not (= sj3-return-code 0)) + (sj3-connection-error) + nil) + ) + nil) + (if (or (= sj3-return-code 0) (> -1 sj3-return-code)) + (progn (setq *sj3-current-server-version* 1) + (if (not (= sj3-return-code 0)) + (setq *sj3-current-server-version* (- 0 sj3-return-code)) + nil) + (sj3-get-stdy-size) + ) + nil) + ))))) + +(defun sj3-server-active-p () + (and sj3-server-process + (eq (process-status sj3-server-process) 'open))) + +(defun sj3-connection-error () + (setq sj3-error-code ':sj3-no-connection) + (setq sj3-return-code -1) + nil) + +(defun sj3-zero-arg-command (op) + (if (sj3-server-active-p) + (progn + (sj3-command-start op) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code)) + (sj3-connection-error))) + +(defun sj3-server-close () + (let (dict-no) + (while (and (sj3-server-active-p) (setq dict-no (car sj3-sys-dict-list))) + (sj3-server-close-dict dict-no) + (setq sj3-sys-dict-list (cdr sj3-sys-dict-list))) + (while (and (sj3-server-active-p) (setq dict-no (car sj3-user-dict-list))) + (sj3-server-close-dict dict-no) + (setq sj3-user-dict-list (cdr sj3-user-dict-list))) + (sj3-clear-dict-list)) + (sj3-server-close-stdy) + (sj3-zero-arg-command SJ3_CLOSE) + (if (sj3-server-active-p) + (delete-process sj3-server-process)) + (if sj3-server-buffer + (kill-buffer sj3-server-buffer)) + (if sj3-command-buffer + (kill-buffer sj3-command-buffer)) + (if sj3-result-buffer + (kill-buffer sj3-result-buffer)) + (setq sj3-server-process nil) + (setq sj3-server-buffer nil) + (setq sj3-command-buffer nil) + (setq sj3-result-buffer nil)) + +(defun sj3-clear-dict-list () + (setq sj3-sys-dict-list nil) + (setq sj3-user-dict-list nil)) + +;; Remove Wnn's stuff. +(remove-hook 'kill-emacs-hook 'wnn-egg:kill-emacs-function) + +(defun sj3-egg:kill-emacs-function () + (if (sj3-server-active-p) + (sj3-server-close))) + +(add-hook 'kill-emacs-hook 'sj3-egg:kill-emacs-function) + +(defun sj3-get-stdy-size () + (sj3-zero-arg-command SJ3_STDYSIZE) + (if (not (= sj3-return-code 0)) nil + (setq sj3-stdy-size (sj3-get-4byte)))) + +(defun sj3-put-stdy-dmy () + (let ((i 0)) + (while (< i sj3-stdy-size) + (insert 0) + (setq i (1+ i))))) + +;;; Sj3 Result Buffer's layout: +;;; +;;; { length:4 kana 0 kouhoSuu:4 kouhoNo:4 +;;; {studyData kanji 0 } ... +;;; } +;;; 0 0 0 0 + +(defun sj3-skip-length () + (goto-char (+ (point) 4))) + +(defun sj3-skip-4byte () + (goto-char (+ (point) 4))) + +(defun sj3-skip-yomi () + (skip-chars-forward "^\0") (forward-char 1)) + +(defun sj3-skip-stdy () + (goto-char (+ (point) sj3-stdy-size))) + +;;; +;;; entry function +;;; +(defun sj3-server-henkan-begin (henkan-string) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t) mb-str) + (save-excursion + (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))) + (set-buffer sj3-result-buffer) + (erase-buffer) + (setq sj3-bunsetu-suu 0) + (setq sj3-yomi-llist nil) + (goto-char (point-min)) + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_BEGIN_EUC) + (sj3-command-start SJ3_BEGIN) + ) + (sj3-put-string mb-str) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (not (= sj3-return-code 0)) nil + (let ((yp 0) p0 yl offset ystr stdk) + (sj3-get-4byte) + (set-buffer sj3-result-buffer) + (delete-region (point) (point-max)) + (setq p0 (point)) + (insert sj3-henkan-string 0 0 0 0) + (goto-char p0) + (set-buffer sj3-server-buffer) + (while (> (setq yl (sj3-get-byte)) 0) + (setq ystr (substring mb-str yp (+ yp yl)) + yp (+ yp yl)) + (sj3-save-buffer-multibyte-and-enable + (if (= *sj3-current-server-version* 2) + (setq yl (length (decode-coding-string ystr 'euc-japan))) + (setq yl (length (decode-coding-string ystr 'sjis))))) + (setq stdk (concat (sj3-get-stdy) + (sj3-get-convert-string) + "\C-@")) + (set-buffer sj3-result-buffer) + (setq p0 (point)) + (forward-char yl) + (setq sj3-yomi-llist (append sj3-yomi-llist (list yl))) + (insert 0) ;;; yomi + (sj3-put-4byte 1) ;;; kouho suu + (sj3-put-4byte 0) ;;; current kouho number + (insert stdk) ;;; study data and kanji strings + (setq offset (- (point) p0)) + (goto-char p0) (sj3-put-4byte offset) + (goto-char (+ (point) offset)) + (setq sj3-return-code (1+ sj3-return-code)) + (set-buffer sj3-server-buffer)) + (setq sj3-bunsetu-suu sj3-return-code))))))) +;;; +;;; entry function +;;; +(defun sj3-server-henkan-quit () t) + +(defun sj3-get-yomi-suu-org () + (if (setq sj3-yomi-llist (cdr sj3-yomi-llist)) + (car sj3-yomi-llist) + 0)) + +;;; +;;; entry function +;;; +(defun sj3-server-henkan-end (bunsetu-no) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (let (length ystr len kouho-no kouho-suu p0 (ylist nil)) + (set-buffer sj3-result-buffer) + (goto-char (point-min)) + (let ((max (if (and (integerp bunsetu-no) + (<= 0 bunsetu-no) + (<= bunsetu-no sj3-bunsetu-suu)) + bunsetu-no + sj3-bunsetu-suu)) + (i 0)) + (while (< i max) + (setq length (sj3-get-4byte)) + (setq p0 (point)) + (setq ystr (sj3-get-string)) + (setq len (1- (- (point) p0))) + (setq kouho-suu (sj3-get-4byte)) ;;; kouho suu + (setq kouho-no (sj3-get-4byte)) + (if (and (> kouho-no 0) + (< kouho-no (- kouho-suu 2)) + (> kouho-suu 3)) + (sj3-server-b-study kouho-no)) + (setq ylist (cons (list len ystr kouho-suu (point)) ylist)) + (goto-char (+ p0 length)) + (setq i (1+ i))) + (setq ylist (nreverse ylist)) + (setq i 1) + (let ((yp 0) (op 0) (ydata (car ylist)) (ol (car sj3-yomi-llist))) + (while (< i max) + (let ((yl (nth 0 ydata))) + (setq ylist (cdr ylist)) + (if (and (= yp op) (= yl ol)) + (let ((pp (+ yp yl))) + (setq yp pp) + (setq op pp) + (setq ydata (car ylist)) + (setq ol (sj3-get-yomi-suu-org))) + (let ((str (nth 1 ydata)) + (ent (nth 2 ydata))) + (setq ydata (car ylist)) + (setq yp (+ yp yl)) + (while (< op yp) + (setq op (+ op ol)) + (setq ol (sj3-get-yomi-suu-org))) + (if (or (= ent 2) (= (nth 2 ydata) 2)) nil + (let ((sub (- op yp)) (yl1 (nth 0 ydata))) + (set-buffer sj3-result-buffer) + (goto-char (nth 3 ydata)) + (sj3-server-cl-study str (nth 1 ydata)) + (if (and (not (= sub yl1)) (not (= sub (- yl1 ol)))) + nil + (setq i (1+ i)) + (setq ylist (cdr ylist)) + (setq ydata (car ylist)) + (if (= sub yl1) nil + (setq op (+ op ol)) + (setq ol (sj3-get-yomi-suu-org)))))))) + (setq i (1+ i)))) + (if (or (null ydata) (= (nth 0 ydata) ol) (= (nth 2 ydata) 2)) + sj3-return-code + (goto-char (nth 3 ydata)) + (sj3-server-cl-study (nth 1 ydata) ""))))))))) + +(defun sj3-server-cl-study (str1 str2) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (save-excursion + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_END_EUC) + (sj3-command-start SJ3_END)) + (sj3-put-string* str1) + (sj3-put-string* str2) + (if (string= str2 "") (sj3-put-stdy-dmy) + (let (p0) + (set-buffer sj3-result-buffer) + (setq p0 (point)) + (set-buffer sj3-command-buffer) + (insert-buffer-substring sj3-result-buffer p0 (+ p0 sj3-stdy-size)))) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code)))) + +(defun sj3-server-b-study (no) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (save-excursion + (let ((i 0) p0) + (set-buffer sj3-result-buffer) + (while (< i no) + (sj3-skip-stdy) + (sj3-skip-yomi) + (setq i (1+ i))) + (setq p0 (point)) + (sj3-command-start SJ3_STDY) + (insert-buffer-substring sj3-result-buffer p0 (+ p0 sj3-stdy-size)) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-result-goto-bunsetu (bunsetu-no) + (goto-char (point-min)) + (let (length (i 0)) + (while (< i bunsetu-no) + (setq length (sj3-get-4byte)) + (goto-char (+ (point) length)) + (setq i (1+ i))))) + +;;; +;;; entry function +;;; +(defun sj3-server-henkan-kakutei (bunsetu-no jikouho-no) + (cond((not (sj3-server-active-p)) (sj3-connection-error)) + ((or (< bunsetu-no 0) (<= sj3-bunsetu-suu bunsetu-no)) + nil) + (t + (let ((inhibit-quit t)) + (save-excursion + (set-buffer sj3-result-buffer) + (let (kouho-suu) + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + (setq kouho-suu (sj3-get-4byte)) + (if (or (< jikouho-no 0) (<= kouho-suu jikouho-no)) nil + (delete-char 4) (sj3-put-4byte jikouho-no) + t))))))) + +;;; +;;; entry function +;;; +(defun sj3-server-henkan-next (bunsetu-no) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (let (p0 p1 kouho-suu length ystr) + (set-buffer sj3-result-buffer) + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (setq p0 (point)) + (setq ystr (sj3-get-string)) + (setq p1 (point)) + (setq kouho-suu (sj3-get-4byte)) + (if (> kouho-suu 1) t + (let ((ksuu (sj3-server-henkan-kouho ystr)) (startp 0)) + (if (< ksuu 0) sj3-return-code + (let (kanji stdk i) + (set-buffer sj3-result-buffer) + (sj3-skip-4byte) + (sj3-skip-stdy) + (setq kanji (sj3-get-string)) + (if (> ksuu 1) + (progn + (setq i 1) + (set-buffer sj3-server-buffer) + (sj3-get-4byte) + (setq startp (point) + stdk (sj3-get-stdy)) + (let ((kkanji (sj3-get-string*))) + (if (equal kanji kkanji) + (setq startp (point) + stdk "") + (setq stdk (concat stdk kkanji "\0")) + (setq ksuu (1+ ksuu)) + (setq i (1+ i)))) + (while (< i ksuu) + (sj3-get-4byte) + (delete-char -4) + (setq stdk (concat stdk + (sj3-get-stdy) + (sj3-get-convert-string) + "\C-@")) + (setq i (1+ i))) + )) + (set-buffer sj3-result-buffer) + (if (> startp 0) + (insert stdk)) + (sj3-put-kata ystr) + (insert ystr 0) + (setq length (- (point) p0)) + (goto-char p1) + (delete-char 4) + (if (<= ksuu 0)(sj3-put-4byte 3) ;;; + (sj3-put-4byte (+ ksuu 2))) ;;; put kouho-suu + (goto-char p0) + (delete-char -4) + (sj3-put-4byte length)) + t)))))))) + +(defun sj3-server-henkan-kouho (str) + (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))) + len kouho-suu) + (setq len (length mb-str)) + (setq kouho-suu (sj3-server-henkan-kouho-suu len mb-str)) + (if (<= kouho-suu 0) nil + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_KOUHO_EUC) + (sj3-command-start SJ3_KOUHO)) + (sj3-put-4byte len) + (sj3-put-string mb-str) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (not (= sj3-return-code 0)) -1)) + kouho-suu))) + +(defun sj3-put-kata (str) + (sj3-save-buffer-multibyte-and-enable + (setq str (string-as-multibyte (copy-sequence str))) + (let ((i 0) (len (length str)) ch) + (while (< i len) + (setq ch (aref str i)) + (aset str i + (if (and (/= ?$B!<(B ch) + (string-match "\\cH" (char-to-string ch))) + (make-char 'japanese-jisx0208 37 (% ch 256)) + ch)) + (setq i (1+ i))) + (insert str 0)))) + +(defun sj3-server-henkan-kouho-suu (yomi-length yomi) + (if (not (sj3-server-active-p)) -1 + (save-excursion + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_KOUHOSU_EUC) + (sj3-command-start SJ3_KOUHOSU)) + (sj3-put-4byte yomi-length) + (sj3-put-string yomi) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (not (= sj3-return-code 0)) -1 + (sj3-get-4byte))))) + +;;; +;;; entry function +;;; +(defun sj3-server-bunsetu-henkou (bunsetu-no bunsetu-length) + (cond((not (sj3-server-active-p)) (sj3-connection-error)) + ((or (< bunsetu-no 0) (<= sj3-bunsetu-suu bunsetu-no)) + nil) + (t + (let ((inhibit-quit t)) + (save-excursion + (let (yp0 p0 p1 str len1 len2 bunsetu-suu (bno bunsetu-no)) + (set-buffer sj3-result-buffer) + (setq yp0 (sj3-yomi-point bunsetu-no)) + (setq p0 (point)) + (setq str (sj3-get-yomi yp0 bunsetu-length)) + (setq len1 (length str)) + (setq bunsetu-suu sj3-bunsetu-suu) + (let (point length) + (setq len2 len1) + (while (and (< bno sj3-bunsetu-suu) (> len2 0)) + (setq length (sj3-get-4byte)) + (setq point (point)) + (skip-chars-forward "^\0") + (setq len2 (- len2 (- (point) point))) + (goto-char (+ point length)) + (setq bno (1+ bno)))) + (setq p1 (point)) + (delete-region p0 p1) + (setq sj3-bunsetu-suu (- sj3-bunsetu-suu (- bno bunsetu-no))) + (if (= (sj3-put-tanconv str) 0) + (if (not (= len2 0)) + (let ((len (- 0 len2)) (yp1 (+ yp0 len1)) + ystr mb-str) + (if (or (> bno (1+ bunsetu-no)) (= bno bunsetu-suu)) + (setq ystr (sj3-get-yomi yp1 len)) + (let (ll length i) + (set-buffer sj3-result-buffer) + (setq p0 (point)) + (setq length (sj3-get-4byte)) + (skip-chars-forward "^\0") + (setq ll (+ len (- (point) (+ p0 4)))) + (setq p1 (+ p0 (+ length 4))) + (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))) + (setq i (sj3-server-henkan-kouho-suu + (length mb-str) mb-str)) + (set-buffer sj3-result-buffer) + (if (= i 0) (setq ystr (sj3-get-yomi yp1 len)) + (delete-region p0 p1) + (setq sj3-bunsetu-suu (1- sj3-bunsetu-suu)) + (setq len ll)) + (goto-char p0))) + (sj3-put-tanconv ystr)))) + (if (= sj3-return-code -1) nil + sj3-bunsetu-suu))))))) + +(defun sj3-put-tanconv (str) + (let ((point (point)) len ksuu + (mb-str (if (= *sj3-current-server-version* 2) + (encode-coding-string str 'euc-japan) + (encode-coding-string str 'sjis)))) + (setq len (length mb-str)) + (setq ksuu (sj3-server-henkan-kouho-suu len mb-str)) + (if (>= ksuu 0) + (let (offset) + (set-buffer sj3-result-buffer) + (insert str 0) + (if (or (= ksuu 0) + (not (sj3-server-tanconv len mb-str))) + (put-kata-and-hira str) + (let (stdk) + (set-buffer sj3-result-buffer) + (sj3-put-4byte 1) + (sj3-put-4byte 0) + (set-buffer sj3-server-buffer) + (sj3-get-4byte) + (setq stdk (concat + (sj3-get-stdy) + (sj3-get-convert-string) + "\C-@")) + (set-buffer sj3-result-buffer) + (insert stdk))) + (set-buffer sj3-result-buffer) + (setq offset (- (point) point)) + (goto-char point) (sj3-put-4byte offset) + (goto-char (+ (point) offset)) + (setq sj3-bunsetu-suu (1+ sj3-bunsetu-suu)))) + sj3-return-code)) + +(defun sj3-server-tanconv (len str) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_TANCONV_EUC) + (sj3-command-start SJ3_TANCONV)) + (sj3-put-4byte len) + (sj3-put-string str) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code)))) + +(defun put-kata-and-hira (str) + (sj3-put-4byte 2) + (sj3-put-4byte 0) + (sj3-put-stdy-dmy) + (sj3-put-kata str) + (sj3-save-buffer-multibyte-and-enable + (insert str 0))) + +(defun sj3-get-yomi (offset length) + (substring sj3-henkan-string offset (+ offset length))) + +(defun sj3-bunsetu-suu () sj3-bunsetu-suu) + +(defun sj3-bunsetu-kanji (bunsetu-no &optional buffer) + (let ((savebuffer (current-buffer))) + (unwind-protect + (progn + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + + (let ((i 0) + (rksuu (- (sj3-get-4byte) 2)) ;;; real kouho-suu + (max (sj3-get-4byte))) ;;; kouho-number + (sj3-skip-stdy) + (while (< i max) + (sj3-skip-yomi) + (setq i (1+ i)) + (if (< i rksuu) + (sj3-skip-stdy)))) + + (let (p1 string) + (setq p1 (point)) + (skip-chars-forward "^\0") + (setq string (buffer-substring p1 (point))) + (forward-char 1) + (if (null buffer) + string + (set-buffer buffer) + (insert string) + nil)))) + (set-buffer savebuffer)))) + +(defun sj3-bunsetu-kanji-length (bunsetu-no) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + + (let ((i 0) + (rksuu (- (sj3-get-4byte) 2)) ;;; real kouho-suu + (max (sj3-get-4byte))) ;;; kouho-number + (sj3-skip-stdy) + (while (< i max) + (sj3-skip-yomi) + (setq i (1+ i)) + (if (< i rksuu) + (sj3-skip-stdy)))) + + (let (p1) + (setq p1 (point)) + (skip-chars-forward "^\0") + (save-restriction + (narrow-to-region p1 (point)) + (- (point-max) (point-min))))))) + +(defun sj3-bunsetu-yomi-moji-suu (bunsetu-no) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (let ((c 0)) + (while (not (zerop (char-after))) + (forward-char 1) + (setq c (1+ c))) + c)))) + +(defun sj3-yomi-point (bunsetu-no) + (let ((i 0) (len 0) point length) + (goto-char (point-min)) + (while (< i bunsetu-no) + (setq length (sj3-get-4byte)) + (setq point (point)) + (skip-chars-forward "^\0") + (setq len (+ len (- (point) point))) + (goto-char (+ point length)) + (setq i (1+ i))) + len)) + +(defun sj3-bunsetu-yomi (bunsetu-no &optional buffer) + (let ((savebuff (current-buffer))) + (unwind-protect + (progn + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (let (p1 p2 ) + (setq p1 (point)) + (skip-chars-forward "^\0") + (if (null buffer ) (buffer-substring p1 (point)) + (setq p2 (point)) + (set-buffer buffer) + (insert-buffer-substring sj3-result-buffer p1 p2) + t)))) + (set-buffer savebuff)))) + +(defun sj3-bunsetu-yomi-equal (bunsetu-no yomi) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (looking-at (regexp-quote yomi))))) ;93.4.6 by T.Saneto + +(defun sj3-bunsetu-kouho-suu (bunsetu-no) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + (sj3-get-4byte)))) + +(defun sj3-bunsetu-kouho-list (bunsetu-no) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + (let ((max (sj3-get-4byte)) (i 0) (result nil) p0) + (sj3-skip-4byte) ;;; current kouhou number + (sj3-skip-stdy) + (while (< i max) + (setq p0 (point)) + (skip-chars-forward "^\0") + (setq result + (cons (concat (buffer-substring p0 (point))) + result)) + (forward-char 1) + (setq i (1+ i)) + (if (< i (- max 2)) + (sj3-skip-stdy))) + (nreverse result))))) + +(defun sj3-bunsetu-kouho-number (bunsetu-no) + (save-excursion + (set-buffer sj3-result-buffer) + (if (or (< bunsetu-no 0) + (<= sj3-bunsetu-suu bunsetu-no)) + nil + (sj3-result-goto-bunsetu bunsetu-no) + (sj3-skip-length) + (sj3-skip-yomi) + (sj3-skip-4byte) + (sj3-get-4byte))) + ) + +(defun sj3-simple-command (op arg) + (if (sj3-server-active-p) + (let ((inhibit-quit t)) + (progn + (sj3-command-start op) + (sj3-put-4byte arg) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))) + (sj3-connection-error))) + +(defun sj3-server-open-dict (dict-file-name password) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_DICADD) + (sj3-put-string dict-file-name) + (if (stringp password) + (sj3-put-string password) + (sj3-put-string 0)) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code) + (if (not (= sj3-return-code 0)) nil + (let ((dict-no (sj3-get-4byte))) + (if (stringp password) + (setq sj3-user-dict-list + (append sj3-user-dict-list (list dict-no))) + (setq sj3-sys-dict-list + (append sj3-sys-dict-list (list dict-no)))) + dict-no)))))) + +(defun sj3-server-close-dict (dict-no) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_DICDEL) + (sj3-put-4byte dict-no) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-make-dict (dict-file-name) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_MKDIC) + (sj3-put-string dict-file-name) + (sj3-put-4byte 2048) ;;; Index length + (sj3-put-4byte 2048) ;;; Length + (sj3-put-4byte 256) ;;; Number + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-open-stdy (stdy-file-name) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_OPENSTDY) + (sj3-put-string stdy-file-name) + (sj3-put-string 0) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-close-stdy () + (sj3-zero-arg-command SJ3_CLOSESTDY)) + +(defun sj3-server-make-stdy (stdy-file-name) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_MKSTDY) + (sj3-put-string stdy-file-name) + (sj3-put-4byte 2048) ;;; Number + (sj3-put-4byte 1) ;;; Step + (sj3-put-4byte 2048) ;;; Length + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-dict-add (dictno kanji yomi bunpo) + (if (not (sj3-server-active-p))(sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_WREG_EUC) + (sj3-command-start SJ3_WREG)) + (sj3-put-4byte dictno) + (sj3-put-string* yomi) + (sj3-put-string* kanji) + (sj3-put-4byte bunpo) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-dict-delete (dictno kanji yomi bunpo) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (if (= *sj3-current-server-version* 2) + (sj3-command-start SJ3_WDEL_EUC) + (sj3-command-start SJ3_WDEL)) + (sj3-put-4byte dictno) + (sj3-put-string* yomi) + (sj3-put-string* kanji) + (sj3-put-4byte bunpo) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-dict-info (dict-no) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (let ((result nil)) + (set-buffer sj3-server-buffer) + (if (= *sj3-current-server-version* 2) + (sj3-simple-command SJ3_WSCH_EUC dict-no) + (sj3-simple-command SJ3_WSCH dict-no)) + (while (= sj3-return-code 0) + ;;; (sj3-get-4byte) + (setq result (cons (list (sj3-get-string*) + (sj3-get-string*) (sj3-get-4byte)) result)) + (if (= *sj3-current-server-version* 2) + (sj3-simple-command SJ3_WNSCH_EUC dict-no) + (sj3-simple-command SJ3_WNSCH dict-no))) + (if (= sj3-return-code 111) + (setq sj3-error-code nil)) + (nreverse result)))))) + +(defun sj3-server-make-directory (dir-name) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_MKDIR) + (sj3-put-string dir-name) + (sj3-command-end) + (sj3-get-result) + (sj3-get-return-code))))) + +(defun sj3-server-file-access (file-name access-mode) + (if (not (sj3-server-active-p)) (sj3-connection-error) + (let ((inhibit-quit t)) + (save-excursion + (sj3-command-start SJ3_ACCESS) + (sj3-put-string file-name) + (sj3-put-4byte access-mode) + (sj3-command-end) + (sj3-get-result) + (setq sj3-error-code nil) + (sj3-get-4byte))))) + +(defun sj3_lock () + (sj3-zero-arg-command SJ3_LOCK)) + +(defun sj3_unlock () + (sj3-zero-arg-command SJ3_UNLOCK)) + +(defun sj3_version () + (sj3-zero-arg-command SJ3_VERSION)) + +(defconst *sj3-error-alist* + '( + (1 :SJ3_SERVER_DEAD + "$B%5!<%P$,;`$s$G$$$^$9!#(B") + (2 :SJ3_SOCK_OPEN_FAIL + "socket$B$N(Bopen$B$K<:GT$7$^$7$?!#(B") + (6 :SJ3_ALLOC_FAIL + "$B%a%b%j(Balloc$B$G<:GT$7$^$7$?!#(B") + (7 :SJ3_ILLEGAL_COMMAND + "$B%3%^%s%I$,4V0c$C$F$$$k(B") + (12 :SJ3_BAD_HOST + " $B%[%9%HL>$,$J$$(B ") + (13 :SJ3_BAD_USER + " $B%f!<%6L>$,$J$$(B ") + (31 :SJ3_NOT_A_DICT + "$B@5$7$$<-=q$G$O$"$j$^$;$s!#(B") + (35 :SJ3_NO_EXIST + "$B%U%!%$%k$,B8:_$7$^$;$s!#(B") + (37 :SJ3_OPENF_ERR + "$B%U%!%$%k$,%*!<%W%s$G$-$^$;$s!#(B") + (39 :SJ3_PARAMR + "$B%U%!%$%k$NFI$_9~$_8"8B$,$"$j$^$;$s!#(B") + (40 :SJ3_PARAMW + "$B%U%!%$%k$N=q$-9~$_8"8B$,$"$j$^$;$s!#(B") + (71 :SJ3_NOT_A_USERDICT + "$B;XDj$5$l$F<-=q$O!"%f!<%6!<<-=q$G$O$"$j$^$;$s!#(B") + (72 :SJ3_RDONLY + "$B%j!<%I%*%s%j!<$N<-=q$KEPO?$7$h$&$H$7$^$7$?!#(B") + (74 :SJ3_BAD_YOMI + "$BFI$_$KITE,Ev$JJ8;z$,4^$^$l$F$$$^$9!#(B") + (75 :SJ3_BAD_KANJI + "$B4A;z$KITE,Ev$JJ8;z$,4^$^$l$F$$$^$9!#(B") + (76 :SJ3_BAD_HINSHI + "$B;XDj$5$l$?IJ;lHV9f$,$"$j$^$;$s!#(B") + (82 :SJ3_WORD_ALREADY_EXIST + "$B;XDj$5$l$?C18l$O$9$G$KB8:_$7$F$$$^$9!#(B") + (84 :SJ3_JISHOTABLE_FULL + "$B<-=q%F!<%V%k$,0lGU$G$9!#(B") + (92 :SJ3_WORD_NO_EXIST + "$B;XDj$5$l$?C18l$,B8:_$7$^$;$s!#(B") + (102 :SJ3_MKDIR_FAIL + " $B%G%#%l%/%H%j$r:n$jB;$J$C$?(B ") + )) + +(defun sj3-error-symbol (code) + (let ((pair (assoc code *sj3-error-alist*))) + (if (null pair) + (list ':sj3-unknown-error-code code) + (car (cdr pair))))) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/sj3-egg.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,1431 @@ +;; Kana Kanji Conversion Protocol Package for Egg +;; Coded by K.Ishii, Sony Corp. (kiyoji@sm.sony.co.jp) + +;; This file is part of Egg on Mule (Multilingal Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;;; 1998-09-23 Ported to Emacs 20.3.90. +;;; 1998-10-10 Revised. + +;;; +;;; sj3-egg.el +;;; +;;; $B!V$?$^$4!W$N(B sj3 $B%P!<%8%g%s(B +;;; $B$+$J4A;zJQ49%5!<%P$K(B sj3serv $B$r;H$$$^$9!#(B +;;; +;;; sj3-egg $B$K4X$9$kDs0F!"Cn>pJs$O(B kiyoji@sm.sony.co.jp $B$K$*Aw$j2<$5$$!#(B +;;; +;;; $B@P0f(B $B@6 edit-dict + +;;;; Aug-6-92 by K.Ishii +;;;; length $B$r(B string-width $B$KJQ99(B + +;;;; Jul-30-92 by K.Ishii +;;;; set-default-usr-dic-directory $B$G:n$k<-=q%G%#%l%/%H%jL>$N=$@5(B +;;;; jserver-host-name, $B4D6-JQ?t(B JSERVER $B$N:o=|(B +;;;; + +;;;; Jul-7-92 by Y.Kawabe +;;;; jserver-host-name $B$r%;%C%H$9$k:]$K4D6-JQ?t(B SJ3SERV $B$bD4$Y$k!#(B +;;;; sj3fns.el $B$N%m!<%I$r$d$a$k!#(B + +;;;; Jun-2-92 by K.Ishii +;;;; sj3-egg.el $B$r(B wnn-egg.el $B$HF1MM$KJ,3d(B + +;;;; May-14-92 by K.Ishii +;;;; Mule $B$N(B wnn-egg.el $B$r(B sj3serv $B$H$NDL?.MQ$K=$@5(B + +;;;---------------------------------------------------------------------- +;;; +;;; Version control routine +;;; +;;;---------------------------------------------------------------------- + +(defvar sj3-egg-version "3.00" "Version number of this version of Egg. ") +;;; Last modified date: Thu Aug 4 21:18:11 1994 + +;;;---------------------------------------------------------------------- +;;; +;;; KKCP package: Kana Kanji Conversion Protocol +;;; +;;; KKCP to SJ3SERV interface; +;;; +;;;---------------------------------------------------------------------- + +(defvar *KKCP:error-flag* t) + +(defun KKCP:error (errorCode &rest form) + (cond((eq errorCode ':SJ3_SOCK_OPEN_FAIL) + (notify "EGG: %s $B>e$K(B SJ3SERV $B$,$"$j$^$;$s!#(B" (or (get-sj3-host-name) "local")) + (if debug-on-error + (error "EGG: No SJ3SERV on %s is running." (or (get-sj3-host-name) "local")) + (error "EGG: %s $B>e$K(B SJ3SERV $B$,$"$j$^$;$s!#(B" (or (get-sj3-host-name) "local")))) + ((eq errorCode ':SJ3_SERVER_DEAD) + (notify "EGG: %s $B>e$N(BSJ3SERV $B$,;`$s$G$$$^$9!#(B" (or (get-sj3-host-name) "local")) + (if debug-on-error + (error "EGG: SJ3SERV on %s is dead." (or (get-sj3-host-name) "local")) + (error "EGG: %s $B>e$N(B SJ3SERV $B$,;`$s$G$$$^$9!#(B" (or (get-sj3-host-name) "local")))) + ((and (consp errorCode) + (eq (car errorCode) ':SJ3_UNKNOWN_HOST)) + (notify "EGG: $B%[%9%H(B %s $B$,$_$D$+$j$^$;$s!#(B" (car(cdr errorCode))) + (if debug-on-error + (error "EGG: Host %s is unknown." (car(cdr errorCode))) + (error "EGG: $B%[%9%H(B %s $B$,$_$D$+$j$^$;$s!#(B" (car(cdr errorCode))))) + ((and (consp errorCode) + (eq (car errorCode) ':SJ3_UNKNOWN_SERVICE)) + (notify "EGG: Network service %s $B$,$_$D$+$j$^$;$s!#(B" (car(cdr errorCode))) + (if debug-on-error + (error "EGG: Service %s is unknown." (car(cdr errorCode))) + (error "EGG: Network service %s $B$,$_$D$+$j$^$;$s!#(B" (cdr errorCode)))) + (t + (notify "KKCP: $B860x(B %s $B$G(B %s $B$K<:GT$7$^$7$?!#(B" errorCode form) + (if debug-on-error + (error "KKCP: %s failed because of %s." form errorCode) + (error "KKCP: $B860x(B %s $B$G(B %s $B$K<:GT$7$^$7$?!#(B" errorCode form))))) + +(defun KKCP:server-open (hostname loginname) + (let ((result (sj3-server-open hostname loginname))) + (cond((null sj3-error-code) result) + (t (KKCP:error sj3-error-code 'KKCP:server-open hostname loginname))))) + +(defun KKCP:use-dict (dict &optional passwd) + (let ((result (sj3-server-open-dict dict passwd))) + (cond((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:use-dict dict passwd)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code + 'kkcp:use-dict dict))))) + +(defun KKCP:make-dict (dict) + (let ((result (sj3-server-make-dict dict))) + (cond((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:make-dict dict)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code + 'kkcp:make-dict dict))))) + +(defun KKCP:use-stdy (stdy) + (let ((result (sj3-server-open-stdy stdy))) + (cond((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:use-stdy stdy)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code + 'kkcp:use-stdy stdy))))) + +(defun KKCP:make-stdy (stdy) + (let ((result (sj3-server-make-stdy stdy))) + (cond((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:make-stdy stdy)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code + 'kkcp:make-stdy stdy))))) + +(defun KKCP:henkan-begin (henkan-string) + (let ((result (sj3-server-henkan-begin henkan-string))) + (cond((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:henkan-begin henkan-string)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code 'KKCP:henkan-begin henkan-string))))) + +(defun KKCP:henkan-next (bunsetu-no) + (let ((result (sj3-server-henkan-next bunsetu-no))) + (cond ((null sj3-error-code) result) + ((eq sj3-error-code ':sj3-no-connection) + (EGG:open-sj3) + (KKCP:henkan-next bunsetu-no)) + ((null *KKCP:error-flag*) result) + (t (KKCP:error sj3-error-code 'KKCP:henkan-next bunsetu-no))))) + +(defun KKCP:henkan-kakutei (bunsetu-no jikouho-no) + ;;; NOTE: $B$N%7%9%F%`<-=q(B %s $B$,EPO?$5$l$F$$$^$9!#(B" + (file-name-nondirectory dict)) + ) + ((null (KKCP:file-access dict 0)) + (beep) + (notify "$B%7%9%F%`<-=q(B %s $B$,$"$j$^$;$s!#(B" dict)) + (t(let* ((*KKCP:error-flag* nil) + (rc (KKCP:use-dict dict))) + (if (null rc) + (error "EGG: setsysdict failed. :%s" dict) + (setq egg:*dict-list* + (cons (cons (file-name-nondirectory dict) dict) + egg:*dict-list*))))))) + +;;; dict-no --> dict-name +(defvar egg:*usr-dict* nil) + +;;; dict-name --> dict-no +(defvar egg:*dict-menu* nil) + +(defmacro push-end (val loc) + (list 'push-end-internal val (list 'quote loc))) + +(defun push-end-internal (val loc) + (set loc + (if (eval loc) + (nconc (eval loc) (cons val nil)) + (cons val nil)))) + +(defun egg:setusrdict (dict) + (cond((assoc (file-name-nondirectory dict) egg:*dict-list*) + (beep) + (notify "$B4{$KF1L>$NMxMQe$K(B egg-startup-file $B$,$"$j$^$;$s!#(B" + ))))) + +(defun disconnect-sj3 () + (interactive) + (KKCP:server-close)) + +(defun close-sj3 () + (interactive) + (KKCP:server-close)) + +;;; +;;; Kanji henkan +;;; + +(defvar egg:*kanji-kanabuff* nil) + +(defvar *bunsetu-number* nil) + +(defun bunsetu-su () + (sj3-bunsetu-suu)) + +(defun bunsetu-length (number) + (sj3-bunsetu-yomi-moji-suu number)) + +;; #### This looks like a stupid multi-byte kludge. +(defun kanji-moji-suu (str) + "Do Not Call This." + (length str)) + +(defun bunsetu-position (number) + (let ((pos egg:*region-start*) (i 0)) + (while (< i number) + (setq pos (+ pos (bunsetu-kanji-length i) (length egg:*bunsetu-kugiri*))) + (setq i (1+ i))) + pos)) + +(defun bunsetu-kanji-length (bunsetu-no) + (sj3-bunsetu-kanji-length bunsetu-no)) + +(defun bunsetu-kanji (number) + (sj3-bunsetu-kanji number)) + +(defun bunsetu-kanji-insert (bunsetu-no) + (sj3-bunsetu-kanji bunsetu-no (current-buffer))) + +(defun bunsetu-set-kanji (bunsetu-no kouho-no) + (sj3-server-henkan-kakutei bunsetu-no kouho-no)) + +(defun bunsetu-yomi (number) + (sj3-bunsetu-yomi number)) + +(defun bunsetu-yomi-insert (bunsetu-no) + (sj3-bunsetu-yomi bunsetu-no (current-buffer))) + +(defun bunsetu-yomi-equal (number yomi) + (sj3-bunsetu-yomi-equal number yomi)) + +(defun bunsetu-kouho-suu (bunsetu-no) + (let ((no (sj3-bunsetu-kouho-suu bunsetu-no))) + (if (< 1 no) no + (KKCP:henkan-next bunsetu-no) + (sj3-bunsetu-kouho-suu bunsetu-no)))) + +(defun bunsetu-kouho-list (number) + (let ((no (bunsetu-kouho-suu number))) + (if (= no 1) + (KKCP:henkan-next number)) + (sj3-bunsetu-kouho-list number))) + +(defun bunsetu-kouho-number (bunsetu-no) + (sj3-bunsetu-kouho-number bunsetu-no)) + +;;;; +;;;; User entry : henkan-region, henkan-paragraph, henkan-sentence +;;;; + +(defconst egg:*bunsetu-face* nil "*$BJ8@aI=<($KMQ$$$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*bunsetu-overlay* nil "$BJ8@a$NI=<($K;H$&(B overlay")) + +(defconst egg:*bunsetu-kugiri* " " "*$BJ8@a$N6h@Z$j$r<($9J8;zNs(B") + + +(defconst egg:*henkan-face* nil "*$BJQ49NN0h$rI=<($9$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*henkan-overlay* nil "$BJQ49NN0h$NI=<($K;H$&(B overlay")) + +(defconst egg:*henkan-open* "|" "*$BJQ49$N;OE@$r<($9J8;zNs(B") +(defconst egg:*henkan-close* "|" "*$BJQ49$N=*E@$r<($9J8;zNs(B") + +(defvar egg:henkan-mode-in-use nil) +(make-variable-buffer-local 'egg:henkan-mode-in-use) +(set-default 'egg:henkan-mode-in-use nil) +(put 'egg:henkan-mode-in-use 'permanent-local t) + +(defun egg:henkan-face-on () + (if (overlayp egg:*henkan-overlay*) nil + (setq egg:*henkan-overlay* (make-overlay 1 1 nil)) + (overlay-put egg:*henkan-overlay* 'face egg:*henkan-face*) ) + (move-overlay egg:*henkan-overlay* egg:*region-start* egg:*region-end* (current-buffer)) ) + +(defun egg:henkan-face-off () + (and (overlayp egg:*henkan-overlay*) + (delete-overlay egg:*henkan-overlay*) )) + +(defun henkan-region (start end) + (interactive "r") + (if (interactive-p) (set-mark (point))) ;;; to be fixed + (henkan-region-internal start end)) + +(defvar henkan-mode-indicator "$B4A(B") + +(defun henkan-region-internal (start end) + "region$B$r$+$J4A;zJQ49$9$k!#(B" + (or egg:henkan-mode-in-use + (let ((finished nil)) + (unwind-protect + (progn + (setq egg:henkan-mode-in-use t + egg:*kanji-kanabuff* (buffer-substring-no-properties + start end)) + (setq *bunsetu-number* 0) + (let ((result (KKCP:henkan-begin egg:*kanji-kanabuff*))) + (if result + (progn + (mode-line-egg-mode-update henkan-mode-indicator) + (goto-char start) + (or (markerp egg:*region-start*) + (setq egg:*region-start* (make-marker))) + (or (markerp egg:*region-end*) + (setq egg:*region-end* + (set-marker-insertion-type (make-marker) t))) + (if (null (marker-position egg:*region-start*)) + (progn + ;;(buffer-disable-undo (current-buffer)) + (goto-char start) + (delete-region start end) + (suspend-undo) + (insert egg:*henkan-open*) + (set-marker egg:*region-start* (point)) + (insert egg:*henkan-close*) + (set-marker egg:*region-end* egg:*region-start*) + (goto-char egg:*region-start*) + ) + (egg:fence-face-off) + (delete-region + (- egg:*region-start* (length egg:*fence-open*)) + egg:*region-start*) + (delete-region + egg:*region-end* + (+ egg:*region-end* (length egg:*fence-close*))) + (goto-char egg:*region-start*) + (insert egg:*henkan-open*) + (set-marker egg:*region-start* (point)) + (goto-char egg:*region-end*) + (let ((point (point))) + (insert egg:*henkan-close*) + (set-marker egg:*region-end* point)) + (goto-char start) + (delete-region start end) + ) + (henkan-insert-kouho 0) + (egg:henkan-face-on) + (egg:bunsetu-face-on *bunsetu-number*) + (henkan-goto-bunsetu 0)))) + (setq finished t)) + (or finished + (setq egg:henkan-mode-in-use nil)))))) + +(defun henkan-paragraph () + "Kana-kanji henkan paragraph at or after point." + (interactive ) + (save-excursion + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (henkan-region-internal (point) end )))) + +(defun henkan-sentence () + "Kana-kanji henkan sentence at or after point." + (interactive ) + (save-excursion + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (henkan-region-internal (point) end )))) + +(defun henkan-word () + "Kana-kanji henkan word at or after point." + (interactive) + (save-excursion + (re-search-backward "\\b\\w" nil t) + (let ((start (point))) + (re-search-forward "\\w\\b" nil t) + (henkan-region-internal start (point))))) + +;;; +;;; Kana Kanji Henkan Henshuu mode +;;; + +(defun set-egg-henkan-mode-format (open close kugiri &optional henkan-face bunsetu-face) + "$BJQ49(B mode $B$NI=<(J}K!$r@_Dj$9$k!#(BOPEN $B$OJQ49$N;OE@$r<($9J8;zNs$^$?$O(B nil$B!#(B +CLOSE$B$OJQ49$N=*E@$r<($9J8;zNs$^$?$O(B nil$B!#(B +KUGIRI$B$OJ8@a$N6h@Z$j$rI=<($9$kJ8;zNs$^$?$O(B nil$B!#(B +HENKAN-FACE $B$,;XDj$5$l$F(B nil $B$G$J$1$l$P!"JQ496h4V$rI=<($9$k(B face $B$H$7$F;H$o$l$k!#(B +BUNSETU-FACE $B$,;XDj$5$l$F(B nil $B$G$J$1$l$P!"CmL\$7$F$$$kJ8@a$rI=<($9$k(B face $B$H$7$F;H$o$l$k(B" + + (interactive (list (read-string "$BJQ493+;OJ8;zNs(B: ") + (read-string "$BJQ49=*N;J8;zNs(B: ") + (read-string "$BJ8@a6h@Z$jJ8;zNs(B: ") + (cdr (assoc (completing-read "$BJQ496h4VI=<(B0@-(B: " egg:*face-alist*) + egg:*face-alist*)) + (cdr (assoc (completing-read "$BJ8@a6h4VI=<(B0@-(B: " egg:*face-alist*) + egg:*face-alist*)) + )) + + (if (and (or (stringp open) (null open)) + (or (stringp close) (null close)) + (or (stringp kugiri) (null kugiri)) + (or (null henkan-face) (memq henkan-face (face-list))) + (or (null bunsetu-face) (memq henkan-face (face-list)))) + (progn + (setq egg:*henkan-open* (or open "") + egg:*henkan-close* (or close "") + egg:*bunsetu-kugiri* (or kugiri "") + egg:*henkan-face* henkan-face + egg:*bunsetu-face* bunsetu-face) + (if (overlayp egg:*henkan-overlay*) + (overlay-put egg:*henkan-overlay* 'face egg:*henkan-face*)) + (if (overlayp egg:*bunsetu-overlay*) + (overlay-put egg:*bunsetu-overlay* 'face egg:*bunsetu-face*)) + + t) + (error "Wrong type of arguments: %1 %2 %3 %4 %5" open close kugiri henkan-face bunsetu-face))) + +(defun henkan-insert-kouho (bunsetu-no) + (let ((max (bunsetu-su)) (i bunsetu-no)) + (while (< i max) + (bunsetu-kanji-insert i) + (insert egg:*bunsetu-kugiri* ) + (setq i (1+ i))) + (if (< bunsetu-no max) (delete-char (- (length egg:*bunsetu-kugiri*)))))) + +(defun henkan-kakutei () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (setq egg:henkan-mode-in-use nil) + (setq egg:*in-fence-mode* nil) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-start*) + (resume-undo-list) + (let ((i 0) (max (bunsetu-su))) + (while (< i max) + ;;;(KKCP:henkan-kakutei i (bunsetu-kouho-number i)) + (bunsetu-kanji-insert i) + (if (not overwrite-mode) + (undo-boundary)) + (setq i (1+ i)) + )) + (KKCP:henkan-end) + (egg:quit-egg-mode) + ) + +(defun henkan-kakutei-before-point () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (delete-region egg:*region-start* egg:*region-end*) + (goto-char egg:*region-start*) + (let ((i 0) (max *bunsetu-number*)) + (while (< i max) + ;;;(KKCP:henkan-kakutei i (bunsetu-kouho-number i)) + (bunsetu-kanji-insert i) + (if (not overwrite-mode) + (undo-boundary)) + (setq i (1+ i)) + )) + (KKCP:henkan-end *bunsetu-number*) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (insert egg:*fence-open*) + (set-marker egg:*region-start* (point)) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-end*) + (let ((point (point))) + (insert egg:*fence-close*) + (set-marker egg:*region-end* point)) + (goto-char egg:*region-start*) + (egg:fence-face-on) + (let ((point (point)) + (i *bunsetu-number*) (max (bunsetu-su))) + (while (< i max) + (bunsetu-yomi-insert i) + (setq i (1+ i))) + ;;;(insert "|") + ;;;(insert egg:*fence-close*) + ;;;(set-marker egg:*region-end* (point)) + (goto-char point)) + (setq egg:*mode-on* t) + ;;;(use-global-map fence-mode-map) + ;;;(use-local-map nil) + (setq egg:henkan-mode-in-use nil) + (egg:mode-line-display)) + +(defun egg:set-bunsetu-face (no face switch) + (if (not switch) + (egg:bunsetu-face-off) ;; JIC + (if (overlayp egg:*bunsetu-overlay*) nil + (setq egg:*bunsetu-overlay* (make-overlay 1 1 nil)) + (overlay-put egg:*bunsetu-overlay* 'face egg:*bunsetu-face*)) + (move-overlay egg:*bunsetu-overlay* + (if (eq face 'modeline) + (let ((point (bunsetu-position no))) + (1+ point)) + (bunsetu-position no)) + + (if (= no (1- (bunsetu-su))) + egg:*region-end* + (- (bunsetu-position (1+ no)) + (length egg:*bunsetu-kugiri*))) + (current-buffer)))) + +(defun egg:bunsetu-face-on (no) + (egg:set-bunsetu-face no egg:*bunsetu-face* t)) + +(defun egg:bunsetu-face-off () + ;; delete henkan overlay from the current buffer. + (and (overlayp egg:*bunsetu-overlay*) + (delete-overlay egg:*bunsetu-overlay*)) ) + +(defun henkan-goto-bunsetu (number) + (setq *bunsetu-number* + (check-number-range number 0 (1- (bunsetu-su)))) + (goto-char (bunsetu-position *bunsetu-number*)) + (egg:bunsetu-face-on *bunsetu-number*) + ) + +(defun henkan-forward-bunsetu () + (interactive) + (henkan-goto-bunsetu (1+ *bunsetu-number*)) + ) + +(defun henkan-backward-bunsetu () + (interactive) + (henkan-goto-bunsetu (1- *bunsetu-number*)) + ) + +(defun henkan-first-bunsetu () + (interactive) + (henkan-goto-bunsetu 0)) + +(defun henkan-last-bunsetu () + (interactive) + (henkan-goto-bunsetu (1- (bunsetu-su))) + ) + +(defun check-number-range (i min max) + (cond((< i min) max) + ((< max i) min) + (t i))) + +(defun henkan-hiragana () + (interactive) + (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number*) 1))) + +(defun henkan-katakana () + (interactive) + (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number*) 2))) + +(defun henkan-next-kouho () + (interactive) + (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number*)))) + +(defun henkan-previous-kouho () + (interactive) + (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number*)))) + +(defun henkan-goto-kouho (kouho-number) + (let ((point (point)) + (yomi (bunsetu-yomi *bunsetu-number*)) + (i *bunsetu-number*) + (max (bunsetu-su))) + (setq kouho-number + (check-number-range kouho-number + 0 + (1- (bunsetu-kouho-suu *bunsetu-number*)))) + (while (< i max) + (if (bunsetu-yomi-equal i yomi) + (let ((p1 (bunsetu-position i))) + (delete-region p1 + (+ p1 (bunsetu-kanji-length i))) + (goto-char p1) + (bunsetu-set-kanji i kouho-number) + (bunsetu-kanji-insert i))) + (setq i (1+ i))) + (goto-char point)) + (egg:bunsetu-face-on *bunsetu-number*)) + +(defun henkan-bunsetu-chijime () + (interactive) + (or (= (bunsetu-length *bunsetu-number*) 1) + (bunsetu-length-henko (1- (bunsetu-length *bunsetu-number*))))) + +(defun henkan-bunsetu-nobasi () + (interactive) + (if (not (= (1+ *bunsetu-number*) (bunsetu-su))) + (bunsetu-length-henko (1+ (bunsetu-length *bunsetu-number*))))) + +(defun henkan-saishou-bunsetu () + (interactive) + (bunsetu-length-henko 1)) + +(defun henkan-saichou-bunsetu () + (interactive) + (let ((max (bunsetu-su)) (i *bunsetu-number*) + (l 0)) + (while (< i max) + (setq l (+ l (bunsetu-length i))) + (setq i (1+ i))) + (bunsetu-length-henko l))) + +(defun bunsetu-length-henko (length) + (let ((r (KKCP:bunsetu-henkou *bunsetu-number* length))) + (cond(r + (delete-region + (bunsetu-position *bunsetu-number*) egg:*region-end*) + (goto-char (bunsetu-position *bunsetu-number*)) + (henkan-insert-kouho *bunsetu-number*) + (henkan-goto-bunsetu *bunsetu-number*)) + (t + (egg:bunsetu-face-on *bunsetu-number*))))) + +(defun henkan-quit () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-start*) + (insert egg:*fence-open*) + (set-marker egg:*region-start* (point)) + (insert egg:*kanji-kanabuff*) + (let ((point (point))) + (insert egg:*fence-close*) + (set-marker egg:*region-end* point) + ) + (goto-char egg:*region-end*) + (egg:fence-face-on) + (KKCP:henkan-quit) + (setq egg:*mode-on* t) + (setq egg:henkan-mode-in-use nil) + (setq egg:*in-fence-mode* t) + (egg:mode-line-display) + ) + +(defun henkan-select-kouho () + (interactive) + (if (not (eq (selected-window) (minibuffer-window))) + (let ((kouho-list (bunsetu-kouho-list *bunsetu-number*)) + menu) + (setq menu + (list 'menu "$B" henkan-saichou-bunsetu) + ("h" henkan-hiragana) + ("i" henkan-bunsetu-chijime) + ("k" henkan-katakana) + ("o" henkan-bunsetu-nobasi) + ("s" henkan-select-kouho) + ("z" undefined);; predefined by wnn-egg.el + )) + (apply 'define-key henkan-mode-esc-map elem)) + +(or (assq 'egg:henkan-mode-in-use minor-mode-map-alist) + (setq minor-mode-map-alist + (cons (cons 'egg:henkan-mode-in-use henkan-mode-map) + minor-mode-map-alist))) + +(defun henkan-help-command () + "Display documentation fo henkan-mode." + (interactive) + (with-output-to-temp-buffer "*Help*" + (princ (substitute-command-keys henkan-mode-document-string)) + (print-help-return-message))) + +(defvar henkan-mode-document-string "$B4A;zJQ49%b!<%I(B: +$BJ8@a0\F0(B + \\[henkan-first-bunsetu]\t$B@hF,J8@a(B\t\\[henkan-last-bunsetu]\t$B8eHxJ8@a(B + \\[henkan-backward-bunsetu]\t$BD>A0J8@a(B\t\\[henkan-forward-bunsetu]\t$BD>8eJ8@a(B +$BJQ49JQ99(B + $BA0J8@a$^$G3NDj(B \\[henkan-kakutei-before-point] +$BJQ49Cf;_(B \\[henkan-quit] +") + +;;;---------------------------------------------------------------------- +;;; +;;; Dictionary management Facility +;;; +;;;---------------------------------------------------------------------- + +;;; +;;; $B<-=qEPO?(B +;;; + +;;;; +;;;; User entry: toroku-region +;;;; + +(defun remove-regexp-in-string (regexp string) + (cond((not(string-match regexp string)) + string) + (t(let ((str nil) + (ostart 0) + (oend (match-beginning 0)) + (nstart (match-end 0))) + (setq str (concat str (substring string ostart oend))) + (while (string-match regexp string nstart) + (setq ostart nstart) + (setq oend (match-beginning 0)) + (setq nstart (match-end 0)) + (setq str (concat str (substring string ostart oend)))) + str)))) + +(defun toroku-region (start end) + (interactive "r") + (if (not (sj3-server-active-p)) + (EGG:open-sj3)) + (let*((kanji + (remove-regexp-in-string "[\0-\37]" (buffer-substring start end))) + (yomi (egg:read-hiragana-string + (format "$B<-=qEPO?!X(B%s$B!Y(B $BFI$_(B :" kanji))) + (type (menu:select-from-menu *sj3-bunpo-menu*)) + (dict-no + (menu:select-from-menu (list 'menu "$BEPO?<-=qL>(B:" egg:*dict-menu*)))) + ;;;(if (string-match "[\0-\177]" kanji) + ;;; (error "Kanji string contains hankaku character. %s" kanji)) + ;;;(if (string-match "[\0-\177]" yomi) + ;;; (error "Yomi string contains hankaku character. %s" yomi)) + (KKCP:dict-add dict-no kanji yomi type) + (let ((hinshi (nth 1 (assq type *sj3-bunpo-code*))) + (gobi (nth 2 (assq type *sj3-bunpo-code*))) + (dict-name (cdr (assq dict-no egg:*usr-dict*)))) + (notify "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$7$?!#(B" + (if gobi (concat kanji " " gobi) kanji) + (if gobi (concat yomi " " gobi) yomi) + hinshi dict-name)))) + + + +;;; (lsh 1 18) +(defvar *sj3-bunpo-menu* + '(menu "$BIJ;l(B:" + (("$BL>;l(B" . + (menu "$BIJ;l(B:$BL>;l(B:" + (("$BL>;l(B" . 1) + ("$BL>;l(B($B$*!D(B)" . 2) + ("$BL>;l(B($B$4!D(B)" . 3) + ("$BL>;l(B($B!DE*(B/$B2=(B)" . 4) + ("$BL>;l(B($B$*!D$9$k(B)" . 5) + ("$BL>;l(B($B!D$9$k(B)" . 6) + ("$BL>;l(B($B$4!D$9$k(B)" . 7) + ("$BL>;l(B($B!D$J(B/$B$K(B)" . 8) + ("$BL>;l(B($B$*!D$J(B/$B$K(B)" . 9) + ("$BL>;l(B($B$4!D$J(B/$B$K(B)" . 10) + ("$BL>;l(B($BI{;l(B)" . 11)))) + ("$BBeL>;l(B" . 12) + ("$BID;z(B" . 21) + ("$BL>A0(B" . 22) + ("$BCOL>(B" . 24) + ("$B8)(B/$B6hL>(B" . 25) + ("$BF0;l(B" . + (menu "$BIJ;l(B:$BF0;l(B:" + (("$B%5JQ8l44(B" . 80) + ("$B%6JQ8l44(B" . 81) + ("$B0lCJITJQ2=It(B" . 90) + ("$B%+9T8^CJ8l44(B" . 91) + ("$B%,9T8^CJ8l44(B" . 92) + ("$B%59T8^CJ8l44(B" . 93) + ("$B%?9T8^CJ8l44(B" . 94) + ("$B%J9T8^CJ8l44(B" . 95) + ("$B%P9T8^CJ8l44(B" . 96) + ("$B%^9T8^CJ8l44(B" . 97) + ("$B%i9T8^CJ8l44(B" . 98) + ("$B%o9T8^CJ8l44(B" . 99)))) + ("$BO"BN;l(B" . 26) + ("$B@\B3;l(B" . 27) + ("$B=u?t;l(B" . 29) + ("$B?t;l(B" . 30) + ("$B@\F,8l(B" . 31) + ("$B@\Hx8l(B" . 36) + ("$BI{;l(B" . 45) + ("$BI{;l(B2" . 46) + ("$B7AMF;l8l44(B" . 60) + ("$B7AMFF0;l8l44(B" . 71) + ("$BC14A;z(B" . 189)))) + +(defvar *sj3-bunpo-code* + '( + ( 1 "$BL>;l(B" ) + ( 2 "$BL>;l(B($B$*!D(B)" ) + ( 3 "$BL>;l(B($B$4!D(B)" ) + ( 4 "$BL>;l(B($B!DE*(B/$B2=(B)" "$BE*(B" nil) + ( 5 "$BL>;l(B($B$*!D$9$k(B)" "$B$9$k(B" nil) + ( 6 "$BL>;l(B($B!D$9$k(B)" "$B$9$k(B" nil) + ( 7 "$BL>;l(B($B$4!D$9$k(B)" "$B$9$k(B" nil) + ( 8 "$BL>;l(B($B!D$J(B/$B$K(B)" "$B$J(B/$B$K(B" nil) + ( 9 "$BL>;l(B($B$*!D$J(B/$B$K(B)" "$B$J(B/$B$K(B" nil) + ( 10 "$BL>;l(B($B$4!D$J(B/$B$K(B)" "$B$J(B/$B$K(B" nil) + ( 11 "$BL>;l(B($BI{;l(B)" ) + ( 12 "$BBeL>;l(B" ) + ( 21 "$BID;z(B" ) + ( 22 "$BL>A0(B" ) + ( 24 "$BCOL>(B" ) + ( 25 "$B8)(B/$B6hL>(B" ) + ( 26 "$BO"BN;l(B" ) + ( 27 "$B@\B3;l(B" ) + ( 29 "$B=u?t;l(B" ) + ( 30 "$B?t;l(B" ) + ( 31 "$B@\F,8l(B" ) + ( 36 "$B@\Hx8l(B" ) + ( 45 "$BI{;l(B" ) + ( 46 "$BI{;l(B2" ) + ( 60 "$B7AMF;l8l44(B" "$B$$(B" ("" "" "" "" "")) + ( 71 "$B7AMFF0;l8l44(B" "$B$K(B" ("" "" "" "" "") ) + ( 80 "$B%5JQ8l44(B" "$B$9$k(B" ("" "" "" "" "")) + ( 81 "$B%6JQ8l44(B" "$B$:$k(B" ("" "" "" "" "")) + ( 90 "$B0lCJITJQ2=It(B" "$B$k(B" ("" "" "" "" "")) + ( 91 "$B%+9T8^CJ8l44(B" "$B$/(B" ("$B$+$J$$(B" "$B$-$^$9(B" "$B$/(B" "$B$/$H$-(B" "$B$1(B")) + ( 92 "$B%,9T8^CJ8l44(B" "$B$0(B" ("$B$,$J$$(B" "$B$.$^$9(B" "" "" "")) + ( 93 "$B%59T8^CJ8l44(B" "$B$9(B" ("" "" "" "" "")) + ( 94 "$B%?9T8^CJ8l44(B" "$B$D(B" ("" "" "" "" "")) + ( 95 "$B%J9T8^CJ8l44(B" "$B$L(B" ("" "" "" "" "")) + ( 96 "$B%P9T8^CJ8l44(B" "$B$V(B" ("" "" "" "" "")) + ( 97 "$B%^9T8^CJ8l44(B" "$B$`(B" ("" "" "" "" "")) + ( 98 "$B%i9T8^CJ8l44(B" "$B$k(B" ("" "" "" "" "")) + ( 99 "$B%o9T8^CJ8l44(B" "$B$&(B" ("" "" "" "" "")) + ( 189 "$BC14A;z(B" ) + ( 190 "$BITDj(B" ) + ( 1000 "$B$=$NB>(B" ) + )) + +;;; +;;; $B<-=qJT=87O(B DicEd +;;; + +(defvar *diced-window-configuration* nil) + +(defvar *diced-dict-info* nil) + +(defvar *diced-dno* nil) + +;;;;; +;;;;; User entry : edit-dict +;;;;; + +;; predefined by wnn-egg.el +(fmakunbound 'edit-dict-item) + +(defun edit-dict () + (interactive) + (if (not (sj3-server-active-p)) + (EGG:open-sj3)) + (let*((dict-no + (menu:select-from-menu (list 'menu "$B<-=qL>(B:" egg:*dict-menu*))) + (dict-name (file-name-nondirectory + (cdr (assq dict-no egg:*usr-dict*)))) + (dict-info (KKCP:dict-info dict-no))) + (if (null dict-info) + (message "$B<-=q(B: %s $B$KEPO?$5$l$F$$$k9`L\$O$"$j$^$;$s!#(B" dict-name) + (progn + (setq *diced-dno* dict-no) + (setq *diced-window-configuration* (current-window-configuration)) + (pop-to-buffer "*Nihongo Dictionary Information*") + (setq major-mode 'diced-mode) + (setq mode-name "Diced") + (setq mode-line-buffer-identification + (concat "DictEd: " dict-name + (make-string + (max 0 (- 17 (string-width dict-name))) ? ) + )) + (sit-for 0) ;; will redislay. + ;;;(use-global-map diced-mode-map) + (use-local-map diced-mode-map) + (diced-display dict-info) + )))) + +(defun diced-redisplay () + (let ((dict-info (KKCP:dict-info *diced-dno*))) + (if (null dict-info) + (progn + (message "$B<-=q(B: %s $B$KEPO?$5$l$F$$$k9`L\$O$"$j$^$;$s!#(B" + (file-name-nondirectory + (cdr (assq *diced-dno* egg:*usr-dict*)))) + (diced-quit)) + (diced-display dict-info)))) + +(defun diced-display (dict-info) + ;;; (values (list (record yomi kanji bunpo))) + ;;; 0 1 2 + (setq *diced-dict-info* dict-info) + (setq buffer-read-only nil) + (erase-buffer) + (let ((l-yomi + (apply 'max + (mapcar (function (lambda (l) (string-width (nth 0 l)))) + dict-info))) + (l-kanji + (apply 'max + (mapcar (function (lambda (l) (string-width (nth 1 l)))) + dict-info)))) + (while dict-info + (let*((yomi (nth 0 (car dict-info))) + (kanji (nth 1 (car dict-info))) + (bunpo (nth 2 (car dict-info))) + (gobi (nth 2 (assq bunpo *sj3-bunpo-code*))) + (hinshi (nth 1 (assq bunpo *sj3-bunpo-code*)))) + + (insert " " yomi) + (if gobi (insert " " gobi)) + (insert-char ? + (- (+ l-yomi 10) (string-width yomi) + (if gobi (+ 1 (string-width gobi)) 0))) + (insert kanji) + (if gobi (insert " " gobi)) + (insert-char ? + (- (+ l-kanji 10) (string-width kanji) + (if gobi (+ 1 (string-width gobi)) 0))) + (insert hinshi ?\n) + (setq dict-info (cdr dict-info)))) + (goto-char (point-min))) + (setq buffer-read-only t)) + +(defun diced-add () + (interactive) + (diced-execute t) + (let*((kanji (egg:read-kanji-string "$B4A;z!'(B")) + (yomi (egg:read-hiragana-string "$BFI$_!'(B")) + (bunpo (menu:select-from-menu *sj3-bunpo-menu*)) + (gobi (nth 2 (assq bunpo *sj3-bunpo-code*))) + (hinshi (nth 1 (assq bunpo *sj3-bunpo-code*))) + (item (if gobi (concat kanji " " gobi) kanji)) + (item-yomi (if gobi (concat yomi " " gobi) yomi)) + (dict-name (cdr (assq *diced-dno* egg:*usr-dict*)))) + (if (notify-yes-or-no-p "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$9!#(B" + item item-yomi hinshi (file-name-nondirectory dict-name)) + (progn + (KKCP:dict-add *diced-dno* kanji yomi bunpo) + (notify "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$7$?!#(B" + item item-yomi hinshi dict-name) + (diced-redisplay))))) + +(defun diced-delete () + (interactive) + (beginning-of-line) + (if (eq (char-after) ? ) + (let ((buffer-read-only nil)) + (delete-char 1) (insert "D") (backward-char 1)))) + +(defun diced-undelete () + (interactive) + (beginning-of-line) + (if (eq (char-after) ?D) + (let ((buffer-read-only nil)) + (delete-char 1) (insert " ") (backward-char 1)) + (beep))) + +(defun diced-quit () + (interactive) + (setq buffer-read-only nil) + (erase-buffer) + (setq buffer-read-only t) + (bury-buffer (get-buffer "*Nihongo Dictionary Information*")) + (set-window-configuration *diced-window-configuration*) + ) + +(defun diced-execute (&optional display) + (interactive) + (goto-char (point-min)) + (let ((no 0)) + (while (not (eobp)) + (if (eq (char-after) ?D) + (let* ((dict-item (nth no *diced-dict-info*)) + (yomi (nth 0 dict-item)) + (kanji (nth 1 dict-item)) + (bunpo (nth 2 dict-item)) + (gobi (nth 2 (assq bunpo *sj3-bunpo-code*))) + (hinshi (nth 1 (assq bunpo *sj3-bunpo-code*))) + (dict-name (cdr (assq *diced-dno* egg:*usr-dict*))) + (item (if gobi (concat kanji " " gobi) kanji)) + (item-yomi (if gobi (concat yomi " " gobi) yomi))) + (if (notify-yes-or-no-p "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$+$i:o=|$7$^$9!#(B" + item item-yomi hinshi (file-name-nondirectory + dict-name)) + (progn + (KKCP:dict-delete *diced-dno* kanji yomi bunpo) + (notify "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$+$i:o=|$7$^$7$?!#(B" + item item-yomi hinshi dict-name) + )))) + (setq no (1+ no)) + (forward-line 1))) + (forward-line -1) + (if (not display) (diced-redisplay))) + +(defun diced-next-line () + (interactive) + (beginning-of-line) + (forward-line 1) + (if (eobp) (progn (beep) (forward-line -1)))) + +(defun diced-end-of-buffer () + (interactive) + (end-of-buffer) + (forward-line -1)) + +(defun diced-scroll-down () + (interactive) + (scroll-down) + (if (eobp) (forward-line -1))) + +(defun diced-mode () + "Mode for \"editing\" dictionaries. +In diced, you are \"editing\" a list of the entries in dictionaries. +You can move using the usual cursor motion commands. +Letters no longer insert themselves. Instead, + +Type a to Add new entry. +Type d to flag an entry for Deletion. +Type n to move cursor to Next entry. +Type p to move cursor to Previous entry. +Type q to Quit from DicEd. +Type u to Unflag an entry (remove its D flag). +Type x to eXecute the deletions requested. +" + ) + +(defvar diced-mode-map (make-sparse-keymap)) + +(dolist (elem '(("a" diced-add) + ("d" diced-delete) + ("n" diced-next-line) + ("p" previous-line) + ("q" diced-quit) + ("u" diced-undelete) + ("x" diced-execute) + + ("\C-h" help-command) + ("\C-n" diced-next-line) + ("\C-p" previous-line) + ("\C-u");; predefined by wnn-egg.el + ("\C-v" scroll-up) + + ([down] diced-next-line) + ([help] help-command) + ([next] diced-next-line) + ([prior] previous-line) + ([up] previous-line) + + ("\e<" beginning-of-buffer) + ("\e>" diced-end-of-buffer) + ("\eh");; predefined by wnn-egg.el + ("\ev" diced-scroll-down))) + (define-key diced-mode-map (car elem) (nth 1 elem))) + +;;; End of sj3-egg.el +;; 92.7.7 by Y.Kawabe -- commented out +;; (if (boundp 'SJ3) +;; (load-library "sj3fns")) --- emacs-21.2/lisp/startup.el~ 2001-11-01 13:10:34 +0000 +++ emacs-21.2/lisp/startup.el 2003-02-12 06:55:49 +0000 @@ -1151,10 +1151,18 @@ (defun fancy-splash-tail () "Insert the tail part of the splash screen into the current buffer." (let ((fg (if (eq (frame-parameter nil 'background-mode) 'dark) - "cyan" "darkblue"))) + "cyan" "darkblue")) + (version (with-temp-buffer + (insert "This is " + (mapconcat 'identity (split-string (emacs-version)) + " ")) + (let ((fill-column (- (window-width) 2)) + (fill-prefix " ")) + (fill-region (point-min) (point-max))) + (buffer-substring 9 (point-max))))) (fancy-splash-insert :face `(variable-pitch :foreground ,fg) "\nThis is " - (emacs-version) + version "\n" :face '(variable-pitch :height 0.5) "Copyright (C) 2001 Free Software Foundation, Inc."))) --- emacs-21.2/lisp/textmodes/picture.el~ 2001-07-18 09:06:38 +0000 +++ emacs-21.2/lisp/textmodes/picture.el 2003-02-12 06:55:49 +0000 @@ -163,6 +163,28 @@ (interactive) (picture-set-motion 1 0)) +;;; 89.9.7 patch by K.Handa +(defun picture-movement-wnw () + "Move up and left and left after self-inserting character in Picture mode." + (interactive) + (picture-set-motion -1 -2)) + +(defun picture-movement-ene () + "Move up and right and right after self-inserting character in Picture mode." + (interactive) + (picture-set-motion -1 2)) + +(defun picture-movement-wsw () + "Move down and left and left after self-inserting character in Picture mode." + (interactive) + (picture-set-motion 1 -2)) + +(defun picture-movement-ese () + "Move down and right and right after self-inserting character in Picture mode." + (interactive) + (picture-set-motion 1 2)) +;;; end of patch + (defun picture-movement-nw (&optional arg) "Move up and left after self-inserting character in Picture mode. With prefix argument, move up and two-column left." @@ -259,6 +281,70 @@ (picture-update-desired-column (not (eq this-command last-command))) (picture-insert last-command-event arg)) ; Always a character in this case. +;;; 89.9.7 by K.Handa +(defun picture-insert-after-hook (begin end) + "Called as a hook after a string is inserted into the current buffer. +Two arguments BEGIN and END point the head and tail of just inserted string." + (let ((str (buffer-substring begin end))) + (delete-region begin end) + (picture-insert-string str))) + +(defun picture-delete-text-in-column (from to) + "Delete the text between column FROM and TO (exclusive) of the current line. +Nil of FORM or TO means the current column. +If there's a charcter across the borders, the character is replaced with +the same width of spaces before deleting." + (save-excursion + (let (p1 p2) + (if from + (progn + (setq p1 (move-to-column from)) + (if (> p1 from) + (progn + (delete-char -1) + (insert-char ? (- p1 (current-column))) + (forward-char (- from p1)))))) + (setq p1 (point)) + (if to + (progn + (setq p2 (move-to-column to)) + (if (> p2 to) + (progn + (delete-char -1) + (insert-char ? (- p2 (current-column))) + (forward-char (- to p2)))))) + (setq p2 (point)) + (delete-region p1 p2)))) + +(defun picture-insert-string (str) ; 91.11.25, 92.7.10 by K.Handa + "Insert characters in STR one by one in place of character previously +at the cursor while moving cursor in the direction you previously specified +with the commands picture-movement-right, picture-movement-up, etc. +Do \\[command-apropos] picture-movement to see those commands." + (interactive "sInsert string: ") + (let ((len (length str))) + (if (> len 0) + (let* ((idx 0) + (c (aref str idx)) + (width (char-width c)) + clm) + (while idx ; Set to nil at the end of loop + (setq clm (current-column)) + (picture-delete-text-in-column clm (+ clm width)) + (insert c) + (forward-char -1) + (setq idx (1+ idx)) + (if (< idx len) + (setq c (aref str idx) width (char-width c)) + (setq idx nil)) + (if (/= picture-vertical-step 0) + (picture-move) + (if (> picture-horizontal-step 0) + (forward-char 1) + (move-to-column-force (- clm width)))) + ))))) +;;; end of patch + (defun picture-clear-column (arg) "Clear out ARG columns after point without moving." (interactive "p") @@ -581,11 +667,17 @@ (if (not picture-mode-map) (progn (setq picture-mode-map (make-keymap)) - (picture-substitute 'self-insert-command 'picture-self-insert) - (picture-substitute 'completion-separator-self-insert-command - 'picture-self-insert) - (picture-substitute 'completion-separator-self-insert-autofilling - 'picture-self-insert) + (let ((picture-self-insert (cond ((featurep 'canna) + 'canna-self-insert-command) + ((boundp 'EGG) ; 89.9.7 by K.Handa + 'egg-self-insert-command) + (t + 'picture-self-insert)))) + (picture-substitute 'self-insert-command picture-self-insert) + (picture-substitute 'completion-separator-self-insert-command + picture-self-insert) + (picture-substitute 'completion-separator-self-insert-autofilling + picture-self-insert)) (picture-substitute 'forward-char 'picture-forward-column) (picture-substitute 'backward-char 'picture-backward-column) (picture-substitute 'delete-char 'picture-clear-column) @@ -618,6 +710,13 @@ (define-key picture-mode-map "\C-c>" 'picture-movement-right) (define-key picture-mode-map "\C-c^" 'picture-movement-up) (define-key picture-mode-map "\C-c." 'picture-movement-down) + ;;; 89.9.7 by K.Handa + (define-key picture-mode-map "\C-ck" 'picture-insert-string) + (define-key picture-mode-map "\C-c~" 'picture-movement-wnw) + (define-key picture-mode-map "\C-c\"" 'picture-movement-ene) + (define-key picture-mode-map "\C-c?" 'picture-movement-wsw) + (define-key picture-mode-map "\C-c|" 'picture-movement-ese) + ;;; end of patch (define-key picture-mode-map "\C-c`" 'picture-movement-nw) (define-key picture-mode-map "\C-c'" 'picture-movement-ne) (define-key picture-mode-map "\C-c/" 'picture-movement-sw) @@ -633,6 +732,8 @@ (defvar picture-mode-old-mode-name) (defvar picture-mode-old-major-mode) (defvar picture-mode-old-truncate-lines) +(defvar picture-mode-old-self-insert-after-hook) +(defvar self-insert-after-hook) ;;;###autoload (defun picture-mode () @@ -715,6 +816,14 @@ (setq picture-tab-chars (default-value 'picture-tab-chars)) (make-local-variable 'picture-vertical-step) (make-local-variable 'picture-horizontal-step) + ;;; 89.9.17 patch by K.Handa + (make-local-variable 'picture-mode-old-self-insert-after-hook) + (setq picture-mode-old-self-insert-after-hook + (if (boundp 'self-insert-after-hook) + self-insert-after-hook)) + (make-local-variable 'self-insert-after-hook) + (setq self-insert-after-hook 'picture-insert-after-hook) + ;;; end of patch (make-local-variable 'picture-mode-old-truncate-lines) (setq picture-mode-old-truncate-lines truncate-lines) (setq truncate-lines t) @@ -740,6 +849,9 @@ (setq mode-name picture-mode-old-mode-name) (use-local-map picture-mode-old-local-map) (setq major-mode picture-mode-old-major-mode) + ;;; 89.9.17 patch by K.Handa + (setq self-insert-after-hook picture-mode-old-self-insert-after-hook) + ;;; end of patch (kill-local-variable 'tab-stop-list) (setq truncate-lines picture-mode-old-truncate-lines) (force-mode-line-update))) --- emacs-21.2/lisp/version.el~ 2002-03-16 10:40:07 +0000 +++ emacs-21.2/lisp/version.el 2003-02-12 06:55:49 +0000 @@ -55,8 +55,8 @@ (interactive "P") (let ((version-string (format (if (not (interactive-p)) - "GNU Emacs %s (%s%s%s)\n of %s on %s" - "GNU Emacs %s (%s%s%s) of %s on %s") + "GNU Emacs %s (%s%s%s, emcws)\n of %s on %s" + "GNU Emacs %s (%s%s%s, emcws) of %s on %s") emacs-version system-configuration (cond ((featurep 'motif) @@ -84,6 +84,12 @@ (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ? (emacs-version)) " $\n"))) +;;; Canna+Wnn+Sj3 version +(provide 'emcws) + +(defconst emcws-version "20030212" " +Version numbers of this version of Emcws.") + ;;Local variables: ;;version-control: never ;;End: --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/wnn-client.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,1176 @@ +;; Wnn3 server interface for Egg +;; Coded by S.Tomura, Electrotechnical Lab. (tomura@etl.go.jp) + +;; This file is part of Egg on Mule (Multilingual Environment) + +;; Egg is distributed in the forms of patches to GNU +;; Emacs under the terms of the GNU EMACS GENERAL PUBLIC +;; LICENSE which is distributed along with GNU Emacs by the +;; Free Software Foundation. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for +;; more details. + +;; You should have received a copy of the GNU EMACS GENERAL +;; PUBLIC LICENSE along with Nemacs; see the file COPYING. +;; If not, write to the Free Software Foundation, 675 Mass +;; Ave, Cambridge, MA 02139, USA. + +;;; +;;; Nemacs - Wnn V3 server interface in elisp +;;; + +;;; 93.4.6 modified for Mule Ver.0.9.7.1 +;;; by T.Saneto +;;; Bug in wnn-bunsetu-yomi-equal fixed. + +(provide 'wnn-client) + +;;; +;;; Wnn deamon command constants +;;; + +(defconst JD_OPEN_IN 9 "$BJQ49(B") ;;; V3.0 +(defconst JD_OPEN 1 "$BMxMQpJs(B") ;;; 0x26 +(defconst JD_DICSTAT 39 "") ;;; 0x27 V3.0 + +(defconst JD_WDEL 49 "$BC18l:o=|(B") ;;; 0x31 +(defconst JD_WSCH 50 "$BC18l8!:w(B") ;;; 0x32 +(defconst JD_WREG 51 "$BC18lEPO?(B") ;;; 0x33 +(defconst JD_WHDEL 52 "") ;;; 0x34 + +(defconst JD_SETEVF 65 "$BJQ49J}<0JQ99(B") ;;; 0x41 +(defconst JD_GETEVF 66 "$BJQ49J}<0>pJs(B") ;;; 0x42 + +(defconst JD_MKDIR 81 "") ;;; 0x51 V3.0 +(defconst JD_ACCESS 82 "") ;;; 0x52 V3.0 +(defconst JD_WHO 83 "$BMxMQ$,;XDj$5$l$F$$$^$;$s!#(B") + (8 :WNN_HINDO_FILE_NOT_SPECIFIED + "$B%7%9%F%`<-=q$KBP$7$F!"IQEY%U%!%$%k$N;XDj$,$"$j$^$;$s!#(B") + (9 :WNN_JISHOTABLE_FULL + "$B<-=q%F!<%V%k$,0lGU$G$9!#(B") + (10 :WNN_HINDO_NO_MATCH + "$BIQEY%U%!%$%k$,!";XDj$5$l$?<-=q$NIQEY%U%!%$%k$G$O$"$j$^$;$s!#(B") + (11 :WNN_PARAMR + "$B%U%!%$%k$NFI$_9~$_8"8B$,$"$j$^$;$s!#(B") + (12 :WNN_HJT_FULL + "$B%0%m!<%P%kIQEY%F!<%V%k$,0lGU$G$9!#(B") + (13 :WNN_JT_FULL + "$B%0%m!<%P%k<-=q%F!<%V%k$,0lGU$G$9!#(B") + (15 :WNN_PARAMW + "$B%U%!%$%k$KBP$9$k=q$-9~$_8"8B$,$"$j$^$;$s!#(B") + (16 :WNN_OPENF_ERR + "$B%U%!%$%k$,%*!<%W%s$G$-$^$;$s!#(B") +;;; $B<-=q:o=|4X78$N%(%i!<(B + (20 :WNN_DICT_NOT_USED + "$B$=$NHV9f$N<-=q$O!";H$o$l$F$$$^$;$s!#(B") +;;; $B%f!<%6!<<-=qJQ994X78$N%(%i!<(B +;;; +;;;WNN_DICT_NOT_USED +;;; + (21 :WNN_NOT_A_USERDICT + "$B;XDj$5$l$F<-=q$O!"%f!<%6!<<-=q$G$O$"$j$^$;$s!#(B") + (22 :WNN_READONLY + "$B%j!<%I%*%s%j!<$N<-=q$O!"%+%l%s%H%f!<%6!<<-=q$K$O$G$-$^$;$s!#(B") +;;; $B<-=q%;!<%V4X78$N%(%i!<(B +;;; +;;; WNN_PARAMW +;;; WNN_OPENF_ERR +;;; $BJQ49;~$N%(%i!<(B +;;; jishobiki.c + (30 :WNN_JMT_FULL + "$B<-=q%F!<%V%k$,$"$U$l$F$$$^$9!#(B ") + + (31 :WNN_LONG_MOJIRETSU + "$BJQ49$7$h$&$H$9$kJ8;zNs$,D92a$.$^$9!#(B") + (32 :WNN_WKAREA_FULL + "$BIUB08l2r@ONN0h$,ITB-$7$F$$$^$9!#(B") + (33 :WNN_KAREA_FULL + "$B2r@ONN0h$,ITB-$7$F$$$^$9!#(B") + +;;; $BC18lEPO?;~$N%(%i!<(B + (40 :WNN_YOMI_LONG + "$BFI$_$,D92a$.$^$9!#(B") + (41 :WNN_KANJI_LONG + "$B4A;z$,D92a$.$^$9!#(B") + (42 :WNN_BAD_YOMI + "$BFI$_$KITE,Ev$JJ8;z$,4^$^$l$F$$$^$9!#(B") + (43 :WNN_NO_YOMI + "$BFI$_$ND9$5$,(B0$B$G$9!#(B") + (44 :WNN_NO_CURRENT + "$B%+%l%s%H<-=q$,B8:_$7$^$;$s!#(B") + (45 :WNN_RDONLY + "$B%j!<%I%*%s%j!<$N<-=q$KEPO?$7$h$&$H$7$^$7$?!#(B") + +;;; $BC18l:o=|;~!"IJ;l:o=|;~$N%(%i!<(B +;;; +;;;WNN_NO_CURRENT +;;;WNN_RDONLY +;;; + (50 :WNN_WORD_NO_EXIST + "$B;XDj$5$l$?C18l$,B8:_$7$^$;$s!#(B") + +;;; $B$,$J$$(B ") + (82 :WNN_BAD_HOST + " $B%[%9%HL>$,$J$$(B ") + )) + +(defun wnn-error-symbol (code) + (let ((pair (assoc code *wnn-error-alist*))) + (if (null pair) + (list ':wnn-unknown-error-code code) + (car (cdr pair))))) --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/lisp/wnn-egg.el 2003-02-12 06:55:49 +0000 @@ -0,0 +1,1976 @@ +;;; wnn-egg.el --- a inputting method communicating with [jck]server + +;; Author: Satoru Tomura (tomura@etl.go.jp), and +;; Toshiaki Shingu (shingu@cpr.canon.co.jp) +;; Keywords: inputting method + +;; This file is part of Egg on Mule (Multilingual Environment) + +;; Egg is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; Egg is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Commentary: + +;;; Modified for Wnn V4 and Wnn6 by Satoru Tomura(tomura@etl.go.jp) +;;; Modified for Wnn6 by OMRON +;;; Written by Toshiaki Shingu (shingu@cpr.canon.co.jp) +;;; Modified for Wnn V4 library on wnn4v3-egg.el + +;;; $B$?$^$4!V$?$+$J!W%P!<%8%g%s(B +;;; $B!V$?$+$J!W$H$ODR$1J*$N$?$+$J$G$O$"$j$^$;$s!#(B +;;; $B!V$?$^$4$h!?$+$7$3$/!?$J!$7$^$7$?!#(B +;;; Wnn V4 $B$N(B jl $B%i%$%V%i%j$r;H$$$^$9!#(B +;;; $B%i%$%V%i%j$H$N%$%s%?!<%U%'!<%9$O(B wnnfns.c $B$GDj5A$5$l$F$$$^$9!#(B + +;;; $B=$@5%a%b(B + +;;; 94/2/3 kWnn support by H.Kuribayashi +;;; 93/11/24 henkan-select-kouho: bug fixed +;;; 93/7/22 hinsi-from-menu updated +;;; 93/5/12 remove-regexp-in-string +;;; fixed by Shuji NARAZAKI +;;; 93/4/22 set-wnn-host-name, set-cwnn-host-name +;;; 93/4/5 EGG:open-wnn, close-wnn modified by tsuiki. +;;; 93/4/2 wnn-param-set +;;; 93/4/2 modified along with wnn4fns.c +;;; 93/3/3 edit-dict-item: bug fixed +;;; 93/1/8 henkan-help-command modified. +;;; 92/12/1 buffer local 'wnn-server-type' and 'cwnn-zhuyin' +;;; so as to support individual its mode with multiple buffers. +;;; 92/11/26 set-cserver-host-name fixed. +;;; 92/11/26 its:{previous,next}-mode by +;;; 92/11/25 set-wnn-host-name was changed to set-{j,c}server-host-name. +;;; 92/11/25 redefined its:select-mode and its:select-mode-from-menu +;;; defined in egg.el to run hook with its mode selection. +;;; 92/11/20 bug fixed related to henkan mode attribute. +;;; 92/11/12 get-wnn-host-name and set-wnn-host-name were changed. +;;; 92/11/10 (set-dict-comment) bug fixed +;;; 92/10/27 (henkan-region-internal) display message if error occurs. +;;; 92/9/28 completely modified for chinese trandlation. +;;; 92/9/28 diced-{use,hindo-set} bug fixed +;;; 92/9/22 touroku-henkan-mode by +;;; 92/9/18 rewrite wnn-dict-add to support password files. +;;; 92/9/8 henkan-region-internal was modified. +;;; 92/9/8 henkan-mode-map " " 'henkan-next-kouho-dai -> 'henkan-next-kouho +;;; 92/9/7 henkan-mode-map "\C-h" 'help-command -> 'henkan-help-command (Shuji Narazaki) +;;; 92/9/3 wnn-server-get-msg without wnn-error-code. +;;; 92/9/3 get-wnn-lang-name was modified. +;;; 92/8/19 get-wnn-lang-name $B$NJQ99(B (by T.Matsuzawa) +;;; 92/8/5 Bug in henkan-kakutei-first-char fixed. (by Y.Kasai) +;;; 92/7/17 set-egg-henkan-format $B$NJQ99(B +;;; 92/7/17 egg:error $B$N0z?t$r(B format &rest args $B$KJQ99(B +;;; 92/7/17 henkan/gyaku-henkan-word $B$N=$@5(B +;;; 92/7/17 henkan/gyaku-henkan-paragraph/sentence/word $B$G!"(B +;;; $BI=<($,Mp$l$k$N$r=$@5!J(Bsave-excursion $B$r$O$:$9!K(B +;;; 92.7.14 Unnecessary '*' in comments of variables deleted. (by T.Ito) +;;; 92/7/10 henkan-kakutei-first-char $B$rDI2C!"(BC-@ $B$K3d$jEv$F!#(B(by K.Handa) +;;; 92/7/8 overwrite-mode $B$N%5%]!<%H(B(by K. Handa) +;;; 92/6/30 startup file $B<~$j$NJQ99(B +;;; 92/6/30 $BJQ49%b!<%I$N%"%H%j%S%e!<%H$K(B bold $B$rDI2C(B +;;; (by ITO Toshiyuki ) +;;; 92/6/22 $B6uJ8;zNs$rJQ49$9$k$HMn$A$k%P%0$r=$@5(B +;;; 92/5/20 set-egg-henkan-mode-format $B$N(B bug fix +;;; 92/5/20 egg:set-bunsetu-attribute $B$,BgJ8@a$G@5$7$/F0$/$h$&$KJQ99(B +;;; 92/5/19 version 0 +;;; ---------------------------------------------------------------- + +;;; Code: + +(make-variable-buffer-local 'wnn-server-type) +(make-variable-buffer-local 'cwnn-zhuyin) + +(defvar egg:*sho-bunsetu-face* nil "*$B>.J8@aI=<($KMQ$$$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*sho-bunsetu-overlay* nil "$B>.J8@a$NI=<($K;H$&(B overlay")) + +(defvar egg:*sho-bunsetu-kugiri* "-" "*$B>.J8@a$N6h@Z$j$r<($9J8;zNs(B") + +(defvar egg:*dai-bunsetu-face* nil "*$BBgJ8@aI=<($KMQ$$$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*dai-bunsetu-overlay* nil "$BBgJ8@a$NI=<($K;H$&(B overlay")) + +(defvar egg:*dai-bunsetu-kugiri* " " "*$BBgJ8@a$N6h@Z$j$r<($9J8;zNs(B") + +(defvar egg:*henkan-face* nil "*$BJQ49NN0h$rI=<($9$k(B face $B$^$?$O(B nil") +(make-variable-buffer-local + (defvar egg:*henkan-overlay* nil "$BJQ49NN0h$NI=<($K;H$&(B overlay")) + +(defvar egg:*henkan-open* "|" "*$BJQ49$N;OE@$r<($9J8;zNs(B") +(defvar egg:*henkan-close* "|" "*$BJQ49$N=*E@$r<($9J8;zNs(B") + +(make-variable-buffer-local + (defvar egg:henkan-mode-in-use nil "buffer $B$,JQ49Cf$N;~(B t")) + +;;; ---------------------------------------------------------------- +;;; $B0J2<$N(B its mode $B4X78$N4X?t$O!"(Begg.el $B$GDj5A$5$l$F$$$k$,!"(B +;;; $B$?$+$J$G$O(B its mode $B$N@ZBX$($KF14|$7$F!"(Bjserver/cserver, +;;; pinyin/zhuyin $B$N@ZBX$($b9T$J$$$?$$$N$G!":FDj5A$7$F$$$k!#(B +;;; $B=>$C$F!"(Begg.el, wnn-egg.el $B$N=g$K%m!<%I$7$J$1$l$P$J$i$J$$!#(B + + +(defun its:select-mode (name) + (interactive (list (completing-read "ITS mode: " its:*mode-alist*))) + (if (its:get-mode-map name) + (progn + (setq its:*current-map* (its:get-mode-map name)) + (egg:mode-line-display) + (run-hooks 'its:select-mode-hook)) + (beep)) + ) + +(defun its:select-mode-from-menu () + (interactive) + (setcar (nthcdr 2 its:*select-mode-menu*) its:*mode-alist*) + (setq its:*current-map* (menu:select-from-menu its:*select-mode-menu*)) + (egg:mode-line-display) + (run-hooks 'its:select-mode-hook)) + +(defvar its:select-mode-hook + (function + (lambda () + (cond ((eq its:*current-map* (its:get-mode-map "roma-kana")) + (setq wnn-server-type 'jserver)) + ((eq its:*current-map* (its:get-mode-map "PinYin")) + (setq wnn-server-type 'cserver) + (setq cwnn-zhuyin nil)) + ((eq its:*current-map* (its:get-mode-map "zhuyin")) + (setq wnn-server-type 'cserver) + (setq cwnn-zhuyin t)) + ((eq its:*current-map* (its:get-mode-map "hangul")) + (setq wnn-server-type 'kserver)) + )))) + +(defun its:next-mode () + (interactive) + (let ((pos (its:find its:*current-map* its:*standard-modes*))) + (setq its:*current-map* + (nth (% (1+ pos) (length its:*standard-modes*)) + its:*standard-modes*)) + (egg:mode-line-display) + (run-hooks 'its:select-mode-hook))) + +(defun its:previous-mode () + (interactive) + (let ((pos (its:find its:*current-map* its:*standard-modes*))) + (setq its:*current-map* + (nth (1- (if (= pos 0) (length its:*standard-modes*) pos)) + its:*standard-modes*)) + (egg:mode-line-display) + (run-hooks 'its:select-mode-hook))) + +(defun read-current-its-string (prompt &optional initial-input henkan) + (if henkan + (read-from-minibuffer prompt initial-input) + (egg:read-hiragana-string prompt initial-input))) + +;;;---------------------------------------------------------------------- +;;; +;;; Kana Kanji Henkan +;;; +;;;---------------------------------------------------------------------- + +(defvar wnn-host-name nil "Jserver host name currently connected") +(defvar cwnn-host-name nil "Cserver host name currently connected") +(defvar kwnn-host-name nil "Kserver host name currently connected") +(defvar jserver-list nil "*List of jserver host name") +(defvar cserver-list nil "*List of cserver host name") +(defvar kserver-list nil "*List of kserver host name") +(defvar jserver-host-name nil) + +(defvar egg:*sai-henkan-start* nil) +(defvar egg:*sai-henkan-end* nil) +(defvar egg:*old-bunsetu-suu* nil) + +(defun wnn-egg:kill-emacs-function () + (let ((wnn-server-type)) + (setq wnn-server-type 'jserver) + (close-wnn) + (setq wnn-server-type 'cserver) + (close-wnn) + (setq wnn-server-type 'kserver) + (close-wnn))) + +(add-hook 'kill-emacs-hook 'wnn-egg:kill-emacs-function) + +(defun egg:error (form &rest mesg) + (apply 'notify (or form "%s") mesg) + (apply 'error (or form "%s") mesg)) + +(defun egg:msg-get (message) + (or + (nth 1 (assoc message (nth 1 (assoc wnn-server-type *egg-message-alist*)))) + (format "No message. Check *egg-message-alist* %s %s" + wnn-server-type message))) + +(defvar *egg-message-alist* + '((jserver + ((open-wnn "$B%[%9%H(B %s $B$N(B Wnn $B$r5/F0$7$^$7$?(B") + (no-rcfile "%s $B>e$K(B egg-startup-file $B$,$"$j$^$;$s!#(B") + (file-saved "Wnn$B$NIQEY>pJs!&<-=q>pJs$rB`Hr$7$^$7$?!#(B") + (henkan-mode-indicator "$B4A(B") + (begin-henkan "$BJQ493+;OJ8;zNs(B: ") + (end-henkan "$BJQ49=*N;J8;zNs(B: ") + (kugiri-dai "$BBgJ8@a6h@Z$jJ8;zNs(B: ") + (kugiri-sho "$B>.J8@a6h@Z$jJ8;zNs(B: ") + (face-henkan "$BJQ496h4VI=<(B0@-(B: ") + (face-dai "$BBgJ8@a6h4VI=<(B0@-(B: ") + (face-sho "$B>.J8@a6h4VI=<(B0@-(B: ") + (jikouho "$BA0J8@a(B\t\\[henkan-forward-bunsetu]\t$BD>8eJ8@a(B +$BJQ49JQ99(B + $BBgJ8@a.J8@a.J8@a?-$7(B \\[henkan-bunsetu-nobasi-sho] \t$B>.J8@a=L$a(B \\[henkan-bunsetu-chijime-sho] + $BBgJ8@aJQ498uJdA*Br(B \\[henkan-select-kouho-dai] \t$B>.J8@aJQ498uJdA*Br(B \\[henkan-select-kouho-sho] +$BJQ493NDj(B + $BA4J8@a3NDj(B \\[henkan-kakutei] \t$BD>A0J8@a$^$G3NDj(B \\[henkan-kakutei-before-point] +$BJQ49Cf;_(B \\[henkan-quit] +") + (hinsimei "$BIJ;lL>(B:") + (jishotouroku-yomi "$B<-=qEPO?!X(B%s$B!Y(B $BFI$_(B :") + (touroku-jishomei "$BEPO?<-=qL>(B:" ) + (registerd "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$7$?!#(B" ) + (yomi "$B$h$_!'(B") +; (no-yomi "$B!X(B%s$B!Y$N<-=q9`L\$O$"$j$^$;$s!#(B") + (no-yomi "$B<-=q9`L\!X(B%s$B!Y$O$"$j$^$;$s!#(B") + (jisho "$B<-=q!'(B") + (hindo " $BIQEY!'(B") + (kanji "$B4A;z!'(B") + (register-notify "$B<-=q9`L\!X(B%s$B!Y(B(%s: %s)$B$r(B%s$B$KEPO?$7$^$9!#(B") + (cannot-remove "$B%7%9%F%`<-=q9`L\$O:o=|$G$-$^$;$s!#(B") + (enter-hindo "$BIQEY$rF~$l$F2<$5$$(B: ") + (remove-notify "$B<-=q9`L\(B%s(%s)$B$r(B%s$B$+$i:o=|$7$^$9!#(B") + (removed "$B<-=q9`L\(B%s(%s)$B$r(B%s$B$+$i:o=|$7$^$7$?!#(B") + (jishomei "$B<-=qL>(B:" ) + (comment "$B%3%a%s%H(B: ") + (jisho-comment "$B<-=q(B:%s: $B%3%a%s%H(B:%s") + (param ("$B#N(B ( $BBg(B ) $BJ8@a2r@O$N#N(B" + "$BBgJ8@aCf$N>.J8@a$N:GBg?t(B" + "$B448l$NIQEY$N%Q%i%a!<%?(B" + "$B>.J8@aD9$N%Q%i%a!<%?(B" + "$B448lD9$N%Q%i%a!<%?(B" + "$B:#;H$C$?$h%S%C%H$N%Q%i%a!<%?(B" + "$B<-=q$N%Q%i%a!<%?(B" + "$B>.J8@a$NI>2ACM$N%Q%i%a!<%?(B" + "$BBgJ8@aD9$N%Q%i%a!<%?(B" + "$B>.J8@a?t$N%Q%i%a!<%?(B" + "$B5?;wIJ;l(B $B?t;z$NIQEY(B" + "$B5?;wIJ;l(B $B%+%J$NIQEY(B" + "$B5?;wIJ;l(B $B1Q?t$NIQEY(B" + "$B5?;wIJ;l(B $B5-9f$NIQEY(B" + "$B5?;wIJ;l(B $BJD3g8L$NIQEY(B" + "$B5?;wIJ;l(B $BIUB08l$NIQEY(B" + "$B5?;wIJ;l(B $B3+3g8L$NIQEY(B")) + )) + (cserver + ((open-wnn "Host %s $AIO5D(B cWnn $ARQ>-Fp6/AK(B") + (no-rcfile "$ATZ(B%s $AIOC;SP(B egg-startup-file") + (file-saved "Wnn$A5DF56HND<~:M4G5dPEO"RQ>-MK3vAK(B") + (henkan-mode-indicator "$A::(B") + (begin-henkan "$A1d;;?*JJtPT(B: ") + (face-dai "$A4JWiGxJtPT(B: ") + (face-sho "$A5%4JGxJtPT(B: ") + (jikouho "$A4N:nQ!(B:") + (off-msg "%s %s(%s:%s)$ARQ1;(B off $A5tAK(B") + (henkan-help "$A::WV1d;;D#J=(B: +$A4JWiRF6/(B + \\[henkan-first-bunsetu]\t$AOHM74JWi(B\t\\[henkan-last-bunsetu]\t$A=aN24JWi(B + \\[henkan-backward-bunsetu]\t$AG0R;8v4JWi(B\t\\[henkan-forward-bunsetu]\t$AOBR;8v4JWi(B +$A1d;;1d8|(B + $A4JWi4N:nQ!(B \\[henkan-next-kouho-dai]\t$A5%4J4N:nQ!(B \\[henkan-next-kouho-sho] + $AG0:nQ!(B \\[henkan-previous-kouho] \t$A4N:nQ!(B \\[henkan-next-kouho] + $A4JWi@)U9(B \\[henkan-bunsetu-nobasi-dai] \t$A4JWiJUKu(B \\[henkan-bunsetu-chijime-dai] + $A5%4J@)U9(B \\[henkan-bunsetu-nobasi-sho] \t$A5%4JJUKu(B \\[henkan-bunsetu-chijime-sho] + $A4JWi1d;;:r295DQ!Tq(B \\[henkan-select-kouho-dai] \t$A5%4J1d;;:r295DQ!Tq(B \\[henkan-select-kouho-sho] + $A1d;;:r295DQ!Tq(B \\[henkan-select-kouho-dai] +$A1d;;H76((B + $AH+NDH76((B \\[henkan-kakutei] \t$AIOR;4JWiN*V95DH76((B \\[henkan-kakutei-before-point] +$AM#V91d;;(B \\[henkan-quit] +") + (hinsimei "$A4JPTC{(B:") + (jishotouroku-yomi "$A4G5d5GB-4S(B%s$AVPO{3}AK(B") + (jishomei "$A4G5dC{(B:" ) + (comment "$AW"JM(B: ") + (jisho-comment "$A4G5d(B:%s: $AW"JM(B:%s") + (param ("$A=bNv4JWi8vJ}(B" + "$A4JWiVP4J5DWn4s8vJ}(B" + "$AF56HH(V5(B" + "$A4J3$6HH(V5(B" + "$AKDIyU}H76HH(V5(B" + "$A8U2ESC9}H(V5(B" + "$AWV5dSEOH<6H(V5(B" + "$A4JF@<[>yV5H(V5(B" + "$A4JWi3$H(V5(B" + "$A4JWiVP4JJ}H(V5(B" + "$AJ}WV5DF56H(B" + "$AS"NDWVD85DF56H(B" + "$A4O4Y(B.") + (no-rcfile "%s $(C?!(B egg-startup-file $(C@L(B $(C>x@>4O4Y(B.") + (file-saved "kWnn $(C@G(B $(C^:SxoW\C!$^vnpoW\C8&(B $(C?E0e@>4O4Y(B.") + (henkan-mode-indicator "$(CyS(B") + (begin-henkan "$(C\(|5(B $(CKRc7(B $(CY~m.fj(B: ") + (end-henkan "$(C\(|5(B $(Cp{Vu(B $(CY~m.fj(B: ") + (kugiri-dai "$(CS^Y~o=(B $(CO!\,(B $(CY~m.fj(B: ") + (kugiri-sho "$(Ca3Y~o=(B $(CO!\,(B $(CY~m.fj(B: ") + (face-henkan "$(C\(|5(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ") + (face-dai "$(CS^Y~o=(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ") + (face-sho "$(Ca3Y~o=(B $(CO!J`(B $(CxvcF(B $(CaU`u(B: ") + (jikouho "$(C4Y@=(B $(C}&\M(B:") + (off-msg "%s %s(%s:%s)$(C@;(B off $(CG_@>4O4Y(B.") + (henkan-help "$(CySm.(B $(C\(|5(B $(C8p5e(B: +$(CY~o=(B $(Cl9TQ(B + \\[henkan-first-bunsetu]\t$(C`;Ti(B $(CY~o=(B\t\\[henkan-last-bunsetu]\t$(C}-Z-(B $(CY~o=(B + \\[henkan-backward-bunsetu]\t$(CrAnq(B $(CY~o=(B\t\\[henkan-forward-bunsetu]\t$(CrA}-(B $(CY~o=(B +$(C\(|5(B $(C\(LZ(B + $(CS^Y~o=(B $(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho-dai]\t$(Ca3Y~o=(B $(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho-sho] + $(Cnq(B $(C}&\M(B \\[henkan-previous-kouho] \t$(C4Y@=(B $(C}&\M(B \\[henkan-next-kouho] + $(CS^Y~o=(B $(C|*S^(B \\[henkan-bunsetu-nobasi-dai] \t$(CS^Y~o=(B $(Cuja3(B \\[henkan-bunsetu-chijime-dai] + $(Ca3Y~o=(B $(C|*S^(B \\[henkan-bunsetu-nobasi-sho] \t$(Ca3Y~o=(B $(Cuja3(B \\[henkan-bunsetu-chijime-sho] + $(CS^Y~o=(B $(C\(|5(B $(C4Y@=(B $(C}&\M(B \\[henkan-select-kouho-dai] \t$(Ca3Y~o=(B $(C\(|5(B $(C4Y@=(B $(C}&\M(B \\[henkan-select-kouho-sho] +$(C\(|5(B $(C|,oR(B + $(CnoY~o=(B $(C|,oR(B \\[henkan-kakutei] \t$(CrAnq(B $(CY~o=1nAv(B $(C|,oR(B \\[henkan-kakutei-before-point] +$(C\(|5(B $(Cqir-(B \\[henkan-quit] +") + (hinsimei "$(Cy!^rY#(B: ") + (jishotouroku-yomi "$(C^vnp(B $(CTtVb!:(B%s$(C!;(B $(CGQ1[(B: ") + (touroku-jishomei "$(CTtVb(B $(C^vnpY#(B: " ) + (registerd "$(C^vnp(B $(Cz#YM!:(B%s$(C!;(B(%s: %s)$(C@;(B %s$(C?!(B $(CTtVbG_@>4O4Y(B." ) + (yomi "$(CGQ1[(B: ") +; (no-yomi "$(C!:(B%s$(C!;@G(B $(C^vnp(B $(Cz#YM@L(B $(C>x@>4O4Y(B.") + (no-yomi "$(C^vnp(B $(Cz#YM(B $(C!:(B%s$(C!;@L(B $(C>x@>4O4Y(B.") + (jisho "$(C^vnp(B: ") + (hindo " $(C^:Sx(B: ") + (kanji "$(CySm.(B: ") + (register-notify "$(C^vnp(B $(Cz#YM(B $(C!:(B%s$(C!;(B(%s: %s)$(C@;(B %s$(C?!(B $(CTtVbGO0Z@>4O4Y(B.") + (cannot-remove "$(C=C=:E[(B $(C^vnpz#YM@:(B $(Cax@>4O4Y(B.") + (enter-hindo "$(C^:Sx8&(B $(Cl}UtGO=J=C?@(B: ") + (remove-notify "$(C^vnpz#YM(B %s(%s)$(C@;(B %s$(C:NEM(B $(Ca4O4Y(B.") + (removed "$(C^vnp(B $(Cz#YM(B %s(%s)$(C@;(B %s$(C:NEM(B $(Ca4O4Y(B.") + (jishomei "$(C^vnpY#(B: " ) + (comment "$(CqI`7(B: ") + (jisho-comment "$(C^vnp(B:%s: $(CqI`7(B:%s") + (param ("N ($(CS^(B)$(CY~o=(B $(Cz0`0@G(B N" + "$(CS^Y~o=(B $(C>H@G(B $(Ca3Y~o=(B $(C4O4Y(B $(C:qF.(B $(CFP7/9LEM(B" + "$(C^vnp@G(B $(CFP7/9LEM(B" + "$(Ca3Y~o=@G(B $(CxDJ$v7(B $(CFP7/9LEM(B" + "$(CS^Y~o=(B $(C1f@L(B $(CFP7/9LEM(B" + "$(Ca3Y~o=(B $(Cb&(B $(CFP7/9LEM(B" + "$(CJ#_L(B $(Cy!^r(B: $(Cb&m.@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(CGQ1[@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(CgHb&m.@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(CQ@{\@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(CxMN@{A@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(C]>aUe^@G(B $(C^:Sx(B" + "$(CJ#_L(B $(Cy!^r(B: $(CKRN@{A@G(B $(C^:Sx(B")) + )) + )) + + +;;; +;;; Entry functions for egg-startup-file +;;; + +;(defvar wnn-lang-name nil) +;(defvar default-wnn-lang-name "ja_JP") ; 92.8.19 by T.Matsuzawa + +(defvar skip-wnn-setenv-if-env-exist nil + "skip wnn environment setting when the same name environment exists") + +(defmacro push-end (val loc) + (list 'push-end-internal val (list 'quote loc))) + +(defun push-end-internal (val loc) + (set loc + (if (eval loc) + (nconc (eval loc) (cons val nil)) + (cons val nil)))) + +(defun is-wnn6-server () + (= (wnn-server-version) 61697)) + +(defun is-wnn7-server () + (= (wnn-server-version) 61698)) + +(defun add-wnn-dict (dfile hfile priority dmode hmode &optional dpaswd hpaswd) +; (open-wnn-if-disconnected) + (if (null (wnn-server-dict-add + (substitute-in-file-name dfile) + (substitute-in-file-name hfile) + priority dmode hmode dpaswd hpaswd)) + (egg:error (wnn-server-get-msg)))) + +(defun set-wnn-fuzokugo (ffile) +; (open-wnn-if-disconnected) + (if (null (wnn-server-fuzokugo-set (substitute-in-file-name ffile))) + (egg:error (wnn-server-get-msg)))) + +(defun set-wnn-param (&rest param) + (interactive) +; (open-wnn-if-disconnected) + (let ((current-param (wnn-server-get-param)) + (new-param) + (message (egg:msg-get 'param))) + (while current-param + (setq new-param + (cons + (if (or (null param) (null (car param))) + (string-to-int + (read-from-minibuffer (concat (car message) ": ") + (int-to-string (car current-param)))) + (car param)) + new-param)) + (setq current-param (cdr current-param) + message (cdr message) + param (if param (cdr param) nil))) + (apply 'wnn-server-set-param (nreverse new-param)))) + +;; +;; for Wnn6 +;; +(defun add-wnn-fisys-dict (dfile hfile hmode &optional hpaswd) +; (open-wnn-if-disconnected) + (if (null (wnn-server-fisys-dict-add + (substitute-in-file-name dfile) + (substitute-in-file-name hfile) + hmode hpaswd)) + (egg:error (wnn-server-get-msg)))) + +(defun add-wnn-fiusr-dict (dfile hfile dmode hmode &optional dpaswd hpaswd) +; (open-wnn-if-disconnected) + (if (null (wnn-server-fiusr-dict-add + (substitute-in-file-name dfile) + (substitute-in-file-name hfile) + dmode hmode dpaswd hpaswd)) + (egg:error (wnn-server-get-msg)))) + +(defun add-wnn-notrans-dict (dfile priority dmode &optional dpaswd) +; (open-wnn-if-disconnected) + (if (null (wnn-server-notrans-dict-add + (substitute-in-file-name dfile) + priority dmode dpaswd)) + (egg:error (wnn-server-get-msg)))) + +(defun add-wnn-bmodify-dict (dfile priority dmode &optional dpaswd) +; (open-wnn-if-disconnected) + (if (null (wnn-server-bmodify-dict-add + (substitute-in-file-name dfile) + priority dmode dpaswd)) + (egg:error (wnn-server-get-msg)))) + +(defun set-last-is-first-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-last-is-first + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-complex-conv-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-complex-conv-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-okuri-learn-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-okuri-learn-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-okuri-flag (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-okuri-flag + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-prefix-learn-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-prefix-learn-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-prefix-flag (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-prefix-flag + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-suffix-learn-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-suffix-learn-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-common-learn-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-common-learn-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-freq-func-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-freq-func-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-numeric-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-numeric-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-alphabet-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-alphabet-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-symbol-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-symbol-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun set-yuragi-mode (mode) +; (open-wnn-if-disconnected) + (if (null (wnn-server-set-yuragi-mode + mode)) + (egg:error (wnn-server-get-msg)))) + +(defun wnn6-reset-prev-info () +; (open-wnn-if-disconnected) + (if (null (wnn-reset-previous-info)) + (egg:error (wnn-server-get-msg)))) + +;; +;; for Wnn7 +;; +(defun wnn7-set-boin-kabusoku (mode) + (or (wnn-boin-kabusoku mode) + (egg:error (wnn-server-get-msg)))) + +(defun wnn7-set-shiin-choka (mode) + (or (wnn-shiin-choka mode) + (egg:error (wnn-server-get-msg)))) + +(defun wnn7-set-n-choka (mode) + (or (wnn-n-choka mode) + (egg:error (wnn-server-get-msg)))) + +(defun wnn7-set-nihongo-kosei (mode) + (or (wnn-nihongo-kosei mode) + (egg:error (wnn-server-get-msg)))) + +(defun wnn7-henkan-synonym () ;from wnn7egg-cnv.el + (interactive) + ;;(setq wnn7-rensou-touroku t) ;prediction not implemented + ;(setq *zenkouho-offset* (bunsetu-kouho-number *bunsetu-number* nil)) + (if ;(wnn7-server-synonym *bunsetu-number* *zenkouho-offset* egg:*dai*) + (setq *zenkouho-offset* (wnn-server-synonym *bunsetu-number* egg:*dai*)) + (henkan-select-kouho-dai) + (egg:error (wnn-server-get-msg)))) + +;;; +;;; WNN interface +;;; + +(defmacro make-host-list (name list) + `(cons ,name (delete ,name ,list))) + +(defun set-wnn-host-name (name) + (interactive "sHost name: ") + (let ((wnn-server-type 'jserver)) (close-wnn)) + (setq jserver-list + (make-host-list + name (or jserver-list (list (or wnn-host-name + jserver-host-name + (getenv "JSERVER") + "localhost")))))) + +(defalias 'set-jserver-host-name 'set-wnn-host-name) + +(defun set-cwnn-host-name (name) + (interactive "sHost name: ") + (let ((wnn-server-type 'cserver)) (close-wnn)) + (setq cserver-list + (make-host-list + name (or cserver-list (list (or cwnn-host-name + (getenv "CSERVER") + "localhost")))))) + +(defalias 'set-cserver-host-name 'set-cwnn-host-name) + +(defun set-kwnn-host-name (name) + (interactive "sHost name: ") + (let ((wnn-server-type 'kserver)) (close-wnn)) + (setq kserver-list + (make-host-list + name (or kserver-list (list (or kwnn-host-name + (getenv "KSERVER") + "localhost")))))) + +(defalias 'set-kserver-host-name 'set-kwnn-host-name) + +(defun open-wnn-if-disconnected () + (if (null (wnn-server-isconnect)) + (let ((hostlist + (cond ((eq wnn-server-type 'jserver) + (or jserver-list + (list (or wnn-host-name + jserver-host-name + (getenv "JSERVER") + "localhost")))) + ((eq wnn-server-type 'cserver) + (or cserver-list + (list (or cwnn-host-name + (getenv "CSERVER") + "localhost")))) + ((eq wnn-server-type 'kserver) + (or kserver-list + (list (or kwnn-host-name + (getenv "KSERVER") + "localhost")))))) + (loginname (user-login-name))) + (catch 'succ + (while hostlist + (let ((hostname (car hostlist))) + (if (wnn-server-open hostname loginname) + (progn + (cond ((eq wnn-server-type 'jserver) + (setq wnn-host-name hostname)) + ((eq wnn-server-type 'cserver) + (setq cwnn-host-name hostname)) + ((eq wnn-server-type 'kserver) + (setq kwnn-host-name hostname))) + (throw 'succ hostname)))) + (setq hostlist (cdr hostlist))) + (egg:error (wnn-server-get-msg)))))) + +(defvar egg-default-startup-file "eggrc" + "*Egg startup file name (system default)") + +(defvar egg-startup-file ".eggrc" + "*Egg startup file name.") + +;;; 92/6/30, by K.Handa +(defvar egg-startup-file-search-path '("~" ".") + "*List of directories to search for egg-startup-file +whose name defaults to .eggrc.") + +(defun egg:search-file (filename searchpath) + (if (file-name-directory filename) + (let ((file (substitute-in-file-name (expand-file-name filename)))) + (if (file-exists-p file) file nil)) + (catch 'answer + (while searchpath + (let ((path (car searchpath))) + (if (stringp path) + (let ((file (substitute-in-file-name + (expand-file-name filename path)))) + (if (file-exists-p file) (throw 'answer file))))) + (setq searchpath (cdr searchpath))) + nil))) + +(defun EGG:open-wnn () + (let ((host (open-wnn-if-disconnected))) + (notify (egg:msg-get 'open-wnn) + (or host "local")) + (let* ((path (append egg-startup-file-search-path load-path)) + (eggrc (or (egg:search-file egg-startup-file path) + (egg:search-file egg-default-startup-file load-path)))) + (if (or (null skip-wnn-setenv-if-env-exist) + (null (wnn-server-dict-list))) + (if eggrc (load-file eggrc) + (let ((wnnenv-sticky nil)) (wnn-server-close)) + (egg:error (egg:msg-get 'no-rcfile) path))) + (run-hooks 'egg:open-wnn-hook)))) + +(defun disconnect-wnn () + (interactive) + (if (wnn-server-isconnect) (wnn-server-close))) + +(defun close-wnn () + (interactive) + (if (wnn-server-isconnect) + (progn + (wnn-server-set-rev nil) + (if (wnn-server-dict-save) + (message (egg:msg-get 'file-saved)) + (message (wnn-server-get-msg))) + (sit-for 0) + (wnn-server-set-rev t) + (if (wnn-server-dict-save) + (message (egg:msg-get 'file-saved)) + (message (wnn-server-get-msg))) + (sit-for 0) + (wnn-server-close) + (run-hooks 'egg:close-wnn-hook)))) + +(defun set-wnn-reverse (arg) +; (open-wnn-if-disconnected) + (wnn-server-set-rev arg)) + +;;; +;;; Kanji henkan +;;; + +(defvar egg:*kanji-kanabuff* nil) +(defvar egg:*dai* t) +(defvar *bunsetu-number* nil) +(defvar *zenkouho-suu* nil) +(defvar *zenkouho-offset* nil) + +(defun bunsetu-length-sho (number) + (cdr (wnn-server-bunsetu-yomi number))) + +(defun bunsetu-length (number) + (let ((max (wnn-server-dai-end number)) + (i (1+ number)) + (l (bunsetu-length-sho number))) + (while (< i max) + (setq l (+ l (bunsetu-length-sho i))) + (setq i (1+ i))) + l)) + +(defun bunsetu-position (number) + (let ((pos egg:*region-start*) (i 0)) + (while (< i number) + (setq pos (+ pos (length (bunsetu-kanji i)) + (if (wnn-server-dai-top (1+ i)) + (length egg:*dai-bunsetu-kugiri*) + (length egg:*sho-bunsetu-kugiri*)))) + (setq i (1+ i))) + pos)) + +(defun bunsetu-kanji (number) (car (wnn-server-bunsetu-kanji number))) + +(defun bunsetu-yomi (number) (car (wnn-server-bunsetu-yomi number))) + +(defun bunsetu-kouho-suu (bunsetu-number init) + (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number)) + (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*))) + (setq *zenkouho-suu* (wnn-server-zenkouho-suu))) + +(defun bunsetu-kouho-list (bunsetu-number init) + (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number)) + (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*))) + (let ((i (1- (setq *zenkouho-suu* (wnn-server-zenkouho-suu)))) + (val nil)) + (while (<= 0 i) + (setq val (cons (wnn-server-get-zenkouho i) val)) + (setq i (1- i))) + val)) + +(defun bunsetu-kouho-number (bunsetu-number init) + (if (or init (/= (wnn-server-zenkouho-bun) bunsetu-number)) + (setq *zenkouho-offset* (wnn-server-zenkouho bunsetu-number egg:*dai*))) + *zenkouho-offset*) + +;;;; +;;;; User entry : henkan-region, henkan-paragraph, henkan-sentence +;;;; + +(defun egg:henkan-face-on () + ;; Make an overlay if henkan overlay does not exist. + ;; Move henkan overlay to henkan region. + (if egg:*henkan-face* + (progn + (if (overlayp egg:*henkan-overlay*) + nil + (setq egg:*henkan-overlay* (make-overlay 1 1 nil nil t)) + (overlay-put egg:*henkan-overlay* 'face egg:*henkan-face*)) + (move-overlay egg:*henkan-overlay* egg:*region-start* egg:*region-end*)))) + +(defun egg:henkan-face-off () + ;; detach henkan overlay from the current buffer. + (and egg:*henkan-face* + (overlayp egg:*henkan-overlay*) + (delete-overlay egg:*henkan-overlay*) )) + + +(defun henkan-region (start end) + "Convert a text in the region between START and END from kana to kanji." + (interactive "r") + (if (interactive-p) (set-mark (point))) ;;; to be fixed + (henkan-region-internal start end)) + +(defun gyaku-henkan-region (start end) + "Convert a text in the region between START and END from kanji to kana." + (interactive "r") + (if (interactive-p) (set-mark (point))) ;;; to be fixed + (henkan-region-internal start end t)) + +;(defvar henkan-mode-indicator "$B4A(B") + +(defun henkan-region-internal (start end &optional rev) + ;; region $B$r$+$J4A;zJQ49$9$k(B + (if egg:henkan-mode-in-use nil + (let ((finished nil)) + (unwind-protect + (progn + (setq egg:henkan-mode-in-use t) + (if (null (wnn-server-isconnect)) (EGG:open-wnn)) + (setq egg:*kanji-kanabuff* (buffer-substring start end)) + ;;; for Wnn6 + (if (and (is-wnn6-server) + (not (and + egg:*henkan-fence-mode* + *in-cont-flag*))) + (progn + (wnn6-reset-prev-info))) + + (setq *bunsetu-number* 0) + (setq egg:*dai* t) ; 92.9.8 by T.shingu + (wnn-server-set-rev rev) + (let ((result (wnn-server-henkan-begin egg:*kanji-kanabuff*))) + (if (null result) + (egg:error (wnn-server-get-msg)) + (if (> result 0) + (progn + (mode-line-egg-mode-update (egg:msg-get 'henkan-mode-indicator)) + (goto-char start) + (or (markerp egg:*region-start*) + (setq egg:*region-start* (make-marker))) + (or (markerp egg:*region-end*) + (progn + (setq egg:*region-end* (make-marker)) + (set-marker-insertion-type egg:*region-end* t))) + (if (null (marker-position egg:*region-start*)) + (progn + (delete-region start end) + (suspend-undo) + (goto-char start) + (insert egg:*henkan-open*) + (set-marker egg:*region-start* (point)) + (insert egg:*henkan-close*) + (set-marker egg:*region-end* egg:*region-start*) + (goto-char egg:*region-start*) + ) + (progn + (egg:fence-face-off) + (delete-region (- egg:*region-start* (length egg:*fence-open*)) + egg:*region-start*) + (delete-region egg:*region-end* + (+ egg:*region-end* (length egg:*fence-close*))) + (goto-char egg:*region-start*) + (insert egg:*henkan-open*) + (set-marker egg:*region-start* (point)) + (goto-char egg:*region-end*) + (let ((point (point))) + (insert egg:*henkan-close*) + (set-marker egg:*region-end* point)) + (goto-char start) + (delete-region start end) + )) + (henkan-insert-kouho 0 result) + (egg:henkan-face-on) + (egg:bunsetu-face-on) + (henkan-goto-bunsetu 0) + (run-hooks 'egg:henkan-start-hook))))) + (setq finished t)) + (or finished (setq egg:henkan-mode-in-use nil) + (resume-undo-list))))) + ) + +(defun henkan-paragraph () + "Convert the current paragraph from kana to kanji." + (interactive) + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (henkan-region-internal (point) end))) + +(defun gyaku-henkan-paragraph () + "Convert the current paragraph from kanji to kana." + (interactive) + (forward-paragraph) + (let ((end (point))) + (backward-paragraph) + (henkan-region-internal (point) end t))) + +(defun henkan-sentence () + "Convert the current sentence from kana to kanji." + (interactive) + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (henkan-region-internal (point) end))) + +(defun gyaku-henkan-sentence () + "Convert the current sentence from kanji to kana." + (interactive) + (forward-sentence) + (let ((end (point))) + (backward-sentence) + (henkan-region-internal (point) end t))) + +(defun henkan-word () + "Convert the current word from kana to kanji." + (interactive) + (re-search-backward "\\<" nil t) + (let ((start (point))) + (re-search-forward "\\>" nil t) + (henkan-region-internal start (point)))) + +(defun gyaku-henkan-word () + "Convert the current word from kanji to kana." + (interactive) + (re-search-backward "\\<" nil t) + (let ((start (point))) + (re-search-forward "\\>" nil t) + (henkan-region-internal start (point) t))) + +;;; +;;; Kana Kanji Henkan Henshuu mode +;;; + +(defun set-egg-henkan-mode-format (open close kugiri-dai kugiri-sho + &optional henkan-face dai-bunsetu-face sho-bunsetu-face) + "$BJQ49(B mode $B$NI=<(J}K!$r@_Dj$9$k!#(BOPEN $B$OJQ49$N;OE@$r<($9J8;zNs$^$?$O(B nil$B!#(B +CLOSE$B$OJQ49$N=*E@$r<($9J8;zNs$^$?$O(B nil$B!#(B +KUGIRI-DAI$B$OBgJ8@a$N6h@Z$j$rI=<($9$kJ8;zNs$^$?$O(B nil$B!#(B +KUGIRI-SHO$B$O>.J8@a$N6h@Z$j$rI=<($9$kJ8;zNs$^$?$O(B nil$B!#(B +optional HENKAN-FACE $B$OJQ496h4V$rI=<($9$k(B face $B$^$?$O(B nil +optional DAI-BUNSETU-FACE $B$OBgJ8@a6h4V$rI=<($9$k(B face $B$^$?$O(B nil +optional SHO-BUNSETU-FACE $B$O>.J8@a6h4V$rI=<($9$k(B face $B$^$?$O(B nil" + + (interactive (list (read-string (egg:msg-get 'begin-henkan)) + (read-string (egg:msg-get 'end-henkan)) + (read-string (egg:msg-get 'kugiri-dai)) + (read-string (egg:msg-get 'kugiri-sho)) + (cdr (assoc (completing-read (egg:msg-get 'face-henkan) + egg:*face-alist*) + egg:*face-alist*)) + (cdr (assoc (completing-read (egg:msg-get 'face-dai) + egg:*face-alist*) + egg:*face-alist*)) + (cdr (assoc (completing-read (egg:msg-get 'face-sho) + egg:*face-alist*) + egg:*face-alist*)) + )) + (if (or (stringp open) (null open)) + (setq egg:*henkan-open* (or open "")) + (egg:error "Wrong type of arguments(open): %s" open)) + + (if (or (stringp close) (null close)) + (setq egg:*henkan-close* (or close "")) + (egg:error "Wrong type of arguments(close): %s" close)) + + (if (or (stringp kugiri-dai) (null kugiri-dai)) + (setq egg:*dai-bunsetu-kugiri* (or kugiri-dai "")) + (egg:error "Wrong type of arguments(kugiri-dai): %s" kugiri-dai)) + + (if (or (stringp kugiri-sho) (null kugiri-sho)) + (setq egg:*sho-bunsetu-kugiri* (or kugiri-sho "")) + (egg:error "Wrong type of arguments(kugiri-sho): %s" kugiri-sho)) + + (if (or (null henkan-face) (memq henkan-face (face-list))) + (progn + (setq egg:*henkan-face* henkan-face) + (if (overlayp egg:*henkan-overlay*) + (overlay-put egg:*henkan-overlay* 'face egg:*henkan-face*))) + (egg:error "Wrong type of arguments(henkan-face): %s" henkan-face)) + + (if (or (null dai-bunsetu-face) (memq dai-bunsetu-face (face-list))) + (progn + (setq egg:*dai-bunsetu-face* dai-bunsetu-face) + (if (overlayp egg:*dai-bunsetu-overlay*) + (overlay-put egg:*dai-bunsetu-overlay* 'face egg:*dai-bunsetu-face*))) + (egg:error "Wrong type of arguments(dai-bunsetu-face): %s" dai-bunsetu-face)) + + (if (or (null sho-bunsetu-face) (memq sho-bunsetu-face (face-list))) + (progn + (setq egg:*sho-bunsetu-face* sho-bunsetu-face) + (if (overlayp egg:*sho-bunsetu-overlay*) + (overlay-put egg:*sho-bunsetu-overlay* 'face egg:*sho-bunsetu-face*))) + (egg:error "Wrong type of arguments(sho-bunsetu-face): %s" sho-bunsetu-face)) + ) + +(defun henkan-insert-kouho (start number) + (let ((i start)) + (while (< i number) + (insert (car (wnn-server-bunsetu-kanji i)) + (if (= (1+ i) number) + "" + (if (wnn-server-dai-top (1+ i)) + egg:*dai-bunsetu-kugiri* + egg:*sho-bunsetu-kugiri*))) + (setq i (1+ i))))) + +(defun henkan-kakutei () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (setq egg:henkan-mode-in-use nil) + (setq egg:*in-fence-mode* nil) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-start*) + (setq egg:*sai-henkan-start* (point)) + (resume-undo-list) + (let ((i 0) (max (wnn-server-bunsetu-suu))) + (setq egg:*old-bunsetu-suu* max) + (while (< i max) + (insert (car (wnn-server-bunsetu-kanji i ))) + (if (not overwrite-mode) + (undo-boundary)) + (setq i (1+ i)) + )) + (setq egg:*sai-henkan-end* (point)) + (wnn-server-hindo-update) +;; (when egg-predict-status ;prediction not implemented +;; (egg-predict-inc-kakutei-length) +;; (or wnn7-rensou-touroku +;; (egg-predict-toroku))) +;; (setq wnn7-rensou-touroku nil) + (egg:quit-egg-mode) + (run-hooks 'egg:henkan-end-hook) + ) + +;; 92.7.10 by K.Handa +(defun henkan-kakutei-first-char () + "$B3NDjJ8;zNs$N:G=i$N0lJ8;z$@$1A^F~$9$k!#(B" + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (setq egg:henkan-mode-in-use nil) + (setq egg:*in-fence-mode* nil) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* + ;; 92.8.5 by Y.Kasai + (length egg:*henkan-close*))) + (goto-char egg:*region-start*) + (resume-undo-list) + (insert (car (wnn-server-bunsetu-kanji 0))) + (if (not overwrite-mode) + (undo-boundary)) + (goto-char egg:*region-start*) + (forward-char 1) + (delete-region (point) egg:*region-end*) + (wnn-server-hindo-update) + (egg:quit-egg-mode) + ) +;; end of patch + +(defun henkan-kakutei-before-point () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (delete-region egg:*region-start* egg:*region-end*) + (goto-char egg:*region-start*) + (let ((i 0) (max *bunsetu-number*)) + (while (< i max) + (insert (car (wnn-server-bunsetu-kanji i ))) + (if (not overwrite-mode) + (undo-boundary)) + (setq i (1+ i)) + )) + (wnn-server-hindo-update *bunsetu-number*) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (insert egg:*fence-open*) + (set-marker egg:*region-start* (point)) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-end*) + (let ((point (point))) + (insert egg:*fence-close*) + (set-marker egg:*region-end* point)) + (goto-char egg:*region-start*) + (egg:fence-face-on) + (let ((point (point)) + (i *bunsetu-number*) (max (wnn-server-bunsetu-suu))) + (while (< i max) + (insert (car (wnn-server-bunsetu-yomi i))) + (setq i (1+ i))) + ;;;(insert "|") + ;;;(insert egg:*fence-close*) + ;;;(set-marker egg:*region-end* (point)) + (goto-char point)) + (setq egg:*mode-on* t) + (setq egg:henkan-mode-in-use nil) + (egg:mode-line-display)) + +(defun sai-henkan () + (interactive) + (if egg:henkan-mode-in-use nil + (let ((finished nil)) + (unwind-protect + (progn + (setq egg:henkan-mode-in-use t) + (mode-line-egg-mode-update (egg:msg-get 'henkan-mode-indicator)) + (goto-char egg:*sai-henkan-start*) + (delete-region egg:*sai-henkan-start* egg:*sai-henkan-end*) + (suspend-undo) + (goto-char egg:*sai-henkan-start*) + (insert egg:*henkan-open*) + (set-marker egg:*region-start* (point)) + (insert egg:*henkan-close*) + (set-marker egg:*region-end* egg:*region-start*) + (goto-char egg:*region-start*) + (henkan-insert-kouho 0 egg:*old-bunsetu-suu*) + (egg:henkan-face-on) + (egg:bunsetu-face-on) + (henkan-goto-bunsetu 0) + (setq finished t)) + (or finished (setq egg:henkan-mode-in-use nil) + (resume-undo-list))))) + ) + +(defun egg:bunsetu-face-on () + ;; make dai-bunsetu overlay and sho-bunsetu overlay if they do not exist. + ;; put thier faces to overlays and move them to each bunsetu. + (let* ((bunsetu-begin *bunsetu-number*) + (bunsetu-end) + (bunsetu-suu (wnn-server-bunsetu-suu))) +; dai bunsetu + (if egg:*dai-bunsetu-face* + (progn + (if (overlayp egg:*dai-bunsetu-overlay*) + nil + (setq egg:*dai-bunsetu-overlay* (make-overlay 1 1)) + (overlay-put egg:*dai-bunsetu-overlay* 'face egg:*dai-bunsetu-face*)) + (setq bunsetu-end (wnn-server-dai-end *bunsetu-number*)) + (while (not (wnn-server-dai-top bunsetu-begin)) + (setq bunsetu-begin (1- bunsetu-begin))) + (move-overlay egg:*dai-bunsetu-overlay* + (bunsetu-position bunsetu-begin) + (+ (bunsetu-position (1- bunsetu-end)) + (length (bunsetu-kanji (1- bunsetu-end))))))) +; sho bunsetu + (if egg:*sho-bunsetu-face* + (progn + (if (overlayp egg:*sho-bunsetu-overlay*) + nil + (setq egg:*sho-bunsetu-overlay* (make-overlay 1 1)) + (overlay-put egg:*sho-bunsetu-overlay* 'face egg:*sho-bunsetu-face*)) + (setq bunsetu-end (1+ *bunsetu-number*)) + (move-overlay egg:*sho-bunsetu-overlay* + (let ((point (bunsetu-position *bunsetu-number*))) + (if (eq egg:*sho-bunsetu-face* 'modeline) + (1+ point) + point)) + (+ (bunsetu-position (1- bunsetu-end)) + (length (bunsetu-kanji (1- bunsetu-end))))))))) + +(defun egg:bunsetu-face-off () + (and egg:*dai-bunsetu-face* + (overlayp egg:*dai-bunsetu-overlay*) + (delete-overlay egg:*dai-bunsetu-overlay*)) + (and egg:*sho-bunsetu-face* + (overlayp egg:*sho-bunsetu-overlay*) + (delete-overlay egg:*sho-bunsetu-overlay*)) + ) + +(defun henkan-goto-bunsetu (number) + (setq *bunsetu-number* + (check-number-range number 0 (1- (wnn-server-bunsetu-suu)))) + (goto-char (bunsetu-position *bunsetu-number*)) +; (egg:move-bunsetu-overlay) + (egg:bunsetu-face-on) + ) + +(defun henkan-forward-bunsetu () + (interactive) + (henkan-goto-bunsetu (1+ *bunsetu-number*)) + ) + +(defun henkan-backward-bunsetu () + (interactive) + (henkan-goto-bunsetu (1- *bunsetu-number*)) + ) + +(defun henkan-first-bunsetu () + (interactive) + (henkan-goto-bunsetu 0)) + +(defun henkan-last-bunsetu () + (interactive) + (henkan-goto-bunsetu (1- (wnn-server-bunsetu-suu))) + ) + +(defun check-number-range (i min max) + (cond((< i min) max) + ((< max i) min) + (t i))) + +(defun henkan-hiragana () + (interactive) + (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number* nil) 1))) + +(defun henkan-katakana () + (interactive) + (henkan-goto-kouho (- (bunsetu-kouho-suu *bunsetu-number* nil) 2))) + +(defun henkan-next-kouho () + (interactive) + (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* nil)))) + +(defun henkan-next-kouho-dai () + (interactive) + (let ((init (not egg:*dai*))) + (setq egg:*dai* t) + (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* init))))) + +(defun henkan-next-kouho-sho () + (interactive) + (let ((init egg:*dai*)) + (setq egg:*dai* nil) + (henkan-goto-kouho (1+ (bunsetu-kouho-number *bunsetu-number* init))))) + +(defun henkan-previous-kouho () + (interactive) + (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* nil)))) + +(defun henkan-previous-kouho-dai () + (interactive) + (let ((init (not egg:*dai*))) + (setq egg:*dai* t) + (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* init))))) + +(defun henkan-previous-kouho-sho () + (interactive) + (let ((init egg:*dai*)) + (setq egg:*dai* nil) + (henkan-goto-kouho (1- (bunsetu-kouho-number *bunsetu-number* init))))) + +(defun henkan-goto-kouho (kouho-number) +; (egg:bunsetu-face-off) + (let ((point (point)) + (yomi (bunsetu-yomi *bunsetu-number*)) + (max) + (min)) + (setq kouho-number + (check-number-range kouho-number + 0 + (1- (length (bunsetu-kouho-list + *bunsetu-number* nil))))) + (setq *zenkouho-offset* kouho-number) + (wnn-server-henkan-kakutei kouho-number egg:*dai*) + (setq max (wnn-server-bunsetu-suu)) + (setq min (max 0 (1- *bunsetu-number*))) + (delete-region + (bunsetu-position min) egg:*region-end*) + (goto-char (bunsetu-position min)) + (henkan-insert-kouho min max) + (goto-char point)) +; (egg:move-bunsetu-overlay) + (egg:bunsetu-face-on) + (egg:henkan-face-on) + ) + +(defun henkan-bunsetu-chijime-dai () + (interactive) + (setq egg:*dai* t) + (or (= (bunsetu-length *bunsetu-number*) 1) + (bunsetu-length-henko (1- (bunsetu-length *bunsetu-number*))))) + +(defun henkan-bunsetu-chijime-sho () + (interactive) + (setq egg:*dai* nil) + (or (= (bunsetu-length-sho *bunsetu-number*) 1) + (bunsetu-length-henko (1- (bunsetu-length-sho *bunsetu-number*))))) + +(defun henkan-bunsetu-nobasi-dai () + (interactive) + (setq egg:*dai* t) + (let ((i *bunsetu-number*) + (max (wnn-server-bunsetu-suu)) + (len (bunsetu-length *bunsetu-number*)) + (maxlen 0)) + (while (< i max) + (setq maxlen (+ maxlen (cdr (wnn-server-bunsetu-yomi i)))) + (setq i (1+ i))) + (if (not (= len maxlen)) + (bunsetu-length-henko (1+ len))))) + +(defun henkan-bunsetu-nobasi-sho () + (interactive) + (setq egg:*dai* nil) + (let ((i *bunsetu-number*) + (max (wnn-server-bunsetu-suu)) + (len (bunsetu-length-sho *bunsetu-number*)) + (maxlen 0)) + (while (< i max) + (setq maxlen (+ maxlen (cdr (wnn-server-bunsetu-yomi i)))) + (setq i (1+ i))) + (if (not (= len maxlen)) + (bunsetu-length-henko (1+ len))))) + +; (if (not (= (1+ *bunsetu-number*) (wnn-server-bunsetu-suu))) +; (bunsetu-length-henko (1+ (bunsetu-length *bunsetu-number*))))) + + +(defun henkan-saishou-bunsetu () + (interactive) + (bunsetu-length-henko 1)) + +(defun henkan-saichou-bunsetu () + (interactive) + (let ((max (wnn-server-bunsetu-suu)) (i *bunsetu-number*) + (l 0)) + (while (< i max) + (setq l (+ l (bunsetu-length-sho i))) + (setq i (1+ i))) + (bunsetu-length-henko l))) + +(defun bunsetu-length-henko (length) + (let ((i 0) + (r (wnn-server-bunsetu-henkou *bunsetu-number* length egg:*dai*)) + (start (max 0 (1- *bunsetu-number*)))) + (cond((null r) + (egg:error (wnn-server-get-msg))) + ((> r 0) +; (egg:henkan-face-off) +; (egg:bunsetu-face-off) + (delete-region + (bunsetu-position start) egg:*region-end*) + (goto-char (bunsetu-position start)) + (henkan-insert-kouho start r) + (henkan-goto-bunsetu *bunsetu-number*))))) + +(defun henkan-quit () + (interactive) + (egg:bunsetu-face-off) + (egg:henkan-face-off) + (delete-region (- egg:*region-start* (length egg:*henkan-open*)) + egg:*region-start*) + (delete-region egg:*region-start* egg:*region-end*) + (delete-region egg:*region-end* (+ egg:*region-end* (length egg:*henkan-close*))) + (goto-char egg:*region-start*) + (insert egg:*fence-open*) + (set-marker egg:*region-start* (point)) + (insert egg:*kanji-kanabuff*) + (let ((point (point))) + (insert egg:*fence-close*) + (set-marker egg:*region-end* point) + ) + (goto-char egg:*region-end*) + (egg:fence-face-on) + (wnn-server-henkan-quit) + (setq egg:*mode-on* t) + (setq egg:henkan-mode-in-use nil) + (setq egg:*in-fence-mode* t) + (egg:mode-line-display) + ) + +(defun henkan-select-kouho (init) + (if (not (eq (selected-window) (minibuffer-window))) + (let ((kouho-list (bunsetu-kouho-list *bunsetu-number* init)) + menu) + (setq menu + (list 'menu (egg:msg-get 'jikouho) + (let ((l kouho-list) (r nil) (i 0)) + (while l + (setq r (cons (cons (car l) i) r)) + (setq i (1+ i)) + (setq l (cdr l))) + (reverse r)))) + (henkan-goto-kouho + (menu:select-from-menu menu + (bunsetu-kouho-number *bunsetu-number* nil)))) + (beep))) + +(defun henkan-select-kouho-dai () + (interactive) + (let ((init (not egg:*dai*))) + (setq egg:*dai* t) + (henkan-select-kouho init))) + +(defun henkan-select-kouho-sho () + (interactive) + (let ((init egg:*dai*)) + (setq egg:*dai* nil) + (henkan-select-kouho init))) + +(defun henkan-word-off () + (interactive) + (let ((info (wnn-server-inspect *bunsetu-number*))) + (if (null info) + (notify (wnn-server-get-msg)) + (progn + (let ((dic-list (wnn-server-dict-list))) + (if (null dic-list) + (notify (wnn-server-get-msg)) + (progn + (let* ((kanji (nth 0 info)) + (yomi (nth 1 info)) + (serial (nth 3 info)) + (jisho-no (nth 2 info)) + (jisho-name (nth 2 (assoc jisho-no dic-list)))) + (if (wnn-server-word-use jisho-no serial) + (notify (egg:msg-get 'off-msg) + kanji yomi jisho-name serial) + (egg:error (wnn-server-get-msg))))))))))) + +(defun henkan-kakutei-and-self-insert () + (interactive) + (setq unread-command-events (list last-command-event)) + (henkan-kakutei)) + +(defvar henkan-mode-map (append '(keymap (t . undefined) + (?\C-x keymap (t . undefined))) + function-key-map)) + +(defvar henkan-mode-esc-map + (or (lookup-key henkan-mode-map (vector meta-prefix-char)) + (lookup-key henkan-mode-map [escape]) + (make-sparse-keymap))) + +(or (lookup-key henkan-mode-map (vector meta-prefix-char)) + (define-key henkan-mode-map (vector meta-prefix-char) henkan-mode-esc-map)) +(or (lookup-key henkan-mode-map [escape]) + (define-key henkan-mode-map [escape] henkan-mode-esc-map)) + +(substitute-key-definition 'egg-self-insert-command + 'henkan-kakutei-and-self-insert + henkan-mode-map global-map) + +(dolist (elem '(;;(" " henkan-next-kouho-dai) ; 92.9.8 by T.Shingu + (" " henkan-next-kouho) ; 92.7.10 by K.Handa + ("\177" henkan-quit) + ("\C-@" henkan-kakutei-first-char) + ("\C-\ " henkan-kakutei-first-char) + ("\C-a" henkan-first-bunsetu) + ("\C-b" henkan-backward-bunsetu) + ("\C-c" henkan-quit) + ("\C-e" henkan-last-bunsetu) + ("\C-f" henkan-forward-bunsetu) + ("\C-g" henkan-quit) + ("\C-h" henkan-help-command) + ("\C-i" henkan-bunsetu-chijime-dai) + ("\C-k" henkan-kakutei-before-point) + ("\C-l" henkan-kakutei) + ("\C-m" henkan-kakutei) + ("\C-n" henkan-next-kouho) + ("\C-o" henkan-bunsetu-nobasi-dai) + ("\C-p" henkan-previous-kouho) + ("\C-t" toroku-henkan-mode) + ("\C-v" henkan-inspect-bunsetu) + ("\C-w" henkan-next-kouho-dai) + ("\C-z" henkan-next-kouho-sho) + + ([backspace] henkan-quit) + ([clear] henkan-quit) + ([delete] henkan-quit) + ([down] henkan-next-kouho) + ([help] henkan-help-command) + ([left] henkan-backward-bunsetu) + ([next] henkan-next-kouho) + ([prior] henkan-previous-kouho) + ([return] henkan-kakutei) + ([right] henkan-forward-bunsetu) + ([up] henkan-previous-kouho))) + (apply 'define-key henkan-mode-map elem)) + +(dolist (elem '(([t] undefined);; default binding + ("<" henkan-saishou-bunsetu) + (">" henkan-saichou-bunsetu) + ("h" henkan-hiragana) + ;;("i" henkan-inspect-bunsetu) + ("i" henkan-bunsetu-chijime-sho) + ("k" henkan-katakana) + ("o" henkan-bunsetu-nobasi-sho) + ;("r" wnn7-henkan-synonym) + ("s" henkan-select-kouho-dai) + ("z" henkan-select-kouho-sho))) + (apply 'define-key henkan-mode-esc-map elem)) + +(or (assq 'egg:henkan-mode-in-use minor-mode-map-alist) + (setq minor-mode-map-alist + (cons (cons 'egg:henkan-mode-in-use henkan-mode-map) + minor-mode-map-alist))) + + +(defun henkan-help-command () + "Display documentation for henkan-mode." + (interactive) + (let ((buf "*Help*")) + (if (eq (get-buffer buf) (current-buffer)) + (henkan-quit) + (with-output-to-temp-buffer buf + ;;(princ (substitute-command-keys henkan-mode-document-string)) + (princ (substitute-command-keys (egg:msg-get 'henkan-help))) + (print-help-return-message))))) + +;;;---------------------------------------------------------------------- +;;; +;;; Dictionary management Facility +;;; +;;;---------------------------------------------------------------------- + +;;; +;;; $B<-=qEPO?(B +;;; + +;;;; +;;;; User entry: toroku-region +;;;; + +(defun remove-regexp-in-string (regexp string) + (cond((not(string-match regexp string)) + string) + (t(let ((str nil) + (ostart 0) + (oend (match-beginning 0)) + (nstart (match-end 0))) + (setq str (concat str (substring string ostart oend))) + (while (string-match regexp string nstart) + (setq ostart nstart) + (setq oend (match-beginning 0)) + (setq nstart (match-end 0)) + (setq str (concat str (substring string ostart oend)))) + (concat str (substring string nstart)))))) + +(defun hinsi-from-menu (dict-number name) + (let ((result (wnn-server-hinsi-list dict-number name)) +; (hinsi-pair) + (menu)) + (if (null result) + (egg:error (wnn-server-get-msg)) + (if (eq result 0) + name + (progn +; (setq hinsi-pair (mapcar '(lambda (x) (cons x x)) result)) +; (if (null (string= name "/")) +; (setq hinsi-pair (cons (cons "/" "/") hinsi-pair))) +; (setq menu (list 'menu (egg:msg-get 'hinsimei) hinsi-pair)) + (setq menu (list 'menu (egg:msg-get 'hinsimei) + (if (string= name "/") + result + (cons "/" result)))) + (hinsi-from-menu dict-number + (menu:select-from-menu menu))))))) + +(defun wnn-dict-name (dict-number dict-list) + (let* ((dict-info (assoc dict-number dict-list)) + (dict-comment (nth 2 dict-info))) + (if (string= dict-comment "") + (file-name-nondirectory (nth 1 dict-info)) + dict-comment))) + +(defun egg:toroku-word (yomi kanji interactive) + (let*((dic-list (wnn-server-dict-list)) + (writable-dic-list (wnn-server-hinsi-dicts -1)) + (dict-number + (menu:select-from-menu + (list 'menu (egg:msg-get 'touroku-jishomei) + (mapcar '(lambda (x) + (let ((y (car (assoc x dic-list)))) + (cons (wnn-dict-name y dic-list) y))) + writable-dic-list)))) + (hinsi-name (hinsi-from-menu dict-number "/")) + (hinsi-no (wnn-server-hinsi-number hinsi-name)) + (dict-name (wnn-dict-name dict-number dic-list))) + (if (or (not interactive) + (notify-yes-or-no-p (egg:msg-get 'register-notify) + kanji yomi hinsi-name dict-name)) + (if (wnn-server-word-add dict-number kanji yomi "" hinsi-no) + (notify (egg:msg-get 'registerd) kanji yomi hinsi-name dict-name) + (egg:error (wnn-server-get-msg)))))) + +(defun toroku-region (start end) + (interactive "r") + (if (null (wnn-server-isconnect)) (EGG:open-wnn)) + (wnn-server-set-rev nil) + (let*((kanji + (remove-regexp-in-string "[\0-\37]" (buffer-substring start end))) + (yomi (read-current-its-string + (format (egg:msg-get 'jishotouroku-yomi) kanji)))) + (egg:toroku-word yomi kanji nil))) + +(defun delete-space (string) + (let ((len (length string))) + (if (eq len 0) "" + (if (or (char-equal (aref string 0) ? ) (char-equal (aref string 0) ?-)) + (delete-space (substring string 1)) + (concat (substring string 0 1) (delete-space (substring string 1))))))) + + +(defun toroku-henkan-mode () + (interactive) + (let*((kanji + (read-current-its-string (egg:msg-get 'kanji) + (delete-space + (buffer-substring (point) egg:*region-end* )))) + (yomi (read-current-its-string + (format (egg:msg-get 'jishotouroku-yomi) kanji) + (let ((str "") + (i *bunsetu-number*) + (max (wnn-server-bunsetu-suu))) + (while (< i max) + (setq str (concat str (car (wnn-server-bunsetu-yomi i)) )) + (setq i (1+ i))) + str)))) + (egg:toroku-word yomi kanji nil))) + +;;; +;;; $B<-=qJT=87O(B DicEd +;;; + +(defvar *diced-window-configuration* nil) + +(defvar *diced-dict-info* nil) + +(defvar *diced-yomi* nil) + +;;;;; +;;;;; User entry : edit-dict-item +;;;;; + +(defun edit-dict-item (yomi) + (interactive (list (read-current-its-string (egg:msg-get 'yomi)))) + (if (null (wnn-server-isconnect)) (EGG:open-wnn)) + (wnn-server-set-rev nil) + (let ((dict-info (wnn-server-word-search yomi)) + (current-wnn-server-type)) + (if (null dict-info) + (message (egg:msg-get 'no-yomi) yomi) + (progn + (setq current-wnn-server-type wnn-server-type) + (setq *diced-yomi* yomi) + (setq *diced-window-configuration* (current-window-configuration)) + (pop-to-buffer "*Nihongo Dictionary Information*") + (setq wnn-server-type current-wnn-server-type) + (setq major-mode 'diced-mode) + (setq mode-name "Diced") + (setq mode-line-buffer-identification + (concat "DictEd: " yomi + (make-string (max 0 (- 17 (string-width yomi))) ? ))) + (sit-for 0) ;; will redislay. + ;;;(use-global-map diced-mode-map) + (use-local-map diced-mode-map) + (diced-display dict-info) + )))) + +(defun diced-redisplay () + (wnn-server-set-rev nil) + (let ((dict-info (wnn-server-word-search *diced-yomi*))) + (if (null dict-info) + (progn + (message (egg:msg-get 'no-yomi) *diced-yomi*) + (diced-quit)) + (diced-display dict-info)))) + +(defun diced-display (dict-info) + ;;; (values (list (record kanji bunpo hindo dict-number serial-number))) + ;;; 0 1 2 3 4 + (setq dict-info + (sort dict-info + (function (lambda (x y) + (or (< (nth 1 x) (nth 1 y)) + (if (= (nth 1 x) (nth 1 y)) + (or (> (nth 2 x) (nth 2 y)) + (if (= (nth 2 x) (nth 2 y)) + (< (nth 3 x) (nth 3 y)))))))))) + (setq *diced-dict-info* dict-info) + (setq buffer-read-only nil) + (erase-buffer) + (let ((l-kanji + (apply 'max + (mapcar (function (lambda (l) (string-width (nth 0 l)))) + dict-info))) + (l-bunpo + (apply 'max + (mapcar (function(lambda (l) + (string-width (wnn-server-hinsi-name (nth 1 l))))) + dict-info))) + (dict-list (wnn-server-dict-list)) + (writable-dict-list (wnn-server-hinsi-dicts -1))) + (while dict-info + (let*((kanji (nth 0 (car dict-info))) + (bunpo (nth 1 (car dict-info))) + (hinshi (wnn-server-hinsi-name bunpo)) + (hindo (nth 2 (car dict-info))) + (dict-number (nth 3 (car dict-info))) + (dict-name (wnn-dict-name dict-number dict-list)) + (sys-dict-p (null (memq dict-number writable-dict-list))) + (serial-number (nth 4 (car dict-info)))) + (insert (if sys-dict-p " *" " ")) + (insert kanji) + (insert-char ? + (- (+ l-kanji 10) (string-width kanji))) + (insert hinshi) + (insert-char ? (- (+ l-bunpo 2) (string-width hinshi))) + (insert (egg:msg-get 'jisho) (file-name-nondirectory dict-name) + "/" (int-to-string serial-number) + (egg:msg-get 'hindo) (int-to-string hindo) ?\n ) + (setq dict-info (cdr dict-info)))) + (goto-char (point-min))) + (setq buffer-read-only t)) + +(defun diced-add () + (interactive) + (diced-execute t) + (let*((kanji (read-from-minibuffer (egg:msg-get 'kanji)))) + (egg:toroku-word *diced-yomi* kanji t) + (diced-redisplay))) + +(defun diced-delete () + (interactive) + (beginning-of-line) + (if (= (char-after (1+ (point))) ?* ) + (progn (message (egg:msg-get 'cannot-remove)) (beep)) + (if (= (following-char) ? ) + (let ((buffer-read-only nil)) + (delete-char 1) (insert "D") (backward-char 1)) + ))) + + +(defun diced-undelete () + (interactive) + (beginning-of-line) + (if (= (following-char) ?D) + (let ((buffer-read-only nil)) + (delete-char 1) (insert " ") (backward-char 1)) + (beep))) + +(defun diced-redisplay-hindo (dict-number serial-number) + (let ((hindo)) + (setq buffer-read-only nil) + (beginning-of-line) + (re-search-forward "\\([0-9\-]+\\)\\(\n\\)") + (delete-region (match-beginning 1) (match-end 1)) + (setq hindo (nth 3 (wnn-server-word-info dict-number serial-number))) + (goto-char (match-beginning 1)) + (insert (int-to-string hindo)) + (beginning-of-line) + (setq buffer-read-only t))) + +(defun diced-use () + (interactive) + (let* ((dict-item (nth + (+ (count-lines (point-min) (point)) + (if (= (current-column) 0) 1 0) + -1) + *diced-dict-info*)) + (hindo (nth 2 dict-item)) + (dict-number (nth 3 dict-item)) + (serial-number (nth 4 dict-item)) + ) + (if (null (wnn-server-word-use dict-number serial-number)) + (egg:error (wnn-server-get-msg))) + (diced-redisplay-hindo dict-number serial-number))) + +(defun diced-hindo-set (&optional newhindo) + (interactive) + (if (null newhindo) + (setq newhindo (read-minibuffer (egg:msg-get 'enter-hindo)))) + (let* ((dict-item (nth + (+ (count-lines (point-min) (point)) + (if (= (current-column) 0) 1 0) + -1) + *diced-dict-info*)) + (hindo (nth 2 dict-item)) + (dict-number (nth 3 dict-item)) + (serial-number (nth 4 dict-item)) + ) + (if (null (wnn-server-word-hindo-set dict-number serial-number newhindo)) + (egg:error (wnn-server-get-msg))) + (diced-redisplay-hindo dict-number serial-number))) + +(defun diced-quit () + (interactive) + (setq buffer-read-only nil) + (erase-buffer) + (setq buffer-read-only t) + (bury-buffer (get-buffer "*Nihongo Dictionary Information*")) + (set-window-configuration *diced-window-configuration*) + ) + +(defun diced-execute (&optional display) + (interactive) + (goto-char (point-min)) + (let ((no 0)) + (while (not (eobp)) + (if (= (following-char) ?D) + (let* ((dict-item (nth no *diced-dict-info*)) + (kanji (nth 0 dict-item)) + (bunpo (nth 1 dict-item)) + (hinshi (wnn-server-hinsi-name bunpo)) + (hindo (nth 2 dict-item)) + (dict-number (nth 3 dict-item)) + (dict-name (wnn-dict-name dict-number (wnn-server-dict-list))) + (sys-dict-p (null (memq dict-number (wnn-server-hinsi-dicts -1)))) + (serial-number (nth 4 dict-item)) + ) + (if (notify-yes-or-no-p (egg:msg-get 'remove-notify) + kanji hinshi dict-name) + (progn + (if (wnn-server-word-delete dict-number serial-number) + (notify (egg:msg-get 'removed) + kanji hinshi dict-name) + (egg:error (wnn-server-get-msg))) + )))) + (setq no (1+ no)) + (forward-line 1))) + (forward-line -1) + (if (not display) (diced-redisplay))) + +(defun diced-next-line () + (interactive) + (beginning-of-line) + (forward-line 1) + (if (eobp) (progn (beep) (forward-line -1)))) + +(defun diced-end-of-buffer () + (interactive) + (goto-char (point-max)) + (forward-line -1)) + +(defun diced-scroll-down () + (interactive) + (scroll-down) + (if (eobp) (forward-line -1))) + +(defun diced-mode () + "Mode for \"editing\" dictionaries. +In diced, you are \"editing\" a list of the entries in dictionaries. +You can move using the usual cursor motion commands. +Letters no longer insert themselves. Instead, + +Type a to Add new entry. +Type d to flag an entry for Deletion. +Type n to move cursor to Next entry. +Type p to move cursor to Previous entry. +Type q to Quit from DicEd. +Type C-u to Toggle the word to use/unuse. +Type u to Unflag an entry (remove its D flag). +Type x to eXecute the deletions requested. +" + ) + +(defvar diced-mode-map (make-sparse-keymap)) + +(dolist (elem '(("a" diced-add) + ("d" diced-delete) + ("n" diced-next-line) + ("p" previous-line) + ("q" diced-quit) + ;;("t" diced-use) + ("u" diced-undelete) + ("x" diced-execute) + + ("\C-h" help-command) + ("\C-n" diced-next-line) + ("\C-p" previous-line) + ("\C-u" diced-use) + ("\C-v" scroll-up) + + ([down] diced-next-line) + ([help] help-command) + ([next] diced-next-line) + ([prior] previous-line) + ([up] previous-line) + + ("\e<" beginning-of-buffer) + ("\e>" diced-end-of-buffer) + ("\eh" diced-hindo-set) + ("\ev" diced-scroll-down))) + (apply 'define-key diced-mode-map elem)) + +;;; +;;; set comment on dictionary +;;; + +(defun set-dict-comment () + (interactive) + (if (null (wnn-server-isconnect)) (EGG:open-wnn)) + (wnn-server-set-rev nil) + (let*((dic-list (wnn-server-dict-list)) + (writable-dic-list (wnn-server-hinsi-dicts -1)) + (dict-number + (menu:select-from-menu + (list 'menu (egg:msg-get 'jishomei) + (mapcar '(lambda (x) + (let ((y (assoc x dic-list))) + (cons (nth 1 y) (nth 0 y)))) + writable-dic-list)))) + (comment (read-from-minibuffer (egg:msg-get 'comment) + (wnn-dict-name dict-number dic-list)))) + (if (wnn-server-dict-comment dict-number comment) + (notify (egg:msg-get 'jisho-comment) + (wnn-dict-name dict-number dic-list) comment) + (egg:error (wnn-server-get-msg))))) + + +;;; +;;; Pure inspect facility +;;; + +(defun henkan-inspect-bunsetu () + (interactive) + (let ((info (wnn-server-inspect *bunsetu-number*))) + (if (null info) + (notify (wnn-server-get-msg)) + (progn + (let ((dic-list (wnn-server-dict-list))) + (if (null dic-list) + (notify (wnn-server-get-msg)) + (progn + (let ((hinsi (wnn-server-hinsi-name (nth 4 info))) + (kanji (nth 0 info)) + (yomi (nth 1 info)) + (serial (nth 3 info)) + (hindo (nth 5 info)) + (jisho (wnn-dict-name (nth 2 info) dic-list)) + (ima (nth 6 info)) + (hyoka (nth 7 info)) + (daihyoka (nth 8 info)) + (kangovect (nth 9 info))) + (notify-internal + (format "%s %s(%s %s:%s Freq:%s%s) S:%s D:%s V:%s " + kanji yomi hinsi jisho serial + (if (= ima 1) "*" " ") + hindo hyoka daihyoka kangovect) + t))))))))) + +(provide 'wnn-egg) + +;;; wnn-egg.el ends here --- emacs-21.2/src/Makefile.in~ 2001-12-17 14:09:32 +0000 +++ emacs-21.2/src/Makefile.in 2003-02-12 06:55:49 +0000 @@ -245,6 +245,30 @@ #define C_SWITCH_ASM #endif +#ifndef LIBS_MULE +# define LIBS_MULE +#endif /* LIBS_MULE */ + +#ifndef C_SWITCH_WNN +# define C_SWITCH_WNN +#endif /* C_SWITCH_WNN */ + +#ifndef LD_SWITCH_WNN +# define LD_SWITCH_WNN +#endif /* LD_SWITCH_WNN */ + +#ifndef C_SWITCH_CANNA +# define C_SWITCH_CANNA +#endif /* C_SWITCH_CANNA */ + +#ifndef LD_SWITCH_CANNA +# define LD_SWITCH_CANNA +#endif /* LD_SWITCH_CANNA */ + +#ifndef LD_SWITCH_CANNA_AUX +# define LD_SWITCH_CANNA_AUX +#endif /* LD_SWITCH_CANNA_AUX */ + #ifdef USE_X_TOOLKIT #define USE_@X_TOOLKIT_TYPE@ TOOLKIT_DEFINES = -DUSE_@X_TOOLKIT_TYPE@ @@ -265,7 +289,7 @@ /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAG) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS} +ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(MYCPPFLAG) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_WNN C_SWITCH_CANNA ${CFLAGS} .c.o: $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< @@ -495,7 +519,8 @@ #endif /* not ORDINARY_LINK */ ALL_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE \ - LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE $(LDFLAGS) + LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE LD_SWITCH_WNN \ + LD_SWITCH_CANNA $(LDFLAGS) /* A macro which other sections of Makefile can redefine to munge the flags before they're passed to LD. This is helpful if you have @@ -526,12 +551,24 @@ #endif #endif +#ifdef WNN +# define WNN_OBJ wnnfns.o +#else /* not WNN */ +# define WNN_OBJ +#endif /* not WNN */ + +#ifdef CANNA +# define CANNA_OBJ canna.o +#else /* not CANNA */ +# define CANNA_OBJ +#endif /* not CANNA */ + /* lastfile must follow all files whose initialized data areas should be dumped as pure by dump-emacs. */ obj= dispnew.o frame.o scroll.o xdisp.o xmenu.o window.o \ charset.o coding.o category.o ccl.o\ - cm.o term.o xfaces.o $(XOBJ) \ + cm.o term.o xfaces.o $(XOBJ) WNN_OBJ CANNA_OBJ\ emacs.o keyboard.o macros.o keymap.o sysdep.o \ buffer.o filelock.o insdel.o marker.o \ minibuf.o fileio.o dired.o filemode.o \ @@ -633,6 +670,40 @@ #define WINNT_SUPPORT #endif +#ifdef WNN +#define WNN_SUPPORT ${lispsource}egg.elc ${lispsource}wnn-egg.elc +#define WNN_ELC ${dotdot}/lisp/egg.elc ${dotdot}/lisp/wnn-egg.elc +#else +#define WNN_SUPPORT +#define WNN_ELC +#endif + +#ifdef SJ3 +#define SJ3_SUPPORT ${lispsource}egg.elc ${lispsource}sj3-client.elc ${lispsource}sj3-egg.elc +#define SJ3_ELC ${dotdot}/lisp/sj3-client.elc ${dotdot}/lisp/sj3-egg.elc +#else +#define SJ3_SUPPORT +#define SJ3_ELC +#endif + +#ifdef CANNA +#define CANNA_SUPPORT ${lispsource}canna.elc +#define CANNA_ELC ${dotdot}/lisp/canna.elc +#else +#define CANNA_SUPPORT +#define CANNA_ELC +#endif + +#define MULE_SUPPORT_EXTRA \ + WNN_SUPPORT \ + SJ3_SUPPORT \ + CANNA_SUPPORT + +#define MULE_SOME_MACHINE_LISP \ + WNN_ELC \ + SJ3_ELC \ + CANNA_ELC + /* List of Lisp files loaded into the dumped Emacs. It's arranged like this because it's easier to generate it semi-mechanically from loadup.el this way. @@ -646,6 +717,9 @@ in SOME_MACHINE_LISP. */ lisp= \ + WNN_SUPPORT \ + SJ3_SUPPORT \ + CANNA_SUPPORT \ ${lispsource}abbrev.elc \ ${lispsource}buff-menu.elc \ ${lispsource}byte-run.elc \ @@ -664,6 +738,7 @@ ${lispsource}help.elc \ ${lispsource}indent.elc \ ${lispsource}isearch.elc \ + ${lispsource}isearch-ext.elc \ ${lispsource}loadup.el \ ${lispsource}loaddefs.el \ ${lispsource}bindings.elc \ @@ -711,6 +786,7 @@ ${lispsource}textmodes/fill.elc \ ${lispsource}textmodes/page.elc \ ${lispsource}textmodes/paragraphs.elc \ + ${lispsource}textmodes/picture.elc \ ${lispsource}textmodes/text-mode.elc \ ${lispsource}vc-hooks.elc \ ${lispsource}ediff-hook.elc \ @@ -810,7 +886,8 @@ ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc \ ${dotdot}/lisp/disp-table.elc ${dotdot}/lisp/dos-vars.elc \ ${dotdot}/lisp/international/ccl.elc \ - ${dotdot}/lisp/international/codepage.elc + ${dotdot}/lisp/international/codepage.elc \ + MULE_SOME_MACHINE_LISP /* Construct full set of libraries to be linked. Note that SunOS needs -lm to come before -lc; otherwise, you get @@ -818,6 +895,7 @@ with GCC, we might need gnulib again after them. */ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \ LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \ + LIBS_MULE \ LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \ $(GNULIB_VAR) @@ -833,7 +911,30 @@ all: emacs OTHER_FILES +/* 93.2.10 by K.Handa */ +#ifdef SUFFIX_BUG +elc-patched: +#else +.SUFFIXES: .elc .el +.el.elc: +#endif /* not SUFFIX_BUG */ +#ifdef MSDOS + coff2exe temacs + temacs.exe -batch -l mule-inst.el ${lisp} +#else +#ifdef HAVE_SHM + ./temacs -nl -batch -l mule-inst.el ${lisp} +#else + ./temacs -batch -l mule-inst.el ${lisp} +#endif +#endif +/* end of patch */ + +#ifdef SUFFIX_BUG +emacs: temacs elc-patched ${etc}DOC ${lisp} +#else emacs: temacs ${etc}DOC ${lisp} +#endif #ifdef CANNOT_DUMP rm -f emacs ln temacs emacs --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/src/canna.c 2003-02-12 06:55:49 +0000 @@ -0,0 +1,1387 @@ +/* + CANNA interface for NEmacs + + This file is a part of Canna on Nemacs. + + Canna on Nemacs is distributed in the forms of patches + to Nemacs under the terms of the GNU EMACS GENERAL + PUBLIC LICENSE which is distributed along with GNU Emacs + by the Free Software Foundation. + + Canna on Nemacs is distributed in the hope that it will + be useful, but WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU EMACS GENERAL PUBLIC + LICENSE for more details. + + You should have received a copy of the GNU EMACS GENERAL + PUBLIC LICENSE along with Nemacs; see the file COPYING. + If not, write to the Free Software Foundation, 675 Mass + Ave, Cambridge, MA 02139, USA. + + Authors: Akira Kon (kon@d1.bs2.mt.nec.co.jp) + Ichiro Hirakura (hirakura@uxp.bs2.mt.nec.co.jp) + + Functions defined in this file are + + (canna-key-proc key) + key: single STRING + RETURNS: + Length of converted string if no error occurs. + Error string if error occurs. + DESCRIPTION: + Convert a key input to a set of strings. The + strings contain both well-formed string and a + intermediate result to show the translation + information to a user. converted strings are + stored in specific variables. + + (canna-initialize) + RETURNS: + List of the following things: + - list of keys to toggle Japanese-mode + - error message + - list of warning messages + DESCRIPTION: + Initialize ``canna'', which is a kana-to-kanji + converter for GNU Emacs. The first arg + specifies if inserting space character between + BUNSETSU when candidates are displayed. The + second arg specifies server. The third arg + specifies a file which will be used as a + customization description. If nil is + specified for each arg, the default value will + be used. + + (canna-finalize) + RETURNS: + list of warning messages + DESCRIPTION: + finalize ``canna'', which is a kana-to-kanji + converter for GNU Emacs. This cause to write + miscellaneous informations to kana-to-kanji + dictionary. + + (canna-touroku-string string) + string: + String to register to a dictionary. + RETURNS: + The same thing returns as canna-key-proc does. + DESCRIPTION: + Register Kanji words into kana-to-kanji + conversion dictionary. + + (canna-set-width width) + width: + Column width of the place where the candidates + of kana-to-kanji conversion will be shown. + RETURNS: + nil + DESCRIPTION: + Set status-line width information, which is + used to display kanji candidates. + + (canna-change-mode num) + num: + The mode number of Canna. + RETURNS: + The same thing returns as canna-key-proc does. + DESCRIPTION: + Change Japanese pre-edit mode. + + (canna-store-yomi yomi roma) + yomi: + ``Yomi'' to be stored. + roma: + ``Romaji'' which corresponds to the ``Yomi''. + RETURNS: + The same thing returns as canna-key-proc does. + DESCRIPTION: + Store yomi characters as a YOMI of + kana-to-kanji conversion. + + (canna-do-function num ch) + num: + A function number to be called. + ch: + A character will be specified in order to feed + the character to the function if the function + needs a input character. + RETURNS: + The same thing returns as canna-key-proc does. + DESCRIPTION: + Do specified function at current mode. + + (canna-parse string) + string: + To be parsed. + RETURNS: + List of warning messages. + DESCRIPTION: + Parse customize string. + + (canna-query-mode) + RETURNS: + A string which indicate the current mode. + DESCRIPTION: + Get current mode string. + + Functions below are used for KKCP compatible library. These + functions provides a base kana-to-kanji conversion system for EGG. + These functions may be used when users want to change the engine + from Wnn to Canna without changing user interface of Japanese input. + + (canna-henkan-begin) + (canna-henkan-next) + (canna-bunsetu-henkou) + (canna-henkan-kakutei) + (canna-henkan-end) + (canna-henkan-quit) + + */ + +#ifndef lint +static char rcs_id[] = "$Id: canna.c,v 1.35 1994/03/15 08:00:03 kon Exp $"; +#endif + +#include + +#include "config.h" +#include "lisp.h" +#include "buffer.h" +#ifdef CANNA_MULE +#include "charset.h" +#include "coding.h" +#endif + +#ifdef CANNA2 +#define IROHA_BC +#include "canna/jrkanji.h" +#include "canna/RK.h" +#else /* !CANNA2 */ +#include "iroha/jrkanji.h" +#include "iroha/RK.h" +#endif /* !CANNA2 */ +extern char *jrKanjiError; + +#define KEYTOSTRSIZE 2048 +static unsigned char buf[KEYTOSTRSIZE]; +static char **warning; + +static int Vcanna_empty_info, Vcanna_through_info; +static int Vcanna_underline; +static int Vcanna_inhibit_hankakukana; /* hir, 1994.12.5 */ + +static Lisp_Object Vcanna_kakutei_string; +static Lisp_Object Vcanna_kakutei_yomi; +static Lisp_Object Vcanna_kakutei_romaji; +static Lisp_Object Vcanna_henkan_string; +static int Vcanna_henkan_length; +static int Vcanna_henkan_revPos; +static int Vcanna_henkan_revLen; +static Lisp_Object Vcanna_ichiran_string; +static int Vcanna_ichiran_length; +static int Vcanna_ichiran_revPos; +static int Vcanna_ichiran_revLen; +static Lisp_Object Vcanna_mode_string; + +static int IRCP_context; + +#if __STDC__ +static Lisp_Object storeResults(unsigned char *, int, jrKanjiStatus *); +static Lisp_Object kanjiYomiList(int, int); +#else +static Lisp_Object storeResults(); +static Lisp_Object kanjiYomiList(); +#endif + +#ifdef CANNA_MULE +#if __STDC__ +static m2c(unsigned char *, int, unsigned char *); +static Lisp_Object mule_make_string(unsigned char *, int); +static mule_strlen(unsigned char *, int); +static count_char(unsigned char *,int, int, int, int *, int *, int *); +#else +static m2c(); +static Lisp_Object mule_make_string(); +static mule_strlen(); +static count_char(); +#endif +#define make_string mule_make_string +#endif + +/* Lisp functions definition */ + +DEFUN ("canna-key-proc", Fcanna_key_proc, Scanna_key_proc, + 1, 1, 0, +"Translate a key input to a set of strings. The strings contain both\n\ +well-formed string and intermediate result to show the translation\n\ +information to a user. Converted strings are stored in specific\n\ +variables.") + (ch) +Lisp_Object ch; +{ + jrKanjiStatus ks; + int len; + + CHECK_NUMBER (ch, 0); + len = jrKanjiString(0, XINT (ch), buf, KEYTOSTRSIZE, &ks); + return storeResults(buf, len, &ks); +} + +static +Lisp_Object +storeResults(buf, len, ks) +unsigned char *buf; +int len; +jrKanjiStatus *ks; +{ + Lisp_Object val = Qnil; + + if (len < 0) { /* Error detected */ + val = make_string((unsigned char*)jrKanjiError, strlen(jrKanjiError)); + } + else { + /* ³ÎÄꤷ¤¿Ê¸»úÎó */ + Vcanna_kakutei_string = make_string(buf, len); + val = make_number(len); + /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... */ + Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil; + if (ks->info & KanjiYomiInfo) { + unsigned char *p = buf + len + 1; + int yomilen = strlen(p); + + if (len + yomilen + 1 < KEYTOSTRSIZE) { + int yomilen2; + + Vcanna_kakutei_yomi = make_string(p, yomilen); /* ÆÉ¤ß */ + p += yomilen + 1; + yomilen2 = strlen(p); + if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE) { + Vcanna_kakutei_romaji = make_string(p, yomilen2); /* ¥í¡¼¥Þ»ú */ + } + } + } + + + /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£*/ + Vcanna_henkan_string = Qnil; + if (ks->length >= 0) { + Vcanna_henkan_string = make_string(ks->echoStr, ks->length); +#ifndef CANNA_MULE + Vcanna_henkan_length = ks->length; + Vcanna_henkan_revPos = ks->revPos; + Vcanna_henkan_revLen = ks->revLen; +#else /* CANNA_MULE */ + if (Vcanna_underline) { + Vcanna_henkan_length = mule_strlen(ks->echoStr,ks->length); + Vcanna_henkan_revPos = mule_strlen(ks->echoStr,ks->revPos); + Vcanna_henkan_revLen = mule_strlen(ks->echoStr+ks->revPos,ks->revLen); + } + else { + count_char(ks->echoStr, ks->length, ks->revPos, ks->revLen, + &Vcanna_henkan_length, &Vcanna_henkan_revPos, + &Vcanna_henkan_revLen); + } +#endif /* CANNA_MULE */ + } + + /* °ìÍ÷¤Î¾ðÊó */ + Vcanna_ichiran_string = Qnil; + if (ks->info & KanjiGLineInfo && ks->gline.length >= 0) { + Vcanna_ichiran_string = make_string(ks->gline.line, ks->gline.length); +#ifndef CANNA_MULE + Vcanna_ichiran_length = ks->gline.length; + Vcanna_ichiran_revPos = ks->gline.revPos; + Vcanna_ichiran_revLen = ks->gline.revLen; +#else /* CANNA_MULE */ + count_char(ks->gline.line, ks->gline.length, + ks->gline.revPos, ks->gline.revLen, &Vcanna_ichiran_length, + &Vcanna_ichiran_revPos, &Vcanna_ichiran_revLen); +#endif /* CANNA_MULE */ + } + + /* ¥â¡¼¥É¤Î¾ðÊó */ + Vcanna_mode_string = Qnil; + if (ks->info & KanjiModeInfo) { + Vcanna_mode_string = make_string(ks->mode, strlen(ks->mode)); + } + + /* ¤½¤Î¾¤Î¾ðÊó */ + Vcanna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0; + Vcanna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0; + } + + return val; +} + +DEFUN ("canna-set-bunsetsu-kugiri", Fcanna_set_bunsetsu, Scanna_set_bunsetsu, + 0, 1, 0, +"This function sets the clause separator.\n\ +If non-nil value is specified, the white space separator will be used.\n\ +No separator will be used otherwise.") + (num) + Lisp_Object num; +{ + int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */ + + kugiri = NILP(num) ? 0 : 1; + + jrKanjiControl(0, KC_SETBUNSETSUKUGIRI, (char *)kugiri); + + return Qnil; +} + +DEFUN ("canna-initialize", Fcanna_initialize, Scanna_initialize, 0, 3, 0, +"Initialize ``canna'', which is a kana-to-kanji converter for GNU Emacs.\n\ +The first arg specifies if inserting space character between BUNSETSU when\n\ +candidates are displayed.\n\ +The second arg specifies server.\n\ +The third arg specifies a file which will be used as a customization\n\ +description.\n\ +If nil is specified for each arg, the default value will be used.") +(num, server, rcfile) +Lisp_Object num, server, rcfile; +{ + Lisp_Object val; + int res; + unsigned char **p, **q; + + int kugiri; /* ʸÀá¶èÀÚ¤ê¤ò¤¹¤ë¤«¡© */ + + IRCP_context = -1; + + if (NILP(num)) { + kugiri = 1; + } + else { + CHECK_NUMBER(num, 0); + kugiri = XINT(num); + kugiri = (kugiri == 1) ? 1 : 0; + } + + if (NILP(server)) { + jrKanjiControl(0, KC_SETSERVERNAME, (char *)0); + } + else { + char servername[256]; + + CHECK_STRING(server, 0); + strncpy(servername, XSTRING(server)->data, XSTRING(server)->size); + servername[XSTRING(server)->size] = '\0'; + jrKanjiControl(0, KC_SETSERVERNAME, servername); + } + + if (NILP(rcfile)) { + jrKanjiControl(0, KC_SETINITFILENAME, (char *)0); + } + else { + char rcname[256]; + + CHECK_STRING(rcfile, 0); + strncpy(rcname, XSTRING(rcfile)->data, XSTRING(rcfile)->size); + rcname[XSTRING(rcfile)->size] = '\0'; + jrKanjiControl(0, KC_SETINITFILENAME, rcname); + } + + warning = (char **)0; +#ifdef nec_ews_svr4 /* hir, 1994.2.24 */ + stop_polling (); +#endif /* nec_ews_svr4 */ + res = jrKanjiControl(0, KC_INITIALIZE, (char *)&warning); +#ifdef nec_ews_svr4 /* hir, 1994.2.24 */ + start_polling (); +#endif /* nec_ews_svr4 */ + val = Qnil; + if (warning) { + for (p = q = (unsigned char **)warning ; *q ; q++) + ; + while (p < q) { + q--; + val = Fcons(make_string(*q, strlen(*q)), val); + } + } + val = Fcons(val, Qnil); + + if (res == -1) { + val = Fcons(make_string((unsigned char*)jrKanjiError, + strlen(jrKanjiError)), val); + /* ¥¤¥Ë¥·¥ã¥é¥¤¥º¤Ç¼ºÇÔ¤·¤¿¾ì¹ç¡£ */ + return Fcons(Qnil, val); + } + else { + extern (*jrBeepFunc)(); + Lisp_Object Fding(), CANNA_mode_keys(); + + jrBeepFunc = Fding; + +#ifdef KC_SETAPPNAME +#ifndef CANNA_MULE + wcKanjiControl(0, KC_SETAPPNAME, "nemacs"); +#else /* CANNA_MULE */ + wcKanjiControl(0, KC_SETAPPNAME, "mule"); +#endif /* CANNA_MULE */ +#endif /* KC_SETAPPNAME */ + + jrKanjiControl(0, KC_SETBUNSETSUKUGIRI, (char *)kugiri); + jrKanjiControl(0, KC_SETWIDTH, (char *)78); +#ifndef CANNA_MULE + jrKanjiControl(0, KC_INHIBITHANKAKUKANA, (char *)1); +#else /* hir, 1994.12.5 */ + /* mule ¤À¤Ã¤¿¤éȾ³Ñ¥«¥¿¥«¥Ê¤â»È¤¨¤ë */ + if (Vcanna_inhibit_hankakukana) + jrKanjiControl(0, KC_INHIBITHANKAKUKANA, (char *)1); +#endif + jrKanjiControl(0, KC_YOMIINFO, (char *)2); /* ¢¨£²: ¥í¡¼¥Þ»ú¤Þ¤ÇÊÖ¤¹ */ + val = Fcons(Qnil, val); + return Fcons(CANNA_mode_keys(), val); + } +} + +DEFUN ("canna-finalize", Fcanna_finalize, Scanna_finalize, 0, 0, 0, +"finalize ``canna'', which is a kana-to-kanji converter for GNU Emacs.\n\ +This cause to write miscellaneous informations to kana-to-kanji dictionary.") +() +{ + Lisp_Object val; + unsigned char **p; + + jrKanjiControl(0, KC_FINALIZE, (char *)&warning); + + val = Qnil; + if (warning) { + for (p = (unsigned char**)warning ; *p ; p++) { + val = Fcons(make_string(*p, strlen(*p)), val); + } + } + val = Fcons(val, Qnil); + IRCP_context = -1; + return val; +} + +DEFUN ("canna-touroku-string", Fcanna_touroku_string, + Scanna_touroku_string, 1, 1, 0, +"Register Kanji words into kana-to-kanji conversion dictionary.") + (str) +Lisp_Object str; +{ + jrKanjiStatusWithValue ksv; + jrKanjiStatus ks; + int len; + Lisp_Object val; +#ifdef CANNA_MULE + unsigned char cbuf[4096]; +#endif + + CHECK_STRING(str, 0); + ksv.buffer = (unsigned char *)buf; + ksv.bytes_buffer = KEYTOSTRSIZE; +#ifndef CANNA_MULE + ks.echoStr = XSTRING (str)->data; + ks.length = XSTRING (str)->size; +#else /* CANNA_MULE */ +#ifdef STRING_BYTES + m2c(XSTRING (str)->data, STRING_BYTES (XSTRING (str)), cbuf); +#else /* for byte indexing emacsen (Emacs 20.2) */ + m2c(XSTRING (str)->data, XSTRING (str)->size, cbuf); +#endif /* STRING_BYTES */ + ks.echoStr = cbuf; + ks.length = strlen(cbuf); +#endif /* CANNA_MULE */ + ksv.ks = &ks; + len = jrKanjiControl(0, KC_DEFINEKANJI, (char *)&ksv); + val = storeResults(buf, ksv.val, ksv.ks); + return val; +} + +DEFUN ("canna-set-width", Fcanna_set_width, + Scanna_set_width, 1, 1, 0, +"Set status-line width information, which is used to display \n\ +kanji candidates.") + (num) +Lisp_Object num; +{ + CHECK_NUMBER(num, 0); + + jrKanjiControl(0, KC_SETWIDTH, (char *)XINT (num)); + return Qnil; +} + +DEFUN ("canna-change-mode", Fcanna_change_mode, + Scanna_change_mode, 1, 1, 0, +"Change Japanese pre-edit mode.") + (num) +Lisp_Object num; +{ + jrKanjiStatusWithValue ksv; + jrKanjiStatus ks; + Lisp_Object val; + + CHECK_NUMBER(num, 0); + + ksv.buffer = (unsigned char *)buf; + ksv.bytes_buffer = KEYTOSTRSIZE; + ksv.ks = &ks; + ksv.val = XINT (num); + jrKanjiControl(0, KC_CHANGEMODE, (char *)&ksv); + val = storeResults(buf, ksv.val, ksv.ks); + return val; +} + +Lisp_Object +CANNA_mode_keys() +{ +#define CANNAWORKBUFSIZE 32 + char xxx[CANNAWORKBUFSIZE]; + Lisp_Object val; + int i, n; + + n = jrKanjiControl(0, KC_MODEKEYS, xxx); + val = Qnil; + for (i = n ; i > 0 ;) { + --i; + val = Fcons(make_number((int)(0xFF & (unsigned char)xxx[i])), val); + } + return val; +} + +DEFUN ("canna-store-yomi", Fcanna_store_yomi, Scanna_store_yomi, + 1, 2, 0, +"Store yomi characters as a YOMI of kana-to-kanji conversion.") + (yomi, roma) +Lisp_Object yomi, roma; +{ + jrKanjiStatusWithValue ksv; + jrKanjiStatus ks; + + CHECK_STRING(yomi, 0); +#ifndef CANNA_MULE + strncpy(buf, XSTRING(yomi)->data, XSTRING(yomi)->size); + ks.length = XSTRING (yomi)->size; + buf[ks.length] = '\0'; +#else /* CANNA_MULE */ +#ifdef STRING_BYTES + m2c(XSTRING(yomi)->data, STRING_BYTES (XSTRING(yomi)), buf); +#else /* for byte indexing emacsen (Emacs 20.2) */ + m2c(XSTRING(yomi)->data, XSTRING(yomi)->size, buf); +#endif /* STRING_BYTES */ + ks.length = strlen(buf); +#endif /* CANNA_MULE */ + + if (NILP(roma)) { + ks.mode = 0; + } + else { + CHECK_STRING(roma, 0); + +#ifndef CANNA_MULE + strncpy(buf + XSTRING(yomi)->size + 1, XSTRING(roma)->data, + XSTRING(roma)->size); + buf[XSTRING(yomi)->size + 1 + XSTRING(roma)->size] = '\0'; + ks.mode = (unsigned char *)(buf + XSTRING(yomi)->size + 1); +#else /* CANNA_MULE */ + ks.mode = (unsigned char *)(buf + ks.length + 1); +#ifdef STRING_BYTES + m2c(XSTRING(roma)->data, STRING_BYTES (XSTRING(roma)), ks.mode); +#else /* for byte indexing emacsen (Emacs 20.2) */ + m2c(XSTRING(roma)->data, XSTRING(roma)->size, ks.mode); +#endif /* STRING_BYTES */ +#endif /* CANNA_MULE */ + } + + ks.echoStr = (unsigned char *)buf; + ksv.buffer = (unsigned char *)buf; /* ÊÖÃÍÍÑ */ + ksv.bytes_buffer = KEYTOSTRSIZE; + ksv.ks = &ks; + + jrKanjiControl(0, KC_STOREYOMI, (char *)&ksv); + + return storeResults(buf, ksv.val, ksv.ks); +} + +DEFUN ("canna-do-function", Fcanna_do_function, Scanna_do_function, + 1, 2, 0, +"Do specified function at current mode.") + (num, ch) +Lisp_Object num, ch; +{ + jrKanjiStatusWithValue ksv; + jrKanjiStatus ks; + Lisp_Object val; + + CHECK_NUMBER(num, 0); + + if (NILP(ch)) { + *buf = '@'; + } + else { + CHECK_NUMBER(ch, 0); + *buf = XINT (ch); + } + + ksv.buffer = (unsigned char *)buf; + ksv.bytes_buffer = KEYTOSTRSIZE; + ksv.ks = &ks; + ksv.val = XINT (num); + jrKanjiControl(0, KC_DO, (char *)&ksv); + val = storeResults(buf, ksv.val, ksv.ks); + return val; +} + +DEFUN ("canna-parse", Fcanna_parse, Scanna_parse, + 1, 1, 0, +"Parse customize string.") + (str) +Lisp_Object str; +{ + jrKanjiStatusWithValue ksv; + jrKanjiStatus ks; + Lisp_Object val; + unsigned char **p; + int n; + + CHECK_STRING(str, 0); + +#ifndef CANNA_MULE + strncpy(buf, XSTRING(str)->data, XSTRING(str)->size); + buf[XSTRING(str)->size] = '\0'; +#else /* CANNA_MULE */ +#ifdef STRING_BYTES + m2c(XSTRING(str)->data, STRING_BYTES (XSTRING(str)), buf); +#else /* for byte indexing emacsen (Emacs 20.2) */ + m2c(XSTRING(str)->data, XSTRING(str)->size, buf); +#endif /* STRING_BYTES */ +#endif /* CANNA_MULE */ + p = (unsigned char**)buf; + n = jrKanjiControl(0, KC_PARSE, (char *)&p); + val = Qnil; + while (n > 0) { + n--; + val = Fcons(make_string(p[n], strlen(p[n])), val); + } + return val; +} + +DEFUN ("canna-query-mode", Fcanna_query_mode, Scanna_query_mode, + 0, 0, 0, +"Get current mode string.") + () +{ + unsigned char buf[256]; + + jrKanjiControl(0, KC_QUERYMODE, buf); + return make_string(buf, strlen(buf)); +} + +/* + * Functions following this line are for KKCP interface compatible + * library. These functions may be used by MILK system. + */ + +#define RKBUFSIZE 1024 + +static unsigned char yomibuf[RKBUFSIZE]; +static short kugiri[RKBUFSIZE / 2]; + +static confirmContext() +{ + if (IRCP_context < 0) { + int context; + + if ((context = jrKanjiControl(0, KC_GETCONTEXT, (char *)0)) == -1) { + return 0; + } + IRCP_context = context; + } + return 1; +} + +static byteLen(bun, len) +int bun, len; +{ + int i = 0, offset = 0, ch; + + if (0 <= bun && bun < RKBUFSIZE) { + offset = kugiri[bun]; + } + + while (len-- > 0 && (ch = (int)yomibuf[offset + i])) { + i++; + if (ch & 0x80) { + i++; + } + } + return i; +} + +DEFUN ("canna-henkan-begin", Fcanna_henkan_begin, Scanna_henkan_begin, + 1, 1, 0, +"¤«¤Ê´Á»úÊÑ´¹¤·¤¿·ë²Ì¤òÊÖ´Ô¤¹¤ë¡£Ê¸ÀáÀڤ꤬¤·¤Æ¤¢¤ë¡£") + (yomi) + Lisp_Object yomi; +{ + int nbun; + Lisp_Object res; + + CHECK_STRING(yomi, 0); + if (confirmContext() == 0) { + return Qnil; + } +#ifndef CANNA_MULE + strncpy(yomibuf, XSTRING(yomi)->data, XSTRING(yomi)->size); + yomibuf[XSTRING(yomi)->size] = '\0'; + nbun = RkBgnBun(IRCP_context, XSTRING(yomi)->data, XSTRING(yomi)->size, + (RK_XFER << RK_XFERBITS) | RK_KFER); +#else /* CANNA_MULE */ +#ifdef STRING_BYTES + m2c(XSTRING(yomi)->data, STRING_BYTES (XSTRING(yomi)), yomibuf); +#else /* for byte indexing emacsen (Emacs 20.2) */ + m2c(XSTRING(yomi)->data, XSTRING(yomi)->size, yomibuf); +#endif /* STRING_BYTES */ + nbun = RkBgnBun(IRCP_context, (char *)yomibuf, strlen(yomibuf), + (RK_XFER << RK_XFERBITS) | RK_KFER); +#endif /* CANNA_MULE */ + + return kanjiYomiList(IRCP_context, nbun); +} + +static Lisp_Object kanjiYomiList(context, nbun) +int context, nbun; +{ + Lisp_Object val, res = Qnil; + unsigned char RkBuf[RKBUFSIZE]; + int len, i, total; + + for (i = nbun ; i > 0 ; ) { + i--; + RkGoTo(context, i); + len = RkGetKanji(context, RkBuf, RKBUFSIZE); + val = make_string(RkBuf, len); + len = RkGetYomi(context, RkBuf, RKBUFSIZE); + res = Fcons(Fcons(val, make_string(RkBuf, len)), res); + if (i < RKBUFSIZE / 2) { + kugiri[i] = len; + } + } + for (i = 0, total = 0 ; i < nbun ; i++) { + int temp = kugiri[i]; + kugiri[i] = total; + total += temp; + } + return res; +} + +DEFUN ("canna-henkan-next", Fcanna_henkan_next, Scanna_henkan_next, + 1, 1, 0, +"¸õÊä°ìÍ÷¤òµá¤á¤ë¡£") + (bunsetsu) + Lisp_Object bunsetsu; +{ + int i, nbun, slen, len; + unsigned char *p, RkBuf[RKBUFSIZE]; + Lisp_Object res = Qnil, endp; + + CHECK_NUMBER(bunsetsu, 0); + if (confirmContext() == 0) { + return Qnil; + } + RkGoTo(IRCP_context, XINT (bunsetsu)); + len = RkGetKanjiList(IRCP_context, RkBuf, RKBUFSIZE); + p = RkBuf; + for (i = 0 ; i < len ; i++) { + slen = strlen(p); + if (res == Qnil) { + endp = res = Fcons(make_string(p, slen), Qnil); + } + else { + endp = XCONS (endp)->cdr = Fcons(make_string(p, slen), Qnil); + } + p += slen + 1; + } + return res; +} + +DEFUN ("canna-bunsetu-henkou", Fcanna_bunsetu_henkou, Scanna_bunsetu_henkou, + 2, 2, 0, +"ʸÀá¤ÎŤµ¤ò»ØÄꤹ¤ë¡£") + (bunsetsu, bunlen) + Lisp_Object bunsetsu, bunlen; +{ + int nbun, len; + + CHECK_NUMBER(bunsetsu, 0); + CHECK_NUMBER(bunlen, 0); + + nbun = XINT (bunsetsu); + if (confirmContext() == 0) { + return Qnil; + } + RkGoTo(IRCP_context, nbun); + len = byteLen(nbun, XINT(bunlen)); + return kanjiYomiList(IRCP_context, RkResize(IRCP_context, len)); +} + +DEFUN ("canna-henkan-kakutei", Fcanna_henkan_kakutei, Scanna_henkan_kakutei, + 2, 2, 0, +"¸õÊäÁªÂò¡£") + (bun, kouho) +register Lisp_Object bun, kouho; +{ + if (confirmContext() == 0) { + return Qnil; + } + RkGoTo(IRCP_context, bun); + RkXfer(IRCP_context, kouho); + return Qt; +} + +DEFUN ("canna-henkan-end", Fcanna_henkan_end, Scanna_henkan_end, + 0, 0, 0, +"ÊÑ´¹½ªÎ»¡£") + () +{ + if (confirmContext() == 0) { + return Qnil; + } + RkEndBun(IRCP_context, 1); /* ³Ø½¬¤Ï¤¤¤Ä¤Ç¤â¹Ô¤Ã¤ÆÎɤ¤¤â¤Î¤Ê¤Î¤«¡© */ + return Qt; +} + +DEFUN ("canna-henkan-quit", Fcanna_henkan_quit, Scanna_henkan_quit, + 0, 0, 0, +"ÊÑ´¹½ªÎ»¡£") + () +{ + if (confirmContext() == 0) { + return Qnil; + } + RkEndBun(IRCP_context, 0); + return Qt; +} + +/* variables below this line is constants of Canna */ + +static int Vcanna_mode_AlphaMode = IROHA_MODE_AlphaMode; +static int Vcanna_mode_EmptyMode = IROHA_MODE_EmptyMode; +static int Vcanna_mode_KigoMode = IROHA_MODE_KigoMode; +static int Vcanna_mode_YomiMode = IROHA_MODE_YomiMode; +static int Vcanna_mode_JishuMode = IROHA_MODE_JishuMode; +static int Vcanna_mode_TankouhoMode = IROHA_MODE_TankouhoMode; +static int Vcanna_mode_IchiranMode = IROHA_MODE_IchiranMode; +static int Vcanna_mode_YesNoMode = IROHA_MODE_YesNoMode; +static int Vcanna_mode_OnOffMode = IROHA_MODE_OnOffMode; +#ifdef CANNA_MODE_AdjustBunsetsuMode +static int Vcanna_mode_AdjustBunsetsuMode = CANNA_MODE_AdjustBunsetsuMode; +#endif +#ifdef CANNA_MODE_ChikujiYomiMode +static int Vcanna_mode_ChikujiYomiMode = CANNA_MODE_ChikujiYomiMode; +static int Vcanna_mode_ChikujiTanMode = CANNA_MODE_ChikujiTanMode; +#endif + +static int Vcanna_mode_HenkanMode = IROHA_MODE_HenkanMode; +#ifdef CANNA_MODE_HenkanNyuryokuMode +static int Vcanna_mode_HenkanNyuryokuMode = CANNA_MODE_HenkanNyuryokuMode; +#endif +#ifdef CANNA_MODE_ZenHiraHenkanMode +static int Vcanna_mode_ZenHiraHenkanMode = CANNA_MODE_ZenHiraHenkanMode; +#ifdef CANNA_MODE_HanHiraHenkanMode +static int Vcanna_mode_HanHiraHenkanMode = CANNA_MODE_HanHiraHenkanMode; +#endif +static int Vcanna_mode_ZenKataHenkanMode = CANNA_MODE_ZenKataHenkanMode; +static int Vcanna_mode_HanKataHenkanMode = CANNA_MODE_HanKataHenkanMode; +static int Vcanna_mode_ZenAlphaHenkanMode = CANNA_MODE_ZenAlphaHenkanMode; +static int Vcanna_mode_HanAlphaHenkanMode = CANNA_MODE_HanAlphaHenkanMode; +#endif +static int Vcanna_mode_ZenHiraKakuteiMode = IROHA_MODE_ZenHiraKakuteiMode; +#ifdef CANNA_MODE_HanHiraKakuteiMode +static int Vcanna_mode_HanHiraKakuteiMode = CANNA_MODE_HanHiraKakuteiMode; +#endif +static int Vcanna_mode_ZenKataKakuteiMode = IROHA_MODE_ZenKataKakuteiMode; +static int Vcanna_mode_HanKataKakuteiMode = IROHA_MODE_HanKataKakuteiMode; +static int Vcanna_mode_ZenAlphaKakuteiMode = IROHA_MODE_ZenAlphaKakuteiMode; +static int Vcanna_mode_HanAlphaKakuteiMode = IROHA_MODE_HanAlphaKakuteiMode; +static int Vcanna_mode_HexMode = IROHA_MODE_HexMode; +static int Vcanna_mode_BushuMode = IROHA_MODE_BushuMode; +static int Vcanna_mode_ExtendMode = IROHA_MODE_ExtendMode; +static int Vcanna_mode_RussianMode = IROHA_MODE_RussianMode; +static int Vcanna_mode_GreekMode = IROHA_MODE_GreekMode; +static int Vcanna_mode_LineMode = IROHA_MODE_LineMode; +static int Vcanna_mode_ChangingServerMode = IROHA_MODE_ChangingServerMode; +static int Vcanna_mode_HenkanMethodMode = IROHA_MODE_HenkanMethodMode; +static int Vcanna_mode_DeleteDicMode = IROHA_MODE_DeleteDicMode; +static int Vcanna_mode_TourokuMode = IROHA_MODE_TourokuMode; +static int Vcanna_mode_TourokuEmptyMode = IROHA_MODE_TourokuEmptyMode; +static int Vcanna_mode_TourokuHinshiMode = IROHA_MODE_TourokuHinshiMode; +static int Vcanna_mode_TourokuDicMode = IROHA_MODE_TourokuDicMode; +static int Vcanna_mode_QuotedInsertMode = IROHA_MODE_QuotedInsertMode; +static int Vcanna_mode_BubunMuhenkanMode = IROHA_MODE_BubunMuhenkanMode; +static int Vcanna_mode_MountDicMode = IROHA_MODE_MountDicMode; + +static int Vcanna_fn_SelfInsert = IROHA_FN_SelfInsert; +static int Vcanna_fn_FunctionalInsert = IROHA_FN_FunctionalInsert; +static int Vcanna_fn_QuotedInsert = IROHA_FN_QuotedInsert; +static int Vcanna_fn_JapaneseMode = IROHA_FN_JapaneseMode; +static int Vcanna_fn_AlphaMode = IROHA_FN_AlphaMode; +static int Vcanna_fn_HenkanNyuryokuMode = IROHA_FN_HenkanNyuryokuMode; +static int Vcanna_fn_Forward = IROHA_FN_Forward; +static int Vcanna_fn_Backward = IROHA_FN_Backward; +static int Vcanna_fn_Next = IROHA_FN_Next; +static int Vcanna_fn_Prev = IROHA_FN_Prev; +static int Vcanna_fn_BeginningOfLine = IROHA_FN_BeginningOfLine; +static int Vcanna_fn_EndOfLine = IROHA_FN_EndOfLine; +static int Vcanna_fn_DeleteNext = IROHA_FN_DeleteNext; +static int Vcanna_fn_DeletePrevious = IROHA_FN_DeletePrevious; +static int Vcanna_fn_KillToEndOfLine = IROHA_FN_KillToEndOfLine; +static int Vcanna_fn_Henkan = IROHA_FN_Henkan; +static int Vcanna_fn_Kakutei = IROHA_FN_Kakutei; +static int Vcanna_fn_Extend = IROHA_FN_Extend; +static int Vcanna_fn_Shrink = IROHA_FN_Shrink; +#ifdef CANNA_FN_AdjustBunsetsu +static int Vcanna_fn_AdjustBunsetsu = CANNA_FN_AdjustBunsetsu; +#endif +static int Vcanna_fn_Quit = IROHA_FN_Quit; +static int Vcanna_fn_ConvertAsHex = IROHA_FN_ConvertAsHex; +static int Vcanna_fn_ConvertAsBushu = IROHA_FN_ConvertAsBushu; +static int Vcanna_fn_KouhoIchiran = IROHA_FN_KouhoIchiran; +static int Vcanna_fn_BubunMuhenkan = IROHA_FN_BubunMuhenkan; +static int Vcanna_fn_Zenkaku = IROHA_FN_Zenkaku; +static int Vcanna_fn_Hankaku = IROHA_FN_Hankaku; +static int Vcanna_fn_ToUpper = IROHA_FN_ToUpper; +static int Vcanna_fn_Capitalize = IROHA_FN_Capitalize; +static int Vcanna_fn_ToLower = IROHA_FN_ToLower; +static int Vcanna_fn_Hiragana = IROHA_FN_Hiragana; +static int Vcanna_fn_Katakana = IROHA_FN_Katakana; +static int Vcanna_fn_Romaji = IROHA_FN_Romaji; +#ifdef CANNA_FN_BaseHiragana +static int Vcanna_fn_BaseHiragana = CANNA_FN_BaseHiragana; +static int Vcanna_fn_BaseKatakana = CANNA_FN_BaseKatakana; +static int Vcanna_fn_BaseEisu = CANNA_FN_BaseEisu; +static int Vcanna_fn_BaseZenkaku = CANNA_FN_BaseZenkaku; +static int Vcanna_fn_BaseHankaku = CANNA_FN_BaseHankaku; +static int Vcanna_fn_BaseKana = CANNA_FN_BaseKana; +static int Vcanna_fn_BaseKakutei = CANNA_FN_BaseKakutei; +static int Vcanna_fn_BaseHenkan = CANNA_FN_BaseHenkan; +static int Vcanna_fn_BaseHiraKataToggle = CANNA_FN_BaseHiraKataToggle; +static int Vcanna_fn_BaseZenHanToggle = CANNA_FN_BaseZenHanToggle; +static int Vcanna_fn_BaseKanaEisuToggle = CANNA_FN_BaseKanaEisuToggle; +static int Vcanna_fn_BaseKakuteiHenkanToggle = + CANNA_FN_BaseKakuteiHenkanToggle; +static int Vcanna_fn_BaseRotateForward = CANNA_FN_BaseRotateForward; +static int Vcanna_fn_BaseRotateBackward = CANNA_FN_BaseRotateBackward; +#endif +static int Vcanna_fn_ExtendMode = IROHA_FN_ExtendMode; +static int Vcanna_fn_Touroku = IROHA_FN_Touroku; +static int Vcanna_fn_HexMode = IROHA_FN_HexMode; +static int Vcanna_fn_BushuMode = IROHA_FN_BushuMode; +static int Vcanna_fn_KigouMode = IROHA_FN_KigouMode; +#ifdef CANNA_FN_Mark +static int Vcanna_fn_Mark = CANNA_FN_Mark; +#endif +#ifdef CANNA_FN_TemporalMode +static int Vcanna_fn_TemporalMode = CANNA_FN_TemporalMode; +#endif + +static int Vcanna_key_Nfer = IROHA_KEY_Nfer; +static int Vcanna_key_Xfer = IROHA_KEY_Xfer; +static int Vcanna_key_Up = IROHA_KEY_Up; +static int Vcanna_key_Left = IROHA_KEY_Left; +static int Vcanna_key_Right = IROHA_KEY_Right; +static int Vcanna_key_Down = IROHA_KEY_Down; +static int Vcanna_key_Insert = IROHA_KEY_Insert; +static int Vcanna_key_Rollup = IROHA_KEY_Rollup; +static int Vcanna_key_Rolldown = IROHA_KEY_Rolldown; +static int Vcanna_key_Home = IROHA_KEY_Home; +static int Vcanna_key_Help = IROHA_KEY_Help; +static int Vcanna_key_KP_Key = IROHA_KEY_KP_Key; +static int Vcanna_key_Shift_Nfer = IROHA_KEY_Shift_Nfer; +static int Vcanna_key_Shift_Xfer = IROHA_KEY_Shift_Xfer; +static int Vcanna_key_Shift_Up = IROHA_KEY_Shift_Up; +static int Vcanna_key_Shift_Left = IROHA_KEY_Shift_Left; +static int Vcanna_key_Shift_Right = IROHA_KEY_Shift_Right; +static int Vcanna_key_Shift_Down = IROHA_KEY_Shift_Down; +static int Vcanna_key_Cntrl_Nfer = IROHA_KEY_Cntrl_Nfer; +static int Vcanna_key_Cntrl_Xfer = IROHA_KEY_Cntrl_Xfer; +static int Vcanna_key_Cntrl_Up = IROHA_KEY_Cntrl_Up; +static int Vcanna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left; +static int Vcanna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right; +static int Vcanna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down; + +/*static*/ Lisp_Object VCANNA; /* hir@nec, 1992.5.21 */ + +syms_of_canna () +{ + DEFVAR_LISP ("CANNA", &VCANNA, ""); /* hir@nec, 1992.5.21 */ + VCANNA = Qt; /* hir@nec, 1992.5.21 */ + + defsubr (&Scanna_key_proc); + defsubr (&Scanna_initialize); + defsubr (&Scanna_finalize); + defsubr (&Scanna_touroku_string); + defsubr (&Scanna_set_width); + defsubr (&Scanna_change_mode); + defsubr (&Scanna_store_yomi); + defsubr (&Scanna_do_function); + defsubr (&Scanna_parse); + defsubr (&Scanna_query_mode); + defsubr (&Scanna_set_bunsetsu); + + DEFVAR_LISP("canna-kakutei-string", &Vcanna_kakutei_string, ""); + DEFVAR_LISP("canna-kakutei-yomi", &Vcanna_kakutei_yomi, ""); + DEFVAR_LISP("canna-kakutei-romaji", &Vcanna_kakutei_romaji, ""); + DEFVAR_LISP("canna-henkan-string", &Vcanna_henkan_string, ""); + DEFVAR_INT ("canna-henkan-length", &Vcanna_henkan_length, ""); + DEFVAR_INT ("canna-henkan-revpos", &Vcanna_henkan_revPos, ""); + DEFVAR_INT ("canna-henkan-revlen", &Vcanna_henkan_revLen, ""); + DEFVAR_LISP("canna-ichiran-string", &Vcanna_ichiran_string, ""); + DEFVAR_INT ("canna-ichiran-length", &Vcanna_ichiran_length, ""); + DEFVAR_INT ("canna-ichiran-revpos", &Vcanna_ichiran_revPos, ""); + DEFVAR_INT ("canna-ichiran-revlen", &Vcanna_ichiran_revLen, ""); + DEFVAR_LISP("canna-mode-string", &Vcanna_mode_string, ""); + + DEFVAR_BOOL ("canna-empty-info", &Vcanna_empty_info, "For canna"); + DEFVAR_BOOL ("canna-through-info", &Vcanna_through_info, "For canna"); + DEFVAR_BOOL ("canna-underline", &Vcanna_underline, "For canna"); + DEFVAR_BOOL ("canna-inhibit-hankakukana", &Vcanna_inhibit_hankakukana, + "For canna"); /* hir, 1994.12.5 */ + + defsubr (&Scanna_henkan_begin); + defsubr (&Scanna_henkan_next); + defsubr (&Scanna_bunsetu_henkou); + defsubr (&Scanna_henkan_kakutei); + defsubr (&Scanna_henkan_end); + defsubr (&Scanna_henkan_quit); + + DEFVAR_INT ("canna-mode-alpha-mode", &Vcanna_mode_AlphaMode, ""); + DEFVAR_INT ("canna-mode-empty-mode", &Vcanna_mode_EmptyMode, ""); + DEFVAR_INT ("canna-mode-kigo-mode", &Vcanna_mode_KigoMode, ""); + DEFVAR_INT ("canna-mode-yomi-mode", &Vcanna_mode_YomiMode, ""); + DEFVAR_INT ("canna-mode-jishu-mode", &Vcanna_mode_JishuMode, ""); + DEFVAR_INT ("canna-mode-tankouho-mode", &Vcanna_mode_TankouhoMode, ""); + DEFVAR_INT ("canna-mode-ichiran-mode", &Vcanna_mode_IchiranMode, ""); + DEFVAR_INT ("canna-mode-yes-no-mode", &Vcanna_mode_YesNoMode, ""); + DEFVAR_INT ("canna-mode-on-off-mode", &Vcanna_mode_OnOffMode, ""); +#ifdef CANNA_MODE_AdjustBunsetsuMode + DEFVAR_INT ("canna-mode-adjust-bunsetsu-mode", + &Vcanna_mode_AdjustBunsetsuMode, ""); +#endif +#ifdef CANNA_MODE_ChikujiYomiMode + DEFVAR_INT ("canna-mode-chikuji-yomi-mode", &Vcanna_mode_ChikujiYomiMode,""); + DEFVAR_INT ("canna-mode-chikuji-bunsetsu-mode", + &Vcanna_mode_ChikujiTanMode, ""); +#endif + + DEFVAR_INT ("canna-mode-henkan-mode", &Vcanna_mode_HenkanMode, ""); +#ifdef CANNA_MODE_HenkanNyuryokuMode + DEFVAR_INT ("canna-mode-henkan-nyuuryoku-mode", + &Vcanna_mode_HenkanNyuryokuMode, 0); +#endif +#ifdef CANNA_MODE_ZenHiraHenkanMode + DEFVAR_INT ("canna-mode-zen-hira-henkan-mode", + &Vcanna_mode_ZenHiraHenkanMode, ""); +#ifdef CANNA_MODE_HanHiraHenkanMode + DEFVAR_INT ("canna-mode-han-hira-henkan-mode", + &Vcanna_mode_HanHiraHenkanMode, ""); +#endif + DEFVAR_INT ("canna-mode-zen-kata-henkan-mode", + &Vcanna_mode_ZenKataHenkanMode, ""); + DEFVAR_INT ("canna-mode-han-kata-henkan-mode", + &Vcanna_mode_HanKataHenkanMode, ""); + DEFVAR_INT ("canna-mode-zen-alpha-henkan-mode", + &Vcanna_mode_ZenAlphaHenkanMode, ""); + DEFVAR_INT ("canna-mode-han-alpha-henkan-mode", + &Vcanna_mode_HanAlphaHenkanMode, ""); +#endif + DEFVAR_INT ("canna-mode-zen-hira-kakutei-mode", + &Vcanna_mode_ZenHiraKakuteiMode, ""); +#ifdef CANNA_MODE_HanHiraKakuteiMode + DEFVAR_INT ("canna-mode-han-hira-kakutei-mode", + &Vcanna_mode_HanHiraKakuteiMode, ""); +#endif + DEFVAR_INT ("canna-mode-zen-kata-kakutei-mode", + &Vcanna_mode_ZenKataKakuteiMode, ""); + DEFVAR_INT ("canna-mode-han-kata-kakutei-mode", + &Vcanna_mode_HanKataKakuteiMode, ""); + DEFVAR_INT ("canna-mode-zen-alpha-kakutei-mode", + &Vcanna_mode_ZenAlphaKakuteiMode, ""); + DEFVAR_INT ("canna-mode-han-alpha-kakutei-mode", + &Vcanna_mode_HanAlphaKakuteiMode, ""); + DEFVAR_INT ("canna-mode-hex-mode", &Vcanna_mode_HexMode, ""); + DEFVAR_INT ("canna-mode-bushu-mode", &Vcanna_mode_BushuMode, ""); + DEFVAR_INT ("canna-mode-extend-mode", &Vcanna_mode_ExtendMode, ""); + DEFVAR_INT ("canna-mode-russian-mode", &Vcanna_mode_RussianMode, ""); + DEFVAR_INT ("canna-mode-greek-mode", &Vcanna_mode_GreekMode, ""); + DEFVAR_INT ("canna-mode-line-mode", &Vcanna_mode_LineMode, ""); + DEFVAR_INT ("canna-mode-changing-server-mode", + &Vcanna_mode_ChangingServerMode, ""); + DEFVAR_INT ("canna-mode-henkan-method-mode", + &Vcanna_mode_HenkanMethodMode, ""); + DEFVAR_INT ("canna-mode-delete-dic-mode", &Vcanna_mode_DeleteDicMode, ""); + DEFVAR_INT ("canna-mode-touroku-mode", &Vcanna_mode_TourokuMode, ""); + DEFVAR_INT ("canna-mode-touroku-empty-mode", + &Vcanna_mode_TourokuEmptyMode, ""); + DEFVAR_INT ("canna-mode-touroku-hinshi-mode", + &Vcanna_mode_TourokuHinshiMode, ""); + DEFVAR_INT ("canna-mode-touroku-dic-mode", &Vcanna_mode_TourokuDicMode, ""); + DEFVAR_INT ("canna-mode-quoted-insert-mode", + &Vcanna_mode_QuotedInsertMode, ""); + DEFVAR_INT ("canna-mode-bubun-muhenkan-mode", + &Vcanna_mode_BubunMuhenkanMode, ""); + DEFVAR_INT ("canna-mode-mount-dic-mode", &Vcanna_mode_MountDicMode, ""); + + DEFVAR_INT ("canna-func-self-insert", &Vcanna_fn_SelfInsert ,""); + DEFVAR_INT ("canna-func-functional-insert", &Vcanna_fn_FunctionalInsert ,""); + DEFVAR_INT ("canna-func-quoted-insert", &Vcanna_fn_QuotedInsert ,""); + DEFVAR_INT ("canna-func-japanese-mode", &Vcanna_fn_JapaneseMode ,""); + DEFVAR_INT ("canna-func-alpha-mode", &Vcanna_fn_AlphaMode ,""); + DEFVAR_INT ("canna-func-henkan-nyuryoku-mode", + &Vcanna_fn_HenkanNyuryokuMode ,""); + DEFVAR_INT ("canna-func-forward", &Vcanna_fn_Forward ,""); + DEFVAR_INT ("canna-func-backward", &Vcanna_fn_Backward ,""); + DEFVAR_INT ("canna-func-next", &Vcanna_fn_Next ,""); + DEFVAR_INT ("canna-func-previous", &Vcanna_fn_Prev ,""); + DEFVAR_INT ("canna-func-beginning-of-line", &Vcanna_fn_BeginningOfLine ,""); + DEFVAR_INT ("canna-func-end-of-line", &Vcanna_fn_EndOfLine ,""); + DEFVAR_INT ("canna-func-delete-next", &Vcanna_fn_DeleteNext ,""); + DEFVAR_INT ("canna-func-delete_previous", &Vcanna_fn_DeletePrevious ,""); + DEFVAR_INT ("canna-func-kill-to-end-of-line", &Vcanna_fn_KillToEndOfLine,""); + DEFVAR_INT ("canna-func-henkan", &Vcanna_fn_Henkan ,""); + DEFVAR_INT ("canna-func-kakutei", &Vcanna_fn_Kakutei ,""); + DEFVAR_INT ("canna-func-extend", &Vcanna_fn_Extend ,""); + DEFVAR_INT ("canna-func-shrink", &Vcanna_fn_Shrink ,""); +#ifdef CANNA_FN_AdjustBunsetsu + DEFVAR_INT ("canna-func-adjust-bunsetsu", &Vcanna_fn_AdjustBunsetsu ,""); +#endif + DEFVAR_INT ("canna-func-quit", &Vcanna_fn_Quit ,""); + DEFVAR_INT ("canna-func-convert-as-hex", &Vcanna_fn_ConvertAsHex ,""); + DEFVAR_INT ("canna-func-convert-as-bushu", &Vcanna_fn_ConvertAsBushu ,""); + DEFVAR_INT ("canna-func-kouho-ichiran", &Vcanna_fn_KouhoIchiran ,""); + DEFVAR_INT ("canna-func-bubun-muhenkan", &Vcanna_fn_BubunMuhenkan ,""); + DEFVAR_INT ("canna-func-zenkaku", &Vcanna_fn_Zenkaku ,""); + DEFVAR_INT ("canna-func-hankaku", &Vcanna_fn_Hankaku ,""); + DEFVAR_INT ("canna-func-to-upper", &Vcanna_fn_ToUpper ,""); + DEFVAR_INT ("canna-func-capitalize", &Vcanna_fn_Capitalize ,""); + DEFVAR_INT ("canna-func-to-lower", &Vcanna_fn_ToLower ,""); + DEFVAR_INT ("canna-func-hiragana", &Vcanna_fn_Hiragana ,""); + DEFVAR_INT ("canna-func-katakana", &Vcanna_fn_Katakana ,""); + DEFVAR_INT ("canna-func-romaji", &Vcanna_fn_Romaji ,""); +#ifdef CANNA_FN_BaseHiragana + DEFVAR_INT ("canna-func-base-hiragana", &Vcanna_fn_BaseHiragana ,""); + DEFVAR_INT ("canna-func-base-katakana", &Vcanna_fn_BaseKatakana ,""); + DEFVAR_INT ("canna-func-base-eisu", &Vcanna_fn_BaseEisu ,""); + DEFVAR_INT ("canna-func-base-zenkaku", &Vcanna_fn_BaseZenkaku ,""); + DEFVAR_INT ("canna-func-base-hankaku", &Vcanna_fn_BaseHankaku ,""); + DEFVAR_INT ("canna-func-base-kana", &Vcanna_fn_BaseKana ,""); + DEFVAR_INT ("canna-func-base-kakutei", &Vcanna_fn_BaseKakutei ,""); + DEFVAR_INT ("canna-func-base-henkan", &Vcanna_fn_BaseHenkan ,""); + DEFVAR_INT ("canna-func-base-hiragana-katakana-toggle", + &Vcanna_fn_BaseHiraKataToggle ,""); + DEFVAR_INT ("canna-func-base-zenkaku-hankaku-toggle", + &Vcanna_fn_BaseZenHanToggle ,""); + DEFVAR_INT ("canna-func-base-kana-eisu-toggle", + &Vcanna_fn_BaseKanaEisuToggle ,""); + DEFVAR_INT ("canna-func-base-kakutei-henkan-toggle", + &Vcanna_fn_BaseKakuteiHenkanToggle ,""); + DEFVAR_INT ("canna-func-base-rotate-forward", + &Vcanna_fn_BaseRotateForward ,""); + DEFVAR_INT ("canna-func-base-rotate-backward", + &Vcanna_fn_BaseRotateBackward ,""); +#endif + DEFVAR_INT ("canna-func-extend-mode", &Vcanna_fn_ExtendMode ,""); + DEFVAR_INT ("canna-func-touroku", &Vcanna_fn_Touroku ,""); + DEFVAR_INT ("canna-func-hex-mode", &Vcanna_fn_HexMode ,""); + DEFVAR_INT ("canna-func-bushu-mode", &Vcanna_fn_BushuMode ,""); + DEFVAR_INT ("canna-func-kigo-mode", &Vcanna_fn_KigouMode ,""); +#ifdef CANNA_FN_Mark + DEFVAR_INT ("canna-func-mark", &Vcanna_fn_Mark ,""); +#endif +#ifdef CANNA_FN_TemporalMode + DEFVAR_INT ("canna-func-temporal-mode", &Vcanna_fn_TemporalMode ,""); +#endif + + DEFVAR_INT ("canna-key-nfer", &Vcanna_key_Nfer, ""); + DEFVAR_INT ("canna-key-xfer", &Vcanna_key_Xfer, ""); + DEFVAR_INT ("canna-key-up", &Vcanna_key_Up, ""); + DEFVAR_INT ("canna-key-left", &Vcanna_key_Left, ""); + DEFVAR_INT ("canna-key-right", &Vcanna_key_Right, ""); + DEFVAR_INT ("canna-key-down", &Vcanna_key_Down, ""); + DEFVAR_INT ("canna-key-insert", &Vcanna_key_Insert, ""); + DEFVAR_INT ("canna-key-rollup", &Vcanna_key_Rollup, ""); + DEFVAR_INT ("canna-key-rolldown", &Vcanna_key_Rolldown, ""); + DEFVAR_INT ("canna-key-home", &Vcanna_key_Home, ""); + DEFVAR_INT ("canna-key-help", &Vcanna_key_Help, ""); + DEFVAR_INT ("canna-key-kp-key", &Vcanna_key_KP_Key, ""); + DEFVAR_INT ("canna-key-shift-nfer", &Vcanna_key_Shift_Nfer, ""); + DEFVAR_INT ("canna-key-shift-xfer", &Vcanna_key_Shift_Xfer, ""); + DEFVAR_INT ("canna-key-shift-up", &Vcanna_key_Shift_Up, ""); + DEFVAR_INT ("canna-key-shift-left", &Vcanna_key_Shift_Left, ""); + DEFVAR_INT ("canna-key-shift-right", &Vcanna_key_Shift_Right, ""); + DEFVAR_INT ("canna-key-shift-down", &Vcanna_key_Shift_Down, ""); + DEFVAR_INT ("canna-key-control-nfer", &Vcanna_key_Cntrl_Nfer, ""); + DEFVAR_INT ("canna-key-control-xfer", &Vcanna_key_Cntrl_Xfer, ""); + DEFVAR_INT ("canna-key-control-up", &Vcanna_key_Cntrl_Up, ""); + DEFVAR_INT ("canna-key-control-left", &Vcanna_key_Cntrl_Left, ""); + DEFVAR_INT ("canna-key-control-right", &Vcanna_key_Cntrl_Right, ""); + DEFVAR_INT ("canna-key-control-down", &Vcanna_key_Cntrl_Down, ""); +} + +#ifdef CANNA_MULE +/* To handle MULE internal code and EUC. + I assume CANNA can handle only Japanese EUC. */ + +/* EUC multibyte string to MULE internal string */ + +static +c2mu(cp, l, mp) +char *cp; +int l; +char *mp; +{ + char ch, *ep = cp+l; + + while((cp < ep) && (ch = *cp)) { + if ((unsigned char)ch == ISO_CODE_SS2) { + *mp++ = charset_katakana_jisx0201; + cp++; + } + else if ((unsigned char)ch == ISO_CODE_SS3) { + *mp++ = charset_jisx0212; /* LCJP2; */ + cp++; + *mp++ = *cp++; + } + else if(ch & 0x80) { + *mp++ = charset_jisx0208; + *mp++ = *cp++; + } + *mp++ = *cp++; + } + *mp = 0; +} + +/* MULE internal string to EUC multibyte string */ + +static +m2c(mp, l, cp) +unsigned char *mp; +int l; +unsigned char *cp; +{ + unsigned char ch, *ep = mp + l;; + + while((mp < ep) && (ch = *mp++)) { +#if 0 + switch (ch) { + case charset_katakana_jisx0201: + *cp++ = ISO_CODE_SS2; + *cp++ = *mp++; + break; + case charset_jisx0212 /*LCJP2*/: + *cp++ = ISO_CODE_SS3; + case charset_jisx0208: + *cp++ = *mp++; + *cp++ = *mp++; + break; + default: + *cp++ = ch; + break; + } +#endif + if (ch == charset_katakana_jisx0201) { + *cp++ = ISO_CODE_SS2; + *cp++ = *mp++; + } else if (ch == charset_jisx0212) { /* LCJP2 */ + *cp++ = ISO_CODE_SS3; + *cp++ = *mp++; + *cp++ = *mp++; + } else if (ch == charset_jisx0208) { /* LCJP */ + *cp++ = *mp++; + *cp++ = *mp++; + } else { + *cp++ = ch; + } + } + *cp = 0; +} + +#undef make_string + +/* make_string after converting EUC string to MULE internal string */ +static +Lisp_Object +mule_make_string(p,l) +unsigned char *p; +int l; +{ + unsigned char cbuf[4096]; + + c2mu(p,l,cbuf); + return (make_string(cbuf,strlen(cbuf))); +} + +/* return the MULE internal string length of EUC string */ +static +mule_strlen(p,l) +unsigned char *p; +int l; +{ + unsigned char ch, *cp = p; + int len = 0; + + while((cp < p + l) && (ch = *cp)) { + if ((unsigned char)ch == ISO_CODE_SS2) { +#ifdef STRING_BYTES + len++; +#else + len += 2; +#endif + cp += 2; + } + else if ((unsigned char)ch == ISO_CODE_SS3) { +#ifdef STRING_BYTES + len++; +#else + len += 3; +#endif + cp += 3; + } + else if(ch & 0x80) { +#ifdef STRING_BYTES + len++; +#else + len += 3; +#endif + cp += 2; + } + else { + len++; + cp++; + } + } + return(len); +} + +/* count number of characters */ +static +count_char(p,len,pos,rev,clen,cpos,crev) +unsigned char *p; +int len,pos,rev,*clen,*cpos,*crev; +{ + unsigned char *q = p; + + *clen = *cpos = *crev = 0; + if (len == 0) return; + while (q < p + pos) { + (*clen)++; + (*cpos)++; + if (*q++ & 0x80) q++; + } + while (q < p + pos + rev) { + (*clen)++; + (*crev)++; + if (*q++ & 0x80) q++; + } + while (q < p + len) { + (*clen)++; + if (*q++ & 0x80) q++; + } +} +#endif /* CANNA_MULE */ --- emacs-21.2/src/charset.c~ 2002-02-22 10:51:46 +0000 +++ emacs-21.2/src/charset.c 2003-02-12 06:55:49 +0000 @@ -57,6 +57,7 @@ /* Declaration of special charsets. The values are set by Fsetup_special_charsets. */ int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */ +int charset_jisx0212; /* JISX0212 appended by knak 1997.10.26 */ int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */ int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */ int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */ @@ -1687,6 +1688,7 @@ charset_latin_iso8859_1 = charset_id_internal ("latin-iso8859-1"); charset_jisx0208_1978 = charset_id_internal ("japanese-jisx0208-1978"); charset_jisx0208 = charset_id_internal ("japanese-jisx0208"); + charset_jisx0212 = charset_id_internal ("japanese-jisx0212"); /* appended by knak 1997.10.26 */ charset_katakana_jisx0201 = charset_id_internal ("katakana-jisx0201"); charset_latin_jisx0201 = charset_id_internal ("latin-jisx0201"); charset_big5_1 = charset_id_internal ("chinese-big5-1"); --- emacs-21.2/src/charset.h~ 2001-07-13 09:30:58 +0000 +++ emacs-21.2/src/charset.h 2003-02-12 06:55:49 +0000 @@ -123,6 +123,7 @@ #define CHARSET_8_BIT_GRAPHIC 0x80 /* 0xA0..0xFF */ extern int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */ +extern int charset_jisx0212; /* JISX212 appended by knak 1997.10.26 */ extern int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */ extern int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */ extern int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */ --- emacs-21.2/src/config.in~ 2001-10-19 00:31:27 +0000 +++ emacs-21.2/src/config.in 2003-02-12 06:55:49 +0000 @@ -329,6 +329,19 @@ /* Define if `struct timeval' is declared by . */ #undef HAVE_TIMEVAL +#undef LIBS_MULE /* special library for Mule */ + +#undef WNN /* flag whether to use Wnn */ +#undef C_SWITCH_WNN /* compile switch for Wnn */ +#undef LD_SWITCH_WNN /* link switch for Wnn */ +#undef SJ3 /* flag whether to use sj3 */ +#undef CANNA /* flag whether to use Canna */ +#undef CANNA_MULE /* flag whether to use Canna on Mule */ +#undef CANNA2 /* flag whether to use Canna2 */ +#undef C_SWITCH_CANNA /* compile switch for Canna */ +#undef LD_SWITCH_CANNA /* link switch for Canna */ +#undef LD_SWITCH_CANNA_AUX /* link switch for Canna if -R option is needed */ + /* If using GNU, then support inline function declarations. */ /* Don't try to switch on inline handling as detected by AC_C_INLINE generally, because even if non-gcc compilers accept `inline', they @@ -482,6 +495,34 @@ extern char *getenv (); #endif +#ifdef WNN +# define EGG +# define WNN_PURESIZE 30000 +#else /* not WNN */ +# define WNN_PURESIZE 0 +#endif /* not WNN */ + +#ifdef SJ3 +# define EGG +# define SJ3_PURESIZE 38000 +#else /* not SJ3 */ +# define SJ3_PURESIZE 0 +#endif /* not SJ3 */ + +#ifdef EGG +# define EGG_PURESIZE 32000 +#else /* not EGG */ +# define EGG_PURESIZE 0 +#endif /* not EGG */ + +#ifdef CANNA +# define CANNA2 +# define CANNA_MULE +# define CANNA_PURESIZE 18000 +#else /* not CANNA */ +# define CANNA_PURESIZE 0 +#endif /* not CANNA */ + #endif /* EMACS_CONFIG_H */ /* These default definitions are good for almost all machines. --- emacs-21.2/src/emacs.c~ 2001-10-29 11:31:07 +0000 +++ emacs-21.2/src/emacs.c 2003-02-12 06:55:49 +0000 @@ -90,6 +90,9 @@ #endif EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG; +Lisp_Object VMULE, VEGG, VWNN, VSJ3; /* 92.7.8 by K.Handa and Y.Kawabe */ +/* 95.6.1 by S.Tomura */ + /* Command line args from shell, as list of strings */ Lisp_Object Vcommand_line_args; @@ -1421,6 +1424,16 @@ syms_of_fontset (); #endif /* HAVE_NTGUI */ + syms_of_mule (); /* 94.7.15 by K.Handa */ + +#ifdef WNN + syms_of_wnn (); +#endif +#ifdef CANNA + syms_of_canna (); +#endif /* CANNA */ +/* end of patch */ + #ifdef SYMS_SYSTEM SYMS_SYSTEM; #endif @@ -2254,3 +2267,33 @@ "Most recently used system locale for time."); Vprevious_system_time_locale = Qnil; } + +syms_of_mule () +{ +#if 0 + defsubr (&Sdefine_word_pattern); + + DEFVAR_BOOL ("re-short-flag", &re_short_flag, + "*T means regexp search success when the shortest match is found."); + re_short_flag = 0; + + DEFVAR_LISP ("MULE", &VMULE, ""); + VMULE = Qt; +#endif + +#ifdef EGG + DEFVAR_LISP ("EGG", &VEGG, ""); + VEGG = Qt; +/* 92.7.8 by K.Handa and Y.Kawabe */ +/* 95.6.1 by S.Tomura */ +#ifdef WNN + DEFVAR_LISP ("WNN", &VWNN, ""); + VWNN = Qt; +#else /* not WNN */ +#ifdef SJ3 + DEFVAR_LISP ("SJ3", &VSJ3, ""); + VSJ3 = Qt; +#endif /* SJ3 */ +#endif /* not WNN */ +#endif /* EGG */ +} --- emacs-21.2/src/puresize.h~ 2002-02-22 11:20:08 +0000 +++ emacs-21.2/src/puresize.h 2003-02-12 06:55:49 +0000 @@ -42,7 +42,7 @@ #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (710000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (770000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ @@ -56,7 +56,7 @@ /* This is the actual size in bytes to allocate. */ #ifndef PURESIZE -#define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO) +#define PURESIZE ((BASE_PURESIZE + WNN_PURESIZE + SJ3_PURESIZE + EGG_PURESIZE + CANNA_PURESIZE) * PURESIZE_RATIO) #endif /* Signal an error if OBJ is pure. */ --- emacs-21.2/src/s/netbsd.h~ 2001-09-19 10:55:33 +0000 +++ emacs-21.2/src/s/netbsd.h 2003-02-12 06:55:49 +0000 @@ -33,6 +33,8 @@ #define LIBS_DEBUG /* -lutil is not needed for NetBSD >0.9. */ /* #define LIBS_SYSTEM -lutil */ +/* for Wnn */ +#define LIBS_SYSTEM -lcrypt #define LIBS_TERMCAP -ltermcap #define NEED_ERRNO --- /dev/null 1970-01-01 00:00:00 +0000 +++ emacs-21.2/src/wnnfns.c 2003-02-12 06:55:49 +0000 @@ -0,0 +1,2199 @@ +/* Jserver Interface for Mule + Coded by Yutaka Ishikawa at ETL (yisikawa@etl.go.jp) + Satoru Tomura at ETL (tomura@etl.go.jp) + Modified for Wnn4 library by + Toshiaki Shingu (shingu@cpr.canon.co.jp) + Hiroshi Kuribayashi (kuri@nff.ncl.omron.co.jp) + + This file is part of Egg on Nemacs (Japanese environment) + + Egg is distributed in the forms of patches to GNU + Emacs under the terms of the GNU EMACS GENERAL PUBLIC + LICENSE which is distributed along with GNU Emacs by the + Free Software Foundation. + + Egg is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU EMACS GENERAL PUBLIC LICENSE for + more details. + + You should have received a copy of the GNU EMACS GENERAL + PUBLIC LICENSE along with Nemacs; see the file COPYING. + If not, write to the Free Software Foundation, 675 Mass + Ave, Cambridge, MA 02139, USA. */ + +/* + * CHANGE LOG + * + * 1995.5.30 wnn-server-version + * 1995. functions for Wnn6 + * 1994.2.24 check_wnn_server_type() should not be static. + * 1994.2.3 kWnn support by H.Kuribayashi. + * 1993.6.29 wnn-server-set-rev updated. + * 1993.4.23 serious bug in wnn-server-open fixed. + * 1993.4.2 wnn-server-fuzokugo-set, + * wnn-server-dict-add, wnn-server-dict-delete, + * wnn-server-dict-comment, wnn-server-dict-save, + * wnn-server-word-search, wnn-server-word-hindo-set, + * wnn-server-word-info, wnn-server-word-use, + * wnn-server-word-delete, wnn-server-word-add + * changed to support fixed type dictionary. + * 1993.3.3 w2y: bug fixed. + * 1992.12.7 wnn-server-set-param was modified to set parameters on + * normal/reverse environment individually. + * 1992.11.27 wnn-server-get-msg fixed by kuri. + * 1992.10.29 m2w() and w2m() handle PY_EOF for cserver. + * 1992.10.19 Slight change in Fwnn_word_info() by T.Atsushiba + * 1992.09.29 completely modified for chinese translation. + * 1992.09.03 code related to wnn_error changed. + * 1992.08.20 yes_or_no + * 1992.07.02 wnn-server-dict-list modified + * 1992.07.02 wnn-server-word-info + * 1992.05.18 modified for mule + * 1992.05.15 wnn-server-dict-add/query + * 1992.05.09 SERIOUS BUG FIX with jl_close + * 1992.05.09 wnn-server-open with lang + * 1992.05.09 wnn-server-inspect inproved + * 1992.05.09 zenkouho with dai/sho bunsetu + * 1992.04.23 rewrite for jl library by T.Shingu(shingu@cpr.canon.co.jp) + * ----------------------------------------------------------------------- + * + * Functions defined in this file are + * (wnn-server-open wnn-host-name login-name) + * wnn-host-name: STRING or NIL + * login-name: STRING + * RETURNS: BOOLEAN + * DESCRIPTION: + * jserver $B$H@\B3$7!"%5!<%P!!"IQEY%U%!%$%kL>!"M%@hEY!"<-=q%U%!%$%k%b!<%I(B + * $BIQEY%U%!%$%k%b!<%I$G;XDj$7$?<-=q$r%P%C%U%!$KDI2C$9$k!#(B + * pw1, pw2 $B$O<-=q%U%!%$%k!"IQEY%U%!%$%k$N%Q%9%o!<%I!#(B + * + * (wnn-server-dict-delete dic-no) + * dic-no: INTEGER + * RETURNS: $B%(%i!<$N;~(B nil + * DESCRIPTION: dic-no $B$N<-=qHV9f$N<-=q$r!"%P%C%U%!$+$i(B + * $B:o=|$9$k!#(B + * + * (wnn-server-dict-list) + * RETURNS: ((dic-no1 file-name1 comment1 word-no1 nice1) + * (dic-no2 file-name2 comment2 word-no2 nice2)...) + * DESCRIPTION: $B%P%C%U%!>e$N<-=q$N%j%9%H$rF@$k!#(B + * + * (wnn-server-dict-comment dic-no comment) + * RETURNS: $B%(%i!<$N;~(B nil + * DESCRIPTION: dic-no $B$N<-=q$K%3%a%s%H$r$D$1$k!#(B + * + * (wnn-server-set-rev rev) + * rev: BOOLEAN + * rev $B$,(B nil $B$N;~$O@5JQ49!"$=$l0J30$N;~$O5UJQ49(B + * + * (wnn-server-henkan-begin henkan-string) + * henkan-string: STRING + * RETURNS: bunsetu-suu + * DESCRIPTION: + * $B2>L>4A;zJQ49$r$7!"Bh0l8uJd$NJ8@a?t$rJV$9!#(B + * + * (wnn-server-zenkouho bunsetu-no dai) + * bunsetu-no: INTEGER + * dai: BOOLEAN + * RETURNS: offset + * DESCRIPTION: + * $BJ8@aHV9f$G;XDj$5$l$?J8@a$NA48uJd$r$H$j$@$7(B + * $B!"8=:_$N%*%U%;%C%H$rJV$9!#(B + * + * (wnn-server-get-zenkouho offset) + * bunsetu-no: INTEGER + * dai: BOOLEAN + * RETURNS: list of zenkouho + * DESCRIPTION: + * $B%*%U%;%C%H$G;XDj$5$l$?8uJd$rF@$k!#(B + * + * (wnn-server-zenkouho-bun) + * RETURNS: INTEGER + * DESCRIPTION: + * $BA48uJd$rI=<($7$F$$$kJ8@aHV9f$rF@$k!#(B + * + * (wnn-server-zenkouho-suu) + * RETURNS: INTEGER + * DESCRIPTION: + * $BA48uJd$rI=<($7$F$$$kJ8@a$NA48uJd?t$rF@$k!#(B + * + * (wnn-server-dai-top bun-no) + * bun-no: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $BJ8@a$,BgJ8@a$N@hF,$J$i(B t + * + * (wnn-server-dai-end bun-no) + * bun-no: INTEGER + * RETURNS: INTEGER + * DESCRIPTION: + * $BpJs$rJQ49%P%C%U%!$+$i$H$j=P$9!#(B + * + * (wnn-server-henkan-quit) + * RETURNS: BOOLEAN + * DESCRIPTION: + * $B2?$b$7$J$$!#(B + * + * (wnn-server-bunsetu-kanji bun-no) + * RETURNS: (bunsetu-kanji length) + * DESCRIPTION: + * + * (wnn-server-bunsetu-yomi bun-no) + * RETURNS: (bunsetu-yomi length) + * DESCRIPTION: + * + * (wnn-server-bunsetu-suu) + * RETURNS: bunsetu-suu + * DESCRIPTION: + * + * (wnn-server-hindo-update &optional bunsetu-no) + * bunsetu-no: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $BIQEY>pJs$r99?7$9$k!#(B + * + * (wnn-server-word-add dic-no tango yomi comment hinsi) + * dic-no: INTEGER + * tango: STRING + * yoni: STRING + * comment: STRING + * hinsi: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $B<-=q$KC18l$rEPO?$9$k!#(B + * + * (wnn-server-word-delete dic-no entry) + * dic-no: INTEGER + * entry: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$r:o=|$9$k!#(B + * + * (wnn-server-word-use dic-no entry) + * dic-no: INTEGER + * entry: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NM-8z!?L58z$r%H%0%k$9$k!#(B + * + * (wnn-server-word-info dic-no entry) + * dic-no: INTEGER + * entry: INTEGER + * RETURNS: (yomi kanji comment hindo hinsi) + * DESCRIPTION: + * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$N>pJs$rF@$k!#(B + * + * (wnn-server-word-hindo-set dic-no entry hindo) + * dic-no: INTEGER + * entry: INTEGER + * hindo: INTEGER + * RETURNS: BOOLEAN + * DESCRIPTION: + * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NIQEY$r@_Dj$9$k!#(B + * + * (wnn-server-word-search yomi) + * yomi: STRING + * RETURNS: a LIST of dict-joho + * DESCRIPTION: + * $BA4$F$N<-=q$+$iC18l8!:w$r9T$J$&!#(B + * + * (wnn-server-dict-save) + * RETURNS: BOOLEAN + * DESCRIPTION: + * $BA4$F$N<-=q$HIQEY%U%!%$%k$r%;!<%V$9$k!#(B + * + * (wnn-server-get-param) + * RETURNS: (n nsho p1 p2 p3 ... p15) + * DESCRIPTION: $BJQ49%Q%i%a!<%?$rF@$k!#(B + * + * (wnn-server-set-param n sho p1 ... p15) + * RETURNS: $B%(%i!<$N;~(B nil + * DESCRIPTION: $BJQ49%Q%i%a!<%?$r@_Dj$9$k!#(B + * + * (wnn-server-get-msg error-no) + * RETURNS: $B%(%i!<%a%C%;!<%8(B + * DESCRIPTION: $B%(%i!(B + * DESCRIPTION: $B%P%C%U%!$NImB08l%U%!%$%kL>$rF@$k!#(B + * + * (wnn-server-isconnect) + * RETURNS: $B%3%M%/%H$7$F$l$P(B t, $B$7$F$J$1$l$P(B nil + * DESCRIPTION: $B%5!<%P$H7Q$C$F$$$k$+D4$Y$k!#(B + * + * (wnn-server-hinsi-dicts hinsi-no) + * RETURNS: (dic-no1 dic-no2 ...) + * DESCRIPTION: hinsi-no $B$NIJ;l$,EPO?$G$-$k<-=q$N%j%9%H$rF@$k!#(B + * hinsi-no = -1 $B$N$H$-$K$O!"EPO?2DG=$JA4<-=q$rF@$k!#(B + * + * (wnn-server-hinsi-list dic-no name) + * RETURNS: (name1 name2 ... ) + * DESCRIPTION: dic-no $B$N<-=q$G!"IJ;l%N!<%I$KB0$9$k(B + * $BIJ;l%N!<%I!JL>!K$N%j%9%H$rF@$k!#(B + * $BIJ;lL>$rM?$($?;~$O!"#0$rJV$9!#(B + * + * (wnn-server-hinsi-name hinsi-no) + * RETURNS: hinsi-name + * DESCRIPTION: $BIJ;lHV9f$+$iL>A0$r$rIJ;lHV9f$KJQ49$9$k!#(B + * + * (wnn-server-version) + * RETURNS: version ID(int) + * + */ + +#include + +#include "config.h" + +#include "commonhd.h" +#include "jllib.h" +/* + * FI-Wnn -- JSERVER_VERSION >= 0xF101 + * Wnn6 -- JSERVER_VERSION == 0xF101 + * Wnn7 -- JSERVER_VERSION == 0xF102 + */ +#if JSERVER_VERSION < 0xF102 +#include "cplib.h" +#endif + +/* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */ +#define _UCHAR_T + +#define EGG_TIMEOUT 0 +#define NSERVER 4 +#define WNNSERVER_J 0 +#define WNNSERVER_C 1 +#define WNNSERVER_T 2 +#define WNNSERVER_K 3 + +#include "lisp.h" +#include "buffer.h" +#include "window.h" +#include "charset.h" + +#define LCKANA 0x89 /* Right half of JIS X0201-1976 */ +#define LCROMAN 0x8A /* Left half of JIS X0201-1976 */ +#define LCJPOLD 0x90 /* For Japanese JIS X0208-1978 */ +#define LCCN 0x91 /* For Chinese Hanzi GB2312-1980 */ +#define LCJP 0x92 /* For Japanese JIS X0208-1983 */ +#define LCKR 0x93 /* For Hangul KS C5601-1987 */ +#define LCJP2 0x94 /* For Japanese JIS X0212-1990 */ +#define LCBIG5_1 0x98 /* For Big5 Level 1 */ +#define LCBIG5_2 0x99 /* For Big5 Level 2 */ +#define LCPRV11 0x9A /* 1-byte/1-clm character-set of private use */ +#define LCINV 0x9F /* Never used */ + +static struct wnn_buf *wnnfns_buf[NSERVER]; +static struct wnn_env *wnnfns_env_norm[NSERVER]; +static struct wnn_env *wnnfns_env_rev[NSERVER]; +static int wnnfns_norm; +static unsigned char lc_wnn_server_type[NSERVER] = {LCJP, LCCN, LCINV, LCKR}; + +/* Lisp Variables and Constants Definition */ +Lisp_Object Qjserver; +Lisp_Object Qcserver; +/*Lisp_Object Qtserver;*/ +Lisp_Object Qkserver; +Lisp_Object Qwnn_no_uniq; +Lisp_Object Qwnn_uniq; +Lisp_Object Qwnn_uniq_kanji; +Lisp_Object Vwnn_server_type; +Lisp_Object Vcwnn_zhuyin; +Lisp_Object Vwnnenv_sticky; +Lisp_Object Vwnn_uniq_level; +int lc_sisheng; + +/* Lisp functions definition */ + + + +DEFUN ("wnn-server-open", Fwnn_open, Swnn_open, + 2, 2, 0, + "Connect to jserver of host HNAME, make an environment with\n\ +login name LNAME in the server.\n\ +Return nil if error occurs") + (hname, lname) + register Lisp_Object hname, lname; +{ + char envname[32]; + char langname[32]; + char hostname[32]; + int snum; + CHECK_STRING (lname, 0); + +#ifdef WINDOWSNT + init_winsock(TRUE); +#endif /* WINDOWSNT */ + snum = check_wnn_server_type(); + switch (snum) { + case WNNSERVER_J: + strcpy(langname, "ja_JP"); + break; + case WNNSERVER_C: + strcpy(langname, "zh_CN"); + break; +/* + case WNNSERVER_T: + strcpy(langname, "zh_TW"); + break; +*/ + case WNNSERVER_K: + strcpy(langname, "ko_KR"); + break; + } + strncpy(envname, XSTRING(lname)->data, 32); + if (hname == Qnil) strcpy(hostname, ""); + else { + CHECK_STRING (hname, 1); + strncpy(hostname, XSTRING(hname)->data, 32); + } + CHECK_STRING (lname, 1); + if(!(wnnfns_buf[snum] = jl_open_lang(envname, hostname, langname, + 0, 0, 0, EGG_TIMEOUT))) { + return Qnil; + } + if (!jl_isconnect(wnnfns_buf[snum])) return Qnil; + wnnfns_env_norm[snum] = jl_env_get(wnnfns_buf[snum]); +/* if (Vwnnenv_sticky == Qt) jl_env_sticky_e(wnnfns_env_norm[snum]); + else jl_env_un_sticky_e(wnnfns_env_norm[snum]);*/ + strcat(envname, "R"); + if(!(wnnfns_env_rev[snum] = jl_connect_lang(envname, hostname, langname, + 0, 0, 0, EGG_TIMEOUT))) { + return Qnil; + } +/* if (Vwnnenv_sticky == Qt) jl_env_sticky_e(wnnfns_env_rev[snum]); + else jl_env_un_sticky_e(wnnfns_env_rev[snum]);*/ + return Qt; +} + + +DEFUN ("wnn-server-close", Fwnn_close, Swnn_close, 0, 0, 0, + "Close the connection to jserver, Dictionary and friquency files\n\ +are not saved.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(wnnfns_env_norm[snum]) { + if (Vwnnenv_sticky == Qnil) jl_env_un_sticky_e(wnnfns_env_norm[snum]); + else jl_env_sticky_e(wnnfns_env_norm[snum]); + jl_disconnect(wnnfns_env_norm[snum]); + } + if(wnnfns_env_rev[snum]) { + if (Vwnnenv_sticky == Qnil) jl_env_un_sticky_e(wnnfns_env_rev[snum]); + else jl_env_sticky_e(wnnfns_env_rev[snum]); + jl_disconnect(wnnfns_env_rev[snum]); + } + jl_env_set(wnnfns_buf[snum], 0); + jl_close(wnnfns_buf[snum]); + wnnfns_buf[snum] = (struct wnn_buf *)0; + wnnfns_env_norm[snum] = wnnfns_env_rev[snum] = (struct wnn_env *)0; + return Qt; +} + +DEFUN ("wnn-server-dict-add", Fwnn_dict_add, Swnn_dict_add, 5, MANY, 0, + "Add dictionary specified by DIICT-FILE-NAME, FREQ-FILE-NAME,\n\ +PRIORITY, DICT-FILE-MODE, FREQ-FILE-MODE.\n\ +Specify password files of dictionary and frequency, PW1 and PW2, if needed.") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + static int yes_or_no(); + static void puts2(); + struct gcpro gcpro1; + int snum; + CHECK_STRING (args[0], 0); + CHECK_STRING (args[1], 1); + CHECK_NUMBER (args[2], 2); + if (args[5] != Qnil) CHECK_STRING (args[5], 5); + if (args[6] != Qnil) CHECK_STRING (args[6], 6); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + GCPRO1 (*args); + gcpro1.nvars = nargs; + if(jl_dic_add(wnnfns_buf[snum], + XSTRING(args[0])->data, + XSTRING(args[1])->data, + wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, + XINT(args[2]), + (args[3] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (args[4] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (args[5] == Qnil) ? 0 : XSTRING(args[5])->data, + (args[6] == Qnil) ? 0 : XSTRING(args[6])->data, + yes_or_no, + puts2 ) < 0) { + UNGCPRO; + return Qnil; + } + UNGCPRO; + return Qt; +} + +DEFUN ("wnn-server-dict-delete", Fwnn_dict_delete, Swnn_dict_delete, + 1, 1, 0, + "Remove dictionary specified by DIC-NUMBER from buffer.") + (dicno) + register Lisp_Object dicno; +{ + int no; + int snum; + CHECK_NUMBER(dicno, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + no = XINT(dicno); + if(!wnnfns_buf[snum]) return Qnil; + if(jl_dic_delete(wnnfns_buf[snum], no) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-dict-list", Fwnn_dict_list, Swnn_dict_list, + 0, 0, 0, + "Return information of dictionaries.") + () +{ + WNN_DIC_INFO *dicinfo; + int cnt, i; + unsigned char comment[1024]; + Lisp_Object val; + int snum; + unsigned char lc; + + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; +#if JSERVER_VERSION >= 0xF101 + if((cnt = jl_fi_dic_list(wnnfns_buf[snum], 0x3f, &dicinfo)) < 0) return Qnil; +#else + if((cnt = jl_dic_list(wnnfns_buf[snum], &dicinfo)) < 0) return Qnil; +#endif + val = Qnil; + for(i = 0, dicinfo += cnt; i < cnt; i++) { + dicinfo--; + w2m(dicinfo->comment, comment, lc); + val = Fcons(Fcons(make_number(dicinfo->dic_no), + Fcons(make_string(dicinfo->fname, strlen(dicinfo->fname)), + Fcons(make_string(comment, strlen(comment)), + Fcons(make_number(dicinfo->gosuu), + Fcons(make_number(dicinfo->nice), Qnil))))), val); + } + return val; +} + +DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, Swnn_dict_comment, + 2, 2, 0, + "Set comment to dictionary specified by DIC-NUMBER.\n\ +Comment string COMMENT") + (dicno, comment) + register Lisp_Object dicno, comment; +{ + w_char wbuf[512]; + int snum; + CHECK_NUMBER(dicno, 0); + CHECK_STRING(comment, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(comment)->data, wbuf); + if(jl_dic_comment_set(wnnfns_buf[snum], XINT(dicno), wbuf) < 0) + return Qnil; + return Qt; +} + + +DEFUN ("wnn-server-set-rev", Fwnn_set_rev, Swnn_set_rev, + 1, 1, 0, + "Switch the translation mode to normal if T, or reverse if NIL.") + (rev) + register Lisp_Object rev; +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(rev == Qnil){ + if((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return; + jl_env_set(wnnfns_buf[snum], wnnfns_env_norm[snum]); + wnnfns_norm = 1; + } + else{ + if((!wnnfns_buf[snum]) || (!wnnfns_env_rev[snum])) return; + jl_env_set(wnnfns_buf[snum], wnnfns_env_rev[snum]); + wnnfns_norm = 0; + } +} + +DEFUN ("wnn-server-henkan-begin", Fwnn_begin_henkan, Swnn_begin_henkan, + 1, 1, 0, + "Translate YOMI string to kanji. Retuen the number of bunsetsu.") + (hstring) + register Lisp_Object hstring; +{ + int cnt; + w_char wbuf[5000]; + int snum; + CHECK_STRING(hstring, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(hstring)->data, wbuf); +#if JSERVER_VERSION <= 0xF101 + if (snum == WNNSERVER_C) /* 92.10.30 by T.Saneto */ + w2y(wbuf); +#endif + +#if JSERVER_VERSION >= 0xF101 + if((cnt = jl_fi_ren_conv(wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) + return Qnil; +#else + if((cnt = jl_ren_conv(wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0) + return Qnil; +#endif + return make_number(cnt); +} + +DEFUN ("wnn-server-zenkouho", Fwnn_zenkouho, Swnn_zenkouho, 2, 2, 0, + "Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T\n\ +if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho.") + (bunNo, dai) + register Lisp_Object bunNo, dai; +{ + int no, offset; + int snum; + int uniq_level; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + no = XINT(bunNo); + if (Vwnn_uniq_level == Qwnn_no_uniq) uniq_level = WNN_NO_UNIQ; + else if (Vwnn_uniq_level == Qwnn_uniq) uniq_level = WNN_UNIQ; + else uniq_level = WNN_UNIQ_KNJ; + if(dai == Qnil) { + if (offset = jl_zenkouho(wnnfns_buf[snum],no,WNN_USE_MAE, uniq_level) < 0) + return Qnil; + } + else { + if (offset = jl_zenkouho_dai(wnnfns_buf[snum], no, dai_end(no, snum), + WNN_USE_MAE, uniq_level) < 0) + return Qnil; + } + return make_number(offset); +} + + +DEFUN ("wnn-server-get-zenkouho", Fwnn_get_zenkouho, Swnn_get_zenkouho, + 1, 1, 0, "Get kanji string of KOUHO-NUMBER") + (kouhoNo) + register Lisp_Object kouhoNo; +{ + unsigned char kanji_buf[256]; + w_char wbuf[256]; + int snum; + unsigned char lc; + CHECK_NUMBER(kouhoNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + jl_get_zenkouho_kanji(wnnfns_buf[snum], XINT(kouhoNo), wbuf); + w2m(wbuf, kanji_buf, lc); + return make_string(kanji_buf, strlen(kanji_buf)); +} + +DEFUN ("wnn-server-zenkouho-bun", Fwnn_zenkouho_bun, Swnn_zenkouho_bun, + 0, 0, 0, + "For Wnn.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + return make_number(jl_zenkouho_bun(wnnfns_buf[snum])); +} + +DEFUN ("wnn-server-zenkouho-suu", Fwnn_zenkouho_suu, Swnn_zenkouho_suu, + 0, 0, 0, + "Return the number of zen kouho") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + return make_number(jl_zenkouho_suu(wnnfns_buf[snum])); +} + +DEFUN ("wnn-server-dai-top", Fwnn_dai_top, Swnn_dai_top, 1, 1, 0, + "Return T if bunsetsu BUN-NUMBER is dai-bunsetsu.") + (bunNo) + register Lisp_Object bunNo; +{ + int snum; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if (jl_dai_top(wnnfns_buf[snum], XINT(bunNo)) == 1) return Qt; + else return Qnil; +} + +DEFUN ("wnn-server-dai-end", Fwnn_dai_end, Swnn_dai_end, 1, 1, 0, + "Return the bunsetu number of the next dai-bunsetsu after BUN-NUMBER.") + (bunNo) + register Lisp_Object bunNo; +{ + int snum; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + return make_number(dai_end(XINT(bunNo), snum)); +} + +DEFUN ("wnn-server-henkan-kakutei", Fwnn_kakutei, Swnn_kakutei, 2, 2, 0, + "Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu.") + (offset, dai) + register Lisp_Object offset, dai; +{ + int snum; + CHECK_NUMBER(offset, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(dai == Qnil) { + if(jl_set_jikouho(wnnfns_buf[snum], XINT(offset)) < 0) return Qnil; + } + else { + if(jl_set_jikouho_dai(wnnfns_buf[snum], XINT(offset)) < 0) return Qnil; + } + return Qt; +} + +DEFUN ("wnn-server-bunsetu-henkou", Fwnn_bunsetu_henkou, Swnn_bunsetu_henkou, + 3, 3, 0, + "Change length of BUN-NUMBER bunsetu to LEN. DAI is T if dai-bunsetsu.") + (bunNo, len, dai) + register Lisp_Object bunNo, len, dai; +{ + Lisp_Object val; + int cnt, no; + int snum; + CHECK_NUMBER(bunNo, 0); + CHECK_NUMBER(len, 1); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + no = XINT(bunNo); +#if JSERVER_VERSION >= 0xF101 + if((cnt = jl_fi_nobi_conv(wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE, + (dai == Qnil) ? WNN_SHO : WNN_DAI)) < 0) + return Qnil; +#else + if((cnt = jl_nobi_conv(wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE, + (dai == Qnil) ? WNN_SHO : WNN_DAI)) < 0) + return Qnil; +#endif + return make_number(cnt); +} + +DEFUN ("wnn-server-inspect", Fwnn_inspect, Swnn_inspect, 1, 1, 0, + "Get bunsetsu information specified by BUN-NUMBER.") + (bunNo) + Lisp_Object bunNo; +{ + Lisp_Object val; + struct wnn_jdata *info_buf; + unsigned char cbuf[512]; + w_char wbuf[256]; + int bun_no, yomilen, jirilen, i; + int snum; + unsigned char lc; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + bun_no = XINT(bunNo); + val = Qnil; + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->kangovect), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->daihyoka), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->hyoka), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->ima), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->hindo), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->hinsi), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->entry), val); + val = Fcons(make_number(wnnfns_buf[snum]->bun[bun_no]->dic_no), val); +#if JSERVER_VERSION >= 0xF102 + yomilen = jl_get_yomi(wnnfns_buf[snum], bun_no, bun_no + 1, wbuf, + sizeof(wbuf)); +#else + yomilen = jl_get_yomi(wnnfns_buf[snum], bun_no, bun_no + 1, wbuf); +#endif + jirilen = wnnfns_buf[snum]->bun[bun_no]->jirilen; + for(i = yomilen; i >= jirilen; i--) wbuf[i+1] = wbuf[i]; + wbuf[jirilen] = '+'; + w2m(wbuf, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); +#if JSERVER_VERSION >= 0xF102 + jl_get_kanji(wnnfns_buf[snum], bun_no, bun_no + 1, wbuf, sizeof(wbuf)); +#else + jl_get_kanji(wnnfns_buf[snum], bun_no, bun_no + 1, wbuf); +#endif + w2m(wbuf, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); + return val; +} + + +DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, Swnn_quit_henkan, 0, 0, 0, + "do nothing") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-bunsetu-kanji", Fwnn_bunsetu_kanji, Swnn_bunsetu_kanji, + 1, 1, 0, + "Get the pair of kanji and length of bunsetsu specified by BUN-NUMBER.") + (bunNo) + register Lisp_Object bunNo; +{ + register int no; + unsigned char kanji_buf[256]; + w_char wbuf[256]; + int kanji_len; + int snum; + unsigned char lc; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + no = XINT(bunNo); +#if JSERVER_VERSION >= 0xF102 + kanji_len = jl_get_kanji(wnnfns_buf[snum], no, no + 1, wbuf, sizeof(wbuf)); +#else + kanji_len = jl_get_kanji(wnnfns_buf[snum], no, no + 1, wbuf); +#endif + w2m(wbuf, kanji_buf, lc); + return Fcons(make_string(kanji_buf, strlen(kanji_buf)), + make_number(kanji_len)); +} + +DEFUN ("wnn-server-bunsetu-yomi", Fwnn_bunsetu_yomi, Swnn_bunsetu_yomi, + 1, 1, 0, + "Get the pair of yomi and length of bunsetsu specified by BUN-NUMBER.") + (bunNo) + register Lisp_Object bunNo; +{ + register int no; + unsigned char yomi_buf[256]; + w_char wbuf[256]; + int yomi_len; + int snum; + unsigned char lc; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + no = XINT(bunNo); +#if JSERVER_VERSION >= 0xF102 + yomi_len = jl_get_yomi(wnnfns_buf[snum], no, no + 1, wbuf, sizeof(wbuf)); +#else + yomi_len = jl_get_yomi(wnnfns_buf[snum], no, no + 1, wbuf); +#endif + w2m(wbuf, yomi_buf, lc); + return Fcons(make_string(yomi_buf, strlen(yomi_buf)), + make_number(yomi_len)); +} + +DEFUN ("wnn-server-bunsetu-suu", Fwnn_bunsetu_suu, Swnn_bunsetu_suu, + 0, 0, 0, + "Get the number of bunsetsu.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + return make_number(jl_bun_suu(wnnfns_buf[snum])); +} + +DEFUN ("wnn-server-hindo-update", Fwnn_hindo_update, Swnn_hindo_update, + 0, 1, 0, + "Update frequency of bunsetsu specified by NUM-NUMBER.") + (bunNo) + Lisp_Object bunNo; +{ + int no; + Lisp_Object val; + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if (bunNo == Qnil) no = -1; + else { + CHECK_NUMBER(bunNo, 0); + no = XINT(bunNo); + } + if(!wnnfns_buf[snum]) return Qnil; +#if JSERVER_VERSION >= 0xF101 + if(jl_optimize_fi(wnnfns_buf[snum], 0, no) < 0) return Qnil; +#else + if(jl_update_hindo(wnnfns_buf[snum], 0, no) < 0) return Qnil; +#endif + return Qt; +} + + +DEFUN ("wnn-server-word-add", Fwnn_word_toroku, Swnn_word_toroku, 5, 5, 0, + "Add a word to dictionary. Arguments are\n\ +DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER") + (dicno, kanji, yomi, comment, hinsi) + register Lisp_Object dicno, kanji, yomi, comment, hinsi; +{ + w_char yomi_buf[256], kanji_buf[256], comment_buf[256]; + int snum; + CHECK_NUMBER(dicno, 0); + CHECK_STRING(kanji, 1); + CHECK_STRING(yomi, 2); + CHECK_STRING(comment, 3); + CHECK_NUMBER(hinsi, 4); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(yomi)->data, yomi_buf); +#if JSERVER_VERSION <= 0xF101 + if (snum == WNNSERVER_C) + w2y(yomi_buf); +#endif + m2w(XSTRING(kanji)->data, kanji_buf); + m2w(XSTRING(comment)->data, comment_buf); + if(jl_word_add(wnnfns_buf[snum], XINT(dicno), yomi_buf, kanji_buf, + comment_buf, XINT(hinsi), 0) < 0) + return Qnil; + else return Qt; +} + + +DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, Swnn_word_sakujo, 2, 2, 0, + "Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER") + (no, serial) + register Lisp_Object no, serial; +{ + int snum; + CHECK_NUMBER(no, 0); + CHECK_NUMBER(serial, 1); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_word_delete(wnnfns_buf[snum], XINT(no), XINT(serial)) < 0) + return Qnil; + else return Qt; +} + + +DEFUN ("wnn-server-word-use", Fwnn_word_use, Swnn_word_use, 2, 2, 0, + "Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER") + (no, serial) + register Lisp_Object no, serial; +{ + int snum; + CHECK_NUMBER(no, 0); + CHECK_NUMBER(serial, 1); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_word_use(wnnfns_buf[snum], XINT(no), XINT(serial)) < 0) + return Qnil; + else return Qt; +} + +DEFUN ("wnn-server-word-info", Fwnn_word_info, Swnn_word_info, 2, 2, 0, + "Return list of yomi, kanji, comment, hindo, hinshi.") + (no, serial) + register Lisp_Object no, serial; +{ + Lisp_Object val; + struct wnn_jdata *info_buf; + unsigned char cbuf[512]; + int snum; + unsigned char lc; + CHECK_NUMBER(no, 0); + CHECK_NUMBER(serial, 1); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + /* 92.10.19 patch by T.Atsushiba + -- coerced to (int) */ + if((int)(info_buf = jl_word_info(wnnfns_buf[snum], + XINT(no), XINT(serial))) <= 0) { + return Qnil; + } else { + val = Qnil; + val = Fcons(make_number(info_buf->hinshi), val); + val = Fcons(make_number(info_buf->hindo), val); + w2m(info_buf->com, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); + w2m(info_buf->kanji, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); + w2m(info_buf->yomi, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); + return val; + } +} + +DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, Swnn_hindo_set, 3, 3, 0, + "Set frequency to arbitrary value. Specified by DIC-NUMBER,\n\ +SERIAL-NUMBER, FREQUENCY") + (no, serial, hindo) + register Lisp_Object no, serial, hindo; +{ + int snum; + CHECK_NUMBER(no, 0); + CHECK_NUMBER(serial, 1); + CHECK_NUMBER(hindo, 2); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(js_hindo_set(jl_env_get(wnnfns_buf[snum]), + XINT(no), + XINT(serial), + WNN_HINDO_NOP, + XINT(hindo)) < 0) + return Qnil; + else return Qt; +} + + +DEFUN ("wnn-server-word-search", Fwnn_dict_search, Swnn_dict_search, 1, 1, 0, + "Search a word YOMI from buffer.\n\ +Return list of (kanji hinshi freq dic_no serial).") + (yomi) + register Lisp_Object yomi; +{ + Lisp_Object val; + struct wnn_jdata *wordinfo; + int i, count; + w_char wbuf[256]; + unsigned char kanji_buf[256]; + int kanji_len; + int snum; + unsigned char lc; + CHECK_STRING(yomi, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(yomi)->data, wbuf); +#if JSERVER_VERSION <= 0xF101 + if (snum == WNNSERVER_C) + w2y(wbuf); +#endif + if((count = jl_word_search_by_env(wnnfns_buf[snum], + wbuf, &wordinfo)) < 0) + return Qnil; + val = Qnil; + for(i = 0, wordinfo += count; i < count; i++) { + wordinfo--; + w2m(wordinfo->kanji, kanji_buf, lc); + val = Fcons(Fcons(make_string(kanji_buf, strlen(kanji_buf)), + Fcons(make_number(wordinfo->hinshi), + Fcons(make_number(wordinfo->hindo), + Fcons(make_number(wordinfo->dic_no), + Fcons(make_number(wordinfo->serial), Qnil))))), + val); + } + return val; +} + +DEFUN ("wnn-server-dict-save", Fwnn_dict_save, Swnn_dict_save, 0, 0, 0, + "Save all dictianaries and grequency files.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_dic_save_all(wnnfns_buf[snum]) < 0) return Qnil; + else return Qt; +} + +DEFUN ("wnn-server-get-param", Fwnn_get_param, Swnn_get_param, + 0, 0, 0, + "Returns (n nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt\n\ +suuji kana eisuu kigou toji_kakko fuzokogo kaikakko)") + () +{ + struct wnn_param param; + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_param_get(wnnfns_buf[snum], ¶m) < 0) return Qnil; + return Fcons(make_number(param.n), + Fcons(make_number(param.nsho), + Fcons(make_number(param.p1), + Fcons(make_number(param.p2), + Fcons(make_number(param.p3), + Fcons(make_number(param.p4), + Fcons(make_number(param.p5), + Fcons(make_number(param.p6), + Fcons(make_number(param.p7), + Fcons(make_number(param.p8), + Fcons(make_number(param.p9), + Fcons(make_number(param.p10), + Fcons(make_number(param.p11), + Fcons(make_number(param.p12), + Fcons(make_number(param.p13), + Fcons(make_number(param.p14), + Fcons(make_number(param.p15),Qnil))))))))))))))))); +} + +DEFUN ("wnn-server-set-param", Fwnn_set_param, Swnn_set_param, + 17, MANY, 0, + "Set parameters, n nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt\n\ +suuji kana eisuu kigou toji_kakko fuzokogo kaikakko") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + int rc; + struct wnn_param param; + int snum; + for (rc = 0; rc < 17; rc++) CHECK_NUMBER(args[rc], rc); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + param.n = XINT(args[0]); + param.nsho = XINT(args[1]); + param.p1 = XINT(args[2]); + param.p2 = XINT(args[3]); + param.p3 = XINT(args[4]); + param.p4 = XINT(args[5]); + param.p5 = XINT(args[6]); + param.p6 = XINT(args[7]); + param.p7 = XINT(args[8]); + param.p8 = XINT(args[9]); + param.p9 = XINT(args[10]); + param.p10 = XINT(args[11]); + param.p11 = XINT(args[12]); + param.p12 = XINT(args[13]); + param.p13 = XINT(args[14]); + param.p14 = XINT(args[15]); + param.p15 = XINT(args[16]); + + rc = jl_param_set(wnnfns_buf[snum], ¶m); + if(rc < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-get-msg", Fwnn_get_msg, Swnn_get_msg, 0, 0, 0, + "Get message string from wnn_perror.") + () +{ + char mbuf[256]; + char *msgp; + int snum; + unsigned char lc; +/* CHECK_NUMBER(errno, 0);*/ + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + lc = lc_wnn_server_type[snum]; +#if JSERVER_VERSION < 0xF102 + { + char langname[32]; + switch (snum) { + case WNNSERVER_J: + strcpy(langname, "ja_JP"); + break; + case WNNSERVER_C: + strcpy(langname, "zh_CN"); + break; + /* + case WNNSERVER_T: + strcpy(langname, "zh_TW"); + break; + */ + case WNNSERVER_K: + strcpy(langname, "ko_KR"); + break; + } + msgp = wnn_perror_lang(langname); + } +#else + msgp = wnn_perror(); +#endif +/* msgp = msg_get(wnn_msg_cat, XINT(errno), 0, 0);*/ + c2m(msgp, mbuf, lc); + return make_string(mbuf, strlen(mbuf)); +} + + +DEFUN ("wnn-server-fuzokugo-set", Fwnn_fuzokugo_set, Swnn_fuzokugo_set, + 1, 1, 0, "For Wnn.") + (file) + register Lisp_Object file; +{ + int snum; + CHECK_STRING(file, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_fuzokugo_set(wnnfns_buf[snum], XSTRING(file)->data) < 0) + return Qnil; + return Qt; +} + +DEFUN ("wnn-server-fuzokugo-get", Fwnn_fuzokugo_get, Swnn_fuzokugo_get, + 0, 0, 0, "For Wnn.") + () +{ + char fname[256]; + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_fuzokugo_get(wnnfns_buf[snum], fname) < 0) return Qnil; + return make_string(fname, strlen(fname)); +} + + +DEFUN ("wnn-server-isconnect", Fwnn_isconnect, Swnn_isconnect, 0, 0, 0, + "For Wnn.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_isconnect(wnnfns_buf[snum])) return Qt; + else return Qnil; +} + +DEFUN ("wnn-server-hinsi-dicts", Fwnn_hinsi_dicts, Swnn_hinsi_dicts, 1, 1, 0, + "For Wnn.") + (hinsi) + register Lisp_Object hinsi; +{ + int *area; + int cnt; + Lisp_Object val; + int snum; + CHECK_NUMBER(hinsi, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if((cnt = jl_hinsi_dicts(wnnfns_buf[snum], XINT(hinsi), &area)) < 0) + return Qnil; + val = Qnil; + for (area += cnt; cnt > 0; cnt--) { + area--; + val = Fcons(make_number(*area), val); + } + return val; +} + +DEFUN ("wnn-server-hinsi-list", Fwnn_hinsi_list, Swnn_hinsi_list, 2, 2, 0, + "For Wnn.") + (dicno, name) + register Lisp_Object dicno, name; +{ + int cnt; + Lisp_Object val; + w_char wbuf[256]; + w_char **area; + unsigned char cbuf[512]; + int snum; + unsigned char lc; + CHECK_NUMBER(dicno, 0); + CHECK_STRING(name, 1); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(name)->data, wbuf); + if((cnt = jl_hinsi_list(wnnfns_buf[snum], XINT(dicno), wbuf, &area)) < 0) + return Qnil; + if (cnt == 0) return make_number(0); + val = Qnil; + for (area += cnt; cnt > 0; cnt--) { + area--; + w2m(*area, cbuf, lc); + val = Fcons(make_string(cbuf, strlen(cbuf)), val); + } + return val; +} + +DEFUN ("wnn-server-hinsi-name", Fwnn_hinsi_name, Swnn_hinsi_name, 1, 1, 0, + "For Wnn.") + (no) + register Lisp_Object no; +{ + unsigned char name[256]; + w_char *wname; + int snum; + unsigned char lc; + CHECK_NUMBER(no, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + lc = lc_wnn_server_type[snum]; + if(!wnnfns_buf[snum]) return Qnil; + if((wname = jl_hinsi_name(wnnfns_buf[snum], XINT(no))) == 0) return Qnil; + w2m(wname, name, lc); + return make_string(name, strlen(name)); +} + +DEFUN ("wnn-server-hinsi-number", Fwnn_hinsi_number, Swnn_hinsi_number, + 1, 1, 0, + "For Wnn.") + (name) + register Lisp_Object name; +{ + w_char w_buf[256]; + int no; + int snum; + CHECK_STRING(name, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + m2w(XSTRING(name)->data, w_buf); + if((no = jl_hinsi_number(wnnfns_buf[snum], w_buf)) < 0) return Qnil; + return make_number(no); +} +#if JSERVER_VERSION >= 0xF101 +DEFUN ("wnn-server-fisys-dict-add", Fwnn_fisys_dict_add, Swnn_fisys_dict_add, 3, MANY, 0, + "Add dictionary specified by FISYS-DICT-FILE-NAME, FISYS-FREQ-FILE-NAME,\n\ +FISYS-FREQ-FILE-MODE.\n\ +Specify password files of dictionary and frequency, PW1 and PW2, if needed.") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + static int yes_or_no(); + static void puts2(); + struct gcpro gcpro1; + int snum; + CHECK_STRING (args[0], 0); + CHECK_STRING (args[1], 1); + if (args[3] != Qnil) CHECK_STRING (args[3], 3); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + GCPRO1 (*args); + gcpro1.nvars = nargs; + if(jl_fi_dic_add(wnnfns_buf[snum], + XSTRING(args[0])->data, + XSTRING(args[1])->data, + WNN_FI_SYSTEM_DICT, + WNN_DIC_RDONLY, + (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW, + 0, + (args[3] == Qnil) ? 0 : XSTRING(args[3])->data, + yes_or_no, + puts2 ) < 0) { + UNGCPRO; + return Qnil; + } + UNGCPRO; + return Qt; +} + +DEFUN ("wnn-server-fiusr-dict-add", Fwnn_fiusr_dict_add, Swnn_fiusr_dict_add, 4, MANY, 0, + "Add dictionary specified by FIUSR-DICT-FILE-NAME, FIUSR-FREQ-FILE-NAME,\n\ +FIUSR-DICT-FILE-MODE, FIUSR-FREQ-FILE-MODE.\n\ +Specify password files of dictionary and frequency, PW1 and PW2, if needed.") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + static int yes_or_no(); + static void puts2(); + struct gcpro gcpro1; + int snum; + CHECK_STRING (args[0], 0); + CHECK_STRING (args[1], 1); + if (args[4] != Qnil) CHECK_STRING (args[4], 4); + if (args[5] != Qnil) CHECK_STRING (args[5], 5); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + GCPRO1 (*args); + gcpro1.nvars = nargs; + if(jl_fi_dic_add(wnnfns_buf[snum], + XSTRING(args[0])->data, + XSTRING(args[1])->data, + WNN_FI_USER_DICT, + (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (args[3] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW, + (args[4] == Qnil) ? 0 : XSTRING(args[4])->data, + (args[5] == Qnil) ? 0 : XSTRING(args[5])->data, + yes_or_no, + puts2 ) < 0) { + UNGCPRO; + return Qnil; + } + UNGCPRO; + return Qt; +} + +DEFUN ("wnn-server-notrans-dict-add", Fwnn_notrans_dict_add, Swnn_notrans_dict_add, 3, MANY, 0, + "Add dictionary specified by NOTRANS-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.\n\ +Specify password files of dictionary and frequency PW1 if needed.") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + static int yes_or_no(); + static void puts2(); + struct gcpro gcpro1; + int snum; + int dic_no; + struct wnn_env *cur_env; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_STRING (args[0], 0); + CHECK_NUMBER (args[1], 1); + if (args[3] != Qnil) CHECK_STRING (args[3], 3); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + GCPRO1 (*args); + gcpro1.nvars = nargs; + if(wnnfns_norm) + cur_env = wnnfns_env_norm[snum]; + else + cur_env = wnnfns_env_rev[snum]; + dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING); + if (dic_no == WNN_NO_LEARNING) { + if((dic_no = jl_dic_add(wnnfns_buf[snum], + XSTRING(args[0])->data, + 0, + wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, + XINT(args[1]), + WNN_DIC_RW, WNN_DIC_RW, + (args[3] == Qnil) ? 0 : XSTRING(args[3])->data, + 0, + yes_or_no, + puts2)) < 0) { + UNGCPRO; + return Qnil; + } + js_set_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING, dic_no); + } + if(!js_is_loaded_temporary_dic(cur_env)) { + if(js_temporary_dic_add(cur_env, + wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) { + UNGCPRO; + return Qnil; + } + } + vmask |= WNN_ENV_MUHENKAN_LEARN_MASK; + henv.muhenkan_flag = (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) { + UNGCPRO; + return Qnil; + } + UNGCPRO; + return Qt; +} + +DEFUN ("wnn-server-bmodify-dict-add", Fwnn_bmodify_dict_add, Swnn_bmodify_dict_add, 3, MANY, 0, + "Add dictionary specified by BMODIFY-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.\n\ +Specify password files of dictionary and frequency PW1 if needed.") + (nargs, args) + int nargs; + register Lisp_Object *args; +{ + static int yes_or_no(); + static void puts2(); + struct gcpro gcpro1; + int snum; + int dic_no; + struct wnn_env *cur_env; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_STRING (args[0], 0); + CHECK_NUMBER (args[1], 1); + if (args[3] != Qnil) CHECK_STRING (args[3], 3); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + GCPRO1 (*args); + gcpro1.nvars = nargs; + if(wnnfns_norm) + cur_env = wnnfns_env_norm[snum]; + else + cur_env = wnnfns_env_rev[snum]; + dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING); + if (dic_no == WNN_NO_LEARNING) { + if((dic_no = jl_dic_add(wnnfns_buf[snum], + XSTRING(args[0])->data, + 0, + wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV, + XINT(args[1]), + WNN_DIC_RW, WNN_DIC_RW, + (args[3] == Qnil) ? 0 : XSTRING(args[3])->data, + 0, + yes_or_no, + puts2)) < 0) { + UNGCPRO; + return Qnil; + } + js_set_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING, dic_no); + } + if(!js_is_loaded_temporary_dic(cur_env)) { + if(js_temporary_dic_add(cur_env, + wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) { + UNGCPRO; + return Qnil; + } + } + vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK; + henv.bunsetsugiri_flag = (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) { + UNGCPRO; + return Qnil; + } + UNGCPRO; + return Qt; +} + +DEFUN ("wnn-server-set-last-is-first", Fwnn_last_is_first, Swnn_last_is_first, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_LAST_IS_FIRST_MASK; + henv.last_is_first_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-complex-conv-mode", Fwnn_complex_conv, Swnn_complex_conv, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_COMPLEX_CONV_MASK; + henv.complex_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-okuri-learn-mode", Fwnn_okuri_learn, Swnn_okuri_learn, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_OKURI_LEARN_MASK; + henv.okuri_learn_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-okuri-flag", Fwnn_okuri_flag, Swnn_okuri_flag, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum, int_mode; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + int_mode = XINT(mode); + if(int_mode != WNN_OKURI_REGULATION && + int_mode != WNN_OKURI_NO && + int_mode != WNN_OKURI_YES) + return Qnil; + henv.okuri_flag = int_mode; + vmask |= WNN_ENV_OKURI_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-prefix-learn-mode", Fwnn_prefix_learn, Swnn_prefix_learn, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_PREFIX_LEARN_MASK; + henv.prefix_learn_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-prefix-flag", Fwnn_prefix_flag, Swnn_prefix_flag, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(mode != WNN_KANA_KOUHO && mode != WNN_KANJI_KOUHO) + return Qnil; + else + henv.prefix_flag = mode; + vmask |= WNN_ENV_PREFIX_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-suffix-learn-mode", Fwnn_suffix_learn, Swnn_suffix_learn, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_SUFFIX_LEARN_MASK; + henv.suffix_learn_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-common-learn-mode", Fwnn_common_learn, Swnn_common_learn, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_COMMON_LAERN_MASK; + henv.common_learn_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-freq-func-mode", Fwnn_freq_func, Swnn_freq_func, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(mode != 0 && mode != 1 && mode != 2 && mode != 3 && mode != 4) + return Qnil; + else + henv.freq_func_flag = mode; + vmask |= WNN_ENV_FREQ_FUNC_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-numeric-mode", Fwnn_numeric, Swnn_numeric, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum, int_mode; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + int_mode = XINT(mode); + if(int_mode != WNN_NUM_KANSUUJI && + int_mode != WNN_NUM_KANOLD && + int_mode != WNN_NUM_HANCAN && + int_mode != WNN_NUM_ZENCAN && + int_mode != WNN_NUM_HAN && + int_mode != WNN_NUM_ZEN && + int_mode != WNN_NUM_KAN) + return Qnil; + henv.numeric_flag = int_mode; + vmask |= WNN_ENV_NUMERIC_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-alphabet-mode", Fwnn_alphabet, Swnn_alphabet, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum, int_mode; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + int_mode = XINT(mode); + if(int_mode != WNN_ALP_HAN && int_mode != WNN_ALP_ZEN) + return Qnil; + henv.alphabet_flag = int_mode; + vmask |= WNN_ENV_ALPHABET_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-symbol-mode", Fwnn_symbol, Swnn_symbol, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum, int_mode; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + CHECK_NUMBER(mode, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + int_mode = XINT(mode); + if(int_mode != WNN_KIG_HAN && + int_mode != WNN_KIG_JIS && + int_mode != WNN_KIG_ASC) + return Qnil; + henv.symbol_flag = int_mode; + vmask |= WNN_ENV_SYMBOL_MASK; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-server-set-yuragi-mode", Fwnn_yuragi, Swnn_yuragi, 1, 1, 0, + "For FI-Wnn.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_YURAGI_MASK; + henv.yuragi_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-reset-previous-info", Fwnn_reset_prev, Swnn_reset_prev, 0, 0, 0, + "For FI-Wnn.") + () +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(jl_reset_prev_bun(wnnfns_buf[snum]) < 0) return Qnil; + return Qt; +} + +# if JSERVER_VERSION >= 0xF102 +DEFUN ("wnn-boin-kabusoku", Fwnn_boin_kabusoku, Swnn_boin_kabusoku, 1, 1, 0, + "For Wnn7.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_BOIN_KABUSOKU_MASK; + henv.boin_kabusoku_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-shiin-choka", Fwnn_shiin_choka, Swnn_shiin_choka, 1, 1, 0, + "For Wnn7.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_SHIIN_CHOKA_MASK; + henv.shiin_choka_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-n-choka", Fwnn_n_choka, Swnn_n_choka, 1, 1, 0, + "For Wnn7.") + (mode) + register Lisp_Object mode; +{ + int snum; + unsigned long vmask = 0; + struct wnn_henkan_env henv; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + vmask |= WNN_ENV_N_CHOKA_MASK; + henv.n_choka_flag = (mode == Qnil) ? False : True; + if(jl_set_henkan_env(wnnfns_buf[snum], + vmask, + &henv) < 0) return Qnil; + return Qt; +} + +DEFUN ("wnn-nihongo-kosei", Fwnn_nihongo_kosei, Swnn_nihongo_kosei, 1, 1, 0, + "For Wnn7.") + (mode) + register Lisp_Object mode; +{ + int snum; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + /* $B$3$N(Btype cast$B$OHs>o$K4m81!#(Bjl.c$B$,;H$C$F$$$k$N$G%^%M$7$F$$$k$@$1!#(B + $B99$K(B js_*()$B7O$r8F$S=P$7$F$k!D(B */ +#include "mt_jlib.h" /* for WNN_ENV_INT */ + if(js_set_henkan_hinsi_group( (WNN_ENV_INT*)wnnfns_buf[snum]->env, + HINSI_NO_GOYOU, + HINSI_NO_GOYOU_START, + HINSI_NO_GOYOU_END, + (mode == Qnil) ? False : True ) < 0) + return Qnil; + if(js_set_henkan_hinsi_group( (WNN_ENV_INT*)wnnfns_buf[snum]->env, + HINSI_NO_ATEJI, + HINSI_NO_ATEJI_START, + HINSI_NO_ATEJI_END, + (mode == Qnil) ? False : True ) < 0) + return Qnil; + return Qt; +} + +DEFUN ("wnn-server-synonym", Fwnn_server_synonym, Swnn_server_synonym, 2, 2, 0, + "For Wnn7.") + (bunNo, dai) + Lisp_Object bunNo, dai; +{ + int no, offset; + int snum; + int uniq_level; + CHECK_NUMBER(bunNo, 0); + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + no = XINT(bunNo); + if (Vwnn_uniq_level == Qwnn_no_uniq) uniq_level = WNN_NO_UNIQ; + else if (Vwnn_uniq_level == Qwnn_uniq) uniq_level = WNN_UNIQ; + else uniq_level = WNN_UNIQ_KNJ; + if(offset = jl_zenassoc_dai( wnnfns_buf[snum], no, dai_end(no, snum), + WNN_USE_MAE, uniq_level ) < 0) + return Qnil; + return make_number(offset); +} +# endif /* Wnn7 */ +#endif /* FI-Wnn */ + +DEFUN ("wnn-server-version", Fwnn_version, Swnn_version, 0, 0, 0, + "Returns Wnn server version ID.") + () +{ + int snum; + int serv; + int libv; + struct wnn_env *cur_env; + if ((snum = check_wnn_server_type()) == -1) return Qnil; + if(!wnnfns_buf[snum]) return Qnil; + if(wnnfns_norm) + cur_env = wnnfns_env_norm[snum]; + else + cur_env = wnnfns_env_rev[snum]; + if(js_version(cur_env->js_id,&serv,&libv) < 0) return Qnil; + return make_number(serv); +} + +syms_of_wnn() +{ + int i; + + defsubr(&Swnn_open); + defsubr(&Swnn_close); + defsubr(&Swnn_dict_add); + defsubr(&Swnn_dict_delete); + defsubr(&Swnn_dict_list); + defsubr(&Swnn_dict_comment); + defsubr(&Swnn_set_rev); + defsubr(&Swnn_begin_henkan); + defsubr(&Swnn_zenkouho); + defsubr(&Swnn_get_zenkouho); + defsubr(&Swnn_zenkouho_bun); + defsubr(&Swnn_zenkouho_suu); + defsubr(&Swnn_dai_top); + defsubr(&Swnn_dai_end); + defsubr(&Swnn_kakutei); + defsubr(&Swnn_bunsetu_henkou); + defsubr(&Swnn_inspect); + defsubr(&Swnn_quit_henkan); + defsubr(&Swnn_bunsetu_kanji); + defsubr(&Swnn_bunsetu_yomi); + defsubr(&Swnn_bunsetu_suu); + defsubr(&Swnn_hindo_update); + defsubr(&Swnn_word_toroku); + defsubr(&Swnn_word_sakujo); + defsubr(&Swnn_word_use); + defsubr(&Swnn_word_info); + defsubr(&Swnn_hindo_set); + defsubr(&Swnn_dict_search); + defsubr(&Swnn_dict_save); + defsubr(&Swnn_get_param); + defsubr(&Swnn_set_param); + defsubr(&Swnn_get_msg); + defsubr(&Swnn_fuzokugo_set); + defsubr(&Swnn_fuzokugo_get); + defsubr(&Swnn_isconnect); + defsubr(&Swnn_hinsi_dicts); + defsubr(&Swnn_hinsi_list); + defsubr(&Swnn_hinsi_name); + defsubr(&Swnn_hinsi_number); +#if JSERVER_VERSION >= 0xF101 + defsubr(&Swnn_fisys_dict_add); + defsubr(&Swnn_fiusr_dict_add); + defsubr(&Swnn_notrans_dict_add); + defsubr(&Swnn_bmodify_dict_add); + defsubr(&Swnn_last_is_first); + defsubr(&Swnn_complex_conv); + defsubr(&Swnn_okuri_learn); + defsubr(&Swnn_okuri_flag); + defsubr(&Swnn_prefix_learn); + defsubr(&Swnn_prefix_flag); + defsubr(&Swnn_suffix_learn); + defsubr(&Swnn_common_learn); + defsubr(&Swnn_freq_func); + defsubr(&Swnn_numeric); + defsubr(&Swnn_alphabet); + defsubr(&Swnn_symbol); + defsubr(&Swnn_yuragi); + defsubr(&Swnn_reset_prev); +# if JSERVER_VERSION >= 0xF102 + defsubr(&Swnn_boin_kabusoku); + defsubr(&Swnn_shiin_choka); + defsubr(&Swnn_n_choka); + defsubr(&Swnn_nihongo_kosei); + defsubr(&Swnn_server_synonym); +# endif /* Wnn7 */ +#endif /* FI-Wnn */ + defsubr(&Swnn_version); + + DEFVAR_INT ("lc-sisheng", &lc_sisheng, "Leading character for Sisheng."); + DEFVAR_LISP ("wnn-server-type", &Vwnn_server_type, "*jserver, cserver .."); + DEFVAR_LISP ("cwnn-zhuyin", &Vcwnn_zhuyin, "*pinyin or zhuyin"); + DEFVAR_LISP ("wnnenv-sticky", &Vwnnenv_sticky, + "*If non-nil, make environment sticky"); + DEFVAR_LISP ("wnn-uniq-level", &Vwnn_uniq_level, "*Uniq level"); + + Qjserver = intern("jserver"); + Qcserver = intern("cserver"); + /* Qtserver = intern("tserver"); */ + Qkserver = intern("kserver"); + + Qwnn_no_uniq = intern("wnn-no-uniq"); + Qwnn_uniq = intern("wnn-uniq"); + Qwnn_uniq_kanji = intern("wnn-uniq-kanji"); + + Vwnn_server_type = Qjserver; + Vcwnn_zhuyin = Qnil; + Vwnnenv_sticky = Qnil; + + Vwnn_uniq_level = Qwnn_uniq; + + for (i = 0; i < NSERVER; i++) { + wnnfns_buf[i] = (struct wnn_buf *)0; + wnnfns_env_norm[i] = (struct wnn_env *)0; + wnnfns_env_rev[i] = (struct wnn_env *)0; + } +} + +w2m(wp, mp, lc) + w_char *wp; + unsigned char *mp; + unsigned char lc; +{ + w_char wc; + w_char pzy[10]; + int i, len; + + while(wc = *wp++) { + switch (wc & 0x8080) { + case 0x80: +#if JSERVER_VERSION <= 0xF101 + if (Vwnn_server_type == Qcserver) { + len = cwnn_yincod_pzy(pzy, wc, + (Vcwnn_zhuyin == Qnil) + ? CWNN_PINYIN + : CWNN_ZHUYIN); + for(i = 0; i < len; i++) { + if (pzy[i] & 0x80) { + *mp++ = LCPRV11; + *mp++ = lc_sisheng; + } + *mp++ = pzy[i]; + } + }else +#endif + { + *mp++ = LCKANA; + *mp++ = (wc & 0xff); + } + break; + case 0x8080: + *mp++ = lc; + *mp++ = (wc & 0xff00) >> 8; + *mp++ = wc & 0x00ff; + break; + case 0x8000: + if (lc == LCJP) + *mp++ = LCJP2; + else if (lc == LCBIG5_1) + *mp++ = LCBIG5_2; + else + *mp++ = lc; + *mp++ = (wc & 0xff00) >> 8; + *mp++ = wc & 0x00ff | 0x80; + break; + default: + *mp++ = wc & 0x00ff; + break; + } + } + *mp = 0; +} + +m2w(mp, wp) + unsigned char *mp; + w_char *wp; +{ + unsigned int ch; + +#define ASCII_P(c) ((c) < 0x80) +#define LC_P(c) (0x80 <= (c) && (c) < LCINV) + while (ch = *mp++) { + if (ASCII_P (ch)) { + *wp++ = ch; + } else if (LC_P (ch)) { + switch (ch) { + case LCKANA: *wp++ = *mp++; break; + case LCROMAN: *wp++ = *mp++ & 0x7F; break; + case LCJPOLD: case LCCN: case LCJP: case LCKR: + /* case LCTW: */ + ch = *mp++; + *wp++ = (ch << 8) | *mp++; + break; + case LCJP2: + ch = *mp++; + *wp++ = (ch << 8) | (*mp++ & 0x7f); + break; + case LCPRV11: + ch = *mp++; + if (ch == lc_sisheng) + *wp++ = 0x8e80 | *mp++; + else + mp++; + break; + default: /* ignore this character */ + mp += bytes_by_char_head[ch] - 1; + } + } + } + *wp = 0; +} + +_xp(x) +int x; +{ + printf("%x\n", x); fflush(stdout); +} + +#if JSERVER_VERSION <= 0xF101 +/* static void */ +w2y(w) +w_char *w; +{ + unsigned long pbuf[5000], ybuf[5000]; + unsigned long *pin; + w_char *y; + int len; + + pin = pbuf; + y = w; + while (1) { + if (*w == 0) {*pin =0; break;} + else *pin = *w; + w++; pin++; + } + len = cwnn_pzy_yincod(ybuf, pbuf, + (Vcwnn_zhuyin == Qnil) ? CWNN_PINYIN : CWNN_ZHUYIN); + if (len <= 0) + return; + + pin = ybuf; + while (1) { + if (*pin == 0 || len == 0) {*y = 0;break;} + *y = *pin; + y++; pin++; len--; + } +} +#endif + +c2m(cp, mp, lc) + unsigned char *cp; + unsigned char *mp; + unsigned char lc; +{ + unsigned char ch; + while(ch = *cp) { + if(ch & 0x80) { + *mp++ = lc; + *mp++ = *cp++; + } + *mp++ = *cp++; + } + *mp = 0; +} + +int +dai_end(no, server) + int no; + int server; +{ + for(no++; no < jl_bun_suu(wnnfns_buf[server]) + && !jl_dai_top(wnnfns_buf[server], no); no++); + return (no); +} + +static int +yes_or_no(s) +unsigned char *s; +{ + extern Lisp_Object Fy_or_n_p(); + unsigned char mbuf[512]; + unsigned char lc; + int len; + int snum; + if ((snum = check_wnn_server_type()) == -1) return 0; + lc = lc_wnn_server_type[snum]; + /* if no message found, create file without query */ +/* if (wnn_msg_cat->msg_bd == 0) return 1;*/ + if (*s == 0) return 1; + c2m(s, mbuf, lc); + /* truncate "(Y/N)" */ + for (len = 0; (mbuf[len]) && (len < 512); len++); + if(index(mbuf,'(')) + for (; (mbuf[len] != '(') && (len > 0); len--); + if (Fy_or_n_p(make_string(mbuf, len)) == Qnil) return 0; + else return (1); +} + +static void +puts2(s) +char *s; +{ + Lisp_Object args[1]; + char mbuf[512]; + unsigned char lc; + extern Lisp_Object Fmessage(); + int snum; + if ((snum = check_wnn_server_type()) == -1) return; + lc = lc_wnn_server_type[snum]; + c2m(s, mbuf, lc); + args[0] = make_string(mbuf, strlen(mbuf)); + Fmessage(1, args); +} + +int +check_wnn_server_type() +{ + if (Vwnn_server_type == Qjserver) { + return WNNSERVER_J; + } + else if (Vwnn_server_type == Qcserver) { + return WNNSERVER_C; + } + /* else if (Vwnn_server_type == Qtserver) { + return WNNSERVER_T; + } */ + else if (Vwnn_server_type == Qkserver) { + return WNNSERVER_K; + } + else return -1; +}