1 /* cmds.c -- Texinfo commands.
2 $Id: cmds.c,v 1.55 2004/12/14 00:15:36 karl Exp $
4 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
27 #include "insertion.h"
32 #include "sectioning.h"
43 static void cm_exampleindent (void),
44 cm_firstparagraphindent (void),
45 cm_paragraphindent (void),
49 static void cm_obsolete (int arg
, int start
, int end
),
50 not_fixed_width (int arg
);
52 /* The dispatch table. */
53 COMMAND command_table
[] = {
54 { "\t", insert_space
, NO_BRACE_ARGS
},
55 { "\n", insert_space
, NO_BRACE_ARGS
},
56 { " ", insert_space
, NO_BRACE_ARGS
},
57 { "!", cm_punct
, NO_BRACE_ARGS
},
58 { "\"", cm_accent_umlaut
, MAYBE_BRACE_ARGS
},
59 { "'", cm_accent_acute
, MAYBE_BRACE_ARGS
},
60 { "*", cm_asterisk
, NO_BRACE_ARGS
},
61 { ",", cm_accent_cedilla
, MAYBE_BRACE_ARGS
},
62 { "-", cm_no_op
, NO_BRACE_ARGS
},
63 { ".", cm_punct
, NO_BRACE_ARGS
},
64 { "/", cm_no_op
, NO_BRACE_ARGS
},
65 { ":", cm_colon
, NO_BRACE_ARGS
},
66 { "=", cm_accent
, MAYBE_BRACE_ARGS
},
67 { "?", cm_punct
, NO_BRACE_ARGS
},
68 { "@", insert_self
, NO_BRACE_ARGS
},
69 { "\\", insert_self
, NO_BRACE_ARGS
},
70 { "^", cm_accent_hat
, MAYBE_BRACE_ARGS
},
71 { "`", cm_accent_grave
, MAYBE_BRACE_ARGS
},
72 { "{", insert_self
, NO_BRACE_ARGS
},
73 { "|", cm_no_op
, NO_BRACE_ARGS
},
74 { "}", insert_self
, NO_BRACE_ARGS
},
75 { "~", cm_accent_tilde
, MAYBE_BRACE_ARGS
},
76 { "AA", cm_special_char
, BRACE_ARGS
},
77 { "AE", cm_special_char
, BRACE_ARGS
},
78 { "H", cm_accent
, MAYBE_BRACE_ARGS
},
79 { "L", cm_special_char
, BRACE_ARGS
},
80 { "LaTeX", cm_LaTeX
, BRACE_ARGS
},
81 { "O", cm_special_char
, BRACE_ARGS
},
82 { "OE", cm_special_char
, BRACE_ARGS
},
83 { "TeX", cm_TeX
, BRACE_ARGS
},
84 { "aa", cm_special_char
, BRACE_ARGS
},
85 { "abbr", cm_abbr
, BRACE_ARGS
},
86 { "acronym", cm_acronym
, BRACE_ARGS
},
87 { "ae", cm_special_char
, BRACE_ARGS
},
88 { "afivepaper", cm_ignore_line
, NO_BRACE_ARGS
},
89 { "afourlatex", cm_ignore_line
, NO_BRACE_ARGS
},
90 { "afourpaper", cm_ignore_line
, NO_BRACE_ARGS
},
91 { "afourwide", cm_ignore_line
, NO_BRACE_ARGS
},
92 { "alias", cm_alias
, NO_BRACE_ARGS
},
93 { "anchor", cm_anchor
, BRACE_ARGS
},
94 { "appendix", cm_appendix
, NO_BRACE_ARGS
},
95 { "appendixsection", cm_appendixsec
, NO_BRACE_ARGS
},
96 { "appendixsec", cm_appendixsec
, NO_BRACE_ARGS
},
97 { "appendixsubsec", cm_appendixsubsec
, NO_BRACE_ARGS
},
98 { "appendixsubsubsec", cm_appendixsubsubsec
, NO_BRACE_ARGS
},
99 { "asis", cm_no_op
, BRACE_ARGS
},
100 { "author", cm_author
, NO_BRACE_ARGS
},
101 { "b", cm_b
, BRACE_ARGS
},
102 { "bullet", cm_bullet
, BRACE_ARGS
},
103 { "bye", cm_bye
, NO_BRACE_ARGS
},
104 { "c", cm_comment
, NO_BRACE_ARGS
},
105 { "caption", cm_caption
, BRACE_ARGS
},
106 { "cartouche", cm_cartouche
, NO_BRACE_ARGS
},
107 { "center", cm_center
, NO_BRACE_ARGS
},
108 { "centerchap", cm_unnumbered
, NO_BRACE_ARGS
},
109 { "chapheading", cm_chapheading
, NO_BRACE_ARGS
},
110 { "chapter", cm_chapter
, NO_BRACE_ARGS
},
111 { "cindex", cm_cindex
, NO_BRACE_ARGS
},
112 { "cite", cm_cite
, BRACE_ARGS
},
113 { "clear", cm_clear
, NO_BRACE_ARGS
},
114 { "code", cm_code
, BRACE_ARGS
},
115 { "comma", cm_comma
, BRACE_ARGS
},
116 { "command", cm_code
, BRACE_ARGS
},
117 { "comment", cm_comment
, NO_BRACE_ARGS
},
118 { "contents", cm_contents
, NO_BRACE_ARGS
},
119 { "copying", cm_copying
, NO_BRACE_ARGS
},
120 { "copyright", cm_copyright
, BRACE_ARGS
},
121 { "ctrl", cm_obsolete
, BRACE_ARGS
},
122 { "defcodeindex", cm_defcodeindex
, NO_BRACE_ARGS
},
123 { "defcv", cm_defun
, NO_BRACE_ARGS
},
124 { "defcvx", cm_defun
, NO_BRACE_ARGS
},
125 { "deffn", cm_defun
, NO_BRACE_ARGS
},
126 { "deffnx", cm_defun
, NO_BRACE_ARGS
},
127 { "defindex", cm_defindex
, NO_BRACE_ARGS
},
128 { "definfoenclose", cm_definfoenclose
, NO_BRACE_ARGS
},
129 { "defivar", cm_defun
, NO_BRACE_ARGS
},
130 { "defivarx", cm_defun
, NO_BRACE_ARGS
},
131 { "defmac", cm_defun
, NO_BRACE_ARGS
},
132 { "defmacx", cm_defun
, NO_BRACE_ARGS
},
133 { "defmethod", cm_defun
, NO_BRACE_ARGS
},
134 { "defmethodx", cm_defun
, NO_BRACE_ARGS
},
135 { "defop", cm_defun
, NO_BRACE_ARGS
},
136 { "defopt", cm_defun
, NO_BRACE_ARGS
},
137 { "defoptx", cm_defun
, NO_BRACE_ARGS
},
138 { "defopx", cm_defun
, NO_BRACE_ARGS
},
139 { "defspec", cm_defun
, NO_BRACE_ARGS
},
140 { "defspecx", cm_defun
, NO_BRACE_ARGS
},
141 { "deftp", cm_defun
, NO_BRACE_ARGS
},
142 { "deftpx", cm_defun
, NO_BRACE_ARGS
},
143 { "deftypecv", cm_defun
, NO_BRACE_ARGS
},
144 { "deftypecvx", cm_defun
, NO_BRACE_ARGS
},
145 { "deftypefn", cm_defun
, NO_BRACE_ARGS
},
146 { "deftypefnx", cm_defun
, NO_BRACE_ARGS
},
147 { "deftypefun", cm_defun
, NO_BRACE_ARGS
},
148 { "deftypefunx", cm_defun
, NO_BRACE_ARGS
},
149 { "deftypeivar", cm_defun
, NO_BRACE_ARGS
},
150 { "deftypeivarx", cm_defun
, NO_BRACE_ARGS
},
151 { "deftypemethod", cm_defun
, NO_BRACE_ARGS
},
152 { "deftypemethodx", cm_defun
, NO_BRACE_ARGS
},
153 { "deftypeop", cm_defun
, NO_BRACE_ARGS
},
154 { "deftypeopx", cm_defun
, NO_BRACE_ARGS
},
155 { "deftypevar", cm_defun
, NO_BRACE_ARGS
},
156 { "deftypevarx", cm_defun
, NO_BRACE_ARGS
},
157 { "deftypevr", cm_defun
, NO_BRACE_ARGS
},
158 { "deftypevrx", cm_defun
, NO_BRACE_ARGS
},
159 { "defun", cm_defun
, NO_BRACE_ARGS
},
160 { "defunx", cm_defun
, NO_BRACE_ARGS
},
161 { "defvar", cm_defun
, NO_BRACE_ARGS
},
162 { "defvarx", cm_defun
, NO_BRACE_ARGS
},
163 { "defvr", cm_defun
, NO_BRACE_ARGS
},
164 { "defvrx", cm_defun
, NO_BRACE_ARGS
},
165 { "detailmenu", cm_detailmenu
, NO_BRACE_ARGS
},
166 { "dfn", cm_dfn
, BRACE_ARGS
},
167 { "dircategory", cm_dircategory
, NO_BRACE_ARGS
},
168 { "direntry", cm_direntry
, NO_BRACE_ARGS
},
169 { "display", cm_display
, NO_BRACE_ARGS
},
170 { "dmn", cm_dmn
, BRACE_ARGS
},
171 { "docbook", cm_docbook
, NO_BRACE_ARGS
},
172 { "documentdescription", cm_documentdescription
, NO_BRACE_ARGS
},
173 { "documentencoding", cm_documentencoding
, NO_BRACE_ARGS
},
174 { "documentlanguage", cm_documentlanguage
, NO_BRACE_ARGS
},
175 { "dotaccent", cm_accent
, MAYBE_BRACE_ARGS
},
176 { "dotless", cm_dotless
, BRACE_ARGS
},
177 { "dots", cm_dots
, BRACE_ARGS
},
178 { "email", cm_email
, BRACE_ARGS
},
179 { "emph", cm_emph
, BRACE_ARGS
},
180 { "end", cm_end
, NO_BRACE_ARGS
},
181 { "enddots", cm_enddots
, BRACE_ARGS
},
182 { "enumerate", cm_enumerate
, NO_BRACE_ARGS
},
183 { "env", cm_code
, BRACE_ARGS
},
184 { "equiv", cm_equiv
, BRACE_ARGS
},
185 { "error", cm_error
, BRACE_ARGS
},
186 { "euro", cm_special_char
, BRACE_ARGS
},
187 { "evenfooting", cm_ignore_line
, NO_BRACE_ARGS
},
188 { "evenheading", cm_ignore_line
, NO_BRACE_ARGS
},
189 { "everyfooting", cm_ignore_line
, NO_BRACE_ARGS
},
190 { "everyheading", cm_ignore_line
, NO_BRACE_ARGS
},
191 { "example", cm_example
, NO_BRACE_ARGS
},
192 { "exampleindent", cm_exampleindent
, NO_BRACE_ARGS
},
193 { "exclamdown", cm_special_char
, BRACE_ARGS
},
194 { "exdent", cm_exdent
, NO_BRACE_ARGS
},
195 { "expansion", cm_expansion
, BRACE_ARGS
},
196 { "file", cm_code
, BRACE_ARGS
},
197 { "finalout", cm_no_op
, NO_BRACE_ARGS
},
198 { "findex", cm_findex
, NO_BRACE_ARGS
},
199 { "firstparagraphindent", cm_firstparagraphindent
, NO_BRACE_ARGS
},
200 { "float", cm_float
, NO_BRACE_ARGS
},
201 { "flushleft", cm_flushleft
, NO_BRACE_ARGS
},
202 { "flushright", cm_flushright
, NO_BRACE_ARGS
},
203 { "footnote", cm_footnote
, NO_BRACE_ARGS
}, /* self-arg eater */
204 { "footnotestyle", cm_footnotestyle
, NO_BRACE_ARGS
},
205 { "format", cm_format
, NO_BRACE_ARGS
},
206 { "ftable", cm_ftable
, NO_BRACE_ARGS
},
207 { "group", cm_group
, NO_BRACE_ARGS
},
208 { "heading", cm_heading
, NO_BRACE_ARGS
},
209 { "headings", cm_ignore_line
, NO_BRACE_ARGS
},
210 { "headitem", cm_headitem
, NO_BRACE_ARGS
},
211 { "html", cm_html
, NO_BRACE_ARGS
},
212 { "hyphenation", cm_ignore_arg
, BRACE_ARGS
},
213 { "i", cm_i
, BRACE_ARGS
},
214 { "ifclear", cm_ifclear
, NO_BRACE_ARGS
},
215 { "ifeq", cm_ifeq
, NO_BRACE_ARGS
},
216 { "ifdocbook", cm_ifdocbook
, NO_BRACE_ARGS
},
217 { "ifhtml", cm_ifhtml
, NO_BRACE_ARGS
},
218 { "ifinfo", cm_ifinfo
, NO_BRACE_ARGS
},
219 { "ifnotdocbook", cm_ifnotdocbook
, NO_BRACE_ARGS
},
220 { "ifnothtml", cm_ifnothtml
, NO_BRACE_ARGS
},
221 { "ifnotinfo", cm_ifnotinfo
, NO_BRACE_ARGS
},
222 { "ifnotplaintext", cm_ifnotplaintext
, NO_BRACE_ARGS
},
223 { "ifnottex", cm_ifnottex
, NO_BRACE_ARGS
},
224 { "ifnotxml", cm_ifnotxml
, NO_BRACE_ARGS
},
225 { "ifplaintext", cm_ifplaintext
, NO_BRACE_ARGS
},
226 { "ifset", cm_ifset
, NO_BRACE_ARGS
},
227 { "iftex", cm_iftex
, NO_BRACE_ARGS
},
228 { "ifxml", cm_ifxml
, NO_BRACE_ARGS
},
229 { "ignore", command_name_condition
, NO_BRACE_ARGS
},
230 { "image", cm_image
, BRACE_ARGS
},
231 { "include", cm_include
, NO_BRACE_ARGS
},
232 { "indent", cm_indent
, NO_BRACE_ARGS
},
233 { "indicateurl", cm_indicate_url
, BRACE_ARGS
},
234 { "inforef", cm_inforef
, BRACE_ARGS
},
235 { "insertcopying", cm_insert_copying
, NO_BRACE_ARGS
},
236 { "item", cm_item
, NO_BRACE_ARGS
},
237 { "itemize", cm_itemize
, NO_BRACE_ARGS
},
238 { "itemx", cm_itemx
, NO_BRACE_ARGS
},
239 { "kbd", cm_kbd
, BRACE_ARGS
},
240 { "kbdinputstyle", cm_ignore_line
, NO_BRACE_ARGS
},
241 { "key", cm_key
, BRACE_ARGS
},
242 { "kindex", cm_kindex
, NO_BRACE_ARGS
},
243 { "l", cm_special_char
, BRACE_ARGS
},
244 { "lisp", cm_lisp
, NO_BRACE_ARGS
},
245 { "listoffloats", cm_listoffloats
, NO_BRACE_ARGS
},
246 { "lowersections", cm_lowersections
, NO_BRACE_ARGS
},
247 { "macro", cm_macro
, NO_BRACE_ARGS
},
248 { "majorheading", cm_majorheading
, NO_BRACE_ARGS
},
249 { "math", cm_math
, BRACE_ARGS
},
250 { "menu", cm_menu
, NO_BRACE_ARGS
},
251 { "minus", cm_minus
, BRACE_ARGS
},
252 { "multitable", cm_multitable
, NO_BRACE_ARGS
},
253 { "need", cm_ignore_line
, NO_BRACE_ARGS
},
254 { "node", cm_node
, NO_BRACE_ARGS
},
255 { "noindent", cm_noindent_cmd
, NO_BRACE_ARGS
},
256 { "novalidate", cm_novalidate
, NO_BRACE_ARGS
},
257 { "nwnode", cm_node
, NO_BRACE_ARGS
},
258 { "o", cm_special_char
, BRACE_ARGS
},
259 { "oddfooting", cm_ignore_line
, NO_BRACE_ARGS
},
260 { "oddheading", cm_ignore_line
, NO_BRACE_ARGS
},
261 { "oe", cm_special_char
, BRACE_ARGS
},
262 { "option", cm_code
, BRACE_ARGS
},
263 { "ordf", cm_special_char
, BRACE_ARGS
},
264 { "ordm", cm_special_char
, BRACE_ARGS
},
265 { "page", cm_no_op
, NO_BRACE_ARGS
},
266 { "pagesizes", cm_ignore_line
, NO_BRACE_ARGS
},
267 { "paragraphindent", cm_paragraphindent
, NO_BRACE_ARGS
},
268 { "pindex", cm_pindex
, NO_BRACE_ARGS
},
269 { "point", cm_point
, BRACE_ARGS
},
270 { "pounds", cm_special_char
, BRACE_ARGS
},
271 { "print", cm_print
, BRACE_ARGS
},
272 { "printindex", cm_printindex
, NO_BRACE_ARGS
},
273 { "pxref", cm_pxref
, BRACE_ARGS
},
274 { "questiondown", cm_special_char
, BRACE_ARGS
},
275 { "quotation", cm_quotation
, NO_BRACE_ARGS
},
276 { "r", cm_r
, BRACE_ARGS
},
277 { "raisesections", cm_raisesections
, NO_BRACE_ARGS
},
278 { "ref", cm_ref
, BRACE_ARGS
},
279 { "refill", cm_no_op
, NO_BRACE_ARGS
},
280 { "registeredsymbol", cm_registeredsymbol
, BRACE_ARGS
},
281 { "result", cm_result
, BRACE_ARGS
},
282 { "ringaccent", cm_accent
, MAYBE_BRACE_ARGS
},
283 { "rmacro", cm_rmacro
, NO_BRACE_ARGS
},
284 { "samp", cm_code
, BRACE_ARGS
},
285 { "sansserif", cm_sansserif
, BRACE_ARGS
},
286 { "sc", cm_sc
, BRACE_ARGS
},
287 { "section", cm_section
, NO_BRACE_ARGS
},
288 { "set", cm_set
, NO_BRACE_ARGS
},
289 { "setchapternewpage", cm_ignore_line
, NO_BRACE_ARGS
},
290 { "setchapterstyle", cm_obsolete
, NO_BRACE_ARGS
},
291 { "setcontentsaftertitlepage", cm_no_op
, NO_BRACE_ARGS
},
292 { "setfilename", cm_setfilename
, NO_BRACE_ARGS
},
293 { "setshortcontentsaftertitlepage", cm_no_op
, NO_BRACE_ARGS
},
294 { "settitle", cm_settitle
, NO_BRACE_ARGS
},
295 { "shortcaption", cm_caption
, BRACE_ARGS
},
296 { "shortcontents", cm_contents
, NO_BRACE_ARGS
},
297 { "shorttitlepage", cm_ignore_line
, NO_BRACE_ARGS
},
298 { "slanted", cm_slanted
, BRACE_ARGS
},
299 { "smallbook", cm_ignore_line
, NO_BRACE_ARGS
},
300 { "smalldisplay", cm_smalldisplay
, NO_BRACE_ARGS
},
301 { "smallexample", cm_smallexample
, NO_BRACE_ARGS
},
302 { "smallformat", cm_smallformat
, NO_BRACE_ARGS
},
303 { "smalllisp", cm_smalllisp
, NO_BRACE_ARGS
},
304 { "sp", cm_sp
, NO_BRACE_ARGS
},
305 { "ss", cm_special_char
, BRACE_ARGS
},
306 { "strong", cm_strong
, BRACE_ARGS
},
307 { "subheading", cm_subheading
, NO_BRACE_ARGS
},
308 { "subsection", cm_subsection
, NO_BRACE_ARGS
},
309 { "subsubheading", cm_subsubheading
, NO_BRACE_ARGS
},
310 { "subsubsection", cm_subsubsection
, NO_BRACE_ARGS
},
311 { "subtitle", cm_titlepage_cmds
, NO_BRACE_ARGS
},
312 { "summarycontents", cm_contents
, NO_BRACE_ARGS
},
313 { "syncodeindex", cm_synindex
, NO_BRACE_ARGS
},
314 { "synindex", cm_synindex
, NO_BRACE_ARGS
},
315 { "t", cm_tt
, BRACE_ARGS
},
316 { "tab", cm_tab
, NO_BRACE_ARGS
},
317 { "table", cm_table
, NO_BRACE_ARGS
},
318 { "tex", cm_tex
, NO_BRACE_ARGS
},
319 { "tie", cm_tie
, BRACE_ARGS
},
320 { "tieaccent", cm_accent
, MAYBE_BRACE_ARGS
},
321 { "tindex", cm_tindex
, NO_BRACE_ARGS
},
322 { "title", cm_titlepage_cmds
, NO_BRACE_ARGS
},
323 { "titlefont", cm_titlefont
, BRACE_ARGS
},
324 { "titlepage", cm_titlepage
, NO_BRACE_ARGS
},
325 { "today", cm_today
, BRACE_ARGS
},
326 { "top", cm_top
, NO_BRACE_ARGS
},
327 { "u", cm_accent
, MAYBE_BRACE_ARGS
},
328 { "ubaraccent", cm_accent
, MAYBE_BRACE_ARGS
},
329 { "udotaccent", cm_accent
, MAYBE_BRACE_ARGS
},
330 { "unmacro", cm_unmacro
, NO_BRACE_ARGS
},
331 { "unnumbered", cm_unnumbered
, NO_BRACE_ARGS
},
332 { "unnumberedsec", cm_unnumberedsec
, NO_BRACE_ARGS
},
333 { "unnumberedsubsec", cm_unnumberedsubsec
, NO_BRACE_ARGS
},
334 { "unnumberedsubsubsec", cm_unnumberedsubsubsec
, NO_BRACE_ARGS
},
335 { "uref", cm_uref
, BRACE_ARGS
},
336 { "url", cm_uref
, BRACE_ARGS
},
337 { "v", cm_accent
, MAYBE_BRACE_ARGS
},
338 { "value", cm_value
, BRACE_ARGS
},
339 { "var", cm_var
, BRACE_ARGS
},
340 { "verb", cm_verb
, NO_BRACE_ARGS
},
341 { "verbatim", cm_verbatim
, NO_BRACE_ARGS
},
342 { "verbatiminclude", cm_verbatiminclude
, NO_BRACE_ARGS
},
343 { "vindex", cm_vindex
, NO_BRACE_ARGS
},
344 { "vtable", cm_vtable
, NO_BRACE_ARGS
},
345 { "vskip", cm_ignore_line
, NO_BRACE_ARGS
},
346 { "w", cm_w
, BRACE_ARGS
},
347 { "xml", cm_xml
, NO_BRACE_ARGS
},
348 { "xref", cm_xref
, BRACE_ARGS
},
350 /* Deprecated commands. These used to be for italics. */
351 { "iappendix", cm_ideprecated
, NO_BRACE_ARGS
},
352 { "iappendixsec", cm_ideprecated
, NO_BRACE_ARGS
},
353 { "iappendixsection", cm_ideprecated
, NO_BRACE_ARGS
},
354 { "iappendixsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
355 { "iappendixsubsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
356 { "ichapter", cm_ideprecated
, NO_BRACE_ARGS
},
357 { "isection", cm_ideprecated
, NO_BRACE_ARGS
},
358 { "isubsection", cm_ideprecated
, NO_BRACE_ARGS
},
359 { "isubsubsection", cm_ideprecated
, NO_BRACE_ARGS
},
360 { "iunnumbered", cm_ideprecated
, NO_BRACE_ARGS
},
361 { "iunnumberedsec", cm_ideprecated
, NO_BRACE_ARGS
},
362 { "iunnumberedsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
363 { "iunnumberedsubsubsec", cm_ideprecated
, NO_BRACE_ARGS
},
365 /* Now @include does what this was used to. */
366 { "infoinclude", cm_obsolete
, NO_BRACE_ARGS
},
367 { "titlespec", cm_obsolete
, NO_BRACE_ARGS
},
369 { NULL
, NULL
, NO_BRACE_ARGS
}
372 /* The bulk of the Texinfo commands. */
374 /* Commands which insert their own names. */
376 insert_self (int arg
)
383 insert_space (int arg
)
388 xml_insert_entity ("space");
394 /* Insert a comma. Useful when a literal , would break our parsing of
395 multiple arguments. */
404 /* Force a line break in the output. */
410 else if (xml
&& !docbook
)
411 xml_insert_entity ("linebreak");
416 close_single_paragraph ();
421 /* Insert ellipsis. */
428 xml_insert_entity ("dots");
430 xml_insert_entity ("hellip");
432 if (html
&& !in_fixed_width_font
)
433 insert_string ("<small class=\"dots\">...</small>");
439 /* Insert ellipsis for sentence end. */
446 xml_insert_entity ("enddots");
449 xml_insert_entity ("hellip");
453 if (html
&& !in_fixed_width_font
)
454 insert_string ("<small class=\"enddots\">....</small>");
467 else if (xml
&& !docbook
)
468 xml_insert_entity ("bullet");
470 xml_insert_entity ("bull");
482 xml_insert_entity ("minus");
484 add_word ("−");
490 /* Formatting a dimension unit. */
495 insert_html_tag_with_attribute (arg
, "span", "class=\"dmn\"");
497 /* No units in docbook yet. */
500 xml_insert_element (DIMENSION
, arg
);
507 static int last_position
;
512 xml_insert_entity ("tex");
516 last_position
= output_paragraph_offset
;
518 else if (last_position
!= output_paragraph_offset
)
520 warning (_("arguments to @%s ignored"), command
);
521 output_paragraph_offset
= last_position
;
525 /* Insert "LaTeX". */
529 static int last_position
;
534 xml_insert_entity ("latex");
538 last_position
= output_paragraph_offset
;
540 else if (last_position
!= output_paragraph_offset
)
542 warning (_("arguments to @%s ignored"), command
);
543 output_paragraph_offset
= last_position
;
547 /* Copyright symbol. */
549 cm_copyright (int arg
)
555 else if (xml
&& !docbook
)
556 xml_insert_entity ("copyright");
558 xml_insert_entity ("copy");
564 /* Registered symbol. */
566 cm_registeredsymbol (int arg
)
573 xml_insert_entity ("reg");
574 else if (xml
&& !docbook
)
575 xml_insert_entity ("registered");
584 static char *months
[12] =
585 { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"),
586 N_("June"), N_("July"), N_("August"), N_("September"), N_("October"),
587 N_("November"), N_("December") };
590 time_t timer
= time (0);
591 struct tm
*ts
= localtime (&timer
);
592 add_word_args ("%d %s %d", ts
->tm_mday
, _(months
[ts
->tm_mon
]),
600 /* For HTML, do not output comments before HTML header is written,
601 otherwise comments before @settitle cause an empty <title> in the
603 if ((html
&& html_output_head_p
) || xml
)
606 get_rest_of_line (0, &line
);
608 if (strlen (line
) > 0)
610 int save_inhibit_indentation
= inhibit_paragraph_indentation
;
611 int save_paragraph_is_open
= paragraph_is_open
;
612 int save_escape_html
= escape_html
;
613 int save_xml_no_para
= xml_no_para
;
616 inhibit_paragraph_indentation
= 1;
620 /* @c and @comment can appear between @item and @itemx,
621 @deffn and @deffnx. */
622 xml_dont_touch_items_defs
++;
624 /* Use insert for HTML, and XML when indentation is enabled.
625 For Docbook, use add_char. */
626 if (xml
&& xml_indentation_increment
> 0
627 && output_paragraph
[output_paragraph_offset
-1] != '\n')
630 /* Crunch double hyphens in comments. */
631 add_html_block_elt ("<!-- ");
632 for (i
= 0; i
< strlen (line
); i
++)
633 if (line
[i
] != '-' || (i
&& line
[i
-1] != '-'))
640 inhibit_paragraph_indentation
= save_inhibit_indentation
;
641 paragraph_is_open
= save_paragraph_is_open
;
642 escape_html
= save_escape_html
;
643 xml_no_para
= save_xml_no_para
;
644 xml_dont_touch_items_defs
--;
655 /* We keep acronyms with two arguments around, to be able to refer to them
656 later with only one argument. */
657 static ACRONYM_DESC
*acronyms_stack
= NULL
;
660 cm_acronym_or_abbr (int arg
, int is_abbr
)
662 char *aa
, *description
;
665 /* We do everything at START. */
669 get_until_in_braces (",", &aa
);
670 if (input_text
[input_text_offset
] == ',')
672 get_until_in_braces ("}", &description
);
675 canon_white (description
);
677 /* If not enclosed in braces, strip after comma to be compatible
679 if (description
[0] != '{' && strchr (description
, ',') != NULL
)
682 while (description
[i
] != ',')
684 /* For now, just terminate the string at comma. */
688 /* Get description out of braces. */
689 if (description
[0] == '{')
692 len
= strlen (description
);
693 if (len
&& description
[len
-1] == '}')
694 description
[len
-1] = 0;
696 /* Save new description. */
697 if (strlen (description
) > 0)
699 ACRONYM_DESC
*new = xmalloc (sizeof (ACRONYM_DESC
));
701 new->acronym
= xstrdup (aa
);
702 new->description
= xstrdup (description
);
703 new->next
= acronyms_stack
;
704 acronyms_stack
= new;
709 add_word (is_abbr
? "<abbr" : "<acronym");
711 if (strlen (description
) > 0)
712 add_word_args (" title=\"%s\"", text_expansion (description
));
713 else if (acronyms_stack
)
715 /* No second argument, get from previous. Search order is from
716 last to first defined, so we get the most recent version of
718 ACRONYM_DESC
*temp
= acronyms_stack
;
722 if (STREQ (aa
, temp
->acronym
)
723 && strlen (temp
->description
) > 0)
725 add_word_args (" title=\"%s\"",
726 text_expansion (temp
->description
));
734 execute_string ("%s", aa
);
735 add_word (is_abbr
? "</abbr>" : "</acronym>");
739 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, START
);
740 execute_string ("%s", aa
);
741 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, END
);
745 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, START
);
747 xml_insert_element (is_abbr
? ABBREVWORD
: ACRONYMWORD
, START
);
748 execute_string ("%s", aa
);
749 xml_insert_element (is_abbr
? ABBREVWORD
: ACRONYMWORD
, END
);
751 if (strlen (description
) > 0)
753 xml_insert_element (is_abbr
? ABBREVDESC
: ACRONYMDESC
, START
);
754 execute_string ("%s", description
);
755 xml_insert_element (is_abbr
? ABBREVDESC
: ACRONYMDESC
, END
);
758 xml_insert_element (is_abbr
? ABBREV
: ACRONYM
, END
);
761 execute_string ("%s", aa
);
763 /* Put description into parenthesis after the acronym for all outputs
765 if (strlen (description
) > 0 && (!xml
|| docbook
))
766 add_word_args (" (%s)", description
);
772 cm_acronym_or_abbr (arg
, 0);
778 cm_acronym_or_abbr (arg
, 1);
784 /* @t{} is a no-op in Info. */
786 insert_html_tag (arg
, "tt");
788 xml_insert_element (TT
, arg
);
795 in_fixed_width_font
++;
799 if (STREQ (command
, "command"))
800 xml_insert_element (COMMAND_TAG
, arg
);
801 else if (STREQ (command
, "env"))
802 xml_insert_element (ENV
, arg
);
803 else if (STREQ (command
, "file"))
804 xml_insert_element (FILE_TAG
, arg
);
805 else if (STREQ (command
, "option"))
806 xml_insert_element (OPTION
, arg
);
807 else if (STREQ (command
, "samp"))
809 if (docbook
&& arg
== START
)
811 /* Even though @samp is in_fixed_width_font, it
812 should always start a paragraph. Unfortunately,
813 in_fixed_width_font inhibits that. */
815 xml_insert_entity ("lsquo");
817 xml_insert_element (SAMP
, arg
);
818 if (docbook
&& arg
== END
)
819 xml_insert_entity ("rsquo");
822 xml_insert_element (CODE
, arg
);
826 if (STREQ (command
, "code"))
827 insert_html_tag (arg
, "code");
829 { /* Use <samp> tag in general to get typewriter. */
831 { /* If @samp specifically, add quotes a la TeX output. */
832 if (STREQ (command
, "samp")) add_char ('`');
835 insert_html_tag_with_attribute (arg
, "span", "class=\"%s\"",command
);
838 add_word ("</samp>");
839 if (STREQ (command
, "samp")) add_char ('\'');
845 extern int printing_index
;
852 add_meta_char ('\'');
861 xml_insert_element (KBD
, arg
);
863 { /* Seems like we should increment in_fixed_width_font for Info
864 format too, but then the quote-omitting special case gets
867 in_fixed_width_font
++;
868 insert_html_tag (arg
, "kbd");
871 { /* People use @kbd in an example to get the "user input" font.
872 We don't want quotes in that case. */
873 if (!in_fixed_width_font
)
878 /* Just show a url (http://example.org/..., for example), don't link to it. */
880 cm_indicate_url (int arg
, int start
, int end
)
883 xml_insert_element (URL
, arg
);
888 insert_html_tag (arg
, "code");
903 xml_insert_element (KEY
, arg
);
905 add_word (arg
== START
? "<" : ">");
907 add_char (arg
== START
? '<' : '>');
910 /* Handle a command that switches to a non-fixed-width font. */
912 not_fixed_width (int arg
)
915 in_fixed_width_font
= 0;
918 /* @var in makeinfo just uppercases the text. */
920 cm_var (int arg
, int start_pos
, int end_pos
)
923 xml_insert_element (VAR
, arg
);
926 not_fixed_width (arg
);
929 insert_html_tag (arg
, "var");
932 while (start_pos
< end_pos
)
934 unsigned char c
= output_paragraph
[start_pos
];
935 if (strchr ("[](),", c
))
936 warning (_("unlikely character %c in @var"), c
);
937 output_paragraph
[start_pos
] = coerce_to_upper (c
);
945 cm_sc (int arg
, int start_pos
, int end_pos
)
948 xml_insert_element (SC
, arg
);
951 not_fixed_width (arg
);
956 insert_html_tag_with_attribute (arg
, "span", "class=\"sc\"");
963 start_pos
+= sizeof ("<span class=\"sc\">") - 1; /* skip <span> */
965 /* Avoid the warning below if there's no text inside @sc{}, or
966 when processing menus under --no-headers. */
967 all_upper
= start_pos
< end_pos
;
969 while (start_pos
< end_pos
)
971 unsigned char c
= output_paragraph
[start_pos
];
975 output_paragraph
[start_pos
] = coerce_to_upper (c
);
979 warning (_("@sc argument all uppercase, thus no effect"));
982 insert_html_tag (arg
, "span");
988 cm_dfn (int arg
, int position
)
991 xml_insert_element (DFN
, arg
);
995 insert_html_tag (arg
, "dfn");
996 else if (arg
== START
)
1007 xml_insert_element (EMPH
, arg
);
1009 insert_html_tag (arg
, "em");
1018 int delimiter
= 0; /* avoid warning */
1021 in_fixed_width_font
++;
1022 /* are these necessary ? */
1023 last_char_was_newline
= 0;
1028 if (input_text_offset
< input_text_length
)
1030 character
= curchar ();
1031 if (character
== '{')
1032 input_text_offset
++;
1034 line_error (_("`{' expected, but saw `%c'"), character
);
1037 if (input_text_offset
< input_text_length
)
1039 delimiter
= curchar ();
1040 input_text_offset
++;
1043 while (input_text_offset
< input_text_length
)
1045 character
= curchar ();
1047 if (character
== '\n')
1051 add_word ("<br>\n");
1054 else if (html
&& character
== '<')
1057 else if (html
&& character
== '&')
1060 else if (character
== delimiter
&& input_text
[input_text_offset
+1] == '}')
1061 { /* Assume no newlines in END_VERBATIM. */
1063 input_text_offset
++;
1068 add_char (character
);
1070 input_text_offset
++;
1074 warning (_("end of file inside verb block"));
1076 if (input_text_offset
< input_text_length
)
1078 character
= curchar ();
1079 if (character
== '}')
1080 input_text_offset
++;
1082 line_error (_("`}' expected, but saw `%c'"), character
);
1088 in_fixed_width_font
--;
1093 cm_strong (int arg
, int start_pos
, int end_pos
)
1095 if (docbook
&& arg
== START
)
1096 xml_insert_element_with_attribute (B
, arg
, "role=\"bold\"");
1098 xml_insert_element (STRONG
, arg
);
1100 insert_html_tag (arg
, "strong");
1104 if (!xml
&& !html
&& !docbook
&& !no_headers
1106 && end_pos
- start_pos
>= 6
1107 && (STRNCASEEQ ((char *) output_paragraph
+ start_pos
, "*Note:", 6)
1108 || STRNCASEEQ ((char *) output_paragraph
+ start_pos
, "*Note ", 6)))
1110 /* Translators: "Note:" is literal here and should not be
1111 translated. @strong{Nota}, say, does not cause the problem. */
1112 warning (_("@strong{Note...} produces a spurious cross-reference in Info; reword to avoid that"));
1113 /* Adjust the output to avoid writing the bad xref. */
1114 output_paragraph
[start_pos
+ 5] = '_';
1119 cm_cite (int arg
, int position
)
1122 xml_insert_element (CITE
, arg
);
1124 insert_html_tag (arg
, "cite");
1134 /* No highlighting, but argument switches fonts. */
1136 cm_not_fixed_width (int arg
, int start
, int end
)
1139 xml_insert_element (NOTFIXEDWIDTH
, arg
);
1140 not_fixed_width (arg
);
1146 /* Make use of <lineannotation> of Docbook, if we are
1147 inside an @example or similar. */
1148 extern int printing_index
;
1149 if (docbook
&& !filling_enabled
&& !printing_index
)
1150 xml_insert_element (LINEANNOTATION
, arg
);
1152 xml_insert_element (I
, arg
);
1154 insert_html_tag (arg
, "i");
1156 not_fixed_width (arg
);
1160 cm_slanted (int arg
)
1162 /* Make use of <lineannotation> of Docbook, if we are
1163 inside an @example or similar. */
1164 extern int printing_index
;
1165 if (docbook
&& !filling_enabled
&& !printing_index
)
1166 xml_insert_element (LINEANNOTATION
, arg
);
1168 xml_insert_element (SLANTED
, arg
);
1170 insert_html_tag (arg
, "i");
1172 not_fixed_width (arg
);
1178 /* See cm_i comments. */
1179 extern int printing_index
;
1180 if (docbook
&& !filling_enabled
&& !printing_index
)
1181 xml_insert_element (LINEANNOTATION
, arg
);
1182 else if (docbook
&& arg
== START
)
1183 xml_insert_element_with_attribute (B
, arg
, "role=\"bold\"");
1185 xml_insert_element (B
, arg
);
1187 insert_html_tag (arg
, "b");
1189 not_fixed_width (arg
);
1195 /* See cm_i comments. */
1196 extern int printing_index
;
1197 if (docbook
&& !filling_enabled
&& !printing_index
)
1198 xml_insert_element (LINEANNOTATION
, arg
);
1200 xml_insert_element (R
, arg
);
1202 insert_html_tag_with_attribute (arg
, "span", "class=\"roman\"");
1204 not_fixed_width (arg
);
1208 cm_sansserif (int arg
)
1210 /* See cm_i comments. */
1211 extern int printing_index
;
1212 if (docbook
&& !filling_enabled
&& !printing_index
)
1213 xml_insert_element (LINEANNOTATION
, arg
);
1215 xml_insert_element (SANSSERIF
, arg
);
1217 insert_html_tag_with_attribute (arg
, "span", "class=\"sansserif\"");
1219 not_fixed_width (arg
);
1223 cm_titlefont (int arg
)
1226 xml_insert_element (TITLEFONT
, arg
);
1229 not_fixed_width (arg
);
1232 html_title_written
= 1; /* suppress title from @settitle */
1234 add_word ("<h1 class=\"titlefont\">");
1236 add_word ("</h1>\n");
1242 /* Unfortunately, we cannot interpret @math{} contents like TeX does. We just
1243 pass them through. */
1247 if (xml
&& !docbook
)
1248 xml_insert_element (MATH
, arg
);
1251 /* Various commands are no-op's. */
1258 /* For proofing single chapters, etc. */
1260 cm_novalidate (void)
1266 /* Prevent the argument from being split across two lines. */
1271 non_splitting_words
++;
1274 if (docbook
|| html
|| xml
)
1275 /* This is so @w{$}Log$ doesn't end up as <dollar>Log<dollar>
1277 insert_string ("<!-- /@w -->");
1279 non_splitting_words
--;
1284 /* An unbreakable word space. Same as @w{ } for makeinfo, but different
1285 for TeX (the space stretches and stretches, and does not inhibit
1299 /* Explain that this command is obsolete, thus the user shouldn't
1300 do anything with it. */
1302 cm_obsolete (int arg
, int start
, int end
)
1305 warning (_("%c%s is obsolete"), COMMAND_PREFIX
, command
);
1309 /* Inhibit the indentation of the next paragraph, but not of following
1314 if (!inhibit_paragraph_indentation
)
1315 inhibit_paragraph_indentation
= -1;
1319 cm_noindent_cmd (void)
1323 skip_whitespace_and_newlines();
1327 else if (html
&& !paragraph_is_open
)
1328 add_html_block_elt ("<p class=\"noindent\">");
1331 paragraph_is_open
= 0;
1336 /* Force indentation of the next paragraph. */
1340 inhibit_paragraph_indentation
= 0;
1342 skip_whitespace_and_newlines();
1346 else if (html
&& !paragraph_is_open
)
1347 add_html_block_elt ("<p class=\"indent\">");
1352 /* I don't know exactly what to do with this. Should I allow
1353 someone to switch filenames in the middle of output? Since the
1354 file could be partially written, this doesn't seem to make sense.
1355 Another option: ignore it, since they don't really want to
1356 switch files. Finally, complain, or at least warn. It doesn't
1357 really matter, anyway, since this doesn't get executed. */
1359 cm_setfilename (void)
1362 get_rest_of_line (1, &filename
);
1363 /* warning ("`@%s %s' encountered and ignored", command, filename); */
1365 add_word_args ("<setfilename>%s</setfilename>", filename
);
1374 xml_begin_document (current_output_filename
);
1375 xml_insert_element (SETTITLE
, START
);
1376 xml_in_book_title
= 1;
1377 get_rest_of_line (0, &title
);
1378 execute_string ("%s", title
);
1379 xml_in_book_title
= 0;
1380 xml_insert_element (SETTITLE
, END
);
1383 get_rest_of_line (0, &title
);
1387 /* Ignore argument in braces. */
1389 cm_ignore_arg (int arg
, int start_pos
, int end_pos
)
1392 output_paragraph_offset
= start_pos
;
1395 /* Ignore argument on rest of line. */
1397 cm_ignore_line (void)
1399 discard_until ("\n");
1402 /* Insert the number of blank lines passed as argument. */
1409 /* Due to tricky stuff in execute_string(), @value{} can't be expanded.
1410 So there is really no reason to enable expansion for @sp parameters. */
1411 get_rest_of_line (0, &line
);
1413 if (sscanf (line
, "%d", &lines
) != 1 || lines
<= 0)
1414 line_error (_("@sp requires a positive numeric argument, not `%s'"), line
);
1419 /* @sp can appear between @item and @itemx, @deffn and @deffnx. */
1420 xml_dont_touch_items_defs
++;
1421 xml_insert_element_with_attribute (SP
, START
, "lines=\"%s\"", line
);
1422 /* insert_string (line);*/
1423 xml_insert_element (SP
, END
);
1424 xml_dont_touch_items_defs
--;
1428 /* Must disable filling since otherwise multiple newlines is like
1429 multiple spaces. Must close paragraph since that's what the
1430 manual says and that's what TeX does. */
1431 int save_filling_enabled
= filling_enabled
;
1432 filling_enabled
= 0;
1434 /* close_paragraph generates an extra blank line. */
1435 close_single_paragraph ();
1437 if (lines
&& html
&& !executing_string
)
1438 html_output_head ();
1441 add_html_block_elt ("<pre class=\"sp\">\n");
1447 add_html_block_elt ("</pre>\n");
1449 filling_enabled
= save_filling_enabled
;
1455 /* @dircategory LINE outputs INFO-DIR-SECTION LINE, unless --no-headers. */
1457 cm_dircategory (void)
1461 if (html
|| docbook
)
1465 xml_insert_element (DIRCATEGORY
, START
);
1466 get_rest_of_line (1, &line
);
1467 insert_string (line
);
1469 xml_insert_element (DIRCATEGORY
, END
);
1473 get_rest_of_line (1, &line
);
1475 if (!no_headers
&& !html
)
1477 kill_self_indent (-1); /* make sure there's no indentation */
1478 insert_string ("INFO-DIR-SECTION ");
1479 insert_string (line
);
1487 /* Start a new line with just this text on it.
1488 Then center the line of text.
1496 xml_insert_element (CENTER
, START
);
1497 get_rest_of_line (0, &line
);
1498 execute_string ("%s", line
);
1500 xml_insert_element (CENTER
, END
);
1504 int i
, start
, length
;
1506 int save_indented_fill
= indented_fill
;
1507 int save_filling_enabled
= filling_enabled
;
1508 int fudge_factor
= 1;
1510 filling_enabled
= indented_fill
= 0;
1512 start
= output_paragraph_offset
;
1515 add_html_block_elt ("<div align=\"center\">");
1517 inhibit_output_flushing ();
1518 get_rest_of_line (0, &line
);
1519 execute_string ("%s", line
);
1521 uninhibit_output_flushing ();
1523 add_html_block_elt ("</div>");
1527 i
= output_paragraph_offset
- 1;
1528 while (i
> (start
- 1) && output_paragraph
[i
] == '\n')
1531 output_paragraph_offset
= ++i
;
1532 length
= output_paragraph_offset
- start
;
1534 if (length
< (fill_column
- fudge_factor
))
1536 line
= xmalloc (1 + length
);
1537 memcpy (line
, (char *)(output_paragraph
+ start
), length
);
1539 i
= (fill_column
- fudge_factor
- length
) / 2;
1540 output_paragraph_offset
= start
;
1545 for (i
= 0; i
< length
; i
++)
1553 filling_enabled
= save_filling_enabled
;
1554 indented_fill
= save_indented_fill
;
1555 close_single_paragraph ();
1556 if (looking_at("\n"))
1561 /* Show what an expression returns. */
1566 add_word (html
? "=>" : "=>");
1569 /* What an expression expands to. */
1571 cm_expansion (int arg
)
1574 add_word (html
? "==>" : "==>");
1577 /* Indicates two expressions are equivalent. */
1585 /* What an expression may print. */
1593 /* An error signaled. */
1598 add_word (html
? "error-->" : "error-->");
1601 /* The location of point in an example of a buffer. */
1609 /* @exdent: Start a new line with just this text on it.
1610 The text is outdented one level if possible. */
1615 int save_indent
= current_indent
;
1616 int save_in_fixed_width_font
= in_fixed_width_font
;
1618 /* Read argument. */
1619 get_rest_of_line (0, &line
);
1621 /* Exdent the output. Actually this may be a no-op. */
1623 current_indent
-= default_indentation_increment
;
1625 /* @exdent arg is supposed to be in roman. */
1626 in_fixed_width_font
= 0;
1628 /* The preceding newline already inserted the `current_indent'.
1629 Remove one level's worth. */
1630 kill_self_indent (default_indentation_increment
);
1635 xml_insert_element (LINEANNOTATION
, START
);
1637 xml_insert_element (EXDENT
, START
);
1639 /* Can't close_single_paragraph, then we lose preceding blank lines. */
1641 execute_string ("%s", line
);
1648 xml_insert_element (docbook
? LINEANNOTATION
: EXDENT
, END
);
1652 close_single_paragraph ();
1654 current_indent
= save_indent
;
1655 in_fixed_width_font
= save_in_fixed_width_font
;
1661 Read include-filename, process the include-file:
1662 verbatim_include == 0: process through reader_loop
1663 verbatim_include != 0: process through handle_verbatim_environment
1666 handle_include (int verbatim_include
)
1668 char *arg
, *filename
;
1670 if (macro_expansion_output_stream
&& !executing_string
)
1671 me_append_before_this_command ();
1673 if (!insertion_stack
)
1674 close_paragraph (); /* No blank lines etc. if not at outer level. */
1676 get_rest_of_line (0, &arg
);
1677 /* We really only want to expand @value, but it's easier to just do
1678 everything. TeX will only work with @value. */
1679 filename
= text_expansion (arg
);
1682 if (macro_expansion_output_stream
&& !executing_string
)
1683 remember_itext (input_text
, input_text_offset
);
1687 /* In verbose mode we print info about including another file. */
1691 FSTACK
*stack
= filestack
;
1693 for (i
= 0, stack
= filestack
; stack
; stack
= stack
->next
, i
++);
1697 printf ("%*s", i
, "");
1698 printf ("%c%s `%s'\n", COMMAND_PREFIX
, command
, filename
);
1702 if (!find_and_load (filename
, 1))
1707 /* /wh/bar:5: @include/@verbatiminclude `foo': No such file or dir */
1708 line_error ("%c%s `%s': %s", COMMAND_PREFIX
, command
, filename
,
1716 if (macro_expansion_output_stream
&& !executing_string
)
1717 remember_itext (input_text
, input_text_offset
);
1719 if (!verbatim_include
)
1722 handle_verbatim_environment (0);
1729 /* Include file as if put in @verbatim environment */
1731 cm_verbatiminclude (void)
1737 /* Remember this file, and move onto the next. */
1745 /* @bye: Signals end of processing. Easy to make this happen. */
1750 discard_braces (); /* should not have any unclosed braces left */
1751 input_text_offset
= input_text_length
;
1754 /* @paragraphindent */
1757 cm_paragraphindent (void)
1761 get_rest_of_line (1, &arg
);
1762 if (set_paragraph_indent (arg
) != 0)
1763 line_error (_("Bad argument to %c%s"), COMMAND_PREFIX
, command
);
1769 /* @exampleindent: change indentation of example-like environments. */
1771 set_example_indentation_increment (char *string
)
1773 if (strcmp (string
, "asis") == 0 || strcmp (string
, _("asis")) == 0)
1775 else if (strcmp (string
, "none") == 0 || strcmp (string
, _("none")) == 0)
1776 example_indentation_increment
= 0;
1777 else if (sscanf (string
, "%d", &example_indentation_increment
) != 1)
1783 cm_exampleindent (void)
1787 get_rest_of_line (1, &arg
);
1788 if (set_example_indentation_increment (arg
) != 0)
1789 line_error (_("Bad argument to @%s"), command
);
1791 if (input_text
[input_text_offset
] == '\n')
1792 close_single_paragraph ();
1798 /* @firstparagraphindent: suppress indentation in first paragraphs after
1801 set_firstparagraphindent (char *string
)
1803 if (STREQ (string
, "insert") || STREQ (string
, _("insert")))
1804 do_first_par_indent
= 1;
1805 else if (STREQ (string
, "none") || STREQ (string
, _("none")))
1806 do_first_par_indent
= 0;
1813 cm_firstparagraphindent (void)
1817 get_rest_of_line (1, &arg
);
1818 if (set_firstparagraphindent (arg
) != 0)
1819 line_error (_("Bad argument to %c%s"), COMMAND_PREFIX
, command
);
1824 /* For DocBook and XML, produce . for `.@:'. This gives the processing
1825 software a fighting chance to treat it specially by not adding extra space.
1827 Do this also for ?, !, and :. */
1833 if (strchr (".?!:", input_text
[input_text_offset
-3]) != NULL
)
1835 /* Erase literal character that's there, except `>', which is
1836 part of the XML tag. */
1837 if (output_paragraph
[output_paragraph_offset
-1] != '>')
1838 output_paragraph_offset
--;
1840 switch (input_text
[input_text_offset
-3])
1843 xml_insert_entity ("period");
1846 xml_insert_entity ("quest");
1849 xml_insert_entity ("excl");
1852 xml_insert_entity ("colon");
1859 /* Ending sentences explicitly. Currently, only outputs entities for XML
1860 output, for other formats it calls insert_self. */
1864 if (xml
&& !docbook
)
1866 switch (input_text
[input_text_offset
-1])
1869 xml_insert_entity ("eosperiod");
1872 xml_insert_entity ("eosquest");
1875 xml_insert_entity ("eosexcl");