Friday, January 06, 2006

Meadow3 その5 ddskkのインストール

ddskkをインストールする。
  1. cvs サーバからの SKK ソースの入手を参考にCVS Headをcheckoutする。
    $ cvs -d :pserver:guest@openlab.jp:/circus/cvsroot login
    $ cvs -d :pserver:guest@openlab.jp:/circus/cvsroot checkout skk/main
  2. SKK-CFGの内容を編集する。
    (setq APEL_SPECIFIC_LISPDIR "d:/Meadow3/packages/lisp/apel")
    (setq LISPDIR "d:/Meadow3/site-lisp")
    (setq VERSION_SPECIFIC_LISPDIR "d:/Meadow3/site-lisp/2.11")
    (setq EMU_PREFIX "emu")
    (setq SKK_DATADIR "d:/Meadow3/etc")
    (setq SKK_INFODIR "d:/Meadow3/info")
    (setq SKK_LISPDIR "d:/Meadow3/site-lisp/ddskk")
  3. コンパイルを行ない、指定フォルダにインストールする。
    $ make EMACS=/Meadow3/bin/Meadow.exe
    $ make EMACS=/Meadow3/bin/Meadow.exe what-where
    $ make EMACS=/Meadow3/bin/Meadow.exe install
    $ cp -Rpvu ./experimental/ /Meadow3/site-lisp/ddskk/
  4. .emacsを編集する。
    (global-set-key [hiragana-katakana] 'skk-mode)
    (setq skk-byte-compile-init-file t)
    (setq default-input-method "japanese-skk")
    (if (not (file-directory-p "~/.Meadow3/.ddskk"))
    (make-directory "~/.Meadow3/.ddskk"))
    (setq skk-init-file "~/.Meadow3/.ddskk/init"
    skk-custom-file "~/.Meadow3/.ddskk/custom"
    skk-emacs-id-file "~/.Meadow3/.ddskk/emacs-id"
    skk-record-file "~/.Meadow3/.ddskk/record"
    skk-jisyo "~/.Meadow3/.ddskk/jisyo"
    skk-backup-jisyo "~/.Meadow3/.ddskk/jisyo.bak")
    (setq skk-isearch-start-mode 'latin)
    (setq skk-study-file "~/.Meadow3/.ddskk/skk-study"
    skk-study-backup-file "~/.Meadow3/.ddskk/skk-study.bak")
    (setq skk-aux-large-jisyo "/usr/share/SKK/SKK-JISYO.L")
    (require 'skk-setup)
  5. .skkを編集する。
    (setq skk-server-host "localhost")
    (setq skk-server-portnum 1178)
    (setq skk-japanese-message-and-error t)
    (setq skk-show-annotation t)
    (setq skk-show-tooltip t)
    (when skk-show-tooltip
    (setq skk-tooltip-parameters
    '((background-color . "alice blue")
    (border-color . "royal blue")))
    )
    (setq skk-show-inline t)
    (when skk-show-inline
    (setq skk-inline-show-face nil))
    (setq skk-treat-candidate-appearance-function
    #'(lambda (candidate listing-p)
    (let* ((value (skk-treat-strip-note-from-word candidate))
    (cand (car value))
    (note (cdr value))
    (sep (if note
    (propertize (if (skk-annotation-display-p 'list)
    " ≒ "
    " !")
    'face 'skk-e21-latin-face)
    nil)))
    (cond (note
    (put-text-property 0 (length cand)
    'face 'skk-e21-jisx0201-face cand)
    (put-text-property 0 (length note)
    'face 'skk-e21-katakana-face note)
    (cons cand (cons sep note)))
    (t
    (put-text-property 0 (length cand)
    'face 'skk-e21-hiragana-face cand)
    cand)))))
    (setq skk-egg-like-newline t)
    (setq skk-delete-implies-kakutei nil)
    (setq skk-auto-insert-paren t)
    (setq skk-dcomp-activate t)
    (setq skk-henkan-strict-okuri-precedence t)
    (setq skk-check-okurigana-on-touroku 'ask)
    (setq skk-use-numeric-conversion t)
    (when skk-use-numeric-conversion
    (setq skk-non-numeric-prog-list
    '(skk-look
    skk-tankan-search
    (skk-search-jisyo-file \"/usr/share/skk/SKK-JISYO.jinmei\" 10000))))
    (setq skk-auto-okuri-process t)
    (setq skk-search-prog-list
    (skk-nunion skk-search-prog-list
    '((skk-search-katakana))))
    (setq skk-search-prog-list
    (skk-nunion skk-search-prog-list
    '((skk-search-sagyo-henkaku))))
    (setq skk-share-private-jisyo t)
    (defvar skk-auto-save-jisyo-interval 600)
    (defun skk-auto-save-jisyo ()
    (skk-save-jisyo)
    (skk-bayesian-save-history)
    (skk-bayesian-corpus-save)
    )
    (run-with-idle-timer skk-auto-save-jisyo-interval
    skk-auto-save-jisyo-interval
    'skk-auto-save-jisyo)
    (setq skk-rom-kana-rule-list
    (cons '("-" nil skk-hyphen)
    skk-rom-kana-rule-list))
    (defun skk-hyphen (arg)
    (let ((c (char-before (point))))
    (cond ((null c) "ー")
    ((and (<= ?0 c) (>= ?9 c)) "-")
    ((and (<= ?0 c) (>= ?9 c)) "-")
    ((= 9 c) "-")
    ((and (<= 30 c) (>= 127 c)) "-")
    ((and (<= ?a c) (>= ?z c)) "-")
    ((and (<= ?A c) (>= ?Z c)) "-")
    ((and (<= ?! c) (>= ?/ c)) "-")
    (t "ー"))))
    (defvar skk-last-input (current-time))
    (defvar skk-autooff-secs 60)
    (defvar skk-autooff-poll 3)
    (defvar skk-autooff-timer nil)
    (defadvice skk-insert (after my-add activate)
    (setq skk-last-input (current-time)))
    (setq skk-autooff-timer
    (run-with-timer
    skk-autooff-poll skk-autooff-poll
    (lambda ()
    (when (and (or skk-abbrev-mode skk-j-mode
    skk-jisx0208-latin-mode skk-jisx0201-mode)
    (>= (skk-time-difference skk-last-input (current-time))
    skk-autooff-secs))
    (skk-latin-mode nil)))))
    (defadvice skk-kakutei (after my-add activate)
    (setq skk-last-input (current-time)))
    (setq skk-search-excluding-word-pattern-function
    (function
    (lambda (kakutei-word)
    (save-match-data
    (and
    (not skk-okuri-char)
    (string-match "^[ーァ-ン]+$" kakutei-word)
    (or (not skk-abbrev-mode)
    (not (string-match "^[^ーァ-ンぁ-ん]+$"
    skk-henkan-key))))))))
    (setq skk-rom-kana-rule-list
    (append
    '(("\\" nil "\\")
    ("~" nil "~"))
    skk-rom-kana-rule-list))
    (setq skk-bayesian-history-file "~/.Meadow3/.ddskk/skk-bayesian"
    skk-bayesian-corpus-make t
    skk-bayesian-corpus-file "~/.Meadow3/.ddskk/skk-corpus"
    )
    (require 'skk-bayesian)
    (setq skk-rom-kana-rule-list
    (append skk-rom-kana-rule-list
    '(("." nil skk-period))))
    (defun skk-period (arg)
    (let ((c (char-before (point))))
    (cond ((null c) "。")
    ((and (<= ?0 c) (>= ?9 c)) ".")
    ((and (<= ?0 c) (>= ?9 c)) ".")
    ((= 9 c) ".")
    ((and (<= 30 c) (>= 127 c)) ".")
    ((and (<= ?a c) (>= ?z c)) ".")
    ((and (<= ?A c) (>= ?Z c)) ".")
    ((and (<= ?! c) (>= ?/ c)) ".")
    (t "。"))))
    (setq skk-rom-kana-rule-list
    (append skk-rom-kana-rule-list
    '((":" nil skk-colon))))
    (defun skk-colon (arg)
    (let ((c (char-before (point))))
    (cond ((null c) ":")
    ((and (<= ?0 c) (>= ?9 c)) ":")
    ((and (<= ?0 c) (>= ?9 c)) ":")
    ((= 9 c) ":")
    ((and (<= 30 c) (>= 127 c)) ":")
    ((and (<= ?a c) (>= ?z c)) ":")
    ((and (<= ?A c) (>= ?Z c)) ":")
    ((and (<= ?! c) (>= ?/ c)) ":")
    (t ":"))))
    (setq skk-number-style nil)
    (require 'skk-hint)

Comments:

Post a Comment