annotate yatexadd.el @ 73:f41b01fef5d6

Stable version(hope to be)
author yuuji
date Wed, 22 May 2002 04:57:42 +0000
parents 0aaebd07dad0
children 1b172d26b55e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
1 ;;; -*- Emacs-Lisp -*-
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
2 ;;; YaTeX add-in functions.
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
3 ;;; yatexadd.el rev.14
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
4 ;;; (c )1991-2000 by HIROSE Yuuji.[yuuji@yatex.org]
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
5 ;;; Last modified Sat Sep 29 23:17:06 2001 on duke
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
6 ;;; $Id$
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
7
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
8 ;;;
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
9 ;;Sample functions for LaTeX environment.
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
10 ;;;
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
11 (defvar YaTeX:tabular-default-rule
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
12 "@{\\vrule width 1pt\\ }c|c|c@{\\ \\vrule width 1pt}"
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
13 "*Your favorite default rule format.")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
14
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
15 (defvar YaTeX:tabular-thick-vrule "\\vrule width %s"
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
16 "*Vertical thick line format (without @{}). %s'll be replaced by its width.")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
17
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
18 (defvar YaTeX:tabular-thick-hrule "\\noalign{\\hrule height %s}"
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
19 "*Horizontal thick line format. %s will be replaced by its width.")
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
20
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
21 (defun YaTeX:tabular ()
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
22 "YaTeX add-in function for tabular environment.
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
23 Notice that this function refers the let-variable `env' in
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
24 YaTeX-make-begin-end."
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
25 (let ((width "") bars (rule "") (and "") (j 1) loc ans (hline "\\hline"))
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
26 (if (string= YaTeX-env-name "tabular*")
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
27 (setq width (concat "{" (read-string "Width: ") "}")))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
28 (setq loc (YaTeX:read-position "tb")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
29 bars (string-to-int
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
30 (read-string "Number of columns(0 for default format): " "3")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
31 (if (<= bars 0)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
32 (setq ;if 0, simple format
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
33 rule YaTeX:tabular-default-rule
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
34 and "& &")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
35 (while (< j bars) ;repeat bars-1 times
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
36 (setq rule (concat rule "c|")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
37 and (concat and "& ")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
38 j (1+ j)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
39 (setq rule (concat rule "c"))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
40 (message "(N)ormal-frame or (T)hick frame? [nt]")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
41 (setq ans (read-char))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
42 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
43 ((or (equal ans ?t) (equal ans ?T))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
44 (setq ans (read-string "Rule width: " "1pt")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
45 rule (concat
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
46 "@{" (format YaTeX:tabular-thick-vrule ans) "}"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
47 rule
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
48 "@{\\ " (format YaTeX:tabular-thick-vrule ans) "}")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
49 hline (format YaTeX:tabular-thick-hrule ans)))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
50 (t (setq rule (concat "|" rule "|")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
51 hline "\\hline"))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
52
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
53 (setq rule (read-string "rule format: " rule))
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
54 (setq YaTeX-single-command "hline")
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
55
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
56 (format "%s%s{%s}" width loc rule)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
57
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
58 (fset 'YaTeX:tabular* 'YaTeX:tabular)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
59 (defun YaTeX:array ()
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
60 (concat (YaTeX:read-position "tb")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
61 "{" (read-string "Column format: ") "}"))
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
62
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
63 (defun YaTeX:read-oneof (oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
64 (let ((pos "") loc (guide ""))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
65 (and (boundp 'name) name (setq guide (format "%s " name)))
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
66 (while (not (string-match
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
67 (setq loc (read-key-sequence
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
68 (format "%s position (`%s') [%s]: "
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
69 guide oneof pos));name is in YaTeX-addin
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
70 loc (if (fboundp 'events-to-keys)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
71 (events-to-keys loc) loc))
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
72 "\r\^g\n"))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
73 (cond
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
74 ((string-match loc oneof)
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
75 (if (not (string-match loc pos))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
76 (setq pos (concat pos loc))))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
77 ((and (string-match loc "\C-h\C-?") (> (length pos) 0))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
78 (setq pos (substring pos 0 (1- (length pos)))))
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
79 (t
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
80 (ding)
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
81 (message "Please input one of `%s'." oneof)
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
82 (sit-for 3))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
83 (message "")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
84 pos))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
85
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
86 (defun YaTeX:read-position (oneof)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
87 "Read a LaTeX (optional) position format such as `[htbp]'."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
88 (let ((pos (YaTeX:read-oneof oneof)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
89 (if (string= pos "") "" (concat "[" pos "]"))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
90
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
91 (defun YaTeX:table ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
92 "YaTeX add-in function for table environment."
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
93 (cond
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
94 ((eq major-mode 'yatex-mode)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
95 (setq YaTeX-env-name "tabular"
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
96 YaTeX-section-name "caption")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
97 (YaTeX:read-position "htbp"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
98 ((eq major-mode 'texinfo-mode)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
99 (concat " "
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
100 (completing-read
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
101 "Highlights with: "
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
102 '(("@samp")("@kbd")("@code")("@asis")("@file")("@var"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
103 nil nil "@")))))
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
104
46
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
105 (fset 'YaTeX:figure 'YaTeX:table)
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
106 (fset 'YaTeX:figure* 'YaTeX:table)
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
107
cd1b63102eed Support Mule2
yuuji
parents: 43
diff changeset
108
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
109 (defun YaTeX:description ()
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
110 "Truly poor service:-)"
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
111 (setq YaTeX-single-command "item[]")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
112 "")
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
113
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
114 (defun YaTeX:itemize ()
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
115 "It's also poor service."
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
116 (setq YaTeX-single-command "item")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
117 "")
6
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
118
49be9ccb0b65 Temporary dictionary.
yuuji
parents:
diff changeset
119 (fset 'YaTeX:enumerate 'YaTeX:itemize)
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
120
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
121 (defun YaTeX:picture ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
122 "Ask the size of coordinates of picture environment."
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
123 (concat (YaTeX:read-coordinates "Picture size")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
124 (YaTeX:read-coordinates "Initial position")))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
125
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
126 (defun YaTeX:equation ()
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
127 (YaTeX-jmode-off)
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
128 (if (fboundp 'YaTeX-toggle-math-mode)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
129 (YaTeX-toggle-math-mode t))) ;force math-mode ON.
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
130
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
131 (mapcar '(lambda (f) (fset f 'YaTeX:equation))
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
132 '(YaTeX:eqnarray YaTeX:eqnarray* YaTeX:align YaTeX:align*
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
133 YaTeX:split YaTeX:multline YaTeX:multline* YaTeX:gather YaTeX:gather*
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
134 YaTeX:aligned* YaTeX:gathered YaTeX:gathered*
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
135 YaTeX:alignat YaTeX:alignat* YaTeX:xalignat YaTeX:xalignat*
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
136 YaTeX:xxalignat YaTeX:xxalignat*))
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
137
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
138 (defun YaTeX:list ()
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
139 "%\n{} %default label\n{} %formatting parameter")
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
140
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
141 (defun YaTeX:minipage ()
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
142 (concat (YaTeX:read-position "cbt")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
143 "{" (read-string "Width: ") "}"))
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
144
64
36a48185b95a Changes are listed in yatex.new.
yuuji
parents: 60
diff changeset
145 (defun YaTeX:thebibliography ()
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
146 (setq YaTeX-section-name "bibitem")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
147 "")
64
36a48185b95a Changes are listed in yatex.new.
yuuji
parents: 60
diff changeset
148
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
149 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
150 ;;Sample functions for section-type command.
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
151 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
152 (defun YaTeX:multiput ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
153 (concat (YaTeX:read-coordinates "Pos")
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
154 (YaTeX:read-coordinates "Step")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
155 "{" (read-string "How many times: ") "}"))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
156
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
157 (defun YaTeX:put ()
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
158 (YaTeX:read-coordinates "Pos"))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
159
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
160 (defun YaTeX:makebox ()
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
161 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
162 ((YaTeX-in-environment-p "picture")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
163 (concat (YaTeX:read-coordinates "Dimension")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
164 (YaTeX:read-position "lrtb")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
165 (t
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
166 (let ((width (read-string "Width: ")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
167 (if (string< "" width)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
168 (progn
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
169 (or (equal (aref width 0) ?\[)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
170 (setq width (concat "[" width "]")))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
171 (concat width (YaTeX:read-position "lr"))))))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
172
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
173 (defun YaTeX:framebox ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
174 (if (YaTeX-quick-in-environment-p "picture")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
175 (YaTeX:makebox)))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
176
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
177 (defun YaTeX:dashbox ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
178 (concat "{" (read-string "Dash dimension: ") "}"
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
179 (YaTeX:read-coordinates "Dimension")))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
180
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
181 (defvar YaTeX-minibuffer-quick-map nil)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
182 (if YaTeX-minibuffer-quick-map nil
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
183 (setq YaTeX-minibuffer-quick-map
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
184 (copy-keymap minibuffer-local-completion-map))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
185 (let ((ch (1+ ? )))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
186 (while (< ch 127)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
187 (define-key YaTeX-minibuffer-quick-map (char-to-string ch)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
188 'YaTeX-minibuffer-quick-complete)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
189 (setq ch (1+ ch)))))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
190
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
191 (defvar YaTeX:left-right-delimiters
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
192 '(("(" . ")") (")" . "(") ("[" . "]") ("]" . "[")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
193 ("\\{" . "\\}") ("\\}" . "\\{") ("|") ("\\|")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
194 ("\\lfloor" . "\\rfloor") ("\\lceil" . "\\rceil")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
195 ("\\langle" . "\\rangle") ("/") (".")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
196 ("\\rfloor" . "\\rfloor") ("\\rceil" . "\\lceil")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
197 ("\\rangle" . "\\langle") ("\\backslash")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
198 ("\\uparrow") ("\\downarrow") ("\\updownarrow") ("\\Updownarrow"))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
199 "TeX math delimiter, which can be completed after \\right or \\left.")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
200
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
201 (defvar YaTeX:left-right-default nil "Default string of YaTeX:right.")
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
202
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
203 (defun YaTeX:left ()
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
204 (let ((minibuffer-completion-table YaTeX:left-right-delimiters)
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
205 delimiter (leftp (string= YaTeX-single-command "left")))
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
206 (setq delimiter
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
207 (read-from-minibuffer
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
208 (format "Delimiter%s: "
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
209 (if YaTeX:left-right-default
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
210 (format "(default=`%s')" YaTeX:left-right-default)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
211 "(SPC for menu)"))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
212 nil YaTeX-minibuffer-quick-map))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
213 (if (string= "" delimiter) (setq delimiter YaTeX:left-right-default))
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
214 (setq YaTeX-single-command (if leftp "right" "left")
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
215 YaTeX:left-right-default
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
216 (or (cdr (assoc delimiter YaTeX:left-right-delimiters)) delimiter))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
217 delimiter))
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
218
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
219 (fset 'YaTeX:right 'YaTeX:left)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
220
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
221
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
222 (defun YaTeX:read-coordinates (&optional mes varX varY)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
223 (concat
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
224 "("
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
225 (read-string (format "%s %s: " (or mes "Dimension") (or varX "X")))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
226 ","
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
227 (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y")))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
228 ")"))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
229
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
230 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
231 ;;Sample functions for maketitle-type command.
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
232 ;;;
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
233 (defun YaTeX:sum ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
234 "Read range of summation."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
235 (YaTeX:check-completion-type 'maketitle)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
236 (concat (YaTeX:read-boundary "_") (YaTeX:read-boundary "^")))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
237
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
238 (fset 'YaTeX:int 'YaTeX:sum)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
239
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
240 (defun YaTeX:lim ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
241 "Insert limit notation of \\lim."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
242 (YaTeX:check-completion-type 'maketitle)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
243 (let ((var (read-string "Variable: ")) limit)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
244 (if (string= "" var) ""
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
245 (setq limit (read-string "Limit ($ means infinity): "))
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
246 (if (string= "$" limit) (setq limit "\\infty"))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
247 (concat "_{" var " \\rightarrow " limit "}"))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
248
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
249 (defun YaTeX:gcd ()
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
250 "Add-in function for \\gcd(m,n)."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
251 (YaTeX:check-completion-type 'maketitle)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
252 (YaTeX:read-coordinates "\\gcd" "(?,)" "(,?)"))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
253
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
254 (defun YaTeX:read-boundary (ULchar)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
255 "Read boundary usage by _ or ^. _ or ^ is indicated by argument ULchar."
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
256 (let ((bndry (read-string (concat ULchar "{???} ($ for infinity): "))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
257 (if (string= bndry "") ""
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
258 (if (string= bndry "$") (setq bndry "\\infty"))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
259 (concat ULchar "{" bndry "}"))))
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
260
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
261 (defun YaTeX:verb ()
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
262 "Enclose \\verb's contents with the same characters."
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
263 (let ((quote-char (read-string "Quoting char: " "|"))
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
264 (contents (read-string "Quoted contents: ")))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
265 (concat quote-char contents quote-char)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
266
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
267 (fset 'YaTeX:verb* 'YaTeX:verb)
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
268
43
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
269 (defun YaTeX:footnotemark ()
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
270 (setq YaTeX-section-name "footnotetext")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
271 nil)
43
ef686a35472d Change the default section-type command to footnotetext after
yuuji
parents: 23
diff changeset
272
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
273 (defun YaTeX:cite ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
274 (let ((comment (read-string "Comment for citation: ")))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
275 (if (string= comment "") ""
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
276 (concat "[" comment "]"))))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
277
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
278 (defun YaTeX:bibitem ()
64
36a48185b95a Changes are listed in yatex.new.
yuuji
parents: 60
diff changeset
279 (let ((label (read-string "Citation label for bibitem: ")))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
280 (if (string= label "") ""
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
281 (concat "[" label "]"))))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
282
53
5f4b18da14b3 Fix functions relating YaTeX-beginning-of-environment or
yuuji
parents: 52
diff changeset
283 (defun YaTeX:item ()
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
284 (cond
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
285 ((eq major-mode 'yatex-mode)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
286 (YaTeX-indent-line)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
287 (setq YaTeX-section-name "label"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
288 ((eq major-mode 'texinfo-mode)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
289 (setq YaTeX-section-name "dots"))) ;??
53
5f4b18da14b3 Fix functions relating YaTeX-beginning-of-environment or
yuuji
parents: 52
diff changeset
290 " ")
52
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
291 (fset 'YaTeX:item\[\] 'YaTeX:item)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
292 (fset 'YaTeX:subitem 'YaTeX:item)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
293 (fset 'YaTeX:subsubitem 'YaTeX:item)
5d94deabb9f9 Set YaTeX-indent-line to 'indent-line-function.
yuuji
parents: 51
diff changeset
294
58
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
295 (defun YaTeX:linebreak ()
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
296 (let (obl)
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
297 (message "Break strength 0,1,2,3,4 (default: 4): ")
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
298 (setq obl (char-to-string (read-char)))
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
299 (if (string-match "[0-4]" obl)
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
300 (concat "[" obl "]")
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
301 "")))
58
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
302 (fset 'YaTeX:pagebreak 'YaTeX:linebreak)
3a7c0c2bf16d Official support for AMS-LaTeX, HTML, xdvi -remote, Netscape
yuuji
parents: 57
diff changeset
303
14
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
304 ;;;
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
305 ;;Subroutine
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
306 ;;;
b7b023a74293 Region-based section-type completion.
yuuji
parents: 13
diff changeset
307
8
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
308 (defun YaTeX:check-completion-type (type)
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
309 "Check valid completion type."
c746646cecf5 Restrict YaTeX:framebox in picture environment.
yuuji
parents: 6
diff changeset
310 (if (not (eq type YaTeX-current-completion-type))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
311 (error "This should be completed with %s-type completion." type)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
312
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
313
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
314 ;;;
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
315 ;;; [[Add-in functions for reading section arguments]]
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
316 ;;;
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
317 ;; All of add-in functions for reading sections arguments should
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
318 ;; take an argument ARGP that specify the argument position.
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
319 ;; If argument position is out of range, nil should be returned,
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
320 ;; else nil should NOT be returned.
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
321
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
322 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
323 ; Label selection
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
324 ;;
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
325 (defvar YaTeX-label-menu-other
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
326 (if YaTeX-japan "':̃obt@̃x\n" "':LABEL IN OTHER BUFFER.\n"))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
327 (defvar YaTeX-label-menu-repeat
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
328 (if YaTeX-japan ".:O\\refƓ\n" "/:REPEAT LAST \ref{}\n"))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
329 (defvar YaTeX-label-menu-any
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
330 (if YaTeX-japan "*:Cӂ̕\n" "*:ANY STRING.\n"))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
331 (defvar YaTeX-label-buffer "*Label completions*")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
332 (defvar YaTeX-label-guide-msg "Select label and hit RETURN.")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
333 (defvar YaTeX-label-select-map nil
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
334 "Key map used in label selection buffer.")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
335 (defun YaTeX::label-setup-key-map ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
336 (if YaTeX-label-select-map nil
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
337 (message "Setting up label selection mode map...")
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
338 ;(setq YaTeX-label-select-map (copy-keymap global-map))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
339 (setq YaTeX-label-select-map (make-keymap))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
340 (suppress-keymap YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
341 (substitute-all-key-definition
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
342 'previous-line 'YaTeX::label-previous YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
343 (substitute-all-key-definition
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
344 'next-line 'YaTeX::label-next YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
345 (define-key YaTeX-label-select-map "\C-n" 'YaTeX::label-next)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
346 (define-key YaTeX-label-select-map "\C-p" 'YaTeX::label-previous)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
347 (define-key YaTeX-label-select-map "<" 'beginning-of-buffer)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
348 (define-key YaTeX-label-select-map ">" 'end-of-buffer)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
349 (define-key YaTeX-label-select-map "\C-m" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
350 (define-key YaTeX-label-select-map "\C-j" 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
351 (define-key YaTeX-label-select-map " " 'exit-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
352 (define-key YaTeX-label-select-map "\C-g" 'abort-recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
353 (define-key YaTeX-label-select-map "/" 'isearch-forward)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
354 (define-key YaTeX-label-select-map "?" 'isearch-backward)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
355 (define-key YaTeX-label-select-map "'" 'YaTeX::label-search-tag)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
356 (define-key YaTeX-label-select-map "." 'YaTeX::label-search-tag)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
357 (define-key YaTeX-label-select-map "*" 'YaTeX::label-search-tag)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
358 (message "Setting up label selection mode map...Done")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
359 (let ((key ?A))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
360 (while (<= key ?Z)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
361 (define-key YaTeX-label-select-map (char-to-string key)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
362 'YaTeX::label-search-tag)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
363 (define-key YaTeX-label-select-map (char-to-string (+ key (- ?a ?A)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
364 'YaTeX::label-search-tag)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
365 (setq key (1+ key))))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
366
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
367 (defun YaTeX::label-next ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
368 (interactive) (forward-line 1) (message YaTeX-label-guide-msg))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
369 (defun YaTeX::label-previous ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
370 (interactive) (forward-line -1) (message YaTeX-label-guide-msg))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
371 (defun YaTeX::label-search-tag ()
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
372 (interactive)
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
373 (let ((case-fold-search t)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
374 (tag (regexp-quote (char-to-string last-command-char))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
375 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
376 ((save-excursion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
377 (forward-char 1)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
378 (re-search-forward (concat "^" tag) nil t))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
379 (goto-char (match-beginning 0)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
380 ((save-excursion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
381 (goto-char (point-min))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
382 (re-search-forward (concat "^" tag) nil t))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
383 (goto-char (match-beginning 0))))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
384 (message YaTeX-label-guide-msg)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
385
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
386 ; (defun YaTeX::ref (argp &optional labelcmd refcmd)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
387 ; (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
388 ; ((= argp 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
389 ; (let ((lnum 0) e0 label label-list (buf (current-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
390 ; (labelcmd (or labelcmd "label")) (refcmd (or refcmd "ref"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
391 ; (p (point)) initl line cf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
392 ; (message "Collecting labels...")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
393 ; (save-window-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
394 ; (YaTeX-showup-buffer
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
395 ; YaTeX-label-buffer (function (lambda (x) (window-width x))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
396 ; (if (fboundp 'select-frame) (setq cf (selected-frame)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
397 ; (if (eq (window-buffer (minibuffer-window)) buf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
398 ; (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
399 ; (other-window 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
400 ; (setq buf (current-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
401 ; (set-buffer buf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
402 ; ;(message "cb=%s" buf)(sit-for 3)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
403 ; ))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
404 ; (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
405 ; (set-buffer (get-buffer-create YaTeX-label-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
406 ; (setq buffer-read-only nil)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
407 ; (erase-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
408 ; (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
409 ; (goto-char (point-min))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
410 ; (let ((standard-output (get-buffer YaTeX-label-buffer)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
411 ; (princ (format "=== LABELS in [%s] ===\n" (buffer-name buf)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
412 ; (while (YaTeX-re-search-active-forward
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
413 ; (concat "\\\\" labelcmd "\\b")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
414 ; (regexp-quote YaTeX-comment-prefix) nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
415 ; (goto-char (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
416 ; (skip-chars-forward "^{")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
417 ; (setq label
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
418 ; (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
419 ; (1+ (point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
420 ; (prog2 (forward-list 1) (setq e0 (1- (point)))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
421 ; label-list (cons label label-list))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
422 ; (or initl
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
423 ; (if (< p (point)) (setq initl lnum)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
424 ; (beginning-of-line)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
425 ; (skip-chars-forward " \t\n" nil)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
426 ; (princ (format "%c:{%s}\t<<%s>>\n" (+ (% lnum 26) ?A) label
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
427 ; (buffer-substring (point) (point-end-of-line))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
428 ; (setq lnum (1+ lnum))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
429 ; (message "Collecting \\%s{}... %d" labelcmd lnum)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
430 ; (goto-char e0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
431 ; (princ YaTeX-label-menu-other)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
432 ; (princ YaTeX-label-menu-repeat)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
433 ; (princ YaTeX-label-menu-any)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
434 ; );standard-output
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
435 ; (goto-char p)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
436 ; (or initl (setq initl lnum))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
437 ; (message "Collecting %s...Done" labelcmd)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
438 ; (if (fboundp 'select-frame) (select-frame cf))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
439 ; (YaTeX-showup-buffer YaTeX-label-buffer nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
440 ; (YaTeX::label-setup-key-map)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
441 ; (setq truncate-lines t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
442 ; (setq buffer-read-only t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
443 ; (use-local-map YaTeX-label-select-map)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
444 ; (message YaTeX-label-guide-msg)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
445 ; (goto-line (1+ initl)) ;goto recently defined label line
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
446 ; (switch-to-buffer (current-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
447 ; (unwind-protect
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
448 ; (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
449 ; (recursive-edit)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
450 ; (set-buffer (get-buffer YaTeX-label-buffer)) ;assertion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
451 ; (beginning-of-line)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
452 ; (setq line (1- (count-lines (point-min)(point))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
453 ; (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
454 ; ((= line -1) (setq label ""))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
455 ; ((= line lnum) (setq label (YaTeX-label-other)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
456 ; ((= line (1+ lnum))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
457 ; (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
458 ; (switch-to-buffer buf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
459 ; (goto-char p)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
460 ; (if (re-search-backward
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
461 ; (concat "\\\\" refcmd "{\\([^}]+\\)}") nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
462 ; (setq label (YaTeX-match-string 1))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
463 ; (setq label ""))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
464 ; ((>= line (+ lnum 2))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
465 ; (setq label (read-string (format "\\%s{???}: " refcmd))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
466 ; (t (setq label (nth (- lnum line 1) label-list)))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
467 ; (bury-buffer YaTeX-label-buffer)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
468 ; label)))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
469
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
470 (defun YaTeX::ref-generate-label ()
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
471 "Generate a label string which is unique in current buffer."
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
472 (let ((default (substring (current-time-string) 4)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
473 (read-string "Give a label for this line: "
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
474 (if YaTeX-emacs-19 (cons default 1) default))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
475
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
476 (defun YaTeX::ref-getset-label (buffer point)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
477 "Get label string in the BUFFER near the POINT.
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
478 Make \\label{xx} if no label."
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
479 ;;Here, we rewrite the LaTeX source. Therefore we should be careful
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
480 ;;to decide the location suitable for \label. Do straightforward!
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
481 (let (boundary inspoint cc newlabel (labelholder "label") mathp env
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
482 (r-escape (regexp-quote YaTeX-comment-prefix)))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
483 ;;(set-buffer buffer)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
484 (switch-to-buffer buffer)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
485 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
486 (goto-char point)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
487 (setq cc (current-column))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
488 (if (= (char-after (point)) ?\\) (forward-char 1))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
489 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
490 ((looking-at YaTeX-sectioning-regexp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
491 (skip-chars-forward "^{")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
492 (forward-list 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
493 (skip-chars-forward " \t\n")
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
494 ;(setq boundary "[^\\]")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
495 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
496 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
497 (if (YaTeX-re-search-active-forward "[^\\]" r-escape nil 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
498 (match-beginning 0)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
499 (1- (point))))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
500 ((looking-at "item\\s ")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
501 (setq cc (+ cc 6))
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
502 ;(setq boundary (concat YaTeX-ec-regexp "\\(item\\|begin\\|end\\)\\b"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
503 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
504 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
505 (if (YaTeX-re-search-active-forward
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
506 (concat YaTeX-ec-regexp "\\(item\\|begin\\|end\\)\\b")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
507 r-escape nil 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
508 (match-beginning 0)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
509 (1- (point))))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
510 ((looking-at "bibitem")
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
511 (setq labelholder "bibitem") ; label holder is bibitem itself
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
512 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
513 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
514 (if (YaTeX-re-search-active-forward
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
515 (concat YaTeX-ec-regexp "\\(bibitem\\|end\\)\\b")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
516 r-escape nil 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
517 (match-beginning 0)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
518 (1- (point))))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
519 ((string-match YaTeX::ref-mathenv-regexp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
520 (setq env (or (YaTeX-inner-environment t) "document")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
521 (setq mathp t)
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
522 ;;(setq boundary (concat YaTeX-ec-regexp "\\(\\\\\\|end{" env "}\\)"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
523 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
524 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
525 (if (YaTeX-re-search-active-forward
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
526 (concat YaTeX-ec-regexp "\\(\\\\\\|end{" env "}\\)")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
527 r-escape nil 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
528 (match-beginning 0)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
529 (1- (point))))))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
530 ((looking-at "footnote\\s *{")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
531 (skip-chars-forward "^{") ;move onto `{'
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
532 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
533 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
534 (condition-case err
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
535 (forward-list 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
536 (error (error "\\\\footnote at point %s's brace not closed"
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
537 (point))))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
538 (1- (point)))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
539 ((looking-at "caption\\|\\(begin\\)")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
540 (skip-chars-forward "^{")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
541 (if (match-beginning 1) (forward-list 1))
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
542 ;;(setq boundary (concat YaTeX-ec-regexp "\\(begin\\|end\\)\\b"))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
543 (setq boundary
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
544 (save-excursion
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
545 (if (YaTeX-re-search-active-forward
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
546 (concat YaTeX-ec-regexp "\\(begin\\|end\\)\\b")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
547 r-escape nil 1)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
548 (match-beginning 0)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
549 (1- (point))))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
550 (t ))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
551 (if (save-excursion (skip-chars-forward " \t") (looking-at "%"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
552 (forward-line 1))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
553 (if (and (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
554 (YaTeX-re-search-active-forward
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
555 ;;(concat "\\(" labelholder "\\)\\|\\(" boundary "\\)")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
556 labelholder
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
557 (regexp-quote YaTeX-comment-prefix)
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
558 boundary 1))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
559 (match-beginning 0))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
560 ;; if \label{hoge} found, return it
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
561 (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
562 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
563 (goto-char (match-end 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
564 (skip-chars-forward "^{") (1+ (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
565 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
566 (forward-sexp 1) (1- (point))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
567 ;;else make a label
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
568 ;(goto-char (match-beginning 0))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
569 (goto-char boundary)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
570 (skip-chars-backward " \t\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
571 (save-excursion (setq newlabel (YaTeX::ref-generate-label)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
572 (delete-region (point) (progn (skip-chars-backward " \t") (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
573 (if mathp nil
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
574 (insert "\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
575 (YaTeX-reindent cc))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
576 (insert (format "\\label{%s}" newlabel))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
577 newlabel))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
578
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
579 (defvar YaTeX::ref-labeling-regexp-alist
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
580 '(("\\\\begin{java}{\\([^}]+\\)}" . 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
581 ("\\\\elabel{\\([^}]+\\)}" . 1)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
582 (defvar YaTeX::ref-labeling-regexp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
583 (mapconcat 'car YaTeX::ref-labeling-regexp-alist "\\|"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
584 (defvar YaTeX::ref-mathenv-regexp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
585 "equation\\|eqnarray\\|align\\|gather\\|alignat\\|xalignat")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
586 (defvar YaTeX::ref-enumerateenv-regexp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
587 "enumerate")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
588
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
589 (defvar YaTeX::ref-labeling-section-level 2
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
590 "*ref⊮ŎWZNVjOR}h̉x
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
591 YaTeX-sectioning-level̐lŎw.")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
592
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
593 (defun YaTeX::ref (argp &optional labelcmd refcmd)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
594 (setplist 'YaTeX::ref-labeling-regexp nil) ;erase memory cache
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
595 (require 'yatexsec)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
596 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
597 ((= argp 1)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
598 (let*((lnum 0) e0 x cmd label match-point point-list boundary
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
599 (buf (current-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
600 (llv YaTeX::ref-labeling-section-level)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
601 (mathenvs YaTeX::ref-mathenv-regexp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
602 (enums YaTeX::ref-enumerateenv-regexp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
603 (counter
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
604 (or labelcmd
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
605 (concat
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
606 YaTeX-ec-regexp "\\(\\("
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
607 (mapconcat
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
608 'concat
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
609 (delq nil
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
610 (mapcar
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
611 (function
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
612 (lambda (s)
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
613 (if (>= llv (cdr s))
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
614 (car s))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
615 YaTeX-sectioning-level))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
616 "\\|")
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
617 "\\|caption\\|footnote\\){"
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
618 "\\|\\(begin{\\(" mathenvs "\\|" enums "\\)\\)\\)")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
619 (regexp (concat "\\(" counter
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
620 "\\)\\|\\(" YaTeX::ref-labeling-regexp "\\)"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
621 (itemsep (concat YaTeX-ec-regexp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
622 "\\(\\(bib\\)?item\\|begin\\|end\\)"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
623 (refcmd (or refcmd "ref"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
624 (p (point)) initl line cf
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
625 (percent (regexp-quote YaTeX-comment-prefix))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
626 (output
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
627 (function
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
628 (lambda (label p)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
629 (while (setq x (string-match "\n" label))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
630 (aset label x ? ))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
631 (while (setq x (string-match "[ \t\n][ \t\n]+" label))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
632 (setq label (concat
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
633 (substring label 0 (1+ (match-beginning 0)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
634 (substring label (match-end 0)))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
635 (princ (format "%c: <<%s>>\n" (+ (% lnum 26) ?A) label))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
636 (setq point-list (cons p point-list))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
637 (message "Collecting labels... %d" lnum)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
638 (setq lnum (1+ lnum)))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
639 )
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
640 (message "Collecting labels...")
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
641 (save-window-excursion
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
642 (YaTeX-showup-buffer
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
643 YaTeX-label-buffer (function (lambda (x) (window-width x))))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
644 (if (fboundp 'select-frame) (setq cf (selected-frame)))
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
645 (if (eq (window-buffer (minibuffer-window)) buf)
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
646 (progn
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
647 (other-window 1)
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
648 (setq buf (current-buffer))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
649 (set-buffer buf)))
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
650 (save-excursion
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
651 (set-buffer (get-buffer-create YaTeX-label-buffer))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
652 (setq buffer-read-only nil)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
653 (erase-buffer))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
654 (save-excursion
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
655 (set-buffer buf)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
656 (goto-char (point-min))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
657 (let ((standard-output (get-buffer YaTeX-label-buffer)))
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
658 (princ (format "=== LABELS in [%s] ===\n" (buffer-name buf)))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
659 (while (YaTeX-re-search-active-forward
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
660 regexp ;;counter
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
661 percent nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
662 ;(goto-char (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
663 (setq e0 (match-end 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
664 (cond
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
665 ((YaTeX-literal-p) nil)
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
666 ((YaTeX-match-string 1)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
667 ;;if standard counter commands found
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
668 (setq cmd (YaTeX-match-string 2))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
669 (setq match-point (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
670 (or initl
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
671 (if (< p (point)) (setq initl lnum)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
672 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
673 ((string-match mathenvs cmd) ;;if matches mathematical env
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
674 ;(skip-chars-forward "} \t\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
675 (forward-line 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
676 (setq x (point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
677 (catch 'scan
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
678 (while (YaTeX-re-search-active-forward
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
679 (concat "\\\\\\\\$\\|\\\\end{\\(" mathenvs "\\)")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
680 percent nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
681 (let ((quit (match-beginning 1)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
682 (funcall output
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
683 (buffer-substring x (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
684 x)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
685 (if quit (throw 'scan t)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
686 (setq x (point))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
687 (setq e0 (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
688 ((string-match enums cmd)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
689 ;(skip-chars-forward "} \t\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
690 (save-restriction
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
691 (narrow-to-region
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
692 (point)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
693 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
694 (YaTeX-goto-corresponding-environment) (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
695 (forward-line 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
696 (while (YaTeX-re-search-active-forward
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
697 (concat YaTeX-ec-regexp "item\\s ")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
698 percent nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
699 (setq x (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
700 (funcall
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
701 output
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
702 (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
703 (match-beginning 0)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
704 (if (re-search-forward itemsep nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
705 (progn (goto-char (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
706 (skip-chars-backward " \t")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
707 (1- (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
708 (point-end-of-line)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
709 x))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
710
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
711 ((= (char-after (1- (point))) ?{)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
712 (setq label (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
713 (match-beginning 0)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
714 (progn (forward-char -1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
715 (forward-list 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
716 (point))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
717 (funcall output label match-point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
718 (t
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
719 (skip-chars-forward " \t")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
720 (setq label (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
721 (match-beginning 0)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
722 (if (re-search-forward
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
723 itemsep
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
724 nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
725 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
726 (goto-char (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
727 (skip-chars-backward " \t")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
728 (1- (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
729 (point-end-of-line))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
730 (funcall output label match-point)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
731 ))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
732 ) ;;put label buffer
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
733 ;;
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
734 ;; if user defined label found
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
735 (t
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
736 ;; memorize line number and label into property
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
737 (goto-char (match-beginning 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
738 (let ((list YaTeX::ref-labeling-regexp-alist)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
739 (cache (symbol-plist 'YaTeX::ref-labeling-regexp)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
740 (while list
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
741 (if (looking-at (car (car list)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
742 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
743 (setq label (YaTeX-match-string 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
744 (put 'YaTeX::ref-labeling-regexp lnum
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
745 (YaTeX-match-string (cdr (car list))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
746 (funcall output label 0) ;;0 is dummy, never used
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
747 (setq list nil)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
748 (setq list (cdr list))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
749 ))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
750 (goto-char e0))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
751 (princ YaTeX-label-menu-other)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
752 (princ YaTeX-label-menu-repeat)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
753 (princ YaTeX-label-menu-any)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
754 );standard-output
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
755 (goto-char p)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
756 (or initl (setq initl lnum))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
757 (message "Collecting labels...Done")
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
758 (if (fboundp 'select-frame) (select-frame cf))
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
759 (YaTeX-showup-buffer YaTeX-label-buffer nil t)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
760 (YaTeX::label-setup-key-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
761 (setq truncate-lines t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
762 (setq buffer-read-only t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
763 (use-local-map YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
764 (message YaTeX-label-guide-msg)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
765 (goto-line (1+ initl)) ;goto recently defined label line
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
766 (switch-to-buffer (current-buffer))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
767 (unwind-protect
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
768 (progn
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
769 (recursive-edit)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
770
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
771 (set-buffer (get-buffer YaTeX-label-buffer)) ;assertion
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
772 (beginning-of-line)
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
773 (setq line (1- (count-lines (point-min)(point))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
774 (cond
60
9e08ed569d80 yahtml: change keystroke of calling browser to [prefix] t p
yuuji
parents: 59
diff changeset
775 ((= line -1) (setq label ""))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
776 ((= line lnum) (setq label (YaTeX-label-other)))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
777 ((= line (1+ lnum))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
778 (save-excursion
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
779 (switch-to-buffer buf)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
780 (goto-char p)
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
781 (if (re-search-backward
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
782 (concat "\\\\" refcmd "{\\([^}]+\\)}") nil t)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
783 (setq label (YaTeX-match-string 1))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
784 (setq label ""))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
785 ((>= line (+ lnum 2))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
786 (setq label (read-string (format "\\%s{???}: " refcmd))))
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
787 (t ;(setq label (nth (- lnum line 1) label-list))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
788 (setq label
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
789 (or (get 'YaTeX::ref-labeling-regexp line)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
790 (YaTeX::ref-getset-label
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
791 buf (nth (- lnum line 1) point-list))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
792 )))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
793 (bury-buffer YaTeX-label-buffer)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
794 label)))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
795
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
796 (fset 'YaTeX::pageref 'YaTeX::ref)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
797
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
798 (defun YaTeX::cite-collect-bibs-external (&rest files)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
799 "Collect bibentry from FILES(variable length argument);
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
800 and print them to standard output."
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
801 ;;Thanks; http://icarus.ilcs.hokudai.ac.jp/comp/biblio.html
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
802 (let ((tb (get-buffer-create " *bibtmp*")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
803 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
804 (set-buffer tb)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
805 (while files
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
806 (erase-buffer)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
807 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
808 ((file-exists-p (car files))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
809 (insert-file-contents (car files)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
810 ((file-exists-p (concat (car files) ".bib"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
811 (insert-file-contents (concat (car files) ".bib"))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
812 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
813 (goto-char (point-min))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
814 (while (re-search-forward "^\\s *@[A-Za-z]" nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
815 (skip-chars-forward "^{,")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
816 (if (= (char-after (point)) ?{)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
817 (princ (format "%sbibitem{%s}%s\n"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
818 YaTeX-ec
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
819 (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
820 (1+ (point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
821 (progn (skip-chars-forward "^,\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
822 (point)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
823 (if (re-search-forward "title\\s *=" nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
824 (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
825 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
826 (goto-char (match-end 0))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
827 (skip-chars-forward " \t\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
828 (point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
829 (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
830 (if (looking-at "[{\"]")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
831 (forward-sexp 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
832 (forward-char 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
833 (skip-chars-forward "^,"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
834 (point)))))))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
835 (setq files (cdr files))))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
836
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
837 (defun YaTeX::cite-collect-bibs-internal ()
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
838 "Collect bibentry in the current buffer and print them to standard output."
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
839 (let ((ptn (concat YaTeX-ec-regexp "bibitem\\b"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
840 (pcnt (regexp-quote YaTeX-comment-prefix)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
841 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
842 (while (YaTeX-re-search-active-forward ptn pcnt nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
843 (skip-chars-forward "^{\n")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
844 (or (eolp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
845 (princ (format "%sbibitem{%s}\n"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
846 YaTeX-ec
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
847 (buffer-substring
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
848 (1+ (point))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
849 (progn (forward-sexp 1) (point))))))))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
850
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
851 (defun YaTeX::cite (argp)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
852 (cond
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
853 ((eq argp 1)
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
854 (let* ((cb (current-buffer))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
855 (f (file-name-nondirectory buffer-file-name))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
856 (d default-directory)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
857 (hilit-auto-highlight nil)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
858 (pcnt (regexp-quote YaTeX-comment-prefix))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
859 (bibrx (concat YaTeX-ec-regexp "bibliography{\\([^}]+\\)}"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
860 (bbuf (get-buffer-create " *bibitems*"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
861 (standard-output bbuf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
862 bibs files)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
863 (set-buffer bbuf)(erase-buffer)(set-buffer cb)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
864 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
865 (goto-char (point-min))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
866 ;;(1)search external bibdata
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
867 (while (YaTeX-re-search-active-forward bibrx pcnt nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
868 (apply 'YaTeX::cite-collect-bibs-external
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
869 (YaTeX-split-string
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
870 (YaTeX-match-string 1) ",")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
871 ;;(2)search direct \bibitem usage
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
872 (YaTeX::cite-collect-bibs-internal)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
873 (if (progn
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
874 (YaTeX-visit-main t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
875 (not (eq (current-buffer) cb)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
876 (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
877 (goto-char (point-min))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
878 ;;(1)search external bibdata
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
879 (while (YaTeX-re-search-active-forward bibrx pcnt nil t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
880 (apply 'YaTeX::cite-collect-bibs-external
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
881 (YaTeX-split-string
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
882 (YaTeX-match-string 1) ",")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
883 ;;(2)search internal
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
884 (YaTeX::cite-collect-bibs-internal)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
885 ;;Now bbuf holds the list of bibitem
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
886 (set-buffer bbuf)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
887 (YaTeX::ref argp "\\\\\\(bibitem\\)\\(\\[.*\\]\\)?" "cite"))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
888
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
889 (t nil)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
890
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
891 (and YaTeX-use-AMS-LaTeX (fset 'YaTeX::eqref 'YaTeX::ref))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
892
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
893 (defun YaTeX-yatex-buffer-list ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
894 (save-excursion
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
895 (delq nil (mapcar (function (lambda (buf)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
896 (set-buffer buf)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
897 (if (eq major-mode 'yatex-mode) buf)))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
898 (buffer-list)))))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
899
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
900 (defun YaTeX-select-other-yatex-buffer ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
901 "Select buffer from all yatex-mode's buffers interactivelly."
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
902 (interactive)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
903 (let ((lbuf "*YaTeX mode buffers*") (blist (YaTeX-yatex-buffer-list))
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
904 (lnum -1) buf rv
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
905 (ff "**find-file**"))
12
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
906 (YaTeX-showup-buffer
a7f397790cdc Revise YaTeX-typeset faster.
yuuji
parents: 11
diff changeset
907 lbuf (function (lambda (x) 1))) ;;Select next window surely.
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
908 (save-excursion
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
909 (set-buffer (get-buffer lbuf))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
910 (setq buffer-read-only nil)
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
911 (erase-buffer))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
912 (let ((standard-output (get-buffer lbuf)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
913 (while blist
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
914 (princ
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
915 (format "%c:{%s}\n" (+ (% (setq lnum (1+ lnum)) 26) ?A)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
916 (buffer-name (car blist))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
917 (setq blist (cdr blist)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
918 (princ (format "':{%s}" ff)))
59
48ac97a6b6ce Call drawing tools
yuuji
parents: 58
diff changeset
919 (YaTeX-showup-buffer lbuf nil t)
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
920 (YaTeX::label-setup-key-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
921 (setq buffer-read-only t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
922 (use-local-map YaTeX-label-select-map)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
923 (message YaTeX-label-guide-msg)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
924 (unwind-protect
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
925 (progn
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
926 (recursive-edit)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
927 (set-buffer lbuf)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
928 (beginning-of-line)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
929 (setq rv
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
930 (if (re-search-forward "{\\([^\\}]+\\)}" (point-end-of-line) t)
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
931 (buffer-substring (match-beginning 1) (match-end 1)) nil)))
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
932 (kill-buffer lbuf))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
933 (if (string= rv ff)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
934 (progn
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
935 (call-interactively 'find-file)
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
936 (current-buffer))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
937 rv)))
48
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
938
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
939 (defun YaTeX-label-other ()
a0640ff3f72f Inter-file ref/label, cite/bibitem jump.
yuuji
parents: 46
diff changeset
940 (let ((rv (YaTeX-select-other-yatex-buffer)))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
941 (cond
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
942 ((null rv) "")
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
943 (t
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
944 (set-buffer rv)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
945 (YaTeX::ref argp labelcmd refcmd)))))
11
390df0e505da Label completion works.
yuuji
parents: 8
diff changeset
946
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
947 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
948 ; completion for the arguments of \newcommand
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
949 ;;
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
950 (defun YaTeX::newcommand (&optional argp)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
951 (cond
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
952 ((= argp 1)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
953 (let ((command (read-string "Define newcommand: " "\\")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
954 (put 'YaTeX::newcommand 'command (substring command 1))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
955 command))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
956 ((= argp 2)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
957 (let ((argc
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
958 (string-to-int (read-string "Number of arguments(Default 0): ")))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
959 (def (read-string "Definition: "))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
960 (command (get 'YaTeX::newcommand 'command)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
961 ;;!!! It's illegal to insert string in the add-in function !!!
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
962 (if (> argc 0) (insert (format "[%d]" argc)))
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
963 (if (and (stringp command)
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
964 (string< "" command)
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
965 (y-or-n-p "Update dictionary?"))
18
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
966 (cond
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
967 ((= argc 0)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
968 (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
969 (list command)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
970 'singlecmd-table 'user-singlecmd-table 'tmp-singlecmd-table))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
971 ((= argc 1)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
972 (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
973 (list command)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
974 'section-table 'user-section-table 'tmp-section-table))
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
975 (t (YaTeX-update-table
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
976 (list command argc)
adc2f1472409 Make variables for temporary dictionary buffer-local.
yuuji
parents: 16
diff changeset
977 'section-table 'user-section-table 'tmp-section-table))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
978 (message "")
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
979 def ;return command name
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
980 ))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
981 (t "")))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
982
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
983 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
984 ; completion for the arguments of \pagestyle
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
985 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
986 (defun YaTeX::pagestyle (&optional argp)
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
987 "Read the pagestyle with completion."
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
988 (completing-read
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
989 "Page style: "
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
990 '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil)))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
991
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
992 (fset 'YaTeX::thispagestyle 'YaTeX::pagestyle)
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
993
16
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
994 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
995 ; completion for the arguments of \pagenumbering
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
996 ;;
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
997 (defun YaTeX::pagenumbering (&optional argp)
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
998 "Read the numbering style."
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
999 (completing-read
cb9afa9c1213 Auto-indentation at begin-type completion works correctly.
yuuji
parents: 14
diff changeset
1000 "Page numbering style: "
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1001 '(("arabic") ("Alpha") ("alpha") ("Roman") ("roman"))))
13
eafae54794a0 Show message at comment-region on begin/end mode.
yuuji
parents: 12
diff changeset
1002
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1003 ;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1004 ; Length
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1005 ;;
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1006 (defvar YaTeX:style-parameters-default
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1007 '(("\\arraycolsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1008 ("\\arrayrulewidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1009 ("\\baselineskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1010 ("\\columnsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1011 ("\\columnseprule")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1012 ("\\doublerulesep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1013 ("\\evensidemargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1014 ("\\footheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1015 ("\\footskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1016 ("\\headheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1017 ("\\headsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1018 ("\\itemindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1019 ("\\itemsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1020 ("\\labelsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1021 ("\\labelwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1022 ("\\leftmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1023 ("\\linewidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1024 ("\\listparindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1025 ("\\marginparsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1026 ("\\marginparwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1027 ("\\mathindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1028 ("\\oddsidemargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1029 ("\\parindent")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1030 ("\\parsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1031 ("\\parskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1032 ("\\partopsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1033 ("\\rightmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1034 ("\\tabcolsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1035 ("\\textheight")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1036 ("\\textwidth")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1037 ("\\topmargin")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1038 ("\\topsep")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1039 ("\\topskip")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1040 )
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1041 "Alist of LaTeX style parameters.")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1042 (defvar YaTeX:style-parameters-private nil
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1043 "*User definable alist of style parameters.")
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1044 (defvar YaTeX:style-parameters-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1045 "*User definable alist of local style parameters.")
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1046
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1047 (defvar YaTeX:length-history nil "Holds history of length.")
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
1048 (put 'YaTeX:length-history 'no-default t)
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1049 (defun YaTeX::setlength (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1050 "YaTeX add-in function for arguments of \\setlength."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1051 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1052 ((equal 1 argp)
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1053 ;;(completing-read "Length variable: " YaTeX:style-parameters nil nil "\\")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1054 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1055 "Length variable: "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1056 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1057 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1058 'YaTeX:style-parameters-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1059 nil nil "\\")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1060 )
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1061 ((equal 2 argp)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1062 (read-string-with-history "Length: " nil 'YaTeX:length-history))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1063
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1064 (fset 'YaTeX::addtolength 'YaTeX::setlength)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1065
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1066 (defun YaTeX::settowidth (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1067 "YaTeX add-in function for arguments of \\settowidth."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1068 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1069 ((equal 1 argp)
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1070 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1071 "Length variable: "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1072 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1073 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1074 'YaTeX:style-parameters-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1075 nil nil "\\"))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1076 ((equal 2 argp)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1077 (read-string "Text: "))))
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1078
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1079 (defun YaTeX::newlength (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1080 "YaTeX add-in function for arguments of \\newlength"
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1081 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1082 ((equal argp 1)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1083 (let ((length (read-string "Length variable: " "\\")))
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1084 (if (string< "" length)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1085 (YaTeX-update-table
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1086 (list length)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1087 'YaTeX:style-parameters-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1088 'YaTeX:style-parameters-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1089 'YaTeX:style-parameters-local))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1090 length))))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1091
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1092 ;; \multicolumn's arguments
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1093 (defun YaTeX::multicolumn (&optional argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1094 "YaTeX add-in function for arguments of \\multicolumn."
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1095 (cond
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1096 ((equal 1 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1097 (read-string "Number of columns: "))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1098 ((equal 2 argp)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1099 (let (c)
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1100 (while (not (string-match
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1101 (progn (message "Format(one of l,r,c): ")
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1102 (setq c (char-to-string (read-char))))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1103 "lrc")))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1104 c))
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1105 ((equal 3 argp)
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1106 (read-string "Item: "))))
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1107
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1108 (defvar YaTeX:documentstyles-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1109 '(("article") ("jarticle") ("j-article")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1110 ("book") ("jbook") ("j-book")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1111 ("report") ("jreport") ("j-report")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1112 ("letter") ("ascjletter"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1113 "List of LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1114 (defvar YaTeX:documentstyles-private nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1115 "*User defined list of LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1116 (defvar YaTeX:documentstyles-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1117 "*User defined list of local LaTeX documentstyles.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1118 (defvar YaTeX:documentstyle-options-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1119 '(("a4j") ("a5j") ("b4j") ("b5j")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1120 ("twocolumn") ("jtwocolumn") ("epsf") ("epsfig") ("epsbox") ("nfig"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1121 "List of LaTeX documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1122 (defvar YaTeX:documentstyle-options-private nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1123 "*User defined list of LaTeX documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1124 (defvar YaTeX:documentstyle-options-local nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1125 "List of LaTeX local documentstyle options.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1126
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1127 (defvar YaTeX-minibuffer-completion-map nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1128 "Minibuffer completion key map that allows comma completion.")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1129 (if YaTeX-minibuffer-completion-map nil
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1130 (setq YaTeX-minibuffer-completion-map
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1131 (copy-keymap minibuffer-local-completion-map))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1132 (define-key YaTeX-minibuffer-completion-map " "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1133 'YaTeX-minibuffer-complete)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1134 (define-key YaTeX-minibuffer-completion-map "\t"
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1135 'YaTeX-minibuffer-complete))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1136
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1137 (defun YaTeX:documentstyle ()
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1138 (let*((delim ",")
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1139 (dt (append YaTeX:documentstyle-options-local
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1140 YaTeX:documentstyle-options-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1141 YaTeX:documentstyle-options-default))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1142 (minibuffer-completion-table dt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1143 (opt (read-from-minibuffer
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1144 "Style options ([opt1,opt2,...]): "
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
1145 nil YaTeX-minibuffer-completion-map nil))
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1146 (substr opt) o)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1147 (if (string< "" opt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1148 (progn
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1149 (while substr
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1150 (setq o (substring substr 0 (string-match delim substr)))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1151 (or (assoc o dt)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1152 (YaTeX-update-table
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1153 (list o)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1154 'YaTeX:documentstyle-options-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1155 'YaTeX:documentstyle-options-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1156 'YaTeX:documentstyle-options-local))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1157 (setq substr
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1158 (if (string-match delim substr)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1159 (substring substr (1+ (string-match delim substr))))))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1160 (concat "[" opt "]"))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1161 "")))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1162
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1163 (defun YaTeX::documentstyle (&optional argp)
51
b0371b6ed799 Created `ChangeLog'.
yuuji
parents: 49
diff changeset
1164 "YaTeX add-in function for arguments of \\documentstyle."
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1165 (cond
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1166 ((equal argp 1)
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1167 (setq YaTeX-env-name "document")
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1168 (let ((sname
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1169 (YaTeX-cplread-with-learning
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1170 (format "Documentstyle (default %s): "
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1171 YaTeX-default-document-style)
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1172 'YaTeX:documentstyles-default
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1173 'YaTeX:documentstyles-private
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1174 'YaTeX:documentstyles-local)))
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1175 (if (string= "" sname) (setq sname YaTeX-default-document-style))
69
807c1e7e68b7 yahtml-escape-chars-region
yuuji
parents: 68
diff changeset
1176 (setq YaTeX-default-document-style sname)))))
49
eb0512bfcb7f Abolish user-article table.
yuuji
parents: 48
diff changeset
1177
57
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1178 ;;; -------------------- LaTeX2e stuff --------------------
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1179 (defvar YaTeX:documentclass-options-default
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1180 '(("a4paper") ("a5paper") ("b4paper") ("b5paper") ("10pt") ("11pt") ("12pt")
57
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1181 ("latterpaper") ("legalpaper") ("executivepaper") ("landscape")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1182 ("oneside") ("twoside") ("draft") ("final") ("leqno") ("fleqn") ("openbib")
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1183 ("tombow") ("titlepage") ("notitlepage") ("dvips")
57
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1184 ("clock") ;for slides class only
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1185 )
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1186 "Default options list for documentclass")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1187 (defvar YaTeX:documentclass-options-private nil
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1188 "*User defined options list for documentclass")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1189 (defvar YaTeX:documentclass-options-local nil
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1190 "*User defined options list for local documentclass")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1191
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1192 (defun YaTeX:documentclass ()
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1193 (let*((delim ",")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1194 (dt (append YaTeX:documentclass-options-local
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1195 YaTeX:documentclass-options-private
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1196 YaTeX:documentclass-options-default))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1197 (minibuffer-completion-table dt)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1198 (opt (read-from-minibuffer
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1199 "Documentclass options ([opt1,opt2,...]): "
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1200 nil YaTeX-minibuffer-completion-map nil))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1201 (substr opt) o)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1202 (if (string< "" opt)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1203 (progn
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1204 (while substr
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1205
57
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1206 (setq o (substring substr 0 (string-match delim substr)))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1207 (or (assoc o dt)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1208 (YaTeX-update-table
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1209 (list o)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1210 'YaTeX:documentclass-options-default
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1211 'YaTeX:documentclass-options-private
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1212 'YaTeX:documentclass-options-local))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1213 (setq substr
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1214 (if (string-match delim substr)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1215 (substring substr (1+ (string-match delim substr))))))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1216 (concat "[" opt "]"))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1217 "")))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1218
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1219 (defvar YaTeX:documentclasses-default
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1220 '(("article") ("jarticle") ("report") ("jreport") ("book") ("jbook")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1221 ("j-article") ("j-report") ("j-book")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1222 ("letter") ("slides") ("ltxdoc") ("ltxguide") ("ltnews") ("proc"))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1223 "Default documentclass alist")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1224 (defvar YaTeX:documentclasses-private nil
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1225 "*User defined documentclass alist")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1226 (defvar YaTeX:documentclasses-local nil
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1227 "*User defined local documentclass alist")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1228 (defvar YaTeX-default-documentclass (if YaTeX-japan "jarticle" "article")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1229 "*Default documentclass")
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1230
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1231 (defun YaTeX::documentclass (&optional argp)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1232 (cond
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1233 ((equal argp 1)
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1234 (setq YaTeX-env-name "document")
57
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1235 (let ((sname
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1236 (YaTeX-cplread-with-learning
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1237 (format "Documentclass (default %s): " YaTeX-default-documentclass)
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1238 'YaTeX:documentclasses-default
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1239 'YaTeX:documentclasses-private
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1240 'YaTeX:documentclasses-local)))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1241 (if (string= "" sname) (setq sname YaTeX-default-documentclass))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1242 (setq YaTeX-default-documentclass sname)))))
18f4939986e6 (j)LaTeX2e supported
yuuji
parents: 53
diff changeset
1243
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1244 (defvar YaTeX:latex2e-named-color-alist
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1245 '(("GreenYellow") ("Yellow") ("Goldenrod") ("Dandelion") ("Apricot")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1246 ("Peach") ("Melon") ("YellowOrange") ("Orange") ("BurntOrange")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1247 ("Bittersweet") ("RedOrange") ("Mahogany") ("Maroon") ("BrickRed")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1248 ("Red") ("OrangeRed") ("RubineRed") ("WildStrawberry") ("Salmon")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1249 ("CarnationPink") ("Magenta") ("VioletRed") ("Rhodamine") ("Mulberry")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1250 ("RedViolet") ("Fuchsia") ("Lavender") ("Thistle") ("Orchid")("DarkOrchid")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1251 ("Purple") ("Plum") ("Violet") ("RoyalPurple") ("BlueViolet")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1252 ("Periwinkle") ("CadetBlue") ("CornflowerBlue") ("MidnightBlue")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1253 ("NavyBlue") ("RoyalBlue") ("Blue") ("Cerulean") ("Cyan") ("ProcessBlue")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1254 ("SkyBlue") ("Turquoise") ("TealBlue") ("Aquamarine") ("BlueGreen")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1255 ("Emerald") ("JungleGreen") ("SeaGreen") ("Green") ("ForestGreen")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1256 ("PineGreen") ("LimeGreen") ("YellowGreen") ("SpringGreen") ("OliveGreen")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1257 ("RawSienna") ("Sepia") ("Brown") ("Tan") ("Gray") ("Black") ("White"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1258 "Colors defined in $TEXMF/tex/plain/colordvi.tex")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1259
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1260 (defvar YaTeX:latex2e-basic-color-alist
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1261 '(("black") ("white") ("red") ("blue") ("yellow") ("green") ("cyan")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1262 ("magenta"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1263 "Basic colors")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1264
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1265 (defun YaTeX:textcolor ()
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1266 "Add-in for \\color's option"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1267 (if (y-or-n-p "Use `named' color? ")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1268 "[named]"))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1269
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1270 (defun YaTeX::color-completing-read (prompt)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1271 (let ((completion-ignore-case t)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1272 (namedp (save-excursion
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1273 (skip-chars-backward "^\n\\[\\\\")
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1274 (looking-at "named"))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1275 (completing-read
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1276 prompt
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1277 (if namedp
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1278 YaTeX:latex2e-named-color-alist
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1279 YaTeX:latex2e-basic-color-alist)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1280 nil t)))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1281
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1282 (defun YaTeX::textcolor (argp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1283 "Add-in for \\color's argument"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1284 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1285 ((= argp 1) (YaTeX::color-completing-read "Color: "))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1286 ((= argp 2) (read-string "Colored string: "))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1287
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1288 (fset 'YaTeX:color 'YaTeX:textcolor)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1289 (fset 'YaTeX::color 'YaTeX::textcolor)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1290 (fset 'YaTeX:colorbox 'YaTeX:textcolor)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1291 (fset 'YaTeX::colorbox 'YaTeX::textcolor)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1292 (fset 'YaTeX:fcolorbox 'YaTeX:textcolor)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1293
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1294 (defun YaTeX::fcolorbox (argp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1295 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1296 ((= argp 1) (YaTeX::color-completing-read "Frame color: "))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1297 ((= argp 2) (YaTeX::color-completing-read "Inner color: "))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1298 ((= argp 3) (read-string "Colored string: "))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1299
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1300 (defun YaTeX:scalebox ()
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1301 "Add-in for \\rotatebox"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1302 (let ((vmag (read-string (if YaTeX-japan "{: " "Magnification: ")))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1303 (hmag (read-string (if YaTeX-japan "{(ȗ): "
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1304 "Horizontal magnification(Optional): "))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1305 (if (and hmag (string< "" hmag))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1306 (format "{%s}[%s]" vmag hmag)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1307 (format "{%s}" vmag))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1308
73
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1309 (defun YaTeX:includegraphics ()
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1310 "Add-in for \\includegraphics's option"
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1311 (let (width height (scale "") angle str)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1312 (setq width (read-string "Width: ")
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1313 height (read-string "Height: "))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1314 (or (string< width "") (string< "" height)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1315 (setq scale (read-string "Scale: ")))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1316 (setq angle (read-string "Angle(0-359): "))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1317 (setq str
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1318 (mapconcat
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1319 'concat
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1320 (delq nil
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1321 (mapcar '(lambda (s)
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1322 (and (stringp (symbol-value s))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1323 (string< "" (symbol-value s))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1324 (format "%s=%s" s (symbol-value s))))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1325 '(width height scale angle)))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1326 ","))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1327 (if (string= "" str) ""
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1328 (concat "[" str "]"))))
f41b01fef5d6 Stable version(hope to be)
yuuji
parents: 72
diff changeset
1329
70
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1330 (defun YaTeX::includegraphics (argp)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1331 "Add-in for \\includegraphics"
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1332 (cond
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1333 ((= argp 1)
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1334 (read-file-name "EPS File: " ""))))
44e3a5e1e883 Fix makefile for Windows
yuuji
parents: 69
diff changeset
1335
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1336 (defun YaTeX:caption ()
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1337 (setq YaTeX-section-name "label")
68
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1338 nil)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1339
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1340 ;;; -------------------- math-mode stuff --------------------
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1341 (defun YaTeX::tilde (&optional pos)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1342 "For accent macros in mathmode"
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1343 (cond
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1344 ((equal pos 1)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1345 (message "Put accent on variable: ")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1346 (let ((v (char-to-string (read-char))) (case-fold-search nil))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1347 (message "")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1348 (cond
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1349 ((string-match "i\\|j" v)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1350 (concat "\\" v "math"))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1351 ((string-match "[\r\n\t ]" v)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1352 "")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1353 (t v))))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1354 (nil "")))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1355
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1356 (fset 'YaTeX::hat 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1357 (fset 'YaTeX::check 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1358 (fset 'YaTeX::bar 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1359 (fset 'YaTeX::dot 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1360 (fset 'YaTeX::ddot 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1361 (fset 'YaTeX::vec 'YaTeX::tilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1362
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1363 (defun YaTeX::widetilde (&optional pos)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1364 "For multichar accent macros in mathmode"
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1365 (cond
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1366 ((equal pos 1)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1367 (let ((m "Put over chars[%s ]: ") v v2)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1368 (message m " ")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1369 (setq v (char-to-string (read-char)))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1370 (message "")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1371 (if (string-match "[\r\n\t ]" v)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1372 ""
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1373 (message m v)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1374 (setq v2 (char-to-string (read-char)))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1375 (message "")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1376 (if (string-match "[\r\n\t ]" v2)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1377 v
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1378 (concat v v2)))))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1379 (nil "")))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1380
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1381 (fset 'YaTeX::widehat 'YaTeX::widetilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1382 (fset 'YaTeX::overline 'YaTeX::widetilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1383 (fset 'YaTeX::overrightarrow 'YaTeX::widetilde)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1384
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1385
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1386 ;;;
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1387 ;; Add-in functions for large-type command.
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1388 ;;;
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1389 (defun YaTeX:em ()
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1390 (cond
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1391 ((eq YaTeX-current-completion-type 'large) "\\/")
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1392 (t nil)))
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1393 (fset 'YaTeX:it 'YaTeX:em)
0eb6997bee16 More adjustment for Emacs20 and XEmacs
yuuji
parents: 64
diff changeset
1394
23
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1395 ;;; -------------------- End of yatexadd --------------------
b00c74813e56 Change the YaTeX-math-mode's prefix from `,' to `;'.
yuuji
parents: 18
diff changeset
1396 (provide 'yatexadd)
72
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1397 ; Local variables:
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1398 ; fill-prefix: ";;; "
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1399 ; paragraph-start: "^$\\| \\|;;;$"
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1400 ; paragraph-separate: "^$\\| \\|;;;$"
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1401 ; buffer-file-coding-system: sjis
0aaebd07dad0 Support font-lock on XEmacs-21, Emacs-20, Emacs-21.
yuuji
parents: 70
diff changeset
1402 ; End:

yatex.org