File: sample.tc

package info (click to toggle)
t-code 2%3A2.2.1%2B2.3pre4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 4,828 kB
  • ctags: 627
  • sloc: lisp: 9,029; perl: 748; sh: 374; makefile: 138
file content (142 lines) | stat: -rw-r--r-- 5,085 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
;;; .tc --- setup file for T-Code       -*-emacs-lisp-*-

;;; աۤΥեϡޤǤꡢ
;;; ïˤǤ⤪ǤǤϤޤ
;;; Ƥ򤷤ꤷƤ

;;; ѿ
;; tcode-data-directory  "~/T-Code/" ꤹ롣
(setq tcode-data-directory "~/T-Code/")

;; ưˡTɤǻȤ٤ƤΥ饤֥ɤ롣
(setq tcode-load-immediate t)

;; ѴǸַѤ롣
(setq tcode-use-postfix-bushu-as-default t)

;; Ѵ tc.el ɻɤ߹ࡣ
(setq tcode-bushu-on-demand 0)

;; ɽå¤ˤ롣
(setq tcode-verbose-message nil)

;; إѤΥɥ礭ưŪĴ롣
(setq tcode-adjust-window-for-help t)

;; .tc-record ˵Ͽʤ
(setq tcode-record-file-name nil)

;;; global 

;; `tcode-electric-space'  `tcode-electric-comma' Ȥä
;; ⡼ɤڤؤͭˤ
(global-set-key " " 'tcode-electric-space)
(global-set-key "," 'tcode-electric-comma)

;;;; ĥޥ

(defun toggle-tcode-mode-and-self-insert (arg)
  "Tɥ⡼ɤȥ뤷ƤϤ롣"
  (interactive "*p")
  (toggle-input-method)
  (self-insert-command arg))

;;; Tɥ⡼ɤ˽äȤ˹Ԥ
(add-hook 'tcode-ready-hook
          (function
           (lambda ()
	     ;; ֤ȤDvorakѤ롣
	     (tcode-set-key-layout "dvorak")
	     ;; եȤǤϤǡʸǤϤʤʸϤ롣
	     (setq tcode-shift-lowercase t)
             ;; TɤǻѤ40ĤΥʳΥؤΥޥɤγ
             (set-tcode-mode-key "\\" 'toggle-tcode-mode-and-self-insert)
             ;; ο
             (and window-system
                  (progn
                    (tcode-enable-cursor-to-change-color)
                    ;; Τ
                    (add-hook 'tcode-toggle-hook
                              'tcode-enable-cursor-to-change-color)))
             ;; Tɥ⡼ɤ˺ǽä˸򤼽Ѵμɤ߹ࡣ
             (save-excursion
               (tcode-mazegaki-switch-to-dictionary)))))

;;; ʸɽɤ˹Ԥ
;;;   2ȥʾΥȥΥ
(add-hook 'tcode-after-load-table-hook
          (function
           (lambda ()
             (if (eq tcode-input-method 'tcode)
                 ;; TѤ
                 (progn
		   ;; ɽѹ롣
		   ;;   䢪
		   (tcode-set-action-to-table '(34 29) "")
                   ;; QWERTY ǤΡkeפѿ tcode-left-paren Ƥ롣
                   (tcode-set-action-to-table '(27 12)
                                              'tcode-left-paren)
                   ;; QWERTY ǤΡidפѿ tcode-right-paren Ƥ롣
                   (tcode-set-action-to-table '(17 22)
                                              'tcode-right-paren))))))

;;; 򤼽Ѵ˴ؤ
(add-hook 'tcode-mazegaki-init-hook
          '(lambda ()
             ;; ˻Ѥ륭2ʤˤ롣
             (setq tcode-mazegaki-priority-list
                   ;; 
                   ;;  0  1  2  3  4    5  6  7  8  9
                   ;; 10 11 12 13 14   15 16 17 18 19
                   ;; 20 21 22 23 24   25 26 27 28 29
                   ;; 30 31 32 33 34   35 36 37 38 39
                   '(27 22 26 23 28 21 25 24 29 20
                        17 12 16 13 18 11 15 14 19 10))
             ;; ѴоݤĹ
             (setq tcode-mazegaki-yomi-max 8)
             ;; ؽ(ؤ)򤷤ʤ褦ˤ롣
             (setq tcode-mazegaki-gakusyu-kouho-offset 10000)
             ;; ڡǡѴǤʤ⡼ڤؤԤ
             (set-tcode-mode-key " " 'tcode-electric-space)))

;;; ¾

;; ڤؤ
;; ɸȤ߹碌䤷ġ(פ)פڤؤ褦ˤ롣
(defvar tcode-left-paren "(" "* ")
(make-variable-buffer-local 'tcode-left-paren)
(defvar tcode-right-paren ")" "* Ĥ")
(make-variable-buffer-local 'tcode-right-paren)
(setq tcode-switch-table-list
      '(;; ǥե
        ((tcode-touten . "")
         (tcode-kuten . "")
         (tcode-left-paren . "(")
         (tcode-right-paren . ")"))
        ;; 1Хȷ
        ((tcode-touten . ", ")
         (tcode-kuten . ". ")
         (tcode-left-paren . "(")
         (tcode-right-paren . ")"))
        ;; 2Хȷ
        ((tcode-touten . "")
         (tcode-kuten . "")
         (tcode-left-paren . "")
         (tcode-right-paren . ""))))

;;; μưڤؤ
;; ڤؤε(ɽ)λ
(setq tcode-kutouten-regexp-alist
      (list '("[]" . 1)
            (if (tcode-nemacs-p)
                '("\\z[,.]" . 2)
              '("\\cj[,.]" . 2))
            '("[]" . 3)))
;; ڤؤ⡼ɤ(text-mode latex-mode)
(setq tcode-auto-identify-kutouten-mode-list
      '(text-mode latex-mode))
;; ХåեǺǽ Tɥ⡼ɤäȤˡ
;; ưŪڤؤ롣
(add-hook 'tcode-mode-hook 'tcode-auto-switch-kutouten)

;;; .tc ends here