annotate yatexmth.el @ 294:8d3156073892 dev

for 1.77
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 01 Apr 2013 22:47:31 +0900
parents e1c1616c4f07
children 53709ee88448
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
287
5921f28ef77c Change the first lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 229
diff changeset
1 ;;; yatexmth.el --- YaTeX math-mode-specific functions
5921f28ef77c Change the first lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 229
diff changeset
2 ;;;
294
8d3156073892 for 1.77
HIROSE Yuuji <yuuji@gentei.org>
parents: 292
diff changeset
3 ;;; (c)1993-2013 by HIROSE Yuuji [yuuji@yatex.org]
8d3156073892 for 1.77
HIROSE Yuuji <yuuji@gentei.org>
parents: 292
diff changeset
4 ;;; Last modified Mon Apr 1 22:44:22 2013 on firestorm
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
5 ;;; $Id$
390df0e505da Label completion works.
yuuji
parents:
diff changeset
6
287
5921f28ef77c Change the first lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 229
diff changeset
7 ;;; Commentary:
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
8 ;;; [Customization guide]
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
9 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
10 ;;; By default, you can use two completion groups in YaTeX math
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
11 ;;; mode, `;' for mathematical signs and `:' for greek letters. But
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
12 ;;; you can add other completion groups by defining the alist of
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
13 ;;; `prefix key' vs `completion list' into the variable
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
14 ;;; YaTeX-math-key-list-private. If you wish to accomplish the
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
15 ;;; completion as follows(prefix key is `,'):
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
16 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
17 ;;; KEY COMPLETION
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
18 ;;; s \sin
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
19 ;;; S \arcsin
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
20 ;;; c \cos
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
21 ;;; C \arccos
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
22 ;;; :
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
23 ;;; T \arctan
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
24 ;;; l \log
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
25 ;;; hs \sinh
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
26 ;;;
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
27 ;;; Typing `s' after `,' makes `\sin', `hs' after `,' makes `\sinh'
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
28 ;;; and so on. First, you have to define list of key-completion
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
29 ;;; pairs. Variable name(YaTeX-math-funcs-list) is arbitrary.
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
30 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
31 ;;; (setq YaTeX-math-funcs-list
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
32 ;;; '(("s" "sin")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
33 ;;; ("S" "arcsin")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
34 ;;; :
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
35 ;;; ("hs" "sinh")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
36 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
37 ;;; Next, define the list of prefix-key vs completion list(defined
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
38 ;;; above) into the variable YaTeX-math-key-list-private.
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
39 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
40 ;;; (setq YaTeX-math-key-list-private
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
41 ;;; '(("," . YaTeX-math-funcs-list)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
42 ;;; ("'" . Other-List-if-any)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
43 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
44 ;;; Put these expressions into your ~/.emacs, and you can use this
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
45 ;;; completion in the math-mode.
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
46 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
47 ;;; And you can add your favorite completion sequences to the
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
48 ;;; default completion list invoked with `;', by defining those lists
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
49 ;;; into variable YaTeX-math-sign-alist-private.
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
50
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
51 ;;; 【イメージ補完の追加方法】
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
52 ;;;
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
53 ;;; 標準のイメージ補完では、「;」で始まる数式記号補完と、「:」で始
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
54 ;;; まるギリシャ文字補完が使用可能ですが、これ以外の文字で始まる補完
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
55 ;;; シリーズも定義することができます。例えば、「,」で始まる次のよう
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
56 ;;; な補完シリーズを定義する場合を考えてみます。
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
57 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
58 ;;; 補完キー 補完結果
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
59 ;;; s \sin
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
60 ;;; S \arcsin
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
61 ;;; c \cos
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
62 ;;; C \arccos
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
63 ;;; :
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
64 ;;; T \arctan
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
65 ;;; l \log
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
66 ;;; hs \sinh
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
67 ;;;
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
68 ;;; 「,」のあとに s を押すと \sin が、hs を押すと \sinh が入力されま
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
69 ;;; す。このような補完リストの登録は以下のようにします(変数名は任意)。
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
70 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
71 ;;; (setq YaTeX-math-funcs-list
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
72 ;;; '(("s" "sin")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
73 ;;; ("S" "arcsin")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
74 ;;; :
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
75 ;;; ("hs" "sinh")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
76 ;;;
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
77 ;;; さらに、「,」を押した時にイメージ補完が始まるよう次の変数に、起動キー
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
78 ;;; と上で定義した補完用変数の登録を行ないます。
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
79 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
80 ;;; (setq YaTeX-math-key-list-private
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
81 ;;; '(("," . YaTeX-math-funcs-list)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
82 ;;; ("'" . ほかに定義したいシリーズがあれば…)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
83 ;;;
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
84 ;;; これらを ~/.emacs に書いておけば、math-mode で自分専用のイメージ
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
85 ;;; 補完が利用できます。
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
86
287
5921f28ef77c Change the first lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 229
diff changeset
87 ;;; Code:
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
88 (defvar YaTeX-jisold
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
89 (and (boundp 'dos-machine-type)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
90 (eq dos-machine-type 'pc98)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
91
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
92 (defmacro YaTeX-setq-math-sym (sym old new)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
93 (list 'setq sym (list 'if 'YaTeX-jisold old new)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
94
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
95 (YaTeX-setq-math-sym YaTeX-image-in "E" "∈")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
96 (YaTeX-setq-math-sym YaTeX-image-ni "ヨ" "∋")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
97 (YaTeX-setq-math-sym YaTeX-image-subset " _\n(\n ~" "⊂")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
98 (YaTeX-setq-math-sym YaTeX-image-subseteq " _\n(_\n ~" "⊆")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
99 (YaTeX-setq-math-sym YaTeX-image-supset "_\n )\n~" "⊃")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
100 (YaTeX-setq-math-sym YaTeX-image-supseteq "_\n_)\n~" "⊇")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
101 (YaTeX-setq-math-sym YaTeX-image-nabla "___\n\\\\/" "∇")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
102 (YaTeX-setq-math-sym YaTeX-image-partial " -+\n+-+\n+-+" "∂")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
103 (YaTeX-setq-math-sym YaTeX-image-dagger "+\n|" "†")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
104 (YaTeX-setq-math-sym YaTeX-image-ddagger "+\n+\n|" "‡")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
105 (YaTeX-setq-math-sym YaTeX-image-equiv "=\n ̄" "≡")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
106 (YaTeX-setq-math-sym YaTeX-image-int " /\\\n \\\n\\/" "∫")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
107 (YaTeX-setq-math-sym YaTeX-image-bot "|\n ̄" "⊥")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
108 (YaTeX-setq-math-sym YaTeX-image-neg "イ" "¬")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
109 (YaTeX-setq-math-sym YaTeX-image-flat "b" "♭")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
110 (YaTeX-setq-math-sym YaTeX-image-sqrt "" "√")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
111 (defvar YaTeX-image-nearrow '("__\n /|\n/" " _\n /|\n/" ))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
112 (defvar YaTeX-image-nwarrow '(" __\n|\\\n \\" " _\n|\\n \"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
113 (defvar YaTeX-image-searrow '("\\\n \\|\n--`" "\\n \|\n  ̄"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
114 (defvar YaTeX-image-swarrow '(" /\n|/\n'~~" " /\n|/\n  ̄"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
115
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
116
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
117 (defvar
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
118 YaTeX-math-sign-alist-default
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
119 '(
390df0e505da Label completion works.
yuuji
parents:
diff changeset
120 ;frequently used
390df0e505da Label completion works.
yuuji
parents:
diff changeset
121 ("||" "|" ("||" "‖"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
122 ("sum" "sum" ("\\-+\n >\n/-+" "Σ"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
123 ("sigma" "sum" ("\\-+\n >\n/-+" "Σ"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
124 ("integral" "int" (" /\\\n \\\n\\/" YaTeX-image-int))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
125 ("ointegral" "oint" " /\\\n(\\)\n\\/")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
126 ("sqrt" "sqrt" (" __\n,/" YaTeX-image-sqrt))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
127 ("root" "sqrt" (" __\n,/" YaTeX-image-sqrt))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
128 ("A" "forall" "|_|\nV")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
129 ("E" "exists" "-+\n-+\n-+")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
130 ("!" "neg" ("--+\n |" YaTeX-image-neg))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
131 ("oo" "infty" ("oo" "∞"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
132 ("\\" "backslash" ("\\" "\"))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
133 ("..." "cdots" ("..." "…"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
134
390df0e505da Label completion works.
yuuji
parents:
diff changeset
135 ;;binary operators
390df0e505da Label completion works.
yuuji
parents:
diff changeset
136 ("+-" "pm" ("+\n-" "±"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
137 ("-+" "mp" "-\n+")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
138 ("x" "times" ("x" "×"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
139 ("/" "div" (",\n-\n'" "÷"))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
140 ("f" "frac" "xxx\n---\nyyy" "÷")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
141 ("*" "ast" "*")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
142 ("#" "star" ("_/\\_\n\\ /\n//\\\\" "★"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
143 ("o" "circ" "o")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
144 ("o*" "bullet" " _\n(*)\n ~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
145 ("." "cdot" ".")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
146 ("cap" "cap" "/-\\\n| |")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
147 ("cup" "cup" "| |\n\\-/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
148 ("u+" "uplus" "|+|\n\\-/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
149 ("|~|" "sqcap" "|~|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
150 ("|_|" "sqcup" "|_|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
151 ("v" "vee" "v")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
152 ("^" "wedge" "^")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
153 ("\\\\" "setminus" "\\")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
154 (")(" "wr" " )\n(")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
155 ("<>" "diamond" "<>")
128
d5e19b856ca1 typo in \\bigtriangleup fixed.
yuuji@gentei.org
parents: 80
diff changeset
156 ("/\\-" "bigtriangleup" ("/\\\n~~" "△"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
157 ("-\\/" "bigtriangledown" ("__\n\\/" "▽"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
158 ("<|" "triangleleft" "<|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
159 ("|>" "triangleright" "|>")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
160 ("<||" "lhd" "/|\n\\|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
161 ("||>" "rhd" "|\\\n|/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
162 ("<|-" "unlhd" "<|\n~~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
163 ("|>-" "unrhd" "|>\n~~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
164 ("o+" "oplus" " _\n(+)\n ~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
165 ("o-" "ominus" " _\n(-)\n ~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
166 ("ox" "otimes" " _\n(x)\n ~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
167 ("o/" "oslash" " _\n(/)\n ~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
168 ("o." "odot" "(.)")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
169 ("O" "bigcirc" "O")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
170 ("t" "dagger" ("+\n|" YaTeX-image-dagger))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
171 ("tt" "ddagger" ("+\n+\n|" YaTeX-image-ddagger))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
172 ("II" "amalg" "II")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
173 ; :
390df0e505da Label completion works.
yuuji
parents:
diff changeset
174 ;;relational operators
134
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
175 ("<" "leq" ("<\n-" "<\n-"))
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
176 ("=<" "leqq" ("<\n=" "≦"))
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
177 (">" "geq" (">\n-" ">\n-"))
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
178 (">=" "geqq" (">\n=" "≧"))
143
c9da37260ca9 fallingdotseq
yuuji@gentei.org
parents: 134
diff changeset
179 ("=:" "fallingdotseq" (".\n==\n ." "≒"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
180 ("-=" "equiv" ("=\n-" YaTeX-image-equiv))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
181 ("=-" "equiv" ("=\n-" YaTeX-image-equiv))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
182 ("---" "equiv" ("=\n-" YaTeX-image-equiv))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
183 ("(" "subset" (" _\n(\n ~" YaTeX-image-subset))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
184 ("(-" "subseteq" (" _\n(_\n ~" YaTeX-image-subseteq))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
185 (")" "supset" ("_\n )\n~" YaTeX-image-supset))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
186 (")-" "supseteq" ("_\n_)\n~" YaTeX-image-supseteq))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
187 ("[" "sqsubset" "[")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
188 ("[-" "sqsubseteq" "[\n~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
189 ("]" "sqsupset" "]")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
190 ("]-" "sqsupseteq" "]\n~")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
191 ("{" "in" ("(-" YaTeX-image-in))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
192 ("}" "ni" ("-)" YaTeX-image-ni))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
193 ("|-" "vdash" "|-")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
194 ("-|" "dashv" "-|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
195 ("~" "sim" "~(tild)")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
196 ("~-" "simeq" "~\n-")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
197 ("asymp" "asymp" "v\n^")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
198 ("~~" "approx" "~\n~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
199 ("~=" "cong" "~\n=")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
200 ("=/" "neq" ("=/=" "≠"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
201 (".=" "doteq" ".\n=")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
202 ("o<" "propto" "o<")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
203 ("|=" "models" "|=")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
204 ("_|_" "perp" "_|_")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
205 ("|" "mid" "|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
206 ("||" "parallel" "||")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
207 ("bowtie" "bowtie" "|><|(wide)")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
208 ("|><|" "join" "|><|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
209 ("\\_/" "smile" "\\_/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
210 ("/~\\" "frown" "/~~\\")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
211 ("-<" "prec" ("-<" "く"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
212 ("-<=" "preceq" ("-<\n-" "く\n="))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
213 ("<<" "ll" ("<<" "《"))
134
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
214 ("<<" "lll" "<<<")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
215 (">>" "gg" (">>" "》"))
134
94a1370956a4 `leqq' and `geqq' (in mathsymb)
yuuji@gentei.org
parents: 130
diff changeset
216 (">>>" "ggg" ">>>")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
217 ; :
390df0e505da Label completion works.
yuuji
parents:
diff changeset
218 ;;arrows
390df0e505da Label completion works.
yuuji
parents:
diff changeset
219 ("<-" "leftarrow" ("<-" "←"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
220 ("\C-b" "leftarrow" ("<-" "←"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
221 ("<--" "longleftarrow" ("<--" "←--"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
222 ("<=" "Leftarrow" "<=")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
223 ("<==" "Longleftarrow" "<==")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
224 ("->" "rightarrow" ("->" "→"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
225 ("\C-f" "rightarrow" ("->" "→"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
226 ("-->" "longrightarrow" ("-->" "--→"))
64
36a48185b95a Changes are listed in yatex.new.
yuuji
parents: 60
diff changeset
227 ("=>" "Rightarrow" "=>")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
228 ("==>" "Longrightarrow" "==>")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
229 ("<->" "leftrightarrow" ("<->" "←→"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
230 ("<-->" "longleftrightarrow" ("<---->" "←--→"))
47
d7e7b4654058 Support special popup frame.
yuuji
parents: 37
diff changeset
231 ("<=>" "Leftrightarrow" "<=>")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
232 ("<==>" "Longleftrightarrow" "<==>")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
233 ("^|" "uparrow" ("^\n|" "↑"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
234 ("\C-p" "uparrow" ("^\n|" "↑"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
235 ("^||" "Uparrow" "/\\\n||")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
236 ("\C-n" "downarrow" ("|\nv" "↓"))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
237 ("v|" "downarrow" ("|\nv" "↓"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
238 ("v||" "Downarrow" "||\n\\/")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
239 ("\C-p\C-f" "nearrow" YaTeX-image-nearrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
240 ("\C-f\C-p" "nearrow" YaTeX-image-nearrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
241 ("ne" "nearrow" YaTeX-image-nearrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
242 ("\C-p\C-b" "nwarrow" YaTeX-image-nwarrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
243 ("\C-b\C-p" "nwarrow" YaTeX-image-nwarrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
244 ("nw" "nwarrow" YaTeX-image-nwarrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
245 ("\C-n\C-f" "searrow" YaTeX-image-searrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
246 ("\C-f\C-n" "searrow" YaTeX-image-searrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
247 ("se" "searrow" YaTeX-image-searrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
248 ("\C-n\C-b" "swarrow" YaTeX-image-swarrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
249 ("\C-b\C-n" "swarrow" YaTeX-image-swarrow)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
250 ("sw" "swarrow" YaTeX-image-swarrow)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
251 ("|->" "mapsto" ("|->" "|→"))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
252 ("<-)" "hookleftarrow" (" ,\n<--+" " ヽ\n<--/"))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
253 ("(->" "hookrightarrow" ("`\n+-->" "/\n\-->"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
254 ("/-" "leftharpoonup" "/\n~~~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
255 ("\\-" "leftharpoondown" "__\n\\")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
256 ("-/" "rightharpoondown" "__\n/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
257 ("-\\" "rightharpoonup" "~~\n\\")
53
5f4b18da14b3 Fix functions relating YaTeX-beginning-of-environment or
yuuji
parents: 52
diff changeset
258 ;;left and right
5f4b18da14b3 Fix functions relating YaTeX-beginning-of-environment or
yuuji
parents: 52
diff changeset
259 ("left" "left" "(leftmark)")
5f4b18da14b3 Fix functions relating YaTeX-beginning-of-environment or
yuuji
parents: 52
diff changeset
260 ("right" "right" "(rightmark)")
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
261 ;;accent marks
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
262 ("tilde" "tilde" "~\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
263 ("T" "tilde" "~\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
264 ("wtilde" "widetilde" "~\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
265 ("hat" "hat" "^\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
266 ("what" "widehat" "/\\\n??")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
267 ("w^" "widehat" "/\\\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
268 ("check" "check" "v\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
269 ("bar" "bar" "_\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
270 ("overline" "overline" "_\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
271 ("wbar" "overline" "--\n??")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
272 ("dot" "dot" ".\n?")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
273 ("ddot" "ddot" "..\n??")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
274 ("vec" "vec" ("->\n??" "→\n??"))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
275 ("~>" "overrightarrow" ("-->\nAB" "→\nAB"))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
276 ("VEC" "overrightarrow" ("-->\nAB" "→\nAB"))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
277 ;;rage-aware stuffs
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
278 ("prod" "prod" ("-+--+-\n | |" "Π"))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
279 ("CUP" "bigcup" "|~~|\n| |\n| |")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
280 ("union" "bigcup" "|~~|\n| |\n| |")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
281 ("CAP" "bigcap" "| |\n| |\n|__|")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
282 ("isc" "bigcap" "| |\n| |\n|__|")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
283 ("O+" "bigoplus" "/~~~\\\n| + |\n\\___/")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
284 ("Ox" "bigotimes" "/~~~\\\n| X |\n\\___/")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
285 ;;other marks
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
286 ("angle" "angle" ("/\n~" "∠"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
287 ("/_" "angle" ("/\n~" "∠"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
288 ("Z" "aleph" "|\\|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
289 ("|\\|" "aleph" "|\\|")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
290 ("h-" "hbar" "_\nh")
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
291 ; ("i" "imath" "i") ;These chars are appeared only
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
292 ; ("j" "jmath" "j") ;as section-type arguments
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
293 ("l" "ell" "l")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
294 ("wp" "wp" "???")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
295 ("R" "Re" ")R")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
296 ("Im" "Im" "???")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
297 ("mho" "mho" "~|_|~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
298 ("'" "prime" "'")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
299 ("0" "emptyset" "0")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
300 ("nabla" "nabla" ("___\n\\\\/" YaTeX-image-nabla))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
301 ("\\/" "surd" "-\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
302 ("surd" "surd" "-\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
303 ("top" "top" "T")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
304 ("bot" "bot" ("_|_" YaTeX-image-bot))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
305 ("b" "flat" ("b" YaTeX-image-flat))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
306 ("LT" "natural" "|\nLT\n |")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
307 ("6" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
308 ("partial" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
309 ("round" "partial" (" -+\n+-+\n+-+" YaTeX-image-partial))
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
310 ("[]" "Box" "[]")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
311 ("no" "notag" "\\notag")
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
312 (":" "colon" ":")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
313 ("Diamond" "Diamond" "/\\\n\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
314 ("3" "triangle" "/\\\n~~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
315 ("C" "clubsuit" " o\no+o\n |")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
316 ("D" "diamondsuit" "/\\\n\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
317 ("H" "heartsuit" "<^^>\n \\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
318 ("S" "spadesuit" " /\\\n<++>\n /\\")
229
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
319 ("mi" "mathit" "\\mathit{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
320 ("mr" "mathrm" "\\mathrm{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
321 ("mb" "mathbf" "\\mathbf{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
322 ("mt" "mathtt" "\\mathtt{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
323 ("ms" "mathsf" "\\mathsf{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
324 ("mc" "mathcal" "\\mathcal{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
325 ("mn" "mathnormal" "\\mathnormal{}")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
326 )
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
327 "Default LaTeX-math-command alist.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
328
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
329 (defvar YaTeX-math-sign-alist-private nil
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
330 "*User definable key vs LaTeX-math-command alist.")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
331
390df0e505da Label completion works.
yuuji
parents:
diff changeset
332 (defvar YaTeX-math-quit-with-strict-match nil
390df0e505da Label completion works.
yuuji
parents:
diff changeset
333 "*T for quitting completion as soon as strict-match is found.")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
334 (defvar YaTeX-math-sign-alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
335 (append YaTeX-math-sign-alist-private YaTeX-math-sign-alist-default))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
336
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
337 ;;(defun YaTeX-math-alist2array (alist array)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
338 ;; (set array
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
339 ;; (let ((array (make-vector (length alist) "")) (list alist) (i 0))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
340 ;; (while list
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
341 ;; (aset array i (car (car list)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
342 ;; (setq i (1+ i) list (cdr list)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
343 ;; array))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
344 ;;)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
345
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
346 (defvar YaTeX-greek-key-alist-default
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
347 '(
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
348 ("a" "alpha" ("a" "α"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
349 ("b" "beta" ("|>\n|>\n|" "β"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
350 ("g" "gamma" ("~r" "γ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
351 ("G" "Gamma" ("|~" "Γ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
352 ("d" "delta" ("<~\n<>" "δ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
353 ("D" "Delta" ("/\\\n~~" "Δ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
354 ("e" "epsilon" "<\n<~")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
355 ("e-" "varepsilon" ("(\n(~" "ε"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
356 ("z" "zeta" ("(~\n >" "ζ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
357 ("et" "eta" ("n\n/" "η"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
358 ("th" "theta" ("8" "θ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
359 ("Th" "Theta" ("(8)" "Θ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
360 ("th-" "vartheta" ("-8" "-θ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
361 ("i" "iota" ("i\n\\_/" "ι"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
362 ("k" "kappa" ("k" "κ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
363 ("l" "lambda" ("\\n/\\" "λ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
364 ("L" "Lambda" ("/\\" "Λ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
365 ("m" "mu" (" u_\n/" "μ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
366 ("n" "nu" ("|/" "ν"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
367 ("x" "xi" ("E\n >" "ξ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
368 ("X" "Xi" ("---\n -\n---" "Ξ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
369 ("p" "pi" ("__\n)(" "π"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
370 ("P" "Pi" ("__\n||" "Π"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
371 ("p-" "varpi" ("_\nw" "__\nω"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
372 ("r" "rho" ("/O" "ρ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
373 ("r-" "varrho" ("/O\n~~" "ρ\n~~"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
374 ("s" "sigma" ("o~" "σ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
375 ("S" "Sigma" ("\\-+\n >\n/-+" "Σ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
376 ("s-" "varsigma" "(~~ \n>")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
377 ("t" "tau" ("__\n(" "τ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
378 ("u" "upsilon" ("~v" "υ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
379 ("y" "upsilon" ("~v" "υ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
380 ("U" "Upsilon" ("~Y~" "Υ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
381 ("Y" "Upsilon" ("~Y~" "Υ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
382 ("ph" "phi" (" /\n(/)\n/" "φ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
383 ("Ph" "Phi" (" _\n(|)\n ~" "Φ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
384 ("ph-" "varphi" "\\O\n|")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
385 ("c" "chi" ("x" "χ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
386 ("ps" "psi" ("\\|/\\n |" "ψ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
387 ("Ps" "Psi" (" ~\n\\|/\\n |" "Ψ"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
388 ("o" "omega" ("w" "ω"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
389 ("w" "omega" ("w" "ω"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
390 ("O" "Omega" ("(~)\n~ ~" "Ω"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
391 ("W" "Omega" ("(~)\n~ ~" "Ω"))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
392 ("f" "foo")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
393 )
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
394 "Default LaTeX-math-command alist.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
395
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
396 (defvar YaTeX-greek-key-alist-private nil
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
397 "*User definable key vs LaTeX-math-command alist.")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
398
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
399 (defvar YaTeX-greek-key-alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
400 (append YaTeX-greek-key-alist-private YaTeX-greek-key-alist-default))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
401
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
402 ;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
403 ;; YaTeX-math-key-list)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
404
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
405 (defvar YaTeX-math-indicator "KEY\tLaTeX sequence\t\tsign")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
406
390df0e505da Label completion works.
yuuji
parents:
diff changeset
407 (defvar YaTeX-math-need-image t
390df0e505da Label completion works.
yuuji
parents:
diff changeset
408 "*T for displaying pseudo image momentarily.")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
409 (defvar YaTeX-math-max-key 8)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
410 (defvar YaTeX-math-max-seq
390df0e505da Label completion works.
yuuji
parents:
diff changeset
411 (* 8 (1+ (/ (length "\\longleftrightarrow") 8))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
412 (defvar YaTeX-math-max-sign 5)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
413 (defvar YaTeX-math-sign-width
390df0e505da Label completion works.
yuuji
parents:
diff changeset
414 (+ YaTeX-math-max-key YaTeX-math-max-seq YaTeX-math-max-sign))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
415 (defvar YaTeX-math-display-width
390df0e505da Label completion works.
yuuji
parents:
diff changeset
416 (* 8 (1+ (/ YaTeX-math-sign-width 8))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
417 (defvar YaTeX-math-menu-map nil
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
418 "Keymap used in YaTeX mathematical sign menu mode.")
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
419
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
420 (if YaTeX-math-menu-map nil
390df0e505da Label completion works.
yuuji
parents:
diff changeset
421 (setq YaTeX-math-menu-map (make-sparse-keymap))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
422 (define-key YaTeX-math-menu-map "n" 'next-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
423 (define-key YaTeX-math-menu-map "p" 'previous-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
424 (define-key YaTeX-math-menu-map "f" 'YaTeX-math-forward)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
425 (define-key YaTeX-math-menu-map "b" 'YaTeX-math-backward)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
426 (define-key YaTeX-math-menu-map "v" 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
427 (define-key YaTeX-math-menu-map " " 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
428 (define-key YaTeX-math-menu-map "c" 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
429 (define-key YaTeX-math-menu-map "V" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
430 (define-key YaTeX-math-menu-map "r" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
431 (define-key YaTeX-math-menu-map "\^h" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
432 (define-key YaTeX-math-menu-map "<" 'beginning-of-buffer)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
433 (define-key YaTeX-math-menu-map ">" 'end-of-buffer)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
434 (define-key YaTeX-math-menu-map "\^m" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
435 (define-key YaTeX-math-menu-map "q" 'abort-recursive-edit))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
436
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
437 (defvar YaTeX-math-exit-key "\e"
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
438 "*Key sequence after prefix key of YaTeX-math-mode to exit from math-mode.")
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
439
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
440 (defmacro YaTeX-math-japanese-sign (list)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
441 (list 'nth 1 list))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
442
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
443 (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z|]"))
177
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
444
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
445 ;;; alltt goes into YaTeX-verbatim-environments 2011/3/16
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
446 ;;(defvar YaTeX-math-verbatim-environments
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
447 ;; '("alltt")
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
448 ;; "*List of environments in which LaTeX math mode is disabled.
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
449 ;;This value is appended with YaTeX-verbatim-environments.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
450
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
451 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
452 ;;YaTeX math-mode functions
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
453 ;;;
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
454 ;;;###autoload from yatex.el
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
455 (defun YaTeX-toggle-math-mode (&optional arg)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
456 (interactive "P")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
457 (or (memq 'YaTeX-math-mode mode-line-format) nil
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
458 (setq mode-line-format
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
459 (append (list "" 'YaTeX-math-mode) mode-line-format)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
460 (if YaTeX-auto-math-mode nil ;Only effective on manual mode.
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
461 (if (or arg (null YaTeX-math-mode))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
462 (let (keys)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
463 (setq YaTeX-math-mode "math:")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
464 (message "Turn on math mode. Prefix keys are %s"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
465 (mapconcat 'car YaTeX-math-key-list " "))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
466 (sit-for 3)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
467 (message
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
468 (concat "To exit from math-mode, type `ESC' after prefix, "
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
469 "or type `"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
470 (key-description
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
471 (car
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
472 (where-is-internal
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
473 'YaTeX-switch-mode-menu YaTeX-mode-map)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
474 " $'")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
475 (setq YaTeX-math-mode nil)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
476 (message "Exit from math mode."))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
477 (set-buffer-modified-p (buffer-modified-p))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
478
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
479 (defun YaTeX-math-forward (arg)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
480 (interactive "p")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
481 (re-search-forward YaTeX-math-cmd-regexp nil t arg))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
482
390df0e505da Label completion works.
yuuji
parents:
diff changeset
483 (defun YaTeX-math-backward (arg)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
484 (interactive "p")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
485 (re-search-backward YaTeX-math-cmd-regexp nil t arg))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
486
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
487 (defun YaTeX-math-gets (sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
488 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
489 ((null sign) nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
490 ((listp sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
491 (setq sign
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
492 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
493 (YaTeX-japan (YaTeX-math-japanese-sign sign))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
494 (t (car sign))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
495 (YaTeX-math-gets sign))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
496 ((symbolp sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
497 (YaTeX-math-gets (symbol-value sign)))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
498 (t sign)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
499
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
500 (defun YaTeX-math-get-sign (list)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
501 (YaTeX-math-gets (car (cdr-safe (cdr-safe list)))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
502
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
503 (defvar YaTeX-math-section-type-regexp
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
504 "eqn\\\\\\sw+\\b"
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
505 "*Regexp of section-type math-mode macro")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
506
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
507 (defun YaTeX-in-math-mode-p ()
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
508 "If current position is supposed to be in LaTeX-math-mode, return t.
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
509 This function refers a local variable `source-window' in YaTeX-make-section."
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
510 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
511 (and (boundp 'source-window) source-window
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
512 (set-buffer (window-buffer source-window)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
513 (or (YaTeX-quick-in-environment-p
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
514 (append
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
515 '("math" "eqnarray" "equation" "eqnarray*" "displaymath") ;LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
516 (if YaTeX-use-AMS-LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
517 ;; And math modes of AMS-LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
518 ;;'("align" "align*" "split" "multline" "multline*" "gather"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
519 ;; "gather*" "aligned*" "gathered" "gathered*" "alignat"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
520 ;; "equation*" "cases" "flalign" "flalign*"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
521 ;; "alignat*" "xalignat" "xalignat*" "xxalignat" "xxalignat*"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
522 YaTeX-math-begin-list
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
523 )))
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
524 (let*((p (point)) (nest 0) me0 r firstp dollar
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
525 (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
526 (boundary
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
527 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
528 (if (looking-at delim)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
529 (goto-char (max (point-min) (1- (point)))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
530 (re-search-backward delim nil 1)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
531 (point))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
532 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
533 (cond
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
534 ((catch 'open
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
535 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
536 (while (and (>= nest 0)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
537 (re-search-backward
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
538 (concat YaTeX-ec-regexp ;\
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
539 "\\([()]\\|[][]\\)") boundary t))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
540 (setq me0 (match-end 0))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
541 (if (or (YaTeX-on-comment-p)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
542 (YaTeX-literal-p)) nil
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
543 (if (or (= (char-after (1- me0)) ?\))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
544 (= (char-after (1- me0)) ?\]))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
545 (setq nest (1+ nest))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
546 (if (= (preceding-char) ?\\ ) nil ;;\\[5pt]
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
547 (setq nest (1- nest))))))
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
548 (if (< nest 0)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
549 (throw 'open (cons (YaTeX-match-string 0) (point)))))))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
550 ((and (setq r (YaTeX-on-section-command-p
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
551 YaTeX-math-section-type-regexp))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
552 (numberp r)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
553 (> r 0))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
554 t)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
555 (t (catch 'dollar
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
556 (while ;(search-backward "$" boundary t);little bit fast.
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
557 (YaTeX-re-search-active-backward ;;;;;; Too slow???
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
558 "\\$" (concat "[^\\\\]" YaTeX-comment-prefix) boundary t)
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
559 (setq dollar "$")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
560 (cond
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
561 ((equal (char-after (1- (point))) ?$) ; $$ equation $$
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
562 (setq dollar "$$")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
563 (backward-char 1)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
564 (setq nest (1+ nest)))
177
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
565 ((YaTeX-literal-p)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
566 nil)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
567 ((and (equal (char-after (1- (point))) ?\\ )
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
568 (not (equal (char-after (- (point) 3)) ?\\ )))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
569 nil) ;\$
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
570 (t (setq nest (1+ nest))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
571 (if (and (= nest 1) (null firstp))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
572 (setq firstp (cons dollar (point)))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
573 (if (= (% nest 2) 1)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
574 (throw 'dollar firstp))))))))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
575
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
576 (defun YaTeX-mark-mathenv ()
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
577 "Mark current mathematic environment."
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
578 (interactive)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
579 (let ((mmp (YaTeX-in-math-mode-p)) type bpt)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
580 (if (or (null mmp) (not (stringp (setq type (car mmp)))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
581 nil ;if nil or not string, do nothing
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
582 (setq bpt (cdr mmp))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
583 (goto-char bpt)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
584 (cond
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
585 ((string-match "\\$" type)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
586 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
587 (skip-chars-forward "$")
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
588 (YaTeX-search-active-forward
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
589 type YaTeX-comment-prefix nil) ;if it cause error, obey it
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
590 (goto-char (match-end 0)))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
591 ;;
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
592 ((string-match "^\\\\[\\[(]" type)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
593 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
594 (YaTeX-goto-corresponding-leftright)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
595 (skip-chars-forward "])\\\\"))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
596 ;;
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
597 ((string-match "^[a-z]" type) ; \begin\end type math
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
598 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
599 (YaTeX-goto-corresponding-environment)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
600 (goto-char (match-end 0)))))))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
601
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
602 (defun YaTeX-math-display-list (list cols)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
603 (goto-char (point-max))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
604 (if (= cols 0) (if (not (eolp)) (newline 1))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
605 (forward-line -1)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
606 (while (looking-at "[ \t\n]") (forward-line -1)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
607 (end-of-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
608 (let ((indent (* YaTeX-math-display-width cols)) sign str to)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
609 (indent-to indent)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
610 (insert (car list))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
611 (indent-to (setq indent (+ indent YaTeX-math-max-key)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
612 (insert "\\" (car (cdr list)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
613 (setq indent (+ indent YaTeX-math-max-seq))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
614 (setq sign (YaTeX-math-get-sign list))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
615 (while (and sign (not (string= "" sign)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
616 (setq to (string-match "\n" sign)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
617 str (if to (substring sign 0 to) sign))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
618 (end-of-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
619 (indent-to indent)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
620 (insert str)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
621 (cond ((eobp) (newline 1))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
622 ((> cols 0) (forward-line 1)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
623 (setq sign (if to (substring sign (1+ to)) "")))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
624
390df0e505da Label completion works.
yuuji
parents:
diff changeset
625 (defvar YaTeX-math-menu-buffer "*math-mode-signs*")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
626
390df0e505da Label completion works.
yuuji
parents:
diff changeset
627 (defun YaTeX-math-show-menu (match-str)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
628 (save-window-excursion
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
629 (YaTeX-showup-buffer YaTeX-math-menu-buffer nil t)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
630 (let ((maxcols (max 1 (/ (YaTeX-screen-width) YaTeX-math-sign-width)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
631 (case-fold-search nil)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
632 (cols 0) (list alist) command)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
633 (erase-buffer)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
634 (insert
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
635 "Candidates of sign. [n:next p:prev f:forw b:back q:quit RET:select]\n")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
636 (insert YaTeX-math-indicator "\t")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
637 (insert YaTeX-math-indicator)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
638 (newline 1)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
639 (insert-char ?- (1- (YaTeX-screen-width)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
640 (newline 1)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
641 (while list
390df0e505da Label completion works.
yuuji
parents:
diff changeset
642 (if (string-match match-str (car (car list)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
643 (progn (YaTeX-math-display-list (car list) cols)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
644 (setq cols (% (1+ cols) maxcols))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
645 (setq list (cdr list)))
178
2f9069006bdb avoid using goto-line
yuuji@gentei.org
parents: 177
diff changeset
646 (goto-char (point-min)) (forward-line 3)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
647 (use-local-map YaTeX-math-menu-map)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
648 (setq buffer-read-only t)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
649 (unwind-protect
390df0e505da Label completion works.
yuuji
parents:
diff changeset
650 (recursive-edit)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
651 (skip-chars-backward "^ \t\n")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
652 (setq command
390df0e505da Label completion works.
yuuji
parents:
diff changeset
653 (if (re-search-forward YaTeX-math-cmd-regexp nil t)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
654 (buffer-substring
390df0e505da Label completion works.
yuuji
parents:
diff changeset
655 (match-beginning 0)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
656 (prog2 (skip-chars-forward "^ \t\n") (point)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
657 nil))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
658 (kill-buffer YaTeX-math-menu-buffer))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
659 command)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
660
390df0e505da Label completion works.
yuuji
parents:
diff changeset
661 ;
390df0e505da Label completion works.
yuuji
parents:
diff changeset
662 (defun YaTeX-math-show-image (image &optional exit-char)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
663 "Momentarily display IMAGE at the beginning of the next line;
390df0e505da Label completion works.
yuuji
parents:
diff changeset
664 erase it on the next keystroke. The window is recentered if necessary
390df0e505da Label completion works.
yuuji
parents:
diff changeset
665 to make the whole string visible. If the window isn't large enough,
390df0e505da Label completion works.
yuuji
parents:
diff changeset
666 at least you get to read the beginning."
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
667 (if (and image (not (string= image "")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
668 (let ((buffer-read-only nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
669 (modified (buffer-modified-p))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
670 (name buffer-file-name)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
671 insert-start
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
672 insert-end)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
673 (unwind-protect
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
674 (progn
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
675 (save-excursion
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
676 ;; defeat file locking... don't try this at home, kids!
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
677 (setq buffer-file-name nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
678 (forward-line 1)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
679 (setq insert-start (point))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
680 (if (eobp) (newline))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
681 (insert image)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
682 (setq insert-end (point)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
683 ; make sure the whole string is visible
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
684 (if (not (pos-visible-in-window-p insert-end))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
685 (recenter (max 0
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
686 (- (window-height)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
687 (count-lines insert-start insert-end)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
688 2))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
689 (let ((char (read-char)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
690 (or (eq char exit-char)
292
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
691 (if (boundp 'unread-command-events)
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
692 (setq unread-command-events (list char))
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
693 (setq unread-command-char char)))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
694 (if insert-end
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
695 (save-excursion
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
696 (delete-region insert-start insert-end)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
697 (setq buffer-file-name name)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
698 (set-buffer-modified-p modified)))))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
699
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
700 (defun YaTeX-math-insert-sequence (&optional force initial)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
701 "Insert math-mode sequence with image completion."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
702 (interactive "P")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
703 (let*((key (or initial "")) regkey str last-char list i
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
704 (case-fold-search nil) match sign
290
1a4332ecc58b For emacs-24.3+ and NEmacs(last-command-{char,event} handling)
HIROSE Yuuji <yuuji@gentei.org>
parents: 287
diff changeset
705 (this-key (char-to-string (YaTeX-last-key)))
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
706 (alistsym (cdr (assoc this-key YaTeX-math-key-list)))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
707 (alistname (symbol-name alistsym))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
708 (alist (symbol-value alistsym))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
709 (n (length alist)) (beg (point)) result)
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
710 (if initial (insert YaTeX-ec (car (cdr (assoc initial alist)))))
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
711 (if (string-match "^YaTeX-" alistname)
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
712 (setq alistname (substring alistname (length "YaTeX-"))))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
713 (setq alistname (substring alistname 0 (string-match "-" alistname)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
714 (setq result
390df0e505da Label completion works.
yuuji
parents:
diff changeset
715 (catch 'complete
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
716 (if (and (not force)
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
717 (if YaTeX-auto-math-mode
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
718 (not (YaTeX-in-math-mode-p))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
719 (not YaTeX-math-mode)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
720 (throw 'complete 'escape));this tag should be exit, but...
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
721 (while t
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
722 (message "%ssequence%s: %s"
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
723 (if YaTeX-simple-messages "" (concat alistname " "))
56
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
724 (if YaTeX-simple-messages "" "(TAB for menu)") key)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
725 (setq last-char (read-char)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
726 key (concat key (char-to-string last-char))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
727 i 0)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
728 (cond
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
729 ((string= key this-key) ;;invoke key itself
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
730 (throw 'complete 'escape))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
731 ((string= key YaTeX-math-exit-key) ;;exit from math-mode
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
732 (throw 'complete 'exit))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
733 ((string-match "\r" key) ;;RET = kakutei
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
734 (throw 'complete 'select))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
735 ((string-match "[\C-g\C-c]" key) ;;C-g = abort
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
736 (throw 'complete 'abort))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
737 ((string-match "[\t\n]" key) ;;TAB, LFD = menu
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
738 (throw 'complete 'menu))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
739 ((string-match "[\C-h\C-?]" key) ;;BS, DEL = BS
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
740 (if (< (length key) 2) (throw 'complete 'abort))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
741 (setq key (substring key 0 -2))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
742
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
743 (setq regkey (concat "^" (regexp-quote key)))
56
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
744 (message "Sequence%s: %s"
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
745 (if YaTeX-simple-messages "" "(TAB for menu)") key)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
746 (if
390df0e505da Label completion works.
yuuji
parents:
diff changeset
747 (catch 'found
390df0e505da Label completion works.
yuuji
parents:
diff changeset
748 ;;(1)input string strictly matches with alist
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
749 (setq match (assoc key alist))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
750 ;;remember previous match
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
751
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
752 ;;(2)search partial match into alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
753 (setq list alist)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
754 (while (< i n)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
755 (if (string-match
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
756 regkey
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
757 ;;(aref array i)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
758 ;;(car (nth i alist))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
759 (car (car list)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
760 (progn
390df0e505da Label completion works.
yuuji
parents:
diff changeset
761 (or match
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
762 ;;(setq match (nth i alist))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
763 (setq match (car list)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
764 (throw 'found t)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
765 (setq i (1+ i) list (cdr list)))) ;catch 'found
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
766 nil ;;if any match, continue reading
390df0e505da Label completion works.
yuuji
parents:
diff changeset
767 ;;else reading of sequence has been done.
390df0e505da Label completion works.
yuuji
parents:
diff changeset
768 (message "complete.")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
769 (throw 'complete t))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
770
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
771 (if match
390df0e505da Label completion works.
yuuji
parents:
diff changeset
772 (progn (delete-region beg (point))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
773 (setq YaTeX-single-command (car (cdr match)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
774 (insert YaTeX-ec YaTeX-single-command)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
775 (if (and YaTeX-math-need-image
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
776 (setq sign (YaTeX-math-get-sign match)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
777 (YaTeX-math-show-image (concat sign "\n")))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
778 )
390df0e505da Label completion works.
yuuji
parents:
diff changeset
779 nil)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
780 )))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
781 (delete-region beg (point))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
782 (cond
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
783 ((memq result '(t select))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
784 (if (eq result t)
292
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
785 (if (boundp 'unread-command-events)
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
786 (setq unread-command-events (list last-char))
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
787 (setq unread-command-char last-char))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
788 (message "Done."))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
789 (if (assoc YaTeX-single-command section-table)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
790 (YaTeX-make-section nil nil nil YaTeX-single-command)
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
791 (setq YaTeX-current-completion-type 'maketitle)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
792 (YaTeX-make-singlecmd YaTeX-single-command)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
793 ((eq result 'abort)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
794 (message "Abort."))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
795 ((eq result 'escape)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
796 (call-interactively (lookup-key global-map this-key)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
797 ((eq result 'exit)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
798 (YaTeX-toggle-math-mode))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
799 ((eq result 'menu)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
800 (setq key (concat "^" (regexp-quote (substring key 0 -1))))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
801 (insert (YaTeX-math-show-menu key))))))
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
802
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
803 ;; ----- Change image completion types -----
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
804 (defun YaTeX-math-member-p (item)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
805 "Check if ITEM is a member of image completion.
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
806 If so return the cons of its invocation key and image-string."
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
807 (let ((lists YaTeX-math-key-list) list)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
808 (catch 'found
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
809 (while lists
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
810 (setq list (symbol-value (cdr (car lists))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
811 (while list
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
812 (if (string= item (nth 1 (car list)))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
813 (throw 'found (cons (car (car lists)) (nth 0 (car list)))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
814 (setq list (cdr list)))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
815 (setq lists (cdr lists))))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
816
193
e216f9f347fa Camouflage email addresses.
yuuji@gentei.org
parents: 182
diff changeset
817 ;;; ----- for AMS LaTeX (by matsu<at>math.s.chiba-u.ac.jp) -----
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
818 (defvar YaTeX-ams-paren-modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
819 '(("Biggl" . "Biggr") ("biggl" . "biggr")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
820 ("Bigl" . "Bigr") ("bigl" . "bigr")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
821 ("left" . "right") ("" . ""))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
822 "Alist of modifier of parentheses.")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
823
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
824 (defvar YaTeX-left-paren "(\\|\\[\\|\\\\{")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
825 (defvar YaTeX-right-paren ")\\|\\]\\|\\\\}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
826 (defvar YaTeX-paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
827 (concat YaTeX-left-paren "\\|" YaTeX-right-paren))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
828
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
829 (defun YaTeX-on-parenthesis-p ()
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
830 "If cursor is on an (AMS-LaTeX) parenthesis, return the parenthesis."
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
831 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
832 (let* ((list YaTeX-ams-paren-modifier)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
833 (longest 0) ;; the longest length of parenthesis command strings
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
834 (flag t) ;; flag for whether on braces not following \
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
835 (point (point))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
836 (move 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
837 (paren))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
838 (while list
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
839 (setq longest
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
840 (max longest (length (car (car list))) (length (cdr (car list)))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
841 (setq list (cdr list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
842 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
843 ;; search {} and, if it does not follow `\', set flag nil.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
844 ;; if it is right after `\', set flag t and move to the position of \.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
845 ;; mmmmm.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
846 (if (looking-at "{\\|}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
847 (if (not (equal (char-after (1- (point))) 92))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
848 (setq flag nil)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
849 (forward-char -1)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
850 ;; if flag is nil, do nothing.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
851 (if (and flag (re-search-forward YaTeX-paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
852 (+ (point) 3 longest) t))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
853 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
854 (setq move (- (point) point))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
855 (setq paren (YaTeX-match-string 0))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
856 (setq list YaTeX-ams-paren-modifier)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
857 ;; criterion for whether on [] () \{\} or not.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
858 (if (string-match YaTeX-left-paren paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
859 (while (and list flag)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
860 (let* ((mod (car (car list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
861 (mod-length 0) ;; length of modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
862 paren-regexp ;; regexp of paren.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
863 mod-regexp) ;; regexp of modifier.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
864 (if (> (length mod) 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
865 (setq mod-regexp (concat "\\\\" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
866 mod-length (1+ (length mod))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
867 (cond ((string= paren "\\{")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
868 (setq paren-regexp (concat "\\" paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
869 ((string= paren "[")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
870 (setq paren-regexp "\\["))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
871 (t (setq paren-regexp paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
872 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
873 (if (and (>= (- (point) (point-min))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
874 (+ mod-length (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
875 (not (forward-char
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
876 (- 0 mod-length (length paren))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
877 (looking-at (concat "\\(" mod-regexp "\\)\\("
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
878 paren-regexp "\\)")))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
879 (setq flag nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
880 (setq list (cdr list))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
881 (while (and list flag)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
882 (let* ((mod (cdr (car list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
883 (mod-length 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
884 paren-regexp
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
885 mod-regexp)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
886 (if (> (length mod) 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
887 (setq mod-regexp (concat "\\\\" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
888 mod-length (1+ (length mod))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
889 (cond ((string= paren "\\}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
890 (setq paren-regexp (concat "\\" paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
891 ((string= paren "]")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
892 (setq paren-regexp "\\]"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
893 (t (setq paren-regexp paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
894 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
895 (if (and (>= (- (point) (point-min))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
896 (+ mod-length (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
897 (not (forward-char
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
898 (- 0 mod-length (length paren))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
899 (looking-at (concat "\\(" mod-regexp "\\)\\("
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
900 paren-regexp "\\)")))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
901 (setq flag nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
902 (setq list (cdr list)))))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
903 (if (<= move (length (YaTeX-match-string 0)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
904 (YaTeX-match-string 0)))))))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
905
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
906 (defun YaTeX-goto-open-paren (&optional jumpto-co)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
907 "Jump to the exact position of open parenthesis.
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
908 If optional argument JUMPTO-CO is non-nil, goto corresponding parentheses."
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
909 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
910 (let ((paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
911 (backslash-syntax (char-to-string (char-syntax ?\\))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
912 (if (setq paren (YaTeX-on-parenthesis-p))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
913 (if (string-match "(\\|{\\|\\[" paren (1- (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
914 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
915 (re-search-forward "(\\|{\\|\\[" (+ (point) (length paren)) t)
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
916 (backward-char)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
917 (if jumpto-co
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
918 (unwind-protect
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
919 (progn
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
920 (modify-syntax-entry ?\\ " ")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
921 (forward-list)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
922 (backward-char))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
923 (modify-syntax-entry ?\\ backslash-syntax)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
924 (point))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
925 (re-search-forward ")\\|}\\|\\]" (+ (point) (length paren)) t)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
926 (unwind-protect
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
927 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
928 (modify-syntax-entry ?\\ " ")
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
929 (backward-list)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
930 (point))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
931 (modify-syntax-entry ?\\ backslash-syntax))))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
932
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
933 ;;;###autoload
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
934 (defun YaTeX-goto-corresponding-paren ()
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
935 "Go to corresponding mathematical parentheses."
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
936 (if (YaTeX-on-parenthesis-p)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
937 (YaTeX-goto-open-paren t)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
938 nil))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
939
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
940 (defun YaTeX-change-parentheses ()
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
941 "Change the size of parentheses, braces, and brackets of AMS-LaTeX."
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
942 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
943 (if (not (and YaTeX-use-AMS-LaTeX (YaTeX-on-parenthesis-p)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
944 nil
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
945 (let* ((mod (YaTeX-match-string 1)) ;; modifier
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
946 (paren (if mod (YaTeX-match-string 2) (YaTeX-match-string 0))) ;; paren
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
947 (mod-length (if (or (string= mod "\\left") (string= mod "\\right"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
948 5 ;; 5 in case left or right
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
949 (length mod))) ;; length of modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
950 (paren-length (length paren)) ;; length of paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
951 (length (+ mod-length paren-length)) ;; length of whole string
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
952 (big-p t) ;; flag whether new modifier is "[Bb]ig+" or not.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
953 size ;; left, big, Big etc.
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
954 type ;; parentheses type
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
955 lr ;; "l" or "r".
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
956 char newsize newsize-length
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
957 (backslash-syntax (char-to-string (char-syntax ?\\)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
958 (case-fold-search))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
959 ;; decide lr and size from mod and paren.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
960 (cond ((string-match "\\(\\\\[Bb]ig+\\)[lr]" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
961 (setq size (substring mod 1 (match-end 1))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
962 lr (substring mod (match-end 1) (match-end 0))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
963 ((string-match "\\\\left" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
964 (setq size "left-right" lr "l"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
965 ((string-match "\\\\right" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
966 (setq size "left-right" lr "r"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
967 ((string-match "(\\|\\[\\|\\\\{" paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
968 (setq size "null" lr "l"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
969 ((string-match ")\\|\\]\\|\\\\}" paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
970 (setq size "null" lr "r"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
971 (t
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
972 (setq size nil lr nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
973 (while (not newsize)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
974 (message (format (concat "Change from %s: "
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
975 "l(big) L(Big) h(bigg) H(Bigg) "
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
976 "r(left-right) n(NONE) ( { [") size))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
977 (setq char (read-char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
978 newsize (cond ((char-equal char ?l) "\\big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
979 ((char-equal char ?L) "\\Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
980 ((char-equal char ?h) "\\bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
981 ((char-equal char ?H) "\\Bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
982 ((char-equal char ?r)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
983 (setq big-p nil) "\\left")
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
984 ((memq char '(?\( ?\)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
985 (setq big-p nil type '("(" . ")")) "")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
986 ((memq char '(?\{ ?\}))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
987 (setq big-p nil type '("\\{" . "\\}")) "")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
988 ((memq char '(?\[ ?\]))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
989 (setq big-p nil type '("[" . "]")) "")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
990 ((char-equal char ?n)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
991 (setq big-p nil) "")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
992 (t nil))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
993 newsize-length (length newsize)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
994 (YaTeX-goto-open-paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
995 (forward-char)
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
996 (cond
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
997 (type
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
998 (delete-region (point) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
999 (save-excursion (insert (car type))))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1000 (t
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1001 (delete-region (- (point) length) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1002 (backward-char paren-length)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1003 (insert-string newsize)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1004 (if big-p (insert ?l))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1005 (unwind-protect
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1006 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1007 (modify-syntax-entry ?\\ " ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1008 (forward-list)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1009 (if (string= size "left-right") (setq length (1+ length)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1010 (if (eq char ?r) (setq newsize "\\right"))
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1011 (cond
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1012 (type
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1013 (delete-region (point) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1014 (insert (cdr type)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1015 (t
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1016 (delete-region (- (point) length) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1017 (backward-char paren-length)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1018 (insert-string newsize)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1019 (if big-p (insert ?r))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1020 (forward-char paren-length)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1021 (if (string= lr "l") (backward-list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1022 (modify-syntax-entry ?\\ backslash-syntax))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1023 t)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1024
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1025 (defun YaTeX-insert-amsparens-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1026 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1027 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1028 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1029 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1030 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1031 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1032 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1033 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1034 beg end (concat "\\" st "l(") (concat "\\" st "r)"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1035 (YaTeX-insert-braces-region beg end "(" ")"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1036
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1037 (defun YaTeX-insert-amsbraces-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1038 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1039 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1040 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1041 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1042 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1043 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1044 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1045 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1046 beg end (concat "\\" st "l\\{") (concat "\\" st "r\\}"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1047 (YaTeX-insert-braces-region beg end "\\{" "\\}"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1048
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1049 (defun YaTeX-insert-amsbrackets-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1050 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1051 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1052 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1053 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1054 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1055 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1056 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1057 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1058 beg end (concat "\\" st "l[") (concat "\\" st "r]"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1059 (YaTeX-insert-braces-region beg end "[" "]"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1060
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1061
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
1062 ;;
390df0e505da Label completion works.
yuuji
parents:
diff changeset
1063 (provide 'yatexmth)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1064
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1065 ; Local variables:
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1066 ; fill-prefix: ";;; "
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1067 ; paragraph-start: "^$\\| \\|;;;$"
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1068 ; paragraph-separate: "^$\\| \\|;;;$"
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1069 ; End:

yatex.org