1 /* $NetBSD: cmds.c,v 1.1.1.6 2008/09/02 07:50:24 christos Exp $ */
3 /* cmds.c -- Texinfo commands.
4 Id: cmds.c,v 1.55 2004/12/14 00:15:36 karl Exp
6 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
29 #include "insertion.h"
34 #include "sectioning.h"
45 static void cm_exampleindent (void),
46 cm_firstparagraphindent (void),
47 cm_paragraphindent (void),
51 static void cm_obsolete (int arg
, int start
, int end
),
52 not_fixed_width (int arg
);
54 /* The dispatch table. */
55 COMMAND command_table
[] = {
56 { "\t", insert_space
, NO_BRACE_ARGS
},
57 { "\n", insert_space
, NO_BRACE_ARGS
},
58 { " ", insert_space
, NO_BRACE_ARGS
},
59 { "!", cm_punct
, NO_BRACE_ARGS
},
60 { "\"", cm_accent_umlaut
, MAYBE_BRACE_ARGS
},
61 { "'", cm_accent_acute
, MAYBE_BRACE_ARGS
},
62 { "*", cm_asterisk
, NO_BRACE_ARGS
},
63 { ",", cm_accent_cedilla
, MAYBE_BRACE_ARGS
},
64 { "-", cm_no_op
, NO_BRACE_ARGS
},
65 { ".", cm_punct
, NO_BRACE_ARGS
},
66 { "/", cm_no_op
, NO_BRACE_ARGS
},
67 { ":", cm_colon
, NO_BRACE_ARGS
},
68 { "=", cm_accent
, MAYBE_BRACE_ARGS
},
69 { "?", cm_punct
, NO_BRACE_ARGS
},
70 { "@", insert_self
, NO_BRACE_ARGS
},
71 { "\\", insert_self
, NO_BRACE_ARGS
},
72 { "^", cm_accent_hat
, MAYBE_BRACE_ARGS
},
73 { "`", cm_accent_grave
, MAYBE_BRACE_ARGS
},
74 { "{", insert_self
, NO_BRACE_ARGS
},
75 { "|", cm_no_op
, NO_BRACE_ARGS
},
76 { "}", insert_self
, NO_BRACE_ARGS
},
77 { "~", cm_accent_tilde
, MAYBE_BRACE_ARGS
},
78 { "AA", cm_special_char
, BRACE_ARGS
},
79 { "AE", cm_special_char
, BRACE_ARGS
},
80 { "H", cm_accent
, MAYBE_BRACE_ARGS
},
81 { "L", cm_special_char
, BRACE_ARGS
},
82 { "LaTeX", cm_LaTeX
, BRACE_ARGS
},
83 { "O", cm_special_char
, BRACE_ARGS
},
84 { "OE", cm_special_char
, BRACE_ARGS
},
85 { "TeX", cm_TeX
, BRACE_ARGS
},
86 { "aa", cm_special_char
, BRACE_ARGS
},
87 { "abbr", cm_abbr
, BRACE_ARGS
},
88 { "acronym", cm_acronym
, BRACE_ARGS
},
89 { "ae", cm_special_char
, BRACE_ARGS
},
90 { "afivepaper", cm_ignore_line
, NO_BRACE_ARGS
},
91 { "afourlatex", cm_ignore_line
, NO_BRACE_ARGS
},
92 { "afourpaper", cm_ignore_line
, NO_BRACE_ARGS
},
93 { "afourwide", cm_ignore_line
, NO_BRACE_ARGS
},
94 { "alias", cm_alias
, NO_BRACE_ARGS
},
95 { "anchor", cm_anchor
, BRACE_ARGS
},
96 { "appendix", cm_appendix
, NO_BRACE_ARGS
},
97 { "appendixsection", cm_appendixsec
, NO_BRACE_ARGS
},
98 { "appendixsec", cm_appendixsec
, NO_BRACE_ARGS
},
99 { "appendixsubsec", cm_appendixsubsec
, NO_BRACE_ARGS
},
100 { "appendixsubsubsec", cm_appendixsubsubsec
, NO_BRACE_ARGS
},
101 { "asis", cm_no_op
, BRACE_ARGS
},
102 { "author", cm_author
, NO_BRACE_ARGS
},
103 { "b", cm_b
, BRACE_ARGS
},
104 { "bullet", cm_bullet
, BRACE_ARGS
},
105 { "bye", cm_bye
, NO_BRACE_ARGS
},
106 { "c", cm_comment
, NO_BRACE_ARGS
},
107 { "caption", cm_caption
, BRACE_ARGS
},
108 { "cartouche", cm_cartouche
, NO_BRACE_ARGS
},
109 { "center", cm_center
, NO_BRACE_ARGS
},
110 { "centerchap", cm_unnumbered
, NO_BRACE_ARGS
},
111 { "chapheading", cm_chapheading
, NO_BRACE_ARGS
},
112 { "chapter", cm_chapter
, NO_BRACE_ARGS
},
113 { "cindex", cm_cindex
, NO_BRACE_ARGS
},
114 { "cite", cm_cite
, BRACE_ARGS
},
115 { "clear", cm_clear
, NO_BRACE_ARGS
},
116 { "code", cm_code
, BRACE_ARGS
},
117 { "comma", cm_comma
, BRACE_ARGS
},
118 { "command", cm_code
, BRACE_ARGS
},
119 { "comment", cm_comment
, NO_BRACE_ARGS
},
120 { "contents", cm_contents
, NO_BRACE_ARGS
},
121 { "copying", cm_copying
, NO_BRACE_ARGS
},
122 { "copyright", cm_copyright
, BRACE_ARGS
},
123 { "ctrl", cm_obsolete
, BRACE_ARGS
},
124 { "defcodeindex", cm_defcodeindex
, NO_BRACE_ARGS
},
125 { "defcv", cm_defun
, NO_BRACE_ARGS
},
126 { "defcvx", cm_defun
, NO_BRACE_ARGS
},
127 { "deffn", cm_defun
, NO_BRACE_ARGS
},
128 { "deffnx", cm_defun
, NO_BRACE_ARGS
},
129 { "defindex", cm_defindex
, NO_BRACE_ARGS
},
130 { "definfoenclose", cm_definfoenclose
, NO_BRACE_ARGS
},
131 { "defivar", cm_defun
, NO_BRACE_ARGS
},
132 { "defivarx", cm_defun
, NO_BRACE_ARGS
},
133 { "defmac", cm_defun
, NO_BRACE_ARGS
},
134 { "defmacx", cm_defun
, NO_BRACE_ARGS
},
135 { "defmethod", cm_defun
, NO_BRACE_ARGS
},
136 { "defmethodx", cm_defun
, NO_BRACE_ARGS
},
137 { "defop", cm_defun
, NO_BRACE_ARGS
},
138 { "defopt", cm_defun
, NO_BRACE_ARGS
},
139 { "defoptx", cm_defun
, NO_BRACE_ARGS
},
140 { "defopx", cm_defun
, NO_BRACE_ARGS
},
141 { "defspec", cm_defun
, NO_BRACE_ARGS
},
142 { "defspecx", cm_defun
, NO_BRACE_ARGS
},
143 { "deftp", cm_defun
, NO_BRACE_ARGS
},
144 { "deftpx", cm_defun
, NO_BRACE_ARGS
},
145 { "deftypecv", cm_defun
, NO_BRACE_ARGS
},
146 { "deftypecvx", cm_defun
, NO_BRACE_ARGS
},
147 { "deftypefn", cm_defun
, NO_BRACE_ARGS
},
148 { "deftypefnx", cm_defun
, NO_BRACE_ARGS
},
149 { "deftypefun", cm_defun
, NO_BRACE_ARGS
},
150 { "deftypefunx", cm_defun
, NO_BRACE_ARGS
},
151 { "deftypeivar", cm_defun
, NO_BRACE_ARGS
},
152 { "deftypeivarx", cm_defun
, NO_BRACE_ARGS
},
153 { "deftypemethod", cm_defun
, NO_BRACE_ARGS
},
154 { "deftypemethodx", cm_defun
, NO_BRACE_ARGS
},
155 { "deftypeop", cm_defun
, NO_BRACE_ARGS
},
156 { "deftypeopx", cm_defun
, NO_BRACE_ARGS
},
157 { "deftypevar", cm_defun
, NO_BRACE_ARGS
},
158 { "deftypevarx", cm_defun
, NO_BRACE_ARGS
},
159 { "deftypevr", cm_defun
, NO_BRACE_ARGS
},
160 { "deftypevrx", cm_defun
, NO_BRACE_ARGS
},
161 { "defun", cm_defun
, NO_BRACE_ARGS
},
162 { "defunx", cm_defun
, NO_BRACE_ARGS
},
163 { "defvar", cm_defun
, NO_BRACE_ARGS
},
164 { "defvarx", cm_defun
, NO_BRACE_ARGS
},
165 { "defvr", cm_defun
, NO_BRACE_ARGS
},
166 { "defvrx", cm_defun
, NO_BRACE_ARGS
},
167 { "detailmenu", cm_detailmenu
, NO_BRACE_ARGS
},
168 { "dfn", cm_dfn
, BRACE_ARGS
},
169 { "dircategory", cm_dircategory
, NO_BRACE_ARGS
},
170 { "direntry", cm_direntry
, NO_BRACE_ARGS
},
171 { "display", cm_display
, NO_BRACE_ARGS
},
172 { "dmn", cm_dmn
, BRACE_ARGS
},
173 { "docbook", cm_docbook
, NO_BRACE_ARGS
},
174 { "documentdescription", cm_documentdescription
, NO_BRACE_ARGS
},
175 { "documentencoding", cm_documentencoding
, NO_BRACE_ARGS
},
176 { "documentlanguage", cm_documentlanguage
, NO_BRACE_ARGS
},
177 { "dotaccent", cm_accent
, MAYBE_BRACE_ARGS
},
178 { "dotless", cm_dotless
, BRACE_ARGS
},
179 { "dots", cm_dots
, BRACE_ARGS
},
180 { "email", cm_email
, BRACE_ARGS
},
181 { "emph", cm_emph
, BRACE_ARGS
},
182 { "end", cm_end
, NO_BRACE_ARGS
},
183 { "enddots", cm_enddots
, BRACE_ARGS
},
184 { "enumerate", cm_enumerate
, NO_BRACE_ARGS
},
185 { "env", cm_code
, BRACE_ARGS
},
186 { "equiv", cm_equiv
, BRACE_ARGS
},
187 { "error", cm_error
, BRACE_ARGS
},
188 { "euro", cm_special_char
, BRACE_ARGS
},
189 { "evenfooting", cm_ignore_line
, NO_BRACE_ARGS
},
190 { "evenheading", cm_ignore_line
, NO_BRACE_ARGS
},
191 { "everyfooting", cm_ignore_line
, NO_BRACE_ARGS
},
192 { "everyheading", cm_ignore_line
, NO_BRACE_ARGS
},
193 { "example", cm_example
, NO_BRACE_ARGS
},
194 { "exampleindent", cm_exampleindent
, NO_BRACE_ARGS
},
195 { "exclamdown", cm_special_char
, BRACE_ARGS
},
196 { "exdent", cm_exdent
, NO_BRACE_ARGS
},
197 { "expansion", cm_expansion
, BRACE_ARGS
},
198 { "file", cm_code
, BRACE_ARGS
},
199 { "finalout", cm_no_op
, NO_BRACE_ARGS
},
200 { "findex", cm_findex
, NO_BRACE_ARGS
},
201 { "firstparagraphindent", cm_firstparagraphindent
, NO_BRACE_ARGS
},
202 { "float", cm_float
, NO_BRACE_ARGS
},
203 { "flushleft", cm_flushleft
, NO_BRACE_ARGS
},
204 { "flushright", cm_flushright
, NO_BRACE_ARGS
},
205 { "footnote", cm_footnote
, NO_BRACE_ARGS
}, /* self-arg eater */
206 { "footnotestyle", cm_footnotestyle
, NO_BRACE_ARGS
},
207 { "format", cm_format
, NO_BRACE_ARGS
},
208 { "ftable", cm_ftable
, NO_BRACE_ARGS
},
209 { "group", cm_group
, NO_BRACE_ARGS
},
210 { "heading", cm_heading
, NO_BRACE_ARGS
},
211 { "headings", cm_ignore_line
, NO_BRACE_ARGS
},
212 { "headitem", cm_headitem
, NO_BRACE_ARGS
},
213 { "html", cm_html
, NO_BRACE_ARGS
},
214 { "hyphenation", cm_ignore_arg
, BRACE_ARGS
},
215 { "i", cm_i
, BRACE_ARGS
},
216 { "ifclear", cm_ifclear
, NO_BRACE_ARGS
},
217 { "ifeq", cm_ifeq
, NO_BRACE_ARGS
},
218 { "ifdocbook", cm_ifdocbook
, NO_BRACE_ARGS
},
219 { "ifhtml", cm_ifhtml
, NO_BRACE_ARGS
},
220 { "ifinfo", cm_ifinfo
, NO_BRACE_ARGS
},
221 { "ifnotdocbook", cm_ifnotdocbook
, NO_BRACE_ARGS
},
222 { "ifnothtml", cm_ifnothtml
, NO_BRACE_ARGS
},
223 { "ifnotinfo", cm_ifnotinfo
, NO_BRACE_ARGS
},
224 { "ifnotplaintext", cm_ifnotplaintext
, NO_BRACE_ARGS
},
225 { "ifnottex", cm_ifnottex
, NO_BRACE_ARGS
},
226 { "ifnotxml", cm_ifnotxml
, NO_BRACE_ARGS
},
227 { "ifplaintext", cm_ifplaintext
, NO_BRACE_ARGS
},
228 { "ifset", cm_ifset
, NO_BRACE_ARGS
},
229 { "iftex", cm_iftex
, NO_BRACE_ARGS
},
230 { "ifxml", cm_ifxml
, NO_BRACE_ARGS
},
231 { "ignore", command_name_condition
, NO_BRACE_ARGS
},
232 { "image", cm_image
, BRACE_ARGS
},
233 { "include", cm_include
, NO_BRACE_ARGS
},
234 { "indent", cm_indent
, NO_BRACE_ARGS
},
235 { "indicateurl", cm_indicate_url
, BRACE_ARGS
},
236 { "inforef", cm_inforef
, BRACE_ARGS
},
237 { "insertcopying", cm_insert_copying
, NO_BRACE_ARGS
},
238 { "item", cm_item
, NO_BRACE_ARGS
},
239 { "itemize", cm_itemize
, NO_BRACE_ARGS
},
240 { "itemx", cm_itemx
, NO_BRACE_ARGS
},
241 { "kbd", cm_kbd
, BRACE_ARGS
},
242 { "kbdinputstyle", cm_ignore_line
, NO_BRACE_ARGS
},
243 { "key", cm_key
, BRACE_ARGS
},
244 { "kindex", cm_kindex
, NO_BRACE_ARGS
},
245 { "l", cm_special_char
, BRACE_ARGS
},
246 { "lisp", cm_lisp
, NO_BRACE_ARGS
},
247 { "listoffloats", cm_listoffloats
, NO_BRACE_ARGS
},
248 { "lowersections", cm_lowersections
, NO_BRACE_ARGS
},
249 { "macro", cm_macro
, NO_BRACE_ARGS
},
250 { "majorheading", cm_majorheading
, NO_BRACE_ARGS
},
251 { "math", cm_math
, BRACE_ARGS
},
252 { "menu", cm_menu
, NO_BRACE_ARGS
},
253 { "minus", cm_minus
, BRACE_ARGS
},
254 { "multitable", cm_multitable
, NO_BRACE_ARGS
},
255 { "need", cm_ignore_line
, NO_BRACE_ARGS
},
256 { "node", cm_node
, NO_BRACE_ARGS
},
257 { "noindent", cm_noindent_cmd
, NO_BRACE_ARGS
},
258 { "novalidate", cm_novalidate
, NO_BRACE_ARGS
},
259 { "nwnode", cm_node
, NO_BRACE_ARGS
},
260 { "o", cm_special_char
, BRACE_ARGS
},
261 { "oddfooting", cm_ignore_line
, NO_BRACE_ARGS
},
262 { "oddheading", cm_ignore_line
, NO_BRACE_ARGS
},
263 { "oe", cm_special_char
, BRACE_ARGS
},
264 { "option", cm_code
, BRACE_ARGS
},
265 { "ordf", cm_special_char
, BRACE_ARGS
},
266 { "ordm", cm_special_char
, BRACE_ARGS
},
267 { "page", cm_no_op
, NO_BRACE_ARGS
},
268 { "pagesizes", cm_ignore_line
, NO_BRACE_ARGS
},
269 { "paragraphindent", cm_paragraphindent
, NO_BRACE_ARGS
},
270 { "pindex", cm_pindex
, NO_BRACE_ARGS
},
271 { "point", cm_point
, BRACE_ARGS
},
272 { "pounds", cm_special_char
, BRACE_ARGS
},
273 { "print", cm_print
, BRACE_ARGS
},
274 { "printindex", cm_printindex
, NO_BRACE_ARGS
},
275 { "pxref", cm_pxref
, BRACE_ARGS
},
276 { "questiondown", cm_special_char
, BRACE_ARGS
},
277 { "quotation", cm_quotation
, NO_BRACE_ARGS
},
278 { "r", cm_r
, BRACE_ARGS
},
279 { "raisesections", cm_raisesections
, NO_BRACE_ARGS
},
280 { "ref", cm_ref
, BRACE_ARGS
},
281 { "refill", cm_no_op
, NO_BRACE_ARGS
},
282 { "registeredsymbol", cm_registeredsymbol
, BRACE_ARGS
},
283 { "result", cm_result
, BRACE_ARGS
},
284 { "ringaccent", cm_accent
, MAYBE_BRACE_ARGS
},
285 { "rmacro", cm_rmacro
, NO_BRACE_ARGS
},
286 { "samp", cm_code
, BRACE_ARGS
},
287 { "sansserif", cm_sansserif
, BRACE_ARGS
},
288 { "sc", cm_sc
, BRACE_ARGS
},
289 { "section", cm_section
, NO_BRACE_ARGS
},
290 { "set", cm_set
, NO_BRACE_ARGS
},
291 { "setchapternewpage", cm_ignore_line
, NO_BRACE_ARGS
},
292 { "setchapterstyle", cm_obsolete
, NO_BRACE_ARGS
},
293 { "setcontentsaftertitlepage", cm_no_op
, NO_BRACE_ARGS
},
294 { "setfilename", cm_setfilename
, NO_BRACE_ARGS
},
295 { "setshortcontentsaftertitlepage", cm_no_op
, NO_BRACE_ARGS
},
296 { "settitle", cm_settitle
, NO_BRACE_ARGS
},
297 { "shortcaption", cm_caption
, BRACE_ARGS
},
298 { "shortcontents", cm_contents
, NO_BRACE_ARGS
},
299 { "shorttitlepage", cm_ignore_line
, NO_BRACE_ARGS
},
300 { "slanted", cm_slanted
, BRACE_ARGS
},
301 { "smallbook", cm_ignore_line
, NO_BRACE_ARGS
},
302 { "smalldisplay", cm_smalldisplay
, NO_BRACE_ARGS
},
303 { "smallexample", cm_smallexample
, NO_BRACE_ARGS
},
304 { "smallformat", cm_smallformat
, NO_BRACE_ARGS
},
305 { "smalllisp", cm_smalllisp
, NO_BRACE_ARGS
},
306 { "sp", cm_sp
, NO_BRACE_ARGS
},
307 { "ss", cm_special_char
, BRACE_ARGS
},
308 { "strong", cm_strong
, BRACE_ARGS
},
309 { "subheading", cm_subheading
, NO_BRACE_ARGS
},
310 { "subsection", cm_subsection
, NO_BRACE_ARGS
},
311 { "subsubheading", cm_subsubheading
, NO_BRACE_ARGS
},
312 { "subsubsection", cm_subsubsection
, NO_BRACE_ARGS
},
313 { "subtitle", cm_titlepage_cmds
, NO_BRACE_ARGS
},
314 { "summarycontents", cm_contents
, NO_BRACE_ARGS
},
315 { "syncodeindex", cm_synindex
, NO_BRACE_ARGS
},
316 { "synindex", cm_synindex
, NO_BRACE_ARGS
},
317 { "t", cm_tt
, BRACE_ARGS
},
318 { "tab", cm_tab
, NO_BRACE_ARGS
},
319 { "table", cm_table
, NO_BRACE_ARGS
},
320 { "tex", cm_tex
, NO_BRACE_ARGS
},
321 { "tie", cm_tie
, BRACE_ARGS
},
322 { "tieaccent", cm_accent
, MAYBE_BRACE_ARGS
},
323 { "tindex", cm_tindex
, NO_BRACE_ARGS
},
324 { "title", cm_titlepage_cmds
, NO_BRACE_ARGS
},
325 { "titlefont", cm_titlefont
, BRACE_ARGS
},
326 { "titlepage", cm_titlepage
, NO_BRACE_ARGS
},
327 { "today", cm_today
, BRACE_ARGS
},
328 { "top", cm_top
, NO_BRACE_ARGS
},
329 { "u", cm_accent
, MAYBE_BRACE_ARGS
},
330 { "ubaraccent", cm_accent
, MAYBE_BRACE_ARGS
},
331 { "udotaccent", cm_accent
, MAYBE_BRACE_ARGS
},
332 { "unmacro", cm_unmacro
, NO_BRACE_ARGS
},
333 { "unnumbered", cm_unnumbered
, NO_BRACE_ARGS
},
334 { "unnumberedsec", cm_unnumberedsec
, NO_BRACE_ARGS
},
335 { "unnumberedsubsec", cm_unnumberedsubsec
, NO_BRACE_ARGS
},
336 { "unnumberedsubsubsec", cm_unnumberedsubsubsec
, NO_BRACE_ARGS
},
337 { "uref", cm_uref
, BRACE_ARGS
},
338 { "url", cm_uref
, BRACE_ARGS
},
339 { "v", cm_accent
, MAYBE_BRACE_ARGS
},
340 { "value", cm_value
, BRACE_ARGS
},
341 { "var", cm_var
, BRACE_ARGS
},
342 { "verb", cm_verb
, NO_BRACE_ARGS
},
343 { "verbatim", cm_verbatim
, NO_BRACE_ARGS
},
344 { "verbatiminclude", cm_verbatiminclude
, NO_BRACE_ARGS
},
345 { "vindex", cm_vindex
, NO_BRACE_ARGS
},
346 { "vtable", cm_vtable
, NO_BRACE_ARGS
},
347 { "vskip", cm_ignore_line
, NO_BRACE_ARGS
},
348 { "w", cm_w
, BRACE_ARGS
},
349 { "xml", cm_xml
, NO_BRACE_ARGS
},
350 { "xref", cm_xref
, BRACE_ARGS
},
352 /* Deprecated commands. These used to be for italics. */
353 { "iappendix", cm_ideprecated
, NO_BRACE_ARGS
},
354 { "iappendixsec", cm_ideprecated
, NO_BRACE_ARGS
},
355 { "iappendixsection", cm_ideprecated
, NO_BRACE_ARGS
},
356 { "iappendixsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
357 { "iappendixsubsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
358 { "ichapter", cm_ideprecated
, NO_BRACE_ARGS
},
359 { "isection", cm_ideprecated
, NO_BRACE_ARGS
},
360 { "isubsection", cm_ideprecated
, NO_BRACE_ARGS
},
361 { "isubsubsection", cm_ideprecated
, NO_BRACE_ARGS
},
362 { "iunnumbered", cm_ideprecated
, NO_BRACE_ARGS
},
363 { "iunnumberedsec", cm_ideprecated
, NO_BRACE_ARGS
},
364 { "iunnumberedsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
365 { "iunnumberedsubsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
367 /* Now @include does what this was used to. */
368 { "infoinclude", cm_obsolete
, NO_BRACE_ARGS
},
369 { "titlespec", cm_obsolete
, NO_BRACE_ARGS
},
371 { NULL
, NULL
, NO_BRACE_ARGS
}
374 /* The bulk of the Texinfo commands. */
376 /* Commands which insert their own names. */
378 insert_self (int arg
)
385 insert_space (int arg
)
390 xml_insert_entity ("space");
396 /* Insert a comma. Useful when a literal , would break our parsing of
397 multiple arguments. */
406 /* Force a line break in the output. */
412 else if (xml
&& !docbook
)
413 xml_insert_entity ("linebreak");
418 close_single_paragraph ();
423 /* Insert ellipsis. */
430 xml_insert_entity ("dots");
432 xml_insert_entity ("hellip");
434 if (html
&& !in_fixed_width_font
)
435 insert_string ("<small class=\"dots\">...</small>");
441 /* Insert ellipsis for sentence end. */
448 xml_insert_entity ("enddots");
451 xml_insert_entity ("hellip");
455 if (html
&& !in_fixed_width_font
)
456 insert_string ("<small class=\"enddots\">....</small>");
469 else if (xml
&& !docbook
)
470 xml_insert_entity ("bullet");
472 xml_insert_entity ("bull");
484 xml_insert_entity ("minus");
486 add_word ("−");
492 /* Formatting a dimension unit. */
497 insert_html_tag_with_attribute (arg
, "span", "class=\"dmn\"");
499 /* No units in docbook yet. */
502 xml_insert_element (DIMENSION
, arg
);
509 static int last_position
;
514 xml_insert_entity ("tex");
518 last_position
= output_paragraph_offset
;
520 else if (last_position
!= output_paragraph_offset
)
522 warning (_("arguments to @%s ignored"), command
);
523 output_paragraph_offset
= last_position
;
527 /* Insert "LaTeX". */
531 static int last_position
;
536 xml_insert_entity ("latex");
540 last_position
= output_paragraph_offset
;
542 else if (last_position
!= output_paragraph_offset
)
544 warning (_("arguments to @%s ignored"), command
);
545 output_paragraph_offset
= last_position
;
549 /* Copyright symbol. */
551 cm_copyright (int arg
)
557 else if (xml
&& !docbook
)
558 xml_insert_entity ("copyright");
560 xml_insert_entity ("copy");
566 /* Registered symbol. */
568 cm_registeredsymbol (int arg
)
575 xml_insert_entity ("reg");
576 else if (xml
&& !docbook
)
577 xml_insert_entity ("registered");
586 static char *months
[12] =
587 { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"),
588 N_("June"), N_("July"), N_("August"), N_("September"), N_("October"),
589 N_("November"), N_("December") };
592 time_t timer
= time (0);
593 struct tm
*ts
= localtime (&timer
);
594 add_word_args ("%d %s %d", ts
->tm_mday
, _(months
[ts
->tm_mon
]),
602 /* For HTML, do not output comments before HTML header is written,
603 otherwise comments before @settitle cause an empty <title> in the
605 if ((html
&& html_output_head_p
) || xml
)
608 get_rest_of_line (0, &line
);
610 if (strlen (line
) > 0)
612 int save_inhibit_indentation
= inhibit_paragraph_indentation
;
613 int save_paragraph_is_open
= paragraph_is_open
;
614 int save_escape_html
= escape_html
;
615 int save_xml_no_para
= xml_no_para
;
618 inhibit_paragraph_indentation
= 1;
622 /* @c and @comment can appear between @item and @itemx,
623 @deffn and @deffnx. */
624 xml_dont_touch_items_defs
++;
626 /* Use insert for HTML, and XML when indentation is enabled.
627 For Docbook, use add_char. */
628 if (xml
&& xml_indentation_increment
> 0
629 && output_paragraph
[output_paragraph_offset
-1] != '\n')
632 /* Crunch double hyphens in comments. */
633 add_html_block_elt ("<!-- ");
634 for (i
= 0; i
< strlen (line
); i
++)
635 if (line
[i
] != '-' || (i
&& line
[i
-1] != '-'))
642 inhibit_paragraph_indentation
= save_inhibit_indentation
;
643 paragraph_is_open
= save_paragraph_is_open
;
644 escape_html
= save_escape_html
;
645 xml_no_para
= save_xml_no_para
;
646 xml_dont_touch_items_defs
--;
657 /* We keep acronyms with two arguments around, to be able to refer to them
658 later with only one argument. */
659 static ACRONYM_DESC
*acronyms_stack
= NULL
;
662 cm_acronym_or_abbr (int arg
, int is_abbr
)
664 char *aa
, *description
;
667 /* We do everything at START. */
671 get_until_in_braces (",", &aa
);
672 if (input_text
[input_text_offset
] == ',')
674 get_until_in_braces ("}", &description
);
677 canon_white (description
);
679 /* If not enclosed in braces, strip after comma to be compatible
681 if (description
[0] != '{' && strchr (description
, ',') != NULL
)
684 while (description
[i
] != ',')
686 /* For now, just terminate the string at comma. */
690 /* Get description out of braces. */
691 if (description
[0] == '{')
694 len
= strlen (description
);
695 if (len
&& description
[len
-1] == '}')
696 description
[len
-1] = 0;
698 /* Save new description. */
699 if (strlen (description
) > 0)
701 ACRONYM_DESC
*new = xmalloc (sizeof (ACRONYM_DESC
));
703 new->acronym
= xstrdup (aa
);
704 new->description
= xstrdup (description
);
705 new->next
= acronyms_stack
;
706 acronyms_stack
= new;
711 add_word (is_abbr
? "<abbr" : "<acronym");
713 if (strlen (description
) > 0)
714 add_word_args (" title=\"%s\"", text_expansion (description
));
715 else if (acronyms_stack
)
717 /* No second argument, get from previous. Search order is from
718 last to first defined, so we get the most recent version of
720 ACRONYM_DESC
*temp
= acronyms_stack
;
724 if (STREQ (aa
, temp
->acronym
)
725 && strlen (temp
->description
) > 0)
727 add_word_args (" title=\"%s\"",
728 text_expansion (temp
->description
));
736 execute_string ("%s", aa
);
737 add_word (is_abbr
? "</abbr>" : "</acronym>");
741 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, START
);
742 execute_string ("%s", aa
);
743 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, END
);
747 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, START
);
749 xml_insert_element (is_abbr
? ABBREVWORD
: ACRONYMWORD
, START
);
750 execute_string ("%s", aa
);
751 xml_insert_element (is_abbr
? ABBREVWORD
: ACRONYMWORD
, END
);
753 if (strlen (description
) > 0)
755 xml_insert_element (is_abbr
? ABBREVDESC
: ACRONYMDESC
, START
);
756 execute_string ("%s", description
);
757 xml_insert_element (is_abbr
? ABBREVDESC
: ACRONYMDESC
, END
);
760 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, END
);
763 execute_string ("%s", aa
);
765 /* Put description into parenthesis after the acronym for all outputs
767 if (strlen (description
) > 0 && (!xml
|| docbook
))
768 add_word_args (" (%s)", description
);
774 cm_acronym_or_abbr (arg
, 0);
780 cm_acronym_or_abbr (arg
, 1);
786 /* @t{} is a no-op in Info. */
788 insert_html_tag (arg
, "tt");
790 xml_insert_element (TT
, arg
);
797 in_fixed_width_font
++;
801 if (STREQ (command
, "command"))
802 xml_insert_element (COMMAND_TAG
, arg
);
803 else if (STREQ (command
, "env"))
804 xml_insert_element (ENV
, arg
);
805 else if (STREQ (command
, "file"))
806 xml_insert_element (FILE_TAG
, arg
);
807 else if (STREQ (command
, "option"))
808 xml_insert_element (OPTION
, arg
);
809 else if (STREQ (command
, "samp"))
811 if (docbook
&& arg
== START
)
813 /* Even though @samp is in_fixed_width_font, it
814 should always start a paragraph. Unfortunately,
815 in_fixed_width_font inhibits that. */
817 xml_insert_entity ("lsquo");
819 xml_insert_element (SAMP
, arg
);
820 if (docbook
&& arg
== END
)
821 xml_insert_entity ("rsquo");
824 xml_insert_element (CODE
, arg
);
828 if (STREQ (command
, "code"))
829 insert_html_tag (arg
, "code");
831 { /* Use <samp> tag in general to get typewriter. */
833 { /* If @samp specifically, add quotes a la TeX output. */
834 if (STREQ (command
, "samp")) add_char ('`');
837 insert_html_tag_with_attribute (arg
, "span", "class=\"%s\"",command
);
840 add_word ("</samp>");
841 if (STREQ (command
, "samp")) add_char ('\'');
847 extern int printing_index
;
854 add_meta_char ('\'');
863 xml_insert_element (KBD
, arg
);
865 { /* Seems like we should increment in_fixed_width_font for Info
866 format too, but then the quote-omitting special case gets
869 in_fixed_width_font
++;
870 insert_html_tag (arg
, "kbd");
873 { /* People use @kbd in an example to get the "user input" font.
874 We don't want quotes in that case. */
875 if (!in_fixed_width_font
)
880 /* Just show a url (http://example.org/..., for example), don't link to it. */
882 cm_indicate_url (int arg
, int start
, int end
)
885 xml_insert_element (URL
, arg
);
890 insert_html_tag (arg
, "code");
905 xml_insert_element (KEY
, arg
);
907 add_word (arg
== START
? "<" : ">");
909 add_char (arg
== START
? '<' : '>');
912 /* Handle a command that switches to a non-fixed-width font. */
914 not_fixed_width (int arg
)
917 in_fixed_width_font
= 0;
920 /* @var in makeinfo just uppercases the text. */
922 cm_var (int arg
, int start_pos
, int end_pos
)
925 xml_insert_element (VAR
, arg
);
928 not_fixed_width (arg
);
931 insert_html_tag (arg
, "var");
934 while (start_pos
< end_pos
)
936 unsigned char c
= output_paragraph
[start_pos
];
937 if (strchr ("[](),", c
))
938 warning (_("unlikely character %c in @var"), c
);
939 output_paragraph
[start_pos
] = coerce_to_upper (c
);
947 cm_sc (int arg
, int start_pos
, int end_pos
)
950 xml_insert_element (SC
, arg
);
953 not_fixed_width (arg
);
958 insert_html_tag_with_attribute (arg
, "span", "class=\"sc\"");
965 start_pos
+= sizeof ("<span class=\"sc\">") - 1; /* skip <span> */
967 /* Avoid the warning below if there's no text inside @sc{}, or
968 when processing menus under --no-headers. */
969 all_upper
= start_pos
< end_pos
;
971 while (start_pos
< end_pos
)
973 unsigned char c
= output_paragraph
[start_pos
];
977 output_paragraph
[start_pos
] = coerce_to_upper (c
);
981 warning (_("@sc argument all uppercase, thus no effect"));
984 insert_html_tag (arg
, "span");
990 cm_dfn (int arg
, int position
)
993 xml_insert_element (DFN
, arg
);
997 insert_html_tag (arg
, "dfn");
998 else if (arg
== START
)
1001 add_meta_char ('"');
1009 xml_insert_element (EMPH
, arg
);
1011 insert_html_tag (arg
, "em");
1020 int delimiter
= 0; /* avoid warning */
1023 in_fixed_width_font
++;
1024 /* are these necessary ? */
1025 last_char_was_newline
= 0;
1030 if (input_text_offset
< input_text_length
)
1032 character
= curchar ();
1033 if (character
== '{')
1034 input_text_offset
++;
1036 line_error (_("`{' expected, but saw `%c'"), character
);
1039 if (input_text_offset
< input_text_length
)
1041 delimiter
= curchar ();
1042 input_text_offset
++;
1045 while (input_text_offset
< input_text_length
)
1047 character
= curchar ();
1049 if (character
== '\n')
1053 add_word ("<br>\n");
1056 else if (html
&& character
== '<')
1059 else if (html
&& character
== '&')
1062 else if (character
== delimiter
&& input_text
[input_text_offset
+1] == '}')
1063 { /* Assume no newlines in END_VERBATIM. */
1065 input_text_offset
++;
1070 add_char (character
);
1072 input_text_offset
++;
1076 warning (_("end of file inside verb block"));
1078 if (input_text_offset
< input_text_length
)
1080 character
= curchar ();
1081 if (character
== '}')
1082 input_text_offset
++;
1084 line_error (_("`}' expected, but saw `%c'"), character
);
1090 in_fixed_width_font
--;
1095 cm_strong (int arg
, int start_pos
, int end_pos
)
1097 if (docbook
&& arg
== START
)
1098 xml_insert_element_with_attribute (B
, arg
, "role=\"bold\"");
1100 xml_insert_element (STRONG
, arg
);
1102 insert_html_tag (arg
, "strong");
1106 if (!xml
&& !html
&& !docbook
&& !no_headers
1108 && end_pos
- start_pos
>= 6
1109 && (STRNCASEEQ ((char *) output_paragraph
+ start_pos
, "*Note:", 6)
1110 || STRNCASEEQ ((char *) output_paragraph
+ start_pos
, "*Note ", 6)))
1112 /* Translators: "Note:" is literal here and should not be
1113 translated. @strong{Nota}, say, does not cause the problem. */
1114 warning (_("@strong{Note...} produces a spurious cross-reference in Info; reword to avoid that"));
1115 /* Adjust the output to avoid writing the bad xref. */
1116 output_paragraph
[start_pos
+ 5] = '_';
1121 cm_cite (int arg
, int position
)
1124 xml_insert_element (CITE
, arg
);
1126 insert_html_tag (arg
, "cite");
1136 /* No highlighting, but argument switches fonts. */
1138 cm_not_fixed_width (int arg
, int start
, int end
)
1141 xml_insert_element (NOTFIXEDWIDTH
, arg
);
1142 not_fixed_width (arg
);
1148 /* Make use of <lineannotation> of Docbook, if we are
1149 inside an @example or similar. */
1150 extern int printing_index
;
1151 if (docbook
&& !filling_enabled
&& !printing_index
)
1152 xml_insert_element (LINEANNOTATION
, arg
);
1154 xml_insert_element (I
, arg
);
1156 insert_html_tag (arg
, "i");
1158 not_fixed_width (arg
);
1162 cm_slanted (int arg
)
1164 /* Make use of <lineannotation> of Docbook, if we are
1165 inside an @example or similar. */
1166 extern int printing_index
;
1167 if (docbook
&& !filling_enabled
&& !printing_index
)
1168 xml_insert_element (LINEANNOTATION
, arg
);
1170 xml_insert_element (SLANTED
, arg
);
1172 insert_html_tag (arg
, "i");
1174 not_fixed_width (arg
);
1180 /* See cm_i comments. */
1181 extern int printing_index
;
1182 if (docbook
&& !filling_enabled
&& !printing_index
)
1183 xml_insert_element (LINEANNOTATION
, arg
);
1184 else if (docbook
&& arg
== START
)
1185 xml_insert_element_with_attribute (B
, arg
, "role=\"bold\"");
1187 xml_insert_element (B
, arg
);
1189 insert_html_tag (arg
, "b");
1191 not_fixed_width (arg
);
1197 /* See cm_i comments. */
1198 extern int printing_index
;
1199 if (docbook
&& !filling_enabled
&& !printing_index
)
1200 xml_insert_element (LINEANNOTATION
, arg
);
1202 xml_insert_element (R
, arg
);
1204 insert_html_tag_with_attribute (arg
, "span", "class=\"roman\"");
1206 not_fixed_width (arg
);
1210 cm_sansserif (int arg
)
1212 /* See cm_i comments. */
1213 extern int printing_index
;
1214 if (docbook
&& !filling_enabled
&& !printing_index
)
1215 xml_insert_element (LINEANNOTATION
, arg
);
1217 xml_insert_element (SANSSERIF
, arg
);
1219 insert_html_tag_with_attribute (arg
, "span", "class=\"sansserif\"");
1221 not_fixed_width (arg
);
1225 cm_titlefont (int arg
)
1228 xml_insert_element (TITLEFONT
, arg
);
1231 not_fixed_width (arg
);
1234 html_title_written
= 1; /* suppress title from @settitle */
1236 add_word ("<h1 class=\"titlefont\">");
1238 add_word ("</h1>\n");
1244 /* Unfortunately, we cannot interpret @math{} contents like TeX does. We just
1245 pass them through. */
1249 if (xml
&& !docbook
)
1250 xml_insert_element (MATH
, arg
);
1253 /* Various commands are no-op's. */
1260 /* For proofing single chapters, etc. */
1262 cm_novalidate (void)
1268 /* Prevent the argument from being split across two lines. */
1273 non_splitting_words
++;
1276 if (docbook
|| html
|| xml
)
1277 /* This is so @w{$}Log$ doesn't end up as <dollar>Log<dollar>
1279 insert_string ("<!-- /@w -->");
1281 non_splitting_words
--;
1286 /* An unbreakable word space. Same as @w{ } for makeinfo, but different
1287 for TeX (the space stretches and stretches, and does not inhibit
1301 /* Explain that this command is obsolete, thus the user shouldn't
1302 do anything with it. */
1304 cm_obsolete (int arg
, int start
, int end
)
1307 warning (_("%c%s is obsolete"), COMMAND_PREFIX
, command
);
1311 /* Inhibit the indentation of the next paragraph, but not of following
1316 if (!inhibit_paragraph_indentation
)
1317 inhibit_paragraph_indentation
= -1;
1321 cm_noindent_cmd (void)
1325 skip_whitespace_and_newlines();
1329 else if (html
&& !paragraph_is_open
)
1330 add_html_block_elt ("<p class=\"noindent\">");
1333 paragraph_is_open
= 0;
1338 /* Force indentation of the next paragraph. */
1342 inhibit_paragraph_indentation
= 0;
1344 skip_whitespace_and_newlines();
1348 else if (html
&& !paragraph_is_open
)
1349 add_html_block_elt ("<p class=\"indent\">");
1354 /* I don't know exactly what to do with this. Should I allow
1355 someone to switch filenames in the middle of output? Since the
1356 file could be partially written, this doesn't seem to make sense.
1357 Another option: ignore it, since they don't really want to
1358 switch files. Finally, complain, or at least warn. It doesn't
1359 really matter, anyway, since this doesn't get executed. */
1361 cm_setfilename (void)
1364 get_rest_of_line (1, &filename
);
1365 /* warning ("`@%s %s' encountered and ignored", command, filename); */
1367 add_word_args ("<setfilename>%s</setfilename>", filename
);
1376 xml_begin_document (current_output_filename
);
1377 xml_insert_element (SETTITLE
, START
);
1378 xml_in_book_title
= 1;
1379 get_rest_of_line (0, &title
);
1380 execute_string ("%s", title
);
1381 xml_in_book_title
= 0;
1382 xml_insert_element (SETTITLE
, END
);
1385 get_rest_of_line (0, &title
);
1389 /* Ignore argument in braces. */
1391 cm_ignore_arg (int arg
, int start_pos
, int end_pos
)
1394 output_paragraph_offset
= start_pos
;
1397 /* Ignore argument on rest of line. */
1399 cm_ignore_line (void)
1401 discard_until ("\n");
1404 /* Insert the number of blank lines passed as argument. */
1411 /* Due to tricky stuff in execute_string(), @value{} can't be expanded.
1412 So there is really no reason to enable expansion for @sp parameters. */
1413 get_rest_of_line (0, &line
);
1415 if (sscanf (line
, "%d", &lines
) != 1 || lines
<= 0)
1416 line_error (_("@sp requires a positive numeric argument, not `%s'"), line
);
1421 /* @sp can appear between @item and @itemx, @deffn and @deffnx. */
1422 xml_dont_touch_items_defs
++;
1423 xml_insert_element_with_attribute (SP
, START
, "lines=\"%s\"", line
);
1424 /* insert_string (line);*/
1425 xml_insert_element (SP
, END
);
1426 xml_dont_touch_items_defs
--;
1430 /* Must disable filling since otherwise multiple newlines is like
1431 multiple spaces. Must close paragraph since that's what the
1432 manual says and that's what TeX does. */
1433 int save_filling_enabled
= filling_enabled
;
1434 filling_enabled
= 0;
1436 /* close_paragraph generates an extra blank line. */
1437 close_single_paragraph ();
1439 if (lines
&& html
&& !executing_string
)
1440 html_output_head ();
1443 add_html_block_elt ("<pre class=\"sp\">\n");
1449 add_html_block_elt ("</pre>\n");
1451 filling_enabled
= save_filling_enabled
;
1457 /* @dircategory LINE outputs INFO-DIR-SECTION LINE, unless --no-headers. */
1459 cm_dircategory (void)
1463 if (html
|| docbook
)
1467 xml_insert_element (DIRCATEGORY
, START
);
1468 get_rest_of_line (1, &line
);
1469 insert_string (line
);
1471 xml_insert_element (DIRCATEGORY
, END
);
1475 get_rest_of_line (1, &line
);
1477 if (!no_headers
&& !html
)
1479 kill_self_indent (-1); /* make sure there's no indentation */
1480 insert_string ("INFO-DIR-SECTION ");
1481 insert_string (line
);
1489 /* Start a new line with just this text on it.
1490 Then center the line of text.
1498 xml_insert_element (CENTER
, START
);
1499 get_rest_of_line (0, &line
);
1500 execute_string ("%s", line
);
1502 xml_insert_element (CENTER
, END
);
1506 int i
, start
, length
;
1508 int save_indented_fill
= indented_fill
;
1509 int save_filling_enabled
= filling_enabled
;
1510 int fudge_factor
= 1;
1512 filling_enabled
= indented_fill
= 0;
1514 start
= output_paragraph_offset
;
1517 add_html_block_elt ("<div align=\"center\">");
1519 inhibit_output_flushing ();
1520 get_rest_of_line (0, &line
);
1521 execute_string ("%s", line
);
1523 uninhibit_output_flushing ();
1525 add_html_block_elt ("</div>");
1529 i
= output_paragraph_offset
- 1;
1530 while (i
> (start
- 1) && output_paragraph
[i
] == '\n')
1533 output_paragraph_offset
= ++i
;
1534 length
= output_paragraph_offset
- start
;
1536 if (length
< (fill_column
- fudge_factor
))
1538 line
= xmalloc (1 + length
);
1539 memcpy (line
, (char *)(output_paragraph
+ start
), length
);
1541 i
= (fill_column
- fudge_factor
- length
) / 2;
1542 output_paragraph_offset
= start
;
1547 for (i
= 0; i
< length
; i
++)
1555 filling_enabled
= save_filling_enabled
;
1556 indented_fill
= save_indented_fill
;
1557 close_single_paragraph ();
1558 if (looking_at("\n"))
1563 /* Show what an expression returns. */
1568 add_word (html
? "=>" : "=>");
1571 /* What an expression expands to. */
1573 cm_expansion (int arg
)
1576 add_word (html
? "==>" : "==>");
1579 /* Indicates two expressions are equivalent. */
1587 /* What an expression may print. */
1595 /* An error signaled. */
1600 add_word (html
? "error-->" : "error-->");
1603 /* The location of point in an example of a buffer. */
1611 /* @exdent: Start a new line with just this text on it.
1612 The text is outdented one level if possible. */
1617 int save_indent
= current_indent
;
1618 int save_in_fixed_width_font
= in_fixed_width_font
;
1620 /* Read argument. */
1621 get_rest_of_line (0, &line
);
1623 /* Exdent the output. Actually this may be a no-op. */
1625 current_indent
-= default_indentation_increment
;
1627 /* @exdent arg is supposed to be in roman. */
1628 in_fixed_width_font
= 0;
1630 /* The preceding newline already inserted the `current_indent'.
1631 Remove one level's worth. */
1632 kill_self_indent (default_indentation_increment
);
1637 xml_insert_element (LINEANNOTATION
, START
);
1639 xml_insert_element (EXDENT
, START
);
1641 /* Can't close_single_paragraph, then we lose preceding blank lines. */
1643 execute_string ("%s", line
);
1650 xml_insert_element (docbook
? LINEANNOTATION
: EXDENT
, END
);
1654 close_single_paragraph ();
1656 current_indent
= save_indent
;
1657 in_fixed_width_font
= save_in_fixed_width_font
;
1663 Read include-filename, process the include-file:
1664 verbatim_include == 0: process through reader_loop
1665 verbatim_include != 0: process through handle_verbatim_environment
1668 handle_include (int verbatim_include
)
1670 char *arg
, *filename
;
1672 if (macro_expansion_output_stream
&& !executing_string
)
1673 me_append_before_this_command ();
1675 if (!insertion_stack
)
1676 close_paragraph (); /* No blank lines etc. if not at outer level. */
1678 get_rest_of_line (0, &arg
);
1679 /* We really only want to expand @value, but it's easier to just do
1680 everything. TeX will only work with @value. */
1681 filename
= text_expansion (arg
);
1684 if (macro_expansion_output_stream
&& !executing_string
)
1685 remember_itext (input_text
, input_text_offset
);
1689 /* In verbose mode we print info about including another file. */
1693 FSTACK
*stack
= filestack
;
1695 for (i
= 0, stack
= filestack
; stack
; stack
= stack
->next
, i
++);
1699 printf ("%*s", i
, "");
1700 printf ("%c%s `%s'\n", COMMAND_PREFIX
, command
, filename
);
1704 if (!find_and_load (filename
, 1))
1709 /* /wh/bar:5: @include/@verbatiminclude `foo': No such file or dir */
1710 line_error ("%c%s `%s': %s", COMMAND_PREFIX
, command
, filename
,
1718 if (macro_expansion_output_stream
&& !executing_string
)
1719 remember_itext (input_text
, input_text_offset
);
1721 if (!verbatim_include
)
1724 handle_verbatim_environment (0);
1731 /* Include file as if put in @verbatim environment */
1733 cm_verbatiminclude (void)
1739 /* Remember this file, and move onto the next. */
1747 /* @bye: Signals end of processing. Easy to make this happen. */
1752 discard_braces (); /* should not have any unclosed braces left */
1753 input_text_offset
= input_text_length
;
1756 /* @paragraphindent */
1759 cm_paragraphindent (void)
1763 get_rest_of_line (1, &arg
);
1764 if (set_paragraph_indent (arg
) != 0)
1765 line_error (_("Bad argument to %c%s"), COMMAND_PREFIX
, command
);
1771 /* @exampleindent: change indentation of example-like environments. */
1773 set_example_indentation_increment (char *string
)
1775 if (strcmp (string
, "asis") == 0 || strcmp (string
, _("asis")) == 0)
1777 else if (strcmp (string
, "none") == 0 || strcmp (string
, _("none")) == 0)
1778 example_indentation_increment
= 0;
1779 else if (sscanf (string
, "%d", &example_indentation_increment
) != 1)
1785 cm_exampleindent (void)
1789 get_rest_of_line (1, &arg
);
1790 if (set_example_indentation_increment (arg
) != 0)
1791 line_error (_("Bad argument to @%s"), command
);
1793 if (input_text
[input_text_offset
] == '\n')
1794 close_single_paragraph ();
1800 /* @firstparagraphindent: suppress indentation in first paragraphs after
1803 set_firstparagraphindent (char *string
)
1805 if (STREQ (string
, "insert") || STREQ (string
, _("insert")))
1806 do_first_par_indent
= 1;
1807 else if (STREQ (string
, "none") || STREQ (string
, _("none")))
1808 do_first_par_indent
= 0;
1815 cm_firstparagraphindent (void)
1819 get_rest_of_line (1, &arg
);
1820 if (set_firstparagraphindent (arg
) != 0)
1821 line_error (_("Bad argument to %c%s"), COMMAND_PREFIX
, command
);
1826 /* For DocBook and XML, produce . for `.@:'. This gives the processing
1827 software a fighting chance to treat it specially by not adding extra space.
1829 Do this also for ?, !, and :. */
1835 if (strchr (".?!:", input_text
[input_text_offset
-3]) != NULL
)
1837 /* Erase literal character that's there, except `>', which is
1838 part of the XML tag. */
1839 if (output_paragraph
[output_paragraph_offset
-1] != '>')
1840 output_paragraph_offset
--;
1842 switch (input_text
[input_text_offset
-3])
1845 xml_insert_entity ("period");
1848 xml_insert_entity ("quest");
1851 xml_insert_entity ("excl");
1854 xml_insert_entity ("colon");
1861 /* Ending sentences explicitly. Currently, only outputs entities for XML
1862 output, for other formats it calls insert_self. */
1866 if (xml
&& !docbook
)
1868 switch (input_text
[input_text_offset
-1])
1871 xml_insert_entity ("eosperiod");
1874 xml_insert_entity ("eosquest");
1877 xml_insert_entity ("eosexcl");