annotate yatexgen.el @ 51:b0371b6ed799

Created `ChangeLog'. Log hereafter will be written in `ChangeLog'.
author yuuji
date Tue, 20 Dec 1994 21:00:21 +0000
parents eb0512bfcb7f
children 5d94deabb9f9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
1 ;;; -*- Emacs-Lisp -*-
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
2 ;;; YaTeX add-in function generator.
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
3 ;;; yatexgen.el rev.4
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
4 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
5 ;;; Last modified Sun Dec 11 05:38:35 1994 on VFR
9
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
6 ;;; $Id$
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
7
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
8 (require 'yatex)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
9 (provide 'yatexgen)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
10
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
11 (defmacro YaTeX-setq (var japanese english)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
12 (list 'setq var
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
13 (if YaTeX-japan japanese english))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
14 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
15
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
16 (put 'YaTeX-setq 'lisp-indent-hook 1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
17
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
18 (YaTeX-setq YaTeX-generate-initial-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
19 " 自動生成モードへようこそ!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
20
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
21 初めてやる人はこのバッファの例にしたがって指示通りにやって練習してね。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
22 本番の時もこのバッファに出るメッセージを *よく読んで* 操作しないとう
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
23 まく関数が作れないよ!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
24
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
25 ではリターンキーを押して下さい。"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
26 " Welcome to auto-generation mode!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
27
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
28 If this is your first trial, exercise this according to example and
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
29 following my messages. Then, at making actual function, operate
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
30 reading my messages *carefully*, or you'll fail to generate appropriate
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
31 function.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
32
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
33 Hit return key!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
34 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
35
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
36 (YaTeX-setq YaTeX-generate-start-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
37 "さぁはじめるよ.\n1.登録したい補完をやってみて.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
38 たとえば section 型補完の \\documentstyle だったら \\documentstyle{}
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
39 だけをいれてみてね. ちゃんと『〜型補完』を使わないとダメよ!。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
40 で、おわったらりたーん!!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
41 "Let's begin completion for which you want to make add-in function.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
42 If you want to make add-in function for \\documentstyle input only
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
43 `\\documentstyle{}' *with* completion of yatex-mode.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
44 If you finish this, please press RET."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
45 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
46
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
47 (YaTeX-setq YaTeX-generate-abort-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
48 "やめた、やめた〜いめんどくせ〜"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
49 "Aborted."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
50 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
51
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
52 (YaTeX-setq YaTeX-generate-same-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
53 "それじゃ、なにも変わってねぇだろーが! やめた。"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
54 "I found no difference between them. So I'm quitting."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
55 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
56
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
57 (YaTeX-setq YaTeX-generate-invalid-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
58 "それは、ちと無理というものじゃ."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
59 "It's impossible."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
60 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
61
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
62 (YaTeX-setq YaTeX-generate-idontknow-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
63 "う〜ん、難しくてよくわからないなぁ。ばかでごめんねェ〜"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
64 "Sorry I can't tell your adding method."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
65 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
66
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
67 (YaTeX-setq YaTeX-generate-confirm-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
68 "ということは、付け足したい部分はこれでいいのね"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
69 "Is it additional string of add-in function?"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
70 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
71
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
72 (YaTeX-setq YaTeX-generate-output-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
73 "2.じゃ、それにくっつけたいものを *カーソルの位置に* 足してみて.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
74 さっきの \\documentstyle{} の例だと \\documentstyle[12pt]{} とかにするの。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
75 しつこいようだけど、今の位置からカーソル動かしちゃダメよ!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
76 で、またおわったらりたーん!!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
77 "2.Then input additional string *at CURSOR POSITION*
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
78 According to last example \\documentstyle{},
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
79 modify it \\documentstyle[12pt]{}. RET to finish."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
80 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
81
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
82 (YaTeX-setq YaTeX-generate-put-arg-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
83 "3.このうち、キーボードから読み込んで欲しい文字列を順に入れて。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
84 さっきの \\documentstyle[12pt]{} だったら、付加する文字は[12pt]だけど
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
85 手で入れたいのは 12pt の部分だけですね。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
86 で、全部入れ終ったら、りたーんだけうってね!!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
87 "3.In this string, extract string which you want to input from key
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
88 board with quiry afterwards. For example, though additional string is
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
89 \\documentstyle[12pt]{}, but you want enter only `12pt' by hand.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
90 RET to finish!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
91 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
92
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
93 (YaTeX-setq YaTeX-generate-read-prompt-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
94 "4.では、あとでこれらの文字列を読み込む時に、どういうプロンプトを
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
95 出したいですか? 順に入れて下さい。面倒なら単にリターンを打ってね。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
96 さっきの 12pt の部分だったら、『サイズは』とかがおすすめ。"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
97 "4.When you use this add-in function afterwards, what message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
98 do you like to be prompted with to enter these values. In last
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
99 example `12pt', typical prompt string may be `Size?: '."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
100 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
101
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
102 (YaTeX-setq YaTeX-generate-done-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
103 "よし! これが、君の作りたかった関数だ。~/.emacs にでも入れてせいぜい
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
104 楽してくれ。このバッファ(*ご案内*)を yatex-mode にしておくから
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
105 できた関数が本当にお望みの動作をするか確かめてみるといいかもね。
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
106 ところで、この関数こんなに簡単だろう? そろそろ自分で書いたらどう?
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
107 "
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
108 "OK! This is the definition of function you want to make! Add
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
109 this description to your ~/.emacs or so. Use this buffer(*Guide*)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
110 for testing of this function please.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
111 But you can see this function quite easy, can't you? You had better
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
112 write your most favorite add-in function yourself!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
113 "
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
114 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
115
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
116 (YaTeX-setq YaTeX-generate-nomatch-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
117 "こらこら、そんな文字列どこにもねーぞ!!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
118 "No such string in additional string."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
119 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
120 (YaTeX-setq YaTeX-generate-buffer
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
121 "*付加関数生成バッファ*"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
122 "*Generate-add-in-function*"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
123 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
124
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
125 (YaTeX-setq YaTeX-generate-message-buffer
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
126 "*ご案内*"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
127 "*Guide*"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
128 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
129
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
130 (YaTeX-setq YaTeX-generate-bug-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
131 "ごめ〜ん!! ちょっと、このアドイン関数つくるの失敗しちゃったみたい!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
132 作者まで連絡してくださ〜〜〜い!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
133 "Sorry I failed to make add-in function for you...
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
134 Send bug report to me."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
135 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
136
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
137 (YaTeX-setq YaTeX-generate-narrow-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
138 "画面がせますぎるような気がします。"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
139 "Too narrow screen height."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
140 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
141
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
142 (defvar YaTeX-generate-message-height
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
143 10 "Window height of YaTeX-generate-message-buffer")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
144
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
145 ;;;
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
146 ;Generate mode.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
147 ;;;
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
148 (defun YaTeX-generate ()
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
149 "Genarate YaTeX add-in function with enquiry."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
150 (interactive)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
151 (if (< (screen-height) (+ YaTeX-generate-message-height 10))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
152 (error YaTeX-generate-narrow-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
153 (put 'YaTeX-generate 'disabled t)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
154 (save-window-excursion
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
155 (unwind-protect
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
156 (let (input output (i 0) (beg 0) end add-in map map1 si str slist
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
157 (from (make-marker)) (to (make-marker)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
158 (delete-other-windows)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
159 (switch-to-buffer YaTeX-generate-message-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
160 (yatex-mode)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
161 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
162 (insert YaTeX-generate-initial-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
163 (read-string
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
164 (if YaTeX-japan "リターンキーを押して下さい." "Press RETURN."))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
165 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
166 (insert YaTeX-generate-start-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
167 (pop-to-buffer (get-buffer-create YaTeX-generate-buffer))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
168 (enlarge-window (- (window-height) YaTeX-generate-message-height 1))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
169 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
170 (yatex-mode)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
171 (use-local-map (setq map (copy-keymap YaTeX-mode-map)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
172 (define-key (current-local-map) "\n" 'exit-recursive-edit)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
173 (define-key (current-local-map) "\r" 'exit-recursive-edit)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
174 (define-key (current-local-map) "\C-g" 'abort-recursive-edit)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
175 (setq map1 (copy-keymap map))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
176 (YaTeX-suppress-sparse-keymap map)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
177 ;;First get input form.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
178 (recursive-edit)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
179 (setq input (buffer-string)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
180 end (1- (length input)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
181 (if (string= "" input) (error YaTeX-generate-abort-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
182 (YaTeX-generate-move-to-add-in-position)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
183 (set-marker from (1- (point))) ;;Can't write before `from'
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
184 (set-marker to (1+ (point))) ;;Can't write after `to'
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
185 ;;Second get output form.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
186 (setq beg (1- (point)));;Cheat begin point!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
187 (YaTeX-generate-display-message YaTeX-generate-output-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
188 (use-local-map map1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
189 (fset 'si (symbol-function 'self-insert-command))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
190 (defun self-insert-command (arg)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
191 (interactive "p")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
192 (if (or (not (equal (buffer-name) YaTeX-generate-buffer))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
193 (and (> (point) (marker-position from))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
194 (< (point) (marker-position to))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
195 (insert (this-command-keys)) (ding)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
196 (unwind-protect
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
197 (recursive-edit)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
198 (fset 'self-insert-command (symbol-function 'si)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
199 (setq output (buffer-string))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
200 (cond ((string= "" output) (error YaTeX-generate-abort-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
201 ((string= input output) (error YaTeX-generate-same-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
202 ((< (length output) (length input))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
203 (error YaTeX-generate-invalid-message)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
204 ;;(while (and (< beg end) (= (aref input beg) (aref output i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
205 ;; (setq beg (1+ beg) i (1+ i))) ;;for universal use.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
206 (setq i (1- (length output)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
207 (while (and (>= end beg) (= (aref output i) (aref input end)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
208 (setq end (1- end) i (1- i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
209 (setq add-in (substring output beg
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
210 (if (= i (1- (length output))) nil (1+ i))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
211 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
212 (insert add-in)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
213 (if (not (y-or-n-p YaTeX-generate-confirm-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
214 (error YaTeX-generate-idontknow-message))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
215 ;;Extract arguments.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
216 (YaTeX-generate-display-message YaTeX-generate-put-arg-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
217 (setq i 1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
218 (while (not (string=
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
219 "" (setq str (read-string (format "Arg %d: " i)))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
220 (if (not (string-match (regexp-quote str) add-in))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
221 (progn
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
222 (ding)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
223 (YaTeX-generate-display-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
224 YaTeX-generate-nomatch-message -1))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
225 (setq slist (append slist (list (list str))) i (1+ i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
226 );input all of arguments.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
227 ;;Compare with output string.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
228 (set-buffer YaTeX-generate-buffer) ;;for safety
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
229 (emacs-lisp-mode)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
230 (if (> i 1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
231 (YaTeX-generate-parse-add-in slist add-in)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
232 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
233 (insert "(defun " (YaTeX-generate-function-name) " ()\n")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
234 (insert "\"" (YaTeX-generate-lisp-quote add-in) "\")\n")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
235 (indent-region (point-min) (point-max) nil)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
236 (message (if YaTeX-japan
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
237 "このくらいの関数手で書け!!"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
238 "You don't need me to make such easy function.")))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
239 );let
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
240 (put 'YaTeX-generate 'disabled nil)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
241 (put 'YaTeX-addin 'disabled nil)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
242 ))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
243 (YaTeX-generate-display-message YaTeX-generate-done-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
244 (switch-to-buffer YaTeX-generate-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
245 (condition-case error
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
246 (eval-current-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
247 (error (insert YaTeX-generate-bug-message)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
248 (pop-to-buffer YaTeX-generate-message-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
249 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
250
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
251 (defun YaTeX-generate-parse-add-in (args add-in)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
252 "Parse add-in string and extract argument for it.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
253 Variable add-in is referred in parent function."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
254 (let ((i 1) j (case-fold-search nil) ;i holds argument number
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
255 (prompt (make-vector (length args) ""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
256 (used (make-vector (length add-in) nil))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
257 func-name (string ""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
258 ;;Phase 1. extract argument from add-in string.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
259 (mapcar
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
260 '(lambda (arg)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
261 (let ((index 0) (match 0) beg end (carg (car arg)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
262 (YaTeX-generate-display-message
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
263 YaTeX-generate-read-prompt-message)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
264 (aset prompt (1- i)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
265 (read-string
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
266 (format
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
267 (if YaTeX-japan "%d番目(%s)を読む時?: "
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
268 "When reading argument #%d(%s)?: ") i (car arg))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
269 (while (string-match (regexp-quote carg) (substring add-in index))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
270 (setq beg (+ index (match-beginning 0))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
271 end (+ index (match-end 0)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
272 (if (aref used beg) nil
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
273 (setq match (1+ match))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
274 (cond
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
275 ((= match 1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
276 ;;(setq arg (append arg (list (list beg end))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
277 (YaTeX-generate-register-match))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
278 ((YaTeX-generate-ask-match-position)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
279 (YaTeX-generate-register-match))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
280 (setq index end))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
281 (setq i (1+ i))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
282 args)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
283 ;;Phase 2. Generate function!!
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
284 (setq i 0)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
285 (setq func-name (YaTeX-generate-function-name))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
286 (while (< i (length add-in))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
287 (setq beg i j (aref used i))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
288 (while (and (< i (length add-in)) (equal j (aref used i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
289 (setq i (1+ i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
290 (if j ;If it is argument.
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
291 (setq string (concat string (format " arg%d" j)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
292 (setq string
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
293 (concat string " \""
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
294 (YaTeX-generate-quote-quote (substring add-in beg i))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
295 "\""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
296 ))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
297 (erase-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
298 (setq i 1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
299 (insert
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
300 "(defun " func-name " ()\n"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
301 " (let (")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
302 (mapcar
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
303 '(lambda (arg)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
304 (insert (format "(arg%d (read-string \"%s: \"))\n"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
305 i (aref prompt (1- i))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
306 (setq i (1+ i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
307 args)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
308 (delete-region (point) (progn (forward-line -1) (end-of-line) (point)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
309 (insert ")\n(concat " (YaTeX-generate-lisp-quote string)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
310 ")))\n")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
311 (indent-region (point-min) (point) nil)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
312 used)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
313 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
314
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
315 (defun YaTeX-generate-ask-match-position ()
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
316 "Ask user whether match-position is in his expectation,
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
317 Referencing variables in parent function YaTeX-generate-parse-add-in."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
318 (pop-to-buffer YaTeX-generate-message-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
319 (goto-char (point-max))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
320 (insert "\n\n"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
321 (format (if YaTeX-japan "%d 番目の引数 %s って"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
322 "Is argument #%d's value `%s' also corresponding to")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
323 i carg) "\n" add-in "\n")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
324 (indent-to-column beg)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
325 (let ((c beg))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
326 (while (< c end) (insert "^") (setq c (1+ c))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
327 (insert "\n" (if YaTeX-japan "ここにも対応してるの?"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
328 "this underlined part too?"))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
329 (other-window -1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
330 (y-or-n-p (if YaTeX-japan "下線部はあってますか" "Is underline right"))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
331 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
332
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
333 (defun YaTeX-generate-register-match ()
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
334 (nconc arg (list (list beg end)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
335 (let ((x beg))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
336 (while (< x end) (aset used x i)(setq x (1+ x))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
337 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
338
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
339 (defun YaTeX-generate-display-message (mes &optional bottom)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
340 "Display message to generation buffer."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
341 (pop-to-buffer YaTeX-generate-message-buffer)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
342 (goto-char (point-max))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
343 (insert "\n\n")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
344 (if bottom (recenter (1- bottom)) (recenter 0))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
345 (insert mes)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
346 (other-window -1)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
347 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
348
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
349 (defun YaTeX-generate-move-to-add-in-position ()
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
350 "Move cursor where add-in function should insert string."
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
351 (cond
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
352 ((eq YaTeX-current-completion-type 'begin)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
353 (goto-char (point-min))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
354 (skip-chars-forward "^{")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
355 (setq env-name
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
356 (buffer-substring (1+ (point))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
357 (progn (skip-chars-forward "^}") (point))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
358 (forward-char 1))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
359 ((eq YaTeX-current-completion-type 'section)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
360 (goto-char (point-min))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
361 (skip-chars-forward "^{"))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
362 ((eq YaTeX-current-completion-type 'maketitle)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
363 (goto-char (point-max))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
364 (if (= (preceding-char) ? )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
365 (forward-char -1)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
366 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
367 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
368
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
369 (defun YaTeX-generate-function-name ()
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
370 (concat
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
371 "YaTeX:"
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
372 (cond
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
373 ((eq YaTeX-current-completion-type 'begin) env-name)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
374 ((eq YaTeX-current-completion-type 'section) section-name)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
375 ((eq YaTeX-current-completion-type 'maketitle) single-command)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
376 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
377
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
378 (defun YaTeX-generate-lisp-quote (str)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
379 (let ((len (length str))(i 0) (quote ""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
380 (while (< i len)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
381 (if (= (aref str i) ?\\)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
382 (setq quote (concat quote "\\")))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
383 (if (= (aref str i) 127)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
384 (setq quote (concat quote "\""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
385 (setq quote (concat quote (substring str i (1+ i)))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
386 (setq i (1+ i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
387 quote)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
388 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
389
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
390 (defun YaTeX-generate-quote-quote (str)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
391 (let ((len (length str))(i 0) (quote ""))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
392 (while (< i len)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
393 (if (= (aref str i) ?\")
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
394 (setq quote (concat quote (char-to-string 127))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
395 (setq quote (concat quote (substring str i (1+ i))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
396 (setq i (1+ i)))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
397 quote)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
398 )
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
399
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
400 (defun YaTeX-suppress-sparse-keymap (map)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
401 (let ((i ? ))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
402 (while (< i 127)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
403 (define-key map (char-to-string i) 'undefined)
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
404 (setq i (1+ i))))
7becca042f80 Initial revision.
yuuji
parents:
diff changeset
405 )
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
406
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
407 ;;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
408 ;; Auto-generate Function for Lispers.
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
409 ;;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
410 (defun YaTeX-generate-read-completion-type (nth)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
411 (message
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
412 "Read type(%d): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit" nth)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
413 (let ((c (read-char)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
414 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
415 ((= c ?s) 'string)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
416 ((= c ?c) 'completion)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
417 ((= c ?f) 'file)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
418 ((= c ?\[) 'option)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
419 ((= c ?p) 'oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
420 ((= c ?o) 'coord)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
421 ;;((= c ?m) 'macro)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
422 (t 'quit)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
423 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
424 (defun YaTeX-generate-read-completion-table ()
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
425 (let ((i 1) cand (cands "(") (cb (current-buffer))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
426 (buf (get-buffer-create " *Candidates*")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
427 (save-window-excursion
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
428 (save-excursion
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
429 (YaTeX-showup-buffer buf nil)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
430 (set-buffer buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
431 (erase-buffer)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
432 (while (string<
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
433 ""
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
434 (setq cand (read-string (format "Item[%d](RET to exit): " i))))
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
435 (setq cands (concat cands (format "(\"%s\")\n" cand))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
436 i (1+ i))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
437 (insert cand "\n"))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
438 (kill-buffer buf)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
439 ;;(set-buffer cb)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
440 (concat cands ")"))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
441 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
442 (defun YaTeX-generate-corresponding-paren (left)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
443 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
444 ((equal left "{") "}")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
445 ((equal left "[") "]")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
446 ((equal left "(") ")")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
447 ((equal left "<") ">")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
448 ((equal left "\\begin{" "}"))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
449 (t left))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
450 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
451 (defun YaTeX-generate-create-read-string (&optional nth)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
452 (concat
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
453 "(read-string \""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
454 (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
455 ": \"\n"
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
456 "\"" (read-string "Default: ") "\""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
457 ")\n")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
458 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
459 (defun YaTeX-generate-create-completing-read (&optional nth)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
460 (concat
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
461 "(completing-read \""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
462 (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
463 ": \"\n"
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
464 (format "'%s\n" (YaTeX-generate-read-completion-table))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
465 "nil "
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
466 (format "%s)" (y-or-n-p "Require match? ")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
467 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
468 (defun YaTeX-generate-create-read-file-name (&optional nth)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
469 (concat
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
470 "(read-file-name \""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
471 (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
472 ": \" "" nil t \"\")\n")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
473 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
474 (defun YaTeX-generate-create-read-oneof (&optional nth readpos)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
475 (concat
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
476 (if readpos
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
477 "(YaTeX:read-position \""
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
478 "(YaTeX:read-oneof \"")
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
479 (read-string "Acceptable characters: " "lcr") "\")\n")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
480 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
481 (defun YaTeX-generate-option-type (command)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
482 (let ((func (format "YaTeX:%s" command)) leftp
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
483 (buf (get-buffer-create YaTeX-generate-buffer)) type (n 1))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
484 (set-buffer buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
485 (erase-buffer)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
486 (insert "(defun " func " ()\n (concat\n")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
487 (catch 'done
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
488 (while t
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
489 (setq type (YaTeX-generate-read-completion-type n))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
490 (insert
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
491 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
492 ;;Read string
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
493 ((eq type 'string)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
494 (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
495 \""\n"
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
496 (YaTeX-generate-create-read-string)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
497 \"\" (YaTeX-generate-corresponding-paren leftp) \"\"
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
498 ))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
499
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
500 ;;Completing-read
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
501 ((eq type 'completion)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
502 (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
503 \""\n"
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
504 (YaTeX-generate-create-completing-read)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
505 \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
506 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
507 ((eq type 'file)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
508 (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
509 \""\n"
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
510 (YaTeX-generate-create-read-file-name)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
511 \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
512 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
513 ((eq type 'oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
514 (YaTeX-generate-create-read-oneof nil t)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
515 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
516 ((eq type 'option)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
517 (concat "(let ((op (read-string \""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
518 (read-string "Prompt: ")
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
519 ": \")))\n"
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
520 "(if (string< \"\" op)\n"
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
521 " (concat \"[\" op \"]\")\n"
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
522 " \"\"))\n")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
523 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
524
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
525 ((eq type 'coord)
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
526 (concat "(YaTeX:read-coordinates \""
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
527 (read-string "Prompt for coordinates: ")
46
cd1b63102eed Support Mule2
yuuji
parents: 23
diff changeset
528 ": \")\n")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
529 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
530 ((eq type 'macro)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
531 (error "not yet supported")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
532 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
533 (t (throw 'done t))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
534 (setq n (1+ n))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
535 (insert "))\n") ;close defun
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
536 (goto-char (point-min))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
537 (while (not (eobp)) (lisp-indent-line) (forward-line 1))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
538 (eval-current-buffer)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
539 buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
540 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
541 (defun YaTeX-generate-argument-type (command argc)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
542 "Create an argument-type add-in function."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
543 (interactive)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
544 (let ((func (format "YaTeX::%s" command)) (argp 1)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
545 (cb (current-buffer))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
546 (buf (get-buffer-create YaTeX-generate-buffer)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
547 (set-buffer buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
548 (erase-buffer)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
549 (insert "(defun " func " (&optional argp)\n(cond\n")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
550 (while (<= argp argc)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
551 (insert (format "((equal argp %d)\n" argp))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
552 (setq type (YaTeX-generate-read-completion-type argp))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
553 (insert
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
554 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
555 ((eq type 'string)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
556 (concat (YaTeX-generate-create-read-string argp)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
557 ((eq type 'completion)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
558 (concat (YaTeX-generate-create-completing-read argp)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
559 ((eq type 'oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
560 (YaTeX-generate-create-read-oneof))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
561 ((eq type 'file)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
562 (concat (YaTeX-generate-create-read-file-name argp)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
563 (t ""))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
564 ")\n")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
565 (setq argp (1+ argp)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
566 (insert "))\n")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
567 (goto-char (point-min))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
568 (while (not (eobp)) (lisp-indent-line) (forward-line 1))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
569 (eval-current-buffer)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
570 (set-buffer cb)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
571 (YaTeX-update-table
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
572 (if (> argc 1) (list command argc) (list command))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
573 'section-table 'user-section-table 'tmp-section-table)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
574 buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
575 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
576 (defun YaTeX-generate-simple (&optional command)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
577 "Simple but requiring some elisp knowledge add-in generator."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
578 (interactive)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
579 (or command
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
580 (setq command
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
581 (completing-read
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
582 (format "Making add-in function for (default %s): " section-name)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
583 (append
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
584 section-table user-section-table tmp-section-table
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
585 article-table user-article-table
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
586 env-table user-env-table tmp-env-table
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
587 singlecmd-table user-singlecmd-table tmp-singlecmd-table)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
588 nil nil)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
589 command (if (string= "" command) section-name command)))
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 46
diff changeset
590 (message
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 46
diff changeset
591 (cond
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 46
diff changeset
592 (YaTeX-japan "(o)追加型? (a)引数型? (yatexadd.docを参照のこと) :")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 46
diff changeset
593 (t "(O)ption? (A)rgument?")))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
594 (YaTeX-showup-buffer
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
595 (if (= (read-char) ?o)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
596 (YaTeX-generate-option-type command)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
597 (YaTeX-generate-argument-type
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
598 command
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
599 (string-to-int (read-string "How many arguments?: ")))) nil)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
600 )

yatex.org