annotate yatexmth.el @ 587:c6a26b422d30 draft

Add-in for wraptable added
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 21 Sep 2022 21:34:29 +0900
parents a2ef47ba407f
children c11261c0960f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
395
5aa8208fbef0 Change header lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 366
diff changeset
1 ;;; yatexmth.el --- YaTeX math-mode-specific functions -*- coding: sjis -*-
287
5921f28ef77c Change the first lines.
HIROSE Yuuji <yuuji@gentei.org>
parents: 229
diff changeset
2 ;;;
558
a2ef47ba407f Why 'insert-string was used??
HIROSE Yuuji <yuuji@gentei.org>
parents: 527
diff changeset
3 ;;; (c)1993-2018 by HIROSE Yuuji [yuuji@yatex.org]
a2ef47ba407f Why 'insert-string was used??
HIROSE Yuuji <yuuji@gentei.org>
parents: 527
diff changeset
4 ;;; Last modified Tue Dec 25 20:02:12 2018 on firestorm
366
HIROSE Yuuji <yuuji@gentei.org>
parents: 364
diff changeset
5 ;;; $Id$
11
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" ":")
305
53709ee88448 Add \because and \therefore to math-image completion.
HIROSE Yuuji <yuuji@gentei.org>
parents: 294
diff changeset
313 (".'." "therefore" (".'." "∴"))
53709ee88448 Add \because and \therefore to math-image completion.
HIROSE Yuuji <yuuji@gentei.org>
parents: 294
diff changeset
314 ("'.'" "because" ("'.'" "∵"))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
315 ("Diamond" "Diamond" "/\\\n\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
316 ("3" "triangle" "/\\\n~~")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
317 ("C" "clubsuit" " o\no+o\n |")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
318 ("D" "diamondsuit" "/\\\n\\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
319 ("H" "heartsuit" "<^^>\n \\/")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
320 ("S" "spadesuit" " /\\\n<++>\n /\\")
229
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
321 ("mi" "mathit" "\\mathit{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
322 ("mr" "mathrm" "\\mathrm{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
323 ("mb" "mathbf" "\\mathbf{}")
456
7bf780961390 Add "mathbb" and so on
HIROSE Yuuji <yuuji@gentei.org>
parents: 450
diff changeset
324 ("mB" "mathbb" "\\mathbb{}")
229
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
325 ("mt" "mathtt" "\\mathtt{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
326 ("ms" "mathsf" "\\mathsf{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
327 ("mc" "mathcal" "\\mathcal{}")
922f031af983 mr, mb, mt, ms mc for `;'
yuuji@gentei.org
parents: 195
diff changeset
328 ("mn" "mathnormal" "\\mathnormal{}")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
329 )
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
330 "Default LaTeX-math-command alist.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
331
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
332 (defvar YaTeX-math-sign-alist-private nil
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
333 "*User definable key vs LaTeX-math-command alist.")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
334
390df0e505da Label completion works.
yuuji
parents:
diff changeset
335 (defvar YaTeX-math-quit-with-strict-match nil
390df0e505da Label completion works.
yuuji
parents:
diff changeset
336 "*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
337 (defvar YaTeX-math-sign-alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
338 (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
339
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
340 ;;(defun YaTeX-math-alist2array (alist array)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
341 ;; (set array
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
342 ;; (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
343 ;; (while list
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
344 ;; (aset array i (car (car list)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
345 ;; (setq i (1+ i) list (cdr list)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
346 ;; array))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
347 ;;)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
348
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
349 (defvar YaTeX-greek-key-alist-default
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
350 (append
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
351 '(("a" "alpha" ("a" "α"))
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
352 ("b" "beta" ("|>\n|>\n|" "β"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
353 ("g" "gamma" ("~r" "γ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
354 ("G" "Gamma" ("|~" "Γ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
355 ("d" "delta" ("<~\n<>" "δ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
356 ("D" "Delta" ("/\\\n~~" "Δ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
357 ("e" "epsilon" "<\n<~")
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
358 ("e-" "varepsilon" ("(\n(~" "_ε"))
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
359 ("z" "zeta" ("(~\n >" "ζ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
360 ("et" "eta" ("n\n/" "η"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
361 ("th" "theta" ("8" "θ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
362 ("Th" "Theta" ("(8)" "Θ"))
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
363 ("th-" "vartheta" ("-8" "_θ"))
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
364 ("i" "iota" ("i\n\\_/" "ι"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
365 ("k" "kappa" ("k" "κ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
366 ("l" "lambda" ("\\n/\\" "λ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
367 ("L" "Lambda" ("/\\" "Λ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
368 ("m" "mu" (" u_\n/" "μ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
369 ("n" "nu" ("|/" "ν"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
370 ("x" "xi" ("E\n >" "ξ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
371 ("X" "Xi" ("---\n -\n---" "Ξ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
372 ("p" "pi" ("__\n)(" "π"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
373 ("P" "Pi" ("__\n||" "Π"))
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
374 ("p-" "varpi" ("__\n/(" "_π"))
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
375 ("r" "rho" ("/O" "ρ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
376 ("r-" "varrho" ("/O\n~~" "ρ\n~~"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
377 ("s" "sigma" ("o~" "σ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
378 ("S" "Sigma" ("\\-+\n >\n/-+" "Σ"))
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
379 ("s-" "varsigma" "/~~ \n /")
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
380 ("t" "tau" ("__\n(" "τ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
381 ("u" "upsilon" ("~v" "υ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
382 ("y" "upsilon" ("~v" "υ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
383 ("U" "Upsilon" ("~Y~" "Υ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
384 ("Y" "Upsilon" ("~Y~" "Υ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
385 ("ph" "phi" (" /\n(/)\n/" "φ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
386 ("Ph" "Phi" (" _\n(|)\n ~" "Φ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
387 ("ph-" "varphi" "\\O\n|")
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
388 ("c" "chi" ("x" "χ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
389 ("ps" "psi" ("\\|/\\n |" "ψ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
390 ("Ps" "Psi" (" ~\n\\|/\\n |" "Ψ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
391 ("o" "omega" ("w" "ω"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
392 ("w" "omega" ("w" "ω"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
393 ("O" "Omega" ("(~)\n~ ~" "Ω"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
394 ("W" "Omega" ("(~)\n~ ~" "Ω"))
461
9db0e1522847 Fixes on greek completion
HIROSE Yuuji <yuuji@gentei.org>
parents: 460
diff changeset
395 ("f" "foo"))
460
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
396 (if YaTeX-use-AMS-LaTeX
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
397 '(
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
398 ("G-" "varGamma" ("/~" "_Γ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
399 ("D-" "varDelta" ("/|\n~~" "_Δ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
400 ("Th-" "varTheta" ("/8/" "_Θ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
401 ("L-" "varLambda" ("/|" "_Λ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
402 ("X-" "varXi" (" --\n -\n-- " "_Ξ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
403 ("S-" "varSigma" (" \\-+\n >\n/-+" "_Σ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
404 ("U-" "varUpsilon" ("~~Y~" "_Υ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
405 ("Ph-" "varPhi" (" _\n(|)\n~" "_Φ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
406 ("Ps-" "varPsi" (" ~\n\\//\\n /" "Ψ"))
1790e0d35156 Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents: 456
diff changeset
407 ("O-" "varOmega" ("/~/\n~ ~" "_Ω")))))
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
408 "Default LaTeX-math-command alist.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
409
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
410 (defvar YaTeX-greek-key-alist-private nil
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
411 "*User definable key vs LaTeX-math-command alist.")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
412
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
413 (defvar YaTeX-greek-key-alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
414 (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
415
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
416 ;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
417 ;; YaTeX-math-key-list)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
418
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
419 (defvar YaTeX-math-indicator "KEY\tLaTeX sequence\t\tsign")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
420
390df0e505da Label completion works.
yuuji
parents:
diff changeset
421 (defvar YaTeX-math-need-image t
390df0e505da Label completion works.
yuuji
parents:
diff changeset
422 "*T for displaying pseudo image momentarily.")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
423 (defvar YaTeX-math-max-key 8)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
424 (defvar YaTeX-math-max-seq
390df0e505da Label completion works.
yuuji
parents:
diff changeset
425 (* 8 (1+ (/ (length "\\longleftrightarrow") 8))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
426 (defvar YaTeX-math-max-sign 5)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
427 (defvar YaTeX-math-sign-width
390df0e505da Label completion works.
yuuji
parents:
diff changeset
428 (+ YaTeX-math-max-key YaTeX-math-max-seq YaTeX-math-max-sign))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
429 (defvar YaTeX-math-display-width
390df0e505da Label completion works.
yuuji
parents:
diff changeset
430 (* 8 (1+ (/ YaTeX-math-sign-width 8))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
431 (defvar YaTeX-math-menu-map nil
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
432 "Keymap used in YaTeX mathematical sign menu mode.")
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
433
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
434 (if YaTeX-math-menu-map nil
390df0e505da Label completion works.
yuuji
parents:
diff changeset
435 (setq YaTeX-math-menu-map (make-sparse-keymap))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
436 (define-key YaTeX-math-menu-map "n" 'next-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
437 (define-key YaTeX-math-menu-map "p" 'previous-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
438 (define-key YaTeX-math-menu-map "f" 'YaTeX-math-forward)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
439 (define-key YaTeX-math-menu-map "b" 'YaTeX-math-backward)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
440 (define-key YaTeX-math-menu-map "v" 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
441 (define-key YaTeX-math-menu-map " " 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
442 (define-key YaTeX-math-menu-map "c" 'scroll-up)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
443 (define-key YaTeX-math-menu-map "V" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
444 (define-key YaTeX-math-menu-map "r" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
445 (define-key YaTeX-math-menu-map "\^h" 'scroll-down)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
446 (define-key YaTeX-math-menu-map "<" 'beginning-of-buffer)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
447 (define-key YaTeX-math-menu-map ">" 'end-of-buffer)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
448 (define-key YaTeX-math-menu-map "\^m" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
449 (define-key YaTeX-math-menu-map "q" 'abort-recursive-edit))
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 (defvar YaTeX-math-exit-key "\e"
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
452 "*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
453
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
454 (defmacro YaTeX-math-japanese-sign (list)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
455 (list 'nth 1 list))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
456
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
457 (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
458
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
459 ;;; alltt goes into YaTeX-verbatim-environments 2011/3/16
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
460 ;;(defvar YaTeX-math-verbatim-environments
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
461 ;; '("alltt")
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
462 ;; "*List of environments in which LaTeX math mode is disabled.
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
463 ;;This value is appended with YaTeX-verbatim-environments.")
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
464
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
465 ;;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
466 ;;YaTeX math-mode functions
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
467 ;;;
417
1ab1b9ba8698 Remove superfluous string in autoload line
HIROSE Yuuji <yuuji@gentei.org>
parents: 401
diff changeset
468 ;;;###autoload
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
469 (defun YaTeX-toggle-math-mode (&optional arg)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
470 (interactive "P")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
471 (or (memq 'YaTeX-math-mode mode-line-format) nil
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
472 (setq mode-line-format
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
473 (append (list "" 'YaTeX-math-mode) mode-line-format)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
474 (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
475 (if (or arg (null YaTeX-math-mode))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
476 (let (keys)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
477 (setq YaTeX-math-mode "math:")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
478 (message "Turn on math mode. Prefix keys are %s"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
479 (mapconcat 'car YaTeX-math-key-list " "))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
480 (sit-for 3)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
481 (message
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
482 (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
483 "or type `"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
484 (key-description
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
485 (car
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
486 (where-is-internal
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
487 'YaTeX-switch-mode-menu YaTeX-mode-map)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
488 " $'")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
489 (setq YaTeX-math-mode nil)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
490 (message "Exit from math mode."))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
491 (set-buffer-modified-p (buffer-modified-p))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
492
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
493 (defun YaTeX-math-forward (arg)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
494 (interactive "p")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
495 (re-search-forward YaTeX-math-cmd-regexp nil t arg))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
496
390df0e505da Label completion works.
yuuji
parents:
diff changeset
497 (defun YaTeX-math-backward (arg)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
498 (interactive "p")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
499 (re-search-backward YaTeX-math-cmd-regexp nil t arg))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
500
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
501 (defun YaTeX-math-gets (sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
502 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
503 ((null sign) nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
504 ((listp sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
505 (setq sign
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
506 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
507 (YaTeX-japan (YaTeX-math-japanese-sign sign))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
508 (t (car sign))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
509 (YaTeX-math-gets sign))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
510 ((symbolp sign)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
511 (YaTeX-math-gets (symbol-value sign)))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
512 (t sign)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
513
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
514 (defun YaTeX-math-get-sign (list)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
515 (YaTeX-math-gets (car (cdr-safe (cdr-safe list)))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
516
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
517 (defvar YaTeX-math-section-type-regexp
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
518 "eqn\\\\\\sw+\\b"
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
519 "*Regexp of section-type math-mode macro")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
520
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
521 (defun YaTeX-in-math-mode-p ()
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
522 "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
523 This function refers a local variable `source-window' in YaTeX-make-section."
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
524 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
525 (and (boundp 'source-window) source-window
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
526 (set-buffer (window-buffer source-window)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
527 (or (YaTeX-quick-in-environment-p
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
528 (append
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
529 '("math" "eqnarray" "equation" "eqnarray*" "displaymath") ;LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
530 (if YaTeX-use-AMS-LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
531 ;; And math modes of AMS-LaTeX
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
532 ;;'("align" "align*" "split" "multline" "multline*" "gather"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
533 ;; "gather*" "aligned*" "gathered" "gathered*" "alignat"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
534 ;; "equation*" "cases" "flalign" "flalign*"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
535 ;; "alignat*" "xalignat" "xalignat*" "xxalignat" "xxalignat*"
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
536 YaTeX-math-begin-list
449
c2c547e147c7 YaTeX-math-other-env-alist-* for additional math-environments
HIROSE Yuuji <yuuji@gentei.org>
parents: 443
diff changeset
537 )
450
8871fe9f563b YaTeX-math-other-env-alist should have list form
HIROSE Yuuji <yuuji@gentei.org>
parents: 449
diff changeset
538 YaTeX-math-other-env-list))
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
539 (let*((p (point)) (nest 0) me0 r firstp dollar
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
540 (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l"))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
541 (boundary
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
542 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
543 (if (looking-at delim)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
544 (goto-char (max (point-min) (1- (point)))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
545 (re-search-backward delim nil 1)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
546 (point))))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
547 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
548 (cond
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
549 ((catch 'open
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
550 (save-excursion
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
551 (while (and (>= nest 0)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
552 (re-search-backward
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
553 (concat YaTeX-ec-regexp ;\
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
554 "\\([()]\\|[][]\\)") boundary t))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
555 (setq me0 (match-end 0))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
556 (if (or (YaTeX-on-comment-p)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
557 (YaTeX-literal-p)) nil
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
558 (if (or (= (char-after (1- me0)) ?\))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
559 (= (char-after (1- me0)) ?\]))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
560 (setq nest (1+ nest))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
561 (if (= (preceding-char) ?\\ ) nil ;;\\[5pt]
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
562 (setq nest (1- nest))))))
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
563 (if (< nest 0)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
564 (throw 'open (cons (YaTeX-match-string 0) (point)))))))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
565 ((and (setq r (YaTeX-on-section-command-p
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
566 YaTeX-math-section-type-regexp))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
567 (numberp r)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
568 (> r 0))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
569 t)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
570 (t (catch 'dollar
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
571 (while ;(search-backward "$" boundary t);little bit fast.
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
572 (YaTeX-re-search-active-backward ;;;;;; Too slow???
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
573 "\\$" (concat "[^\\\\]" YaTeX-comment-prefix) boundary t)
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
574 (setq dollar "$")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
575 (cond
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
576 ((equal (char-after (1- (point))) ?$) ; $$ equation $$
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
577 (setq dollar "$$")
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
578 (backward-char 1)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
579 (setq nest (1+ nest)))
177
9c5a764a871f Treat `alltt' in YaTeX-verbatim-environments.
yuuji@gentei.org
parents: 143
diff changeset
580 ((YaTeX-literal-p)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
581 nil)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
582 ((and (equal (char-after (1- (point))) ?\\ )
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
583 (not (equal (char-after (- (point) 3)) ?\\ )))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
584 nil) ;\$
130
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
585 (t (setq nest (1+ nest))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
586 (if (and (= nest 1) (null firstp))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
587 (setq firstp (cons dollar (point)))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
588 (if (= (% nest 2) 1)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
589 (throw 'dollar firstp))))))))))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
590
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
591 (defun YaTeX-mark-mathenv ()
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
592 "Mark current mathematic environment."
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
593 (interactive)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
594 (let ((mmp (YaTeX-in-math-mode-p)) type bpt)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
595 (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
596 nil ;if nil or not string, do nothing
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
597 (setq bpt (cdr mmp))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
598 (goto-char bpt)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
599 (cond
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
600 ((string-match "\\$" type)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
601 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
602 (skip-chars-forward "$")
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
603 (YaTeX-search-active-forward
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
604 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
605 (goto-char (match-end 0)))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
606 ;;
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
607 ((string-match "^\\\\[\\[(]" type)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
608 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
609 (YaTeX-goto-corresponding-leftright)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
610 (skip-chars-forward "])\\\\"))
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
611 ;;
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
612 ((string-match "^[a-z]" type) ; \begin\end type math
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
613 (set-mark-command nil)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
614 (YaTeX-goto-corresponding-environment)
8703f090c628 `[prefix] t e' for YaTeX-typeset-environment.
yuuji@gentei.org
parents: 128
diff changeset
615 (goto-char (match-end 0)))))))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
616
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
617 (defun YaTeX-math-display-list (list cols)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
618 (goto-char (point-max))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
619 (if (= cols 0) (if (not (eolp)) (newline 1))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
620 (forward-line -1)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
621 (while (looking-at "[ \t\n]") (forward-line -1)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
622 (end-of-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
623 (let ((indent (* YaTeX-math-display-width cols)) sign str to)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
624 (indent-to indent)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
625 (insert (car list))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
626 (indent-to (setq indent (+ indent YaTeX-math-max-key)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
627 (insert "\\" (car (cdr list)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
628 (setq indent (+ indent YaTeX-math-max-seq))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
629 (setq sign (YaTeX-math-get-sign list))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
630 (while (and sign (not (string= "" sign)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
631 (setq to (string-match "\n" sign)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
632 str (if to (substring sign 0 to) sign))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
633 (end-of-line)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
634 (indent-to indent)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
635 (insert str)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
636 (cond ((eobp) (newline 1))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
637 ((> cols 0) (forward-line 1)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
638 (setq sign (if to (substring sign (1+ to)) "")))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
639
390df0e505da Label completion works.
yuuji
parents:
diff changeset
640 (defvar YaTeX-math-menu-buffer "*math-mode-signs*")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
641
390df0e505da Label completion works.
yuuji
parents:
diff changeset
642 (defun YaTeX-math-show-menu (match-str)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
643 (save-window-excursion
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
644 (YaTeX-showup-buffer YaTeX-math-menu-buffer nil t)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
645 (let ((maxcols (max 1 (/ (YaTeX-screen-width) YaTeX-math-sign-width)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
646 (case-fold-search nil)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
647 (cols 0) (list alist) command)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
648 (erase-buffer)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
649 (insert
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
650 "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
651 (insert YaTeX-math-indicator "\t")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
652 (insert YaTeX-math-indicator)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
653 (newline 1)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
654 (insert-char ?- (1- (YaTeX-screen-width)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
655 (newline 1)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
656 (while list
390df0e505da Label completion works.
yuuji
parents:
diff changeset
657 (if (string-match match-str (car (car list)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
658 (progn (YaTeX-math-display-list (car list) cols)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
659 (setq cols (% (1+ cols) maxcols))))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
660 (setq list (cdr list)))
178
2f9069006bdb avoid using goto-line
yuuji@gentei.org
parents: 177
diff changeset
661 (goto-char (point-min)) (forward-line 3)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
662 (use-local-map YaTeX-math-menu-map)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
663 (setq buffer-read-only t)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
664 (unwind-protect
390df0e505da Label completion works.
yuuji
parents:
diff changeset
665 (recursive-edit)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
666 (skip-chars-backward "^ \t\n")
390df0e505da Label completion works.
yuuji
parents:
diff changeset
667 (setq command
390df0e505da Label completion works.
yuuji
parents:
diff changeset
668 (if (re-search-forward YaTeX-math-cmd-regexp nil t)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
669 (buffer-substring
390df0e505da Label completion works.
yuuji
parents:
diff changeset
670 (match-beginning 0)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
671 (prog2 (skip-chars-forward "^ \t\n") (point)))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
672 nil))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
673 (kill-buffer YaTeX-math-menu-buffer))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
674 command)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
675
390df0e505da Label completion works.
yuuji
parents:
diff changeset
676 (defun YaTeX-math-show-image (image &optional exit-char)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
677 "Momentarily display IMAGE at the beginning of the next line;
390df0e505da Label completion works.
yuuji
parents:
diff changeset
678 erase it on the next keystroke. The window is recentered if necessary
390df0e505da Label completion works.
yuuji
parents:
diff changeset
679 to make the whole string visible. If the window isn't large enough,
390df0e505da Label completion works.
yuuji
parents:
diff changeset
680 at least you get to read the beginning."
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
681 (if (and image (not (string= image "")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
682 (let ((buffer-read-only nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
683 (modified (buffer-modified-p))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
684 (name buffer-file-name)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
685 insert-start
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
686 insert-end)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
687 (unwind-protect
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
688 (progn
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
689 (save-excursion
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
690 ;; 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
691 (setq buffer-file-name nil)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
692 (forward-line 1)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
693 (setq insert-start (point))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
694 (if (eobp) (newline))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
695 (insert image)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
696 (setq insert-end (point)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
697 ; make sure the whole string is visible
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
698 (if (not (pos-visible-in-window-p insert-end))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
699 (recenter (max 0
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
700 (- (window-height)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
701 (count-lines insert-start insert-end)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
702 2))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
703 (let ((char (read-char)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
704 (or (eq char exit-char)
292
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
705 (if (boundp 'unread-command-events)
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
706 (setq unread-command-events (list char))
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
707 (setq unread-command-char char)))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
708 (if insert-end
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
709 (save-excursion
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
710 (delete-region insert-start insert-end)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
711 (setq buffer-file-name name)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
712 (set-buffer-modified-p modified)))))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
713
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
714 (defun YaTeX-math-insert-sequence (&optional force initial)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
715 "Insert math-mode sequence with image completion."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
716 (interactive "P")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
717 (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
718 (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
719 (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
720 (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
721 (alistname (symbol-name alistsym))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
722 (alist (symbol-value alistsym))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
723 (n (length alist)) (beg (point)) result)
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
724 (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
725 (if (string-match "^YaTeX-" alistname)
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
726 (setq alistname (substring alistname (length "YaTeX-"))))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
727 (setq alistname (substring alistname 0 (string-match "-" alistname)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
728 (setq result
390df0e505da Label completion works.
yuuji
parents:
diff changeset
729 (catch 'complete
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
730 (if (and (not force)
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
731 (if YaTeX-auto-math-mode
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
732 (not (YaTeX-in-math-mode-p))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 47
diff changeset
733 (not YaTeX-math-mode)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
734 (throw 'complete 'escape));this tag should be exit, but...
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
735 (while t
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
736 (message "%ssequence%s: %s"
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
737 (if YaTeX-simple-messages "" (concat alistname " "))
56
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
738 (if YaTeX-simple-messages "" "(TAB for menu)") key)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
739 (setq last-char (read-char)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
740 key (concat key (char-to-string last-char))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
741 i 0)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
742 (cond
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
743 ((string= key this-key) ;;invoke key itself
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
744 (throw 'complete 'escape))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
745 ((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
746 (throw 'complete 'exit))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
747 ((string-match "\r" key) ;;RET = kakutei
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
748 (throw 'complete 'select))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
749 ((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
750 (throw 'complete 'abort))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
751 ((string-match "[\t\n]" key) ;;TAB, LFD = menu
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
752 (throw 'complete 'menu))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
753 ((string-match "[\C-h\C-?]" key) ;;BS, DEL = BS
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
754 (if (< (length key) 2) (throw 'complete 'abort))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
755 (setq key (substring key 0 -2))))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
756
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
757 (setq regkey (concat "^" (regexp-quote key)))
56
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
758 (message "Sequence%s: %s"
a9653fbd1c1c Bug fix version
yuuji
parents: 53
diff changeset
759 (if YaTeX-simple-messages "" "(TAB for menu)") key)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
760 (if
390df0e505da Label completion works.
yuuji
parents:
diff changeset
761 (catch 'found
390df0e505da Label completion works.
yuuji
parents:
diff changeset
762 ;;(1)input string strictly matches with alist
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
763 (setq match (assoc key alist))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
764 ;;remember previous match
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
765
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
766 ;;(2)search partial match into alist
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
767 (setq list alist)
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
768 (while (< i n)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
769 (if (string-match
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
770 regkey
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
771 ;;(aref array i)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
772 ;;(car (nth i alist))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
773 (car (car list)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
774 (progn
390df0e505da Label completion works.
yuuji
parents:
diff changeset
775 (or match
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
776 ;;(setq match (nth i alist))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
777 (setq match (car list)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
778 (throw 'found t)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
779 (setq i (1+ i) list (cdr list)))) ;catch 'found
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
780 nil ;;if any match, continue reading
390df0e505da Label completion works.
yuuji
parents:
diff changeset
781 ;;else reading of sequence has been done.
390df0e505da Label completion works.
yuuji
parents:
diff changeset
782 (message "complete.")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
783 (throw 'complete t))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 14
diff changeset
784
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
785 (if match
390df0e505da Label completion works.
yuuji
parents:
diff changeset
786 (progn (delete-region beg (point))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
787 (setq YaTeX-single-command (car (cdr match)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
788 (insert YaTeX-ec YaTeX-single-command)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
789 (if (and YaTeX-math-need-image
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
790 (setq sign (YaTeX-math-get-sign match)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
791 (YaTeX-math-show-image (concat sign "\n")))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
792 )
390df0e505da Label completion works.
yuuji
parents:
diff changeset
793 nil)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
794 )))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
795 (delete-region beg (point))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
796 (cond
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
797 ((memq result '(t select))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
798 (if (eq result t)
292
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
799 (if (boundp 'unread-command-events)
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
800 (setq unread-command-events (list last-char))
e1c1616c4f07 Use unread-command-events when bound.
HIROSE Yuuji <yuuji@gentei.org>
parents: 290
diff changeset
801 (setq unread-command-char last-char))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
802 (message "Done."))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
803 (if (assoc YaTeX-single-command section-table)
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
804 (YaTeX-make-section nil nil nil YaTeX-single-command)
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
805 (setq YaTeX-current-completion-type 'maketitle)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
806 (YaTeX-make-singlecmd YaTeX-single-command)))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
807 ((eq result 'abort)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
808 (message "Abort."))
390df0e505da Label completion works.
yuuji
parents:
diff changeset
809 ((eq result 'escape)
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
810 (call-interactively (lookup-key global-map this-key)))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
811 ((eq result 'exit)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
812 (YaTeX-toggle-math-mode))
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
813 ((eq result 'menu)
390df0e505da Label completion works.
yuuji
parents:
diff changeset
814 (setq key (concat "^" (regexp-quote (substring key 0 -1))))
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
815 (insert (YaTeX-math-show-menu key))))))
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
816
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
817 ;; ----- Change image completion types -----
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
818 (defun YaTeX-math-member-p (item)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
819 "Check if ITEM is a member of image completion.
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
820 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
821 (let ((lists YaTeX-math-key-list) list)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
822 (catch 'found
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
823 (while lists
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
824 (setq list (symbol-value (cdr (car lists))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
825 (while list
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
826 (if (string= item (nth 1 (car list)))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
827 (throw 'found (cons (car (car lists)) (nth 0 (car list)))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
828 (setq list (cdr list)))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
829 (setq lists (cdr lists))))))
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
830
193
e216f9f347fa Camouflage email addresses.
yuuji@gentei.org
parents: 182
diff changeset
831 ;;; ----- for AMS LaTeX (by matsu<at>math.s.chiba-u.ac.jp) -----
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
832 (defvar YaTeX-ams-paren-modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
833 '(("Biggl" . "Biggr") ("biggl" . "biggr")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
834 ("Bigl" . "Bigr") ("bigl" . "bigr")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
835 ("left" . "right") ("" . ""))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
836 "Alist of modifier of parentheses.")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
837
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
838 (defvar YaTeX-left-paren "(\\|\\[\\|\\\\{")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
839 (defvar YaTeX-right-paren ")\\|\\]\\|\\\\}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
840 (defvar YaTeX-paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
841 (concat YaTeX-left-paren "\\|" YaTeX-right-paren))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
842
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
843 (defun YaTeX-on-parenthesis-p ()
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
844 "If cursor is on an (AMS-LaTeX) parenthesis, return the parenthesis."
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
845 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
846 (let* ((list YaTeX-ams-paren-modifier)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
847 (longest 0) ;; the longest length of parenthesis command strings
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
848 (flag t) ;; flag for whether on braces not following \
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
849 (point (point))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
850 (move 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
851 (paren))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
852 (while list
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
853 (setq longest
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
854 (max longest (length (car (car list))) (length (cdr (car list)))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
855 (setq list (cdr list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
856 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
857 ;; search {} and, if it does not follow `\', set flag nil.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
858 ;; if it is right after `\', set flag t and move to the position of \.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
859 ;; mmmmm.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
860 (if (looking-at "{\\|}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
861 (if (not (equal (char-after (1- (point))) 92))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
862 (setq flag nil)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
863 (forward-char -1)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
864 ;; if flag is nil, do nothing.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
865 (if (and flag (re-search-forward YaTeX-paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
866 (+ (point) 3 longest) t))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
867 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
868 (setq move (- (point) point))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
869 (setq paren (YaTeX-match-string 0))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
870 (setq list YaTeX-ams-paren-modifier)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
871 ;; criterion for whether on [] () \{\} or not.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
872 (if (string-match YaTeX-left-paren paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
873 (while (and list flag)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
874 (let* ((mod (car (car list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
875 (mod-length 0) ;; length of modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
876 paren-regexp ;; regexp of paren.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
877 mod-regexp) ;; regexp of modifier.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
878 (if (> (length mod) 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
879 (setq mod-regexp (concat "\\\\" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
880 mod-length (1+ (length mod))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
881 (cond ((string= paren "\\{")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
882 (setq paren-regexp (concat "\\" paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
883 ((string= paren "[")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
884 (setq paren-regexp "\\["))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
885 (t (setq paren-regexp paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
886 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
887 (if (and (>= (- (point) (point-min))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
888 (+ mod-length (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
889 (not (forward-char
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
890 (- 0 mod-length (length paren))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
891 (looking-at (concat "\\(" mod-regexp "\\)\\("
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
892 paren-regexp "\\)")))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
893 (setq flag nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
894 (setq list (cdr list))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
895 (while (and list flag)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
896 (let* ((mod (cdr (car list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
897 (mod-length 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
898 paren-regexp
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
899 mod-regexp)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
900 (if (> (length mod) 0)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
901 (setq mod-regexp (concat "\\\\" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
902 mod-length (1+ (length mod))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
903 (cond ((string= paren "\\}")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
904 (setq paren-regexp (concat "\\" paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
905 ((string= paren "]")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
906 (setq paren-regexp "\\]"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
907 (t (setq paren-regexp paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
908 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
909 (if (and (>= (- (point) (point-min))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
910 (+ mod-length (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
911 (not (forward-char
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
912 (- 0 mod-length (length paren))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
913 (looking-at (concat "\\(" mod-regexp "\\)\\("
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
914 paren-regexp "\\)")))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
915 (setq flag nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
916 (setq list (cdr list)))))
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
917 (if (<= move (length (YaTeX-match-string 0)))
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
918 (YaTeX-match-string 0)))))))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
919
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
920 (defun YaTeX-goto-open-paren (&optional jumpto-co)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
921 "Jump to the exact position of open parenthesis.
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
922 If optional argument JUMPTO-CO is non-nil, goto corresponding parentheses."
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
923 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
924 (let ((paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
925 (backslash-syntax (char-to-string (char-syntax ?\\))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
926 (if (setq paren (YaTeX-on-parenthesis-p))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
927 (if (string-match "(\\|{\\|\\[" paren (1- (length paren)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
928 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
929 (re-search-forward "(\\|{\\|\\[" (+ (point) (length paren)) t)
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
930 (backward-char)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
931 (if jumpto-co
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
932 (unwind-protect
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
933 (progn
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
934 (modify-syntax-entry ?\\ " ")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
935 (forward-list)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
936 (backward-char))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
937 (modify-syntax-entry ?\\ backslash-syntax)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
938 (point))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
939 (re-search-forward ")\\|}\\|\\]" (+ (point) (length paren)) t)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
940 (unwind-protect
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
941 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
942 (modify-syntax-entry ?\\ " ")
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
943 (backward-list)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
944 (point))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
945 (modify-syntax-entry ?\\ backslash-syntax))))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
946
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
947 ;;;###autoload
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
948 (defun YaTeX-goto-corresponding-paren ()
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
949 "Go to corresponding mathematical parentheses."
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
950 (if (YaTeX-on-parenthesis-p)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
951 (YaTeX-goto-open-paren t)
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
952 nil))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
953
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
954 (defun YaTeX-change-parentheses ()
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
955 "Change the size of parentheses, braces, and brackets of AMS-LaTeX."
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
956 (interactive)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
957 (if (not (and YaTeX-use-AMS-LaTeX (YaTeX-on-parenthesis-p)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
958 nil
80
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
959 (let* ((mod (YaTeX-match-string 1)) ;; modifier
9b4354af748c Too many changes from 1.72.
yuuji
parents: 77
diff changeset
960 (paren (if mod (YaTeX-match-string 2) (YaTeX-match-string 0))) ;; paren
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
961 (mod-length (if (or (string= mod "\\left") (string= mod "\\right"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
962 5 ;; 5 in case left or right
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
963 (length mod))) ;; length of modifier
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
964 (paren-length (length paren)) ;; length of paren
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
965 (length (+ mod-length paren-length)) ;; length of whole string
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
966 (big-p t) ;; flag whether new modifier is "[Bb]ig+" or not.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
967 size ;; left, big, Big etc.
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
968 type ;; parentheses type
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
969 lr ;; "l" or "r".
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
970 char newsize newsize-length
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
971 (backslash-syntax (char-to-string (char-syntax ?\\)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
972 (case-fold-search))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
973 ;; decide lr and size from mod and paren.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
974 (cond ((string-match "\\(\\\\[Bb]ig+\\)[lr]" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
975 (setq size (substring mod 1 (match-end 1))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
976 lr (substring mod (match-end 1) (match-end 0))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
977 ((string-match "\\\\left" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
978 (setq size "left-right" lr "l"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
979 ((string-match "\\\\right" mod)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
980 (setq size "left-right" lr "r"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
981 ((string-match "(\\|\\[\\|\\\\{" paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
982 (setq size "null" lr "l"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
983 ((string-match ")\\|\\]\\|\\\\}" paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
984 (setq size "null" lr "r"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
985 (t
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
986 (setq size nil lr nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
987 (while (not newsize)
527
af4601ee3c6a Format() function don't need message()
HIROSE Yuuji <yuuji@gentei.org>
parents: 497
diff changeset
988 (message (concat "Change from %s: "
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
989 "l(big) L(Big) h(bigg) H(Bigg) "
527
af4601ee3c6a Format() function don't need message()
HIROSE Yuuji <yuuji@gentei.org>
parents: 497
diff changeset
990 "r(left-right) n(NONE) ( { [") size)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
991 (setq char (read-char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
992 newsize (cond ((char-equal char ?l) "\\big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
993 ((char-equal char ?L) "\\Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
994 ((char-equal char ?h) "\\bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
995 ((char-equal char ?H) "\\Bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
996 ((char-equal char ?r)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
997 (setq big-p nil) "\\left")
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
998 ((memq char '(?\( ?\)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
999 (setq big-p nil type '("(" . ")")) "")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1000 ((memq char '(?\{ ?\}))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1001 (setq big-p nil type '("\\{" . "\\}")) "")
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1002 ((memq char '(?\[ ?\]))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1003 (setq big-p nil type '("[" . "]")) "")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1004 ((char-equal char ?n)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1005 (setq big-p nil) "")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1006 (t nil))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1007 newsize-length (length newsize)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1008 (YaTeX-goto-open-paren)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1009 (forward-char)
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1010 (cond
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1011 (type
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1012 (delete-region (point) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1013 (save-excursion (insert (car type))))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1014 (t
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1015 (delete-region (- (point) length) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1016 (backward-char paren-length)))
558
a2ef47ba407f Why 'insert-string was used??
HIROSE Yuuji <yuuji@gentei.org>
parents: 527
diff changeset
1017 (insert newsize)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1018 (if big-p (insert ?l))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1019 (unwind-protect
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1020 (progn
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1021 (modify-syntax-entry ?\\ " ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1022 (forward-list)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1023 (if (string= size "left-right") (setq length (1+ length)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1024 (if (eq char ?r) (setq newsize "\\right"))
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1025 (cond
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1026 (type
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1027 (delete-region (point) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1028 (insert (cdr type)))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1029 (t
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1030 (delete-region (- (point) length) (- (point) paren-length))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1031 (backward-char paren-length)
558
a2ef47ba407f Why 'insert-string was used??
HIROSE Yuuji <yuuji@gentei.org>
parents: 527
diff changeset
1032 (insert newsize)
77
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1033 (if big-p (insert ?r))
1b172d26b55e Fix auto-fill movement on Emacs21.
yuuji
parents: 72
diff changeset
1034 (forward-char paren-length)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1035 (if (string= lr "l") (backward-list)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1036 (modify-syntax-entry ?\\ backslash-syntax))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1037 t)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1038
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1039 (defun YaTeX-insert-amsparens-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1040 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1041 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1042 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1043 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1044 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1045 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1046 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1047 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1048 beg end (concat "\\" st "l(") (concat "\\" st "r)"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1049 (YaTeX-insert-braces-region beg end "(" ")"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1050
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1051 (defun YaTeX-insert-amsbraces-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1052 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1053 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1054 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1055 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1056 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1057 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1058 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1059 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1060 beg end (concat "\\" st "l\\{") (concat "\\" st "r\\}"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1061 (YaTeX-insert-braces-region beg end "\\{" "\\}"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1062
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1063 (defun YaTeX-insert-amsbrackets-region (beg end char)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1064 (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1065 (let* ((case-fold-search)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1066 (st (cond ((char-equal char ?l) "big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1067 ((char-equal char ?L) "Big")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1068 ((char-equal char ?h) "bigg")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1069 ((char-equal char ?H) "Bigg"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1070 (if st
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1071 (YaTeX-insert-braces-region
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1072 beg end (concat "\\" st "l[") (concat "\\" st "r]"))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1073 (YaTeX-insert-braces-region beg end "[" "]"))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1074
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1075
11
390df0e505da Label completion works.
yuuji
parents:
diff changeset
1076 ;;
390df0e505da Label completion works.
yuuji
parents:
diff changeset
1077 (provide 'yatexmth)
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1078
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1079 ; Local variables:
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1080 ; fill-prefix: ";;; "
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1081 ; paragraph-start: "^$\\| \\|;;;$"
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1082 ; paragraph-separate: "^$\\| \\|;;;$"
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 11
diff changeset
1083 ; End:

yatex.org