Mercurial > hgrepos > hgweb.cgi > yatex
annotate yatexpkg.el @ 564:71697ec66240 dev
Auto-usepackage assumes amsart, amsbook and amsproc same as amsmath
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Thu, 24 Jan 2019 08:03:47 +0900 |
parents | a6c72ad6445a |
children | 6c09561c22f0 |
rev | line source |
---|---|
395 | 1 ;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*- |
287 | 2 ;;; |
510
7a64b7761d6b
Add completion set for "\includesvg"
HIROSE Yuuji <yuuji@gentei.org>
parents:
497
diff
changeset
|
3 ;;; (c)2003-2018 by HIROSE, Yuuji [yuuji@yatex.org] |
564
71697ec66240
Auto-usepackage assumes amsart, amsbook and amsproc same as amsmath
HIROSE Yuuji <yuuji@gentei.org>
parents:
554
diff
changeset
|
4 ;;; Last modified Thu Jan 24 08:00:20 2019 on firestorm |
366 | 5 ;;; $Id$ |
78 | 6 |
287 | 7 ;;; Code: |
80 | 8 (defvar YaTeX-package-ams-envs |
9 (mapcar 'car YaTeX-ams-env-table)) | |
10 | |
78 | 11 (defvar YaTeX-package-alist-default |
193 | 12 '(("version" (env "comment") ;by tsuchiya<at>pine.kuee.kyoto-u.ac.jp |
79
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
13 (section "includeversion" "excludeversion")) |
78 | 14 |
193 | 15 ("plext" (section "bou")) ;by yas.axis<at>ma.mni.ne.jp |
78 | 16 |
193 | 17 ("url" (section "url")) ;by fujieda<at>jaist.ac.jp |
78 | 18 |
19 ("fancybox" (section "shadowbox" "doublebox" "ovalbox" "Ovalbox")) | |
80 | 20 ("slashbox" (section "slashbox" "backslashbox")) |
78 | 21 ("pifont" (section "ding")) |
22 ("longtable" (env "longtable")) | |
23 ("ascmac" (env "screen" "boxnote" "shadebox" "itembox") | |
24 (maketitle "return" "Return" "yen") | |
79
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
25 (section "keytop") ("mask") ("maskbox")) |
193 | 26 ("bm" (section "bm")) ;by aoyama<at>le.chiba-u.ac.jp |
78 | 27 |
28 ("alltt" (env "alltt")) | |
29 ("misc" (section "verbfile" "listing")) | |
441
564510b9caca
Add verbatim package for verbatiminput macro
HIROSE Yuuji <yuuji@gentei.org>
parents:
418
diff
changeset
|
30 ("verbatim" (section "verbatiminput")) |
80 | 31 ("eclbkbox" (env "breakbox")) |
32 ("supertabular" (env "supertabular")) | |
33 ("amsmath" (env . YaTeX-package-ams-envs) | |
34 (section "tag" "tag*")) | |
564
71697ec66240
Auto-usepackage assumes amsart, amsbook and amsproc same as amsmath
HIROSE Yuuji <yuuji@gentei.org>
parents:
554
diff
changeset
|
35 ("amsart" (same-as . "amsmath")) |
71697ec66240
Auto-usepackage assumes amsart, amsbook and amsproc same as amsmath
HIROSE Yuuji <yuuji@gentei.org>
parents:
554
diff
changeset
|
36 ("amsbook" (same-as . "amsmath")) |
71697ec66240
Auto-usepackage assumes amsart, amsbook and amsproc same as amsmath
HIROSE Yuuji <yuuji@gentei.org>
parents:
554
diff
changeset
|
37 ("amsproc" (same-as . "amsmath")) |
134 | 38 ("amssymb" (maketitle "leqq" "geqq" "mathbb" "mathfrak" |
305
53709ee88448
Add \because and \therefore to math-image completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
304
diff
changeset
|
39 "fallingdotseq" "therefore" "because" |
460
1790e0d35156
Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents:
456
diff
changeset
|
40 "varDelta" "varTheta" "varLambda" "varXi" "varPi" |
1790e0d35156
Capitalized varGREEK with amssymb, added
HIROSE Yuuji <yuuji@gentei.org>
parents:
456
diff
changeset
|
41 "varSigma" "varUpsilon" "varPhi" "varPsi" "varOmega" |
134 | 42 "lll" "ggg")) ;very few. Please tell us! |
456 | 43 ("mathrsfs" (section "mathscr")) |
80 | 44 ("graphicx" (section "includegraphics" |
45 "rotatebox" "scalebox" "resizebox" "reflectbox") | |
46 (option . YaTeX-package-graphics-driver-alist)) | |
516 | 47 ("svg" (section "includesvg")) |
80 | 48 ("color" (section "textcolor" "colorbox" "pagecolor" "color") |
303
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
49 (option . YaTeX-package-graphics-driver-alist) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
50 (default-option . "usenames,dvipsnames")) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
51 ("xcolor" (same-as . "color")) |
80 | 52 ("ulem" (section "uline" "uuline" "uwave") |
53 (option ("normalem"))) | |
312 | 54 ("multicol" (env "multicols")) |
314
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
55 ("cref" (section "cleveref")) |
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
56 ("crefrange" (same-as . "cref")) |
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
57 ("cpageref" (same-as . "cref")) |
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
58 ("labelcref" (same-as . "cref")) |
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
59 ("labelcpageref" (same-as . "cref")) |
346 | 60 ("wrapfig" (env "wrapfigure" "wraptable")) |
418 | 61 ("setspace" (env "spacing") (section "setstretch")) |
449
c2c547e147c7
YaTeX-math-other-env-alist-* for additional math-environments
HIROSE Yuuji <yuuji@gentei.org>
parents:
443
diff
changeset
|
62 ("cases" (env "numcases" "subnumcases")) |
551
e7356faf50df
Add completion stuff of \subfigure{}.
HIROSE Yuuji <yuuji@gentei.org>
parents:
516
diff
changeset
|
63 ("subfigure" (section "subfigure")) |
554
a6c72ad6445a
Add \ruby{}{} completion with okumacro package
HIROSE Yuuji <yuuji@gentei.org>
parents:
553
diff
changeset
|
64 ("okumacro" (section "ruby" "kenten")) |
314
fae84a98372c
("crefrange") ("cpageref") ("labelcref") ("labelcpageref") for cleveref
HIROSE Yuuji <yuuji@gentei.org>
parents:
313
diff
changeset
|
65 ) |
79
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
66 "Default package vs. macro list. |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
67 Alists contains '(PACKAGENAME . MACROLIST) |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
68 PACKAGENAME Basename of package(String). |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
69 MACROLIST List of '(TYPE . MACROS) |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
70 TYPE One of 'env, 'section or 'maketitle according to completion-type |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
71 MACROS List of macros |
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
72 |
80 | 73 If TYPE is 'option, its cdr is alist of completion candidates for that |
74 package. Its cdr can be a symbol whose value is alist. | |
75 | |
79
0734be649cb8
Do not care file-coding-system when YaTeX-kanji-code is nil.
yuuji
parents:
78
diff
changeset
|
76 An good example is the value of YaTeX-package-alist-default.") |
78 | 77 |
80 | 78 (defvar YaTeX-package-graphics-driver-alist |
303
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
79 '(("dvips") ("dvipsnames") ("usenames") |
333
30a8f68abe0a
Supply `dvipdfmx' completion instead of `dvipdf'
HIROSE Yuuji <yuuji@gentei.org>
parents:
314
diff
changeset
|
80 ("xdvi") ("dvipdfmx") ("pdftex") ("dvipsone") ("dviwindo") |
80 | 81 ("emtex") ("dviwin") ("oztex") ("textures") ("pctexps") ("pctexwin") |
82 ("pctexhp") ("pctex32") ("truetex") ("tcidvi") ("vtex")) | |
553 | 83 "Drivers alist of graphics/color stylefile's supporting devices. |
80 | 84 This list is taken from |
85 %% graphics.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz | |
86 %% Copyright (C) 1995 1996 1997 1998 David Carlisle | |
87 as of 2004/1/19. Thanks.") | |
88 | |
78 | 89 (defvar YaTeX-package-alist-private nil |
90 "*User defined package vs. macro list. See also YaTeX-package-alist-default") | |
91 | |
92 (defun YaTeX-package-lookup (macro &optional type) | |
93 "Look up a package which contains a definition of MACRO. | |
94 Optional second argument TYPE limits the macro type. | |
95 TYPE is a symbol, one of 'env, 'section, 'maketitle." | |
96 (let ((list (append YaTeX-package-alist-private YaTeX-package-alist-default)) | |
304
a57f4c74179a
(yatexpkg)YaTeX-package-lookup sees 'same-as entry.
HIROSE Yuuji <yuuji@gentei.org>
parents:
303
diff
changeset
|
97 origlist element x sameas val pkg pkglist r) |
a57f4c74179a
(yatexpkg)YaTeX-package-lookup sees 'same-as entry.
HIROSE Yuuji <yuuji@gentei.org>
parents:
303
diff
changeset
|
98 (setq origlist list) |
78 | 99 (while list |
100 (setq element (car list) | |
101 pkg (car element) | |
102 element (cdr element)) | |
304
a57f4c74179a
(yatexpkg)YaTeX-package-lookup sees 'same-as entry.
HIROSE Yuuji <yuuji@gentei.org>
parents:
303
diff
changeset
|
103 (if (setq sameas (assq 'same-as element)) ;non-recursive retrieval |
a57f4c74179a
(yatexpkg)YaTeX-package-lookup sees 'same-as entry.
HIROSE Yuuji <yuuji@gentei.org>
parents:
303
diff
changeset
|
104 (setq element (cdr (assoc (cdr sameas) origlist)))) |
78 | 105 (if (setq r (catch 'found |
106 (while element | |
80 | 107 (setq x (car element) |
108 val (cdr x)) | |
109 (if (symbolp val) (setq val (symbol-value val))) | |
110 (and (or (null type) | |
78 | 111 (eq type (car x))) |
80 | 112 (YaTeX-member macro val) |
78 | 113 (throw 'found (car x))) ;car x is type |
114 (setq element (cdr element))))) | |
115 (setq pkglist (cons (cons pkg r) pkglist))) | |
116 (setq list (cdr list))) | |
117 pkglist)) | |
118 | |
303
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
119 (defun YaTeX-package-option-lookup (pkg &optional key) |
80 | 120 "Look up options for specified pkg and returne them in alist form. |
303
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
121 Just only associng against the alist of YaTeX-package-alist-*" |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
122 (let*((list (append YaTeX-package-alist-private YaTeX-package-alist-default)) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
123 (l (cdr (assq (or key 'option) (assoc pkg list)))) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
124 (recur (cdr (assq 'same-as (assoc pkg list))))) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
125 (cond |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
126 (recur (YaTeX-package-option-lookup recur key)) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
127 ((symbolp l) (symbol-value l)) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
128 (t l)))) |
80 | 129 |
78 | 130 (defvar YaTeX-package-resolved-list nil |
131 "List of macros whose package is confirmed to be loaded.") | |
132 | |
356
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
133 (defun YaTeX-package-auto-usepackage (macro type &optional autopkg autoopt) |
78 | 134 "(Semi)Automatically add the \\usepackage line to main-file. |
356
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
135 Search the usepackage for MACRO of the TYPE. |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
136 Optional second and third argument AUTOPKG, AUTOOPT are selected |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
137 without query. Thus those two argument (Full)automatically add |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
138 a \\usepackage line." |
78 | 139 (let ((cb (current-buffer)) |
140 (wc (current-window-configuration)) | |
141 (usepackage (concat YaTeX-ec "usepackage")) | |
80 | 142 (pkglist (YaTeX-package-lookup macro type)) |
78 | 143 (usepkgrx (concat |
144 YaTeX-ec-regexp | |
145 "\\(usepackage\\|include\\)\\b")) | |
353
2a72779d9c50
Rewrite lambda notations to suppress annoying warnings from emacs24
HIROSE Yuuji <yuuji@gentei.org>
parents:
346
diff
changeset
|
146 (register (function |
2a72779d9c50
Rewrite lambda notations to suppress annoying warnings from emacs24
HIROSE Yuuji <yuuji@gentei.org>
parents:
346
diff
changeset
|
147 (lambda () (set-buffer cb) |
78 | 148 (set (make-local-variable 'YaTeX-package-resolved-list) |
353
2a72779d9c50
Rewrite lambda notations to suppress annoying warnings from emacs24
HIROSE Yuuji <yuuji@gentei.org>
parents:
346
diff
changeset
|
149 (cons macro YaTeX-package-resolved-list))))) |
78 | 150 (begdoc (concat YaTeX-ec "begin{document}")) |
80 | 151 pb pkg optlist (option "") mb0 uspkgargs) |
78 | 152 (if (or (YaTeX-member macro YaTeX-package-resolved-list) |
153 (null pkglist)) | |
154 nil ;nothing to do | |
155 ;; Search `usepackage' into main-file | |
156 (YaTeX-visit-main t) ;set buffer to parent file | |
157 (setq pb (current-buffer)) | |
158 (save-excursion | |
159 (save-restriction | |
160 (if (catch 'found | |
161 (goto-char (point-min)) | |
162 (YaTeX-search-active-forward ;if search fails, goto eob | |
163 begdoc YaTeX-comment-prefix nil 1) | |
80 | 164 (while ;(YaTeX-re-search-active-backward |
165 ;usepkgrx YaTeX-comment-prefix nil t) | |
166 ;;allow commented out \usepackages 2004/3/16 | |
167 (re-search-backward usepkgrx nil t) | |
78 | 168 (setq mb0 (match-beginning 0)) |
169 (skip-chars-forward "^{") | |
80 | 170 (setq uspkgargs (YaTeX-buffer-substring |
171 (point) | |
172 (progn | |
173 ;;(forward-list 1) is more precise, | |
174 ;; but higher risk. | |
175 (skip-chars-forward "^}\n")(point)))) | |
78 | 176 (let ((pl pkglist)) |
177 (while pl ;(car pl)'s car is package, cdr is type | |
80 | 178 (if (string-match |
179 (concat "[{,]\\s *" | |
180 (regexp-quote (car (car pl))) | |
181 "\\>") | |
182 uspkgargs) | |
78 | 183 (throw 'found t)) |
184 (setq pl (cdr pl))) | |
185 (goto-char mb0)))) | |
186 ;;corresponding \usepackage found | |
187 (funcall register) | |
188 ;; not found, insert it. | |
356
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
189 (if (or |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
190 autopkg |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
191 (y-or-n-p |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
192 (format "`%s' requires package. Put \\usepackage now?" |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
193 macro))) |
78 | 194 (progn |
80 | 195 (require 'yatexadd) |
78 | 196 (setq pkg |
356
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
197 (or autopkg |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
198 (completing-read |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
199 "Load which package?(TAB for list): " |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
200 pkglist nil nil |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
201 ;;initial input |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
202 (if (= (length pkglist) 1) |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
203 (let ((w (car (car pkglist)))) |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
204 (if YaTeX-emacs-19 (cons w 0) w))))) |
80 | 205 optlist |
206 (YaTeX-package-option-lookup pkg)) | |
207 (if optlist | |
208 (let ((minibuffer-completion-table optlist) | |
303
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
209 (delim ",") (w (car (car optlist))) |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
210 (dflt (YaTeX-package-option-lookup |
13a62b7c8354
(yatexpkg)Add default option for package completion.
HIROSE Yuuji <yuuji@gentei.org>
parents:
294
diff
changeset
|
211 pkg 'default-option))) |
80 | 212 (setq option |
356
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
213 (or |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
214 autoopt |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
215 (read-from-minibuffer |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
216 (format "Any option for {%s}?: " pkg) |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
217 (let ((v (or dflt |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
218 (and (= (length optlist) 1) w)))) |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
219 (and v (if YaTeX-emacs-19 (cons v 0) v))) |
af0bd0f86b27
Now YaTeX-package-auto-usepackage can insert aline full-automaticaly
HIROSE Yuuji <yuuji@gentei.org>
parents:
353
diff
changeset
|
220 YaTeX-minibuffer-completion-map)) |
80 | 221 option (if (string< "" option) |
222 (concat "[" option "]") | |
223 "")))) | |
78 | 224 (set-buffer pb) |
225 (goto-char (point-min)) | |
226 (if (YaTeX-re-search-active-forward | |
227 (concat YaTeX-ec-regexp | |
228 "document\\(style\\|class\\){") | |
229 YaTeX-comment-prefix nil t) | |
230 (forward-line 1)) | |
231 (if (YaTeX-search-active-forward | |
232 begdoc YaTeX-comment-prefix nil t) | |
233 (goto-char (match-beginning 0))) | |
234 (insert | |
235 usepackage | |
80 | 236 (format "%s{%s}\t%% required for `\\%s' (yatex added)\n" |
237 option pkg macro)) | |
78 | 238 (funcall register)) |
120
8772bd5d1f02
Do not ask again when user answer n to usepackage addition.
yuuji@gentei.org
parents:
80
diff
changeset
|
239 (funcall register) |
78 | 240 (message "Don't forget to put \\usepackage{%s} yourself later" |
241 (car (car pkglist)))) ;doing car car is negligence... | |
242 )))))) |