~ubuntu-branches/ubuntu/maverick/texinfo/maverick

« back to all changes in this revision

Viewing changes to makeinfo/defun.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2005-10-28 15:10:30 UTC
  • mto: (2.1.1 dapper) (3.1.4 hardy)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051028151030-9nsf2s2k2z3fktjt
Tags: upstream-4.8
ImportĀ upstreamĀ versionĀ 4.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* defun.c -- @defun and friends.
2
 
   $Id: defun.c,v 1.18 2002/01/22 18:01:24 karl Exp $
 
2
   $Id: defun.c,v 1.11 2004/04/11 17:56:46 karl Exp $
3
3
 
4
 
   Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc.
 
4
   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
 
5
   Foundation, Inc.
5
6
 
6
7
   This program is free software; you can redistribute it and/or modify
7
8
   it under the terms of the GNU General Public License as published by
19
20
 
20
21
#include "system.h"
21
22
#include "defun.h"
22
 
#include "docbook.h"
 
23
#include "xml.h"
23
24
#include "insertion.h"
24
25
#include "makeinfo.h"
 
26
#include "cmds.h"
 
27
#include "html.h"
25
28
 
26
29
 
27
30
#define DEFUN_SELF_DELIMITING(c) \
35
38
};
36
39
 
37
40
static void
38
 
initialize_token_accumulator (accumulator)
39
 
     struct token_accumulator *accumulator;
 
41
initialize_token_accumulator (struct token_accumulator *accumulator)
40
42
{
41
43
  accumulator->length = 0;
42
44
  accumulator->index = 0;
44
46
}
45
47
 
46
48
static void
47
 
accumulate_token (accumulator, token)
48
 
     struct token_accumulator *accumulator;
49
 
     char *token;
 
49
accumulate_token (struct token_accumulator *accumulator, char *token)
50
50
{
51
51
  if (accumulator->index >= accumulator->length)
52
52
    {
61
61
/* Given STRING_POINTER pointing at an open brace, skip forward and return a
62
62
   pointer to just past the matching close brace. */
63
63
static int
64
 
scan_group_in_string (string_pointer)
65
 
     char **string_pointer;
 
64
scan_group_in_string (char **string_pointer)
66
65
{
67
66
  char *scan_string = (*string_pointer) + 1;
68
67
  unsigned int level = 1;
 
68
  int started_command = 0;
69
69
 
70
70
  for (;;)
71
71
    {
80
80
        {
81
81
          /* Tweak line_number to compensate for fact that
82
82
             we gobbled the whole line before coming here. */
83
 
          line_number -= 1;
 
83
          line_number--;
84
84
          line_error (_("Missing `}' in @def arg"));
85
 
          line_number += 1;
 
85
          line_number++;
86
86
          *string_pointer = scan_string - 1;
87
87
          return 0;
88
88
        }
89
89
 
90
 
      if (c == '{')
91
 
        level += 1;
92
 
      if (c == '}')
93
 
        level -= 1;
 
90
      if (c == '{' && !started_command)
 
91
        level++;
 
92
      if (c == '}' && !started_command)
 
93
        level--;
 
94
 
 
95
      /* remember if at @.  */
 
96
      started_command = (c == '@' && !started_command);
94
97
    }
95
98
}
96
99
 
99
102
   Contiguous whitespace characters are converted to a token
100
103
   consisting of a single space. */
101
104
static char **
102
 
args_from_string (string)
103
 
     char *string;
 
105
args_from_string (char *string)
104
106
{
105
107
  struct token_accumulator accumulator;
106
108
  char *token_start, *token_end;
169
171
          token_end = balanced ? (scan_string - 1) : scan_string;
170
172
        }
171
173
 
 
174
      /* Make commas separate tokens so to differentiate them from
 
175
         parameter types in XML output. */
 
176
      else if (*scan_string == ',')
 
177
        {
 
178
          token_start = scan_string;
 
179
          scan_string += 1;
 
180
          token_end = scan_string;
 
181
        }
 
182
 
172
183
      /* Otherwise a token is delimited by whitespace, parentheses,
173
184
         brackets, or braces.  A token is also ended by a command. */
174
185
      else
191
202
                  break;
192
203
                }
193
204
 
 
205
              /* End token if we are looking at a comma, as commas are
 
206
                 delimiters too. */
 
207
              if (c == ',')
 
208
                {
 
209
                  scan_string--;
 
210
                  break;
 
211
                }
 
212
 
194
213
              /* If we encounter a command embedded within a token,
195
214
                 then end the token. */
196
215
              if (c == COMMAND_PREFIX)
209
228
}
210
229
 
211
230
static void
212
 
process_defun_args (defun_args, auto_var_p)
213
 
     char **defun_args;
214
 
     int auto_var_p;
 
231
process_defun_args (char **defun_args, int auto_var_p)
215
232
{
216
233
  int pending_space = 0;
217
234
 
 
235
  if (xml)
 
236
    {
 
237
      xml_process_defun_args (defun_args, auto_var_p);
 
238
      return;
 
239
    }
 
240
 
218
241
  for (;;)
219
242
    {
220
243
      char *defun_arg = *defun_args++;
235
258
        }
236
259
 
237
260
      if (DEFUN_SELF_DELIMITING (defun_arg[0]))
238
 
        add_char (defun_arg[0]);
239
 
      else if (defun_arg[0] == '&')
240
 
        if (html)
241
 
          {
242
 
            defun_arg = escape_string (xstrdup (defun_arg));
243
 
            add_word (defun_arg);
244
 
            free (defun_arg);
245
 
          }
246
 
        else
247
 
          add_word (defun_arg);
248
 
      else if (defun_arg[0] == COMMAND_PREFIX)
 
261
        {
 
262
          /* Within @deffn and friends, texinfo.tex makes parentheses
 
263
             sans serif and brackets bold.  We use roman instead.  */
 
264
          if (html)
 
265
            insert_html_tag (START, "");
 
266
            
 
267
          add_char (defun_arg[0]);
 
268
          
 
269
          if (html)
 
270
            insert_html_tag (END, "");
 
271
        }
 
272
      /* else if (defun_arg[0] == '&' || defun_arg[0] == COMMAND_PREFIX) */
 
273
        /* execute_string ("%s", defun_arg); */
 
274
      /* else if (auto_var_p) */
 
275
        /* execute_string ("%s", defun_arg); */
 
276
      else
249
277
        execute_string ("%s", defun_arg);
250
 
      else if (auto_var_p)
251
 
        if (html)
252
 
          {
253
 
            defun_arg = escape_string (xstrdup (defun_arg));
254
 
            add_word (defun_arg);
255
 
            free (defun_arg);
256
 
          }
257
 
        else
258
 
          add_word (defun_arg);
259
 
      else
260
 
        add_word (defun_arg);
261
278
    }
262
279
}
263
280
 
264
281
static char *
265
 
next_nonwhite_defun_arg (arg_pointer)
266
 
     char ***arg_pointer;
 
282
next_nonwhite_defun_arg (char ***arg_pointer)
267
283
{
268
284
  char **scan = (*arg_pointer);
269
285
  char *arg = (*scan++);
283
299
/* This is needed also in insertion.c.  */
284
300
 
285
301
enum insertion_type
286
 
get_base_type (type)
287
 
     enum insertion_type type;
 
302
get_base_type (int type)
288
303
{
289
 
  enum insertion_type base_type;
 
304
  int base_type;
290
305
  switch (type)
291
306
    {
292
307
    case defivar:       base_type = defcv; break;
294
309
    case defmethod:     base_type = defop; break;
295
310
    case defopt:        base_type = defvr; break;
296
311
    case defspec:       base_type = deffn; break;
 
312
    case deftypecv:     base_type = deftypecv; break;
297
313
    case deftypefun:    base_type = deftypefn; break;
298
314
    case deftypeivar:   base_type = deftypeivar; break;
299
315
    case deftypemethod: base_type = deftypemethod; break;
313
329
   TYPE says which insertion this is.
314
330
   X_P, if nonzero, says not to start a new insertion. */
315
331
static void
316
 
defun_internal (type, x_p)
317
 
     enum insertion_type type;
318
 
     int x_p;
 
332
defun_internal (int type, int x_p)
319
333
{
320
 
  enum insertion_type base_type;
 
334
  int base_type;
321
335
  char **defun_args, **scan_args;
322
 
  char *category, *defined_name, *type_name, *type_name2;
 
336
  const char *category;
 
337
  char *defined_name;
 
338
  char *type_name = NULL;
 
339
  char *type_name2 = NULL;
323
340
 
324
341
  {
325
342
    char *line;
341
358
       Unfortunately, this means that you can't call macros, use @value, etc.
342
359
       inside @def.. commands, sigh.  */
343
360
    get_rest_of_line (0, &line);
 
361
 
 
362
    /* Basic line continuation.  If a line ends with \s*@\s* concatanate
 
363
       the next line. */
 
364
    {
 
365
      char *next_line, *new_line;
 
366
      int i;
 
367
 
 
368
      line_continuation:
 
369
        i = strlen (line) - 1;
 
370
 
 
371
        if (line[i] == '@' && line[i-1] != '@')
 
372
          {
 
373
            get_rest_of_line (0, &next_line);
 
374
            new_line = (char *) xmalloc (i + strlen (next_line) + 2);
 
375
            strncpy (new_line, line, i);
 
376
            new_line[i] = '\0';
 
377
            free (line);
 
378
            strcat (new_line, " ");
 
379
            strcat (new_line, next_line);
 
380
            line = xstrdup (new_line);
 
381
            free (next_line);
 
382
            free (new_line);
 
383
 
 
384
            goto line_continuation;
 
385
          }
 
386
    }
 
387
 
344
388
    defun_args = (args_from_string (line));
345
389
    free (line);
346
390
  }
385
429
    }
386
430
 
387
431
  /* The class name.  */
388
 
  if ((base_type == deftypefn)
 
432
  if ((base_type == deftypecv)
 
433
      || (base_type == deftypefn)
389
434
      || (base_type == deftypevr)
390
435
      || (base_type == defcv)
391
436
      || (base_type == defop)
396
441
    type_name = next_nonwhite_defun_arg (&scan_args);
397
442
 
398
443
  /* The type name for typed languages.  */
399
 
  if ((base_type == deftypemethod)
 
444
  if ((base_type == deftypecv)
400
445
      || (base_type == deftypeivar)
 
446
      || (base_type == deftypemethod)
401
447
      || (base_type == deftypeop)
402
448
     )
403
449
    type_name2 = next_nonwhite_defun_arg (&scan_args);
429
475
  if (*scan_args && **scan_args && **scan_args == '(')
430
476
    warning ("`%c' follows defined name `%s' instead of whitespace",
431
477
             **scan_args, defined_name);
432
 
    
 
478
 
433
479
  if (!x_p)
434
480
    begin_insertion (type);
435
481
 
438
484
  current_indent -= default_indentation_increment;
439
485
  start_paragraph ();
440
486
 
441
 
  if (!x_p) {
442
 
    /* Start the definition on new paragraph.  */
443
 
    if (html)
444
 
      add_word ("<p>\n");
445
 
    if (docbook)
446
 
      docbook_begin_paragraph ();
447
 
  }
448
 
 
449
 
  if (!html && !docbook)
 
487
  if (!html && !xml)
450
488
    switch (base_type)
451
489
      {
452
490
      case deffn:
453
491
      case defvr:
454
492
      case deftp:
455
 
        execute_string (" -- %s: %s", category, defined_name);
 
493
        execute_string (" --- %s: %s", category, defined_name);
456
494
        break;
457
495
      case deftypefn:
458
496
      case deftypevr:
459
 
        execute_string (" -- %s: %s %s", category, type_name, defined_name);
 
497
        execute_string (" --- %s: %s %s", category, type_name, defined_name);
460
498
        break;
461
499
      case defcv:
462
 
        execute_string (" -- %s %s %s: %s", category, _("of"), type_name,
 
500
        execute_string (" --- %s %s %s: %s", category, _("of"), type_name,
463
501
                        defined_name);
464
502
        break;
 
503
      case deftypecv:
465
504
      case deftypeivar:
466
 
        execute_string (" -- %s %s %s: %s %s", category, _("of"), type_name,
 
505
        execute_string (" --- %s %s %s: %s %s", category, _("of"), type_name,
467
506
                        type_name2, defined_name);
468
507
        break;
469
508
      case defop:
470
 
        execute_string (" -- %s %s %s: %s", category, _("on"), type_name,
 
509
        execute_string (" --- %s %s %s: %s", category, _("on"), type_name,
471
510
                        defined_name);
472
511
        break;
473
512
      case deftypeop:
474
 
        execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name,
 
513
        execute_string (" --- %s %s %s: %s %s", category, _("on"), type_name,
475
514
                        type_name2, defined_name);
476
515
        break;
477
516
      case deftypemethod:
478
 
        execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name,
 
517
        execute_string (" --- %s %s %s: %s %s", category, _("on"), type_name,
479
518
                        type_name2, defined_name);
480
519
        break;
481
520
      }
482
 
 
483
 
  if (html)
 
521
  else if (html)
484
522
    {
485
523
      /* If this is not a @def...x version, it could only
486
524
         be a normal version @def.... So start the table here.  */
487
525
      if (!x_p)
488
 
        {
489
 
          add_html_elt ("<table width=");
490
 
          add_word ("\"100%\">\n");
491
 
        }
492
 
 
493
 
      /* If this is an @def...x there has to be an other @def... before
494
 
         it, so this is only a new row within an existing table.  With
495
 
         two complete standalone tables the gap between them is too big.  */
496
 
      add_word ("<tr>\n");
497
 
      add_html_elt ("<td align=\"left\">");
498
 
 
499
 
      switch (base_type)
500
 
        {
501
 
        case deffn:
502
 
        case defvr:
503
 
        case deftp:
504
 
          /* <i> is for the following function arguments.  */
505
 
          add_word ("<b>");
 
526
        insert_string ("<div class=\"defun\">\n");
 
527
      else
 
528
        rollback_empty_tag ("blockquote");
 
529
 
 
530
      /* xx The single words (on, off) used here, should depend on
 
531
         documentlanguage and NOT on gettext  --kama.  */
 
532
      switch (base_type)
 
533
        {
 
534
        case deffn:
 
535
        case defvr:
 
536
        case deftp:
 
537
        case deftypefn:
 
538
        case deftypevr:
 
539
          execute_string ("--- %s: ", category);
 
540
          break;
 
541
 
 
542
        case defcv:
 
543
        case deftypecv:
 
544
        case deftypeivar:
 
545
          execute_string ("--- %s %s %s: ", category, _("of"), type_name);
 
546
          break;
 
547
 
 
548
        case defop:
 
549
        case deftypemethod:
 
550
        case deftypeop:
 
551
          execute_string ("--- %s %s %s: ", category, _("on"), type_name);
 
552
          break;
 
553
        } /* switch (base_type)... */
 
554
 
 
555
      switch (base_type)
 
556
        {
 
557
        case deffn:
 
558
        case defvr:
 
559
        case deftp:
 
560
          /* <var> is for the following function arguments.  */
 
561
          insert_html_tag (START, "b");
506
562
          execute_string ("%s", defined_name);
507
 
          add_word ("</b><i>");
 
563
          insert_html_tag (END, "b");
 
564
          insert_html_tag (START, "var");
508
565
          break;
509
566
        case deftypefn:
510
567
        case deftypevr:
511
568
          execute_string ("%s ", type_name);
512
 
          add_word ("<b>");
 
569
          insert_html_tag (START, "b");
513
570
          execute_string ("%s", defined_name);
514
 
          add_word ("</b><i>");
 
571
          insert_html_tag (END, "b");
 
572
          insert_html_tag (START, "var");
515
573
          break;
516
574
        case defcv:
517
575
        case defop:
518
 
          add_word ("<b>");
 
576
          insert_html_tag (START, "b");
519
577
          execute_string ("%s", defined_name);
520
 
          add_word ("</b><i>");
 
578
          insert_html_tag (END, "b");
 
579
          insert_html_tag (START, "var");
521
580
          break;
 
581
        case deftypecv:
 
582
        case deftypeivar:
522
583
        case deftypemethod:
523
584
        case deftypeop:
524
 
        case deftypeivar:
525
585
          execute_string ("%s ", type_name2);
526
 
          add_word ("<b>");
 
586
          insert_html_tag (START, "b");
527
587
          execute_string ("%s", defined_name);
528
 
          add_word ("</b><i>");
529
 
          break;
530
 
        }
531
 
    } /* if (html)... */
532
 
 
533
 
  if (docbook)
534
 
    {
535
 
      switch (base_type)
536
 
        {
537
 
        case deffn:
538
 
        case defvr:
539
 
        case deftp:
540
 
        case defcv:
541
 
        case defop:
542
 
          add_word_args ("<%s>%s</%s>", DB_FUNCTION, defined_name,
543
 
                                        DB_FUNCTION);
544
 
          break;
545
 
        case deftypefn:
546
 
        case deftypevr:
547
 
          add_word_args ("%s <%s>%s</%s>", type_name, DB_FUNCTION,
548
 
                                           defined_name, DB_FUNCTION);
549
 
          break;
550
 
        case deftypemethod:
551
 
        case deftypeop:
552
 
        case deftypeivar:
553
 
          add_word_args ("%s <%s>%s</%s>", type_name2, DB_FUNCTION,
554
 
                                           defined_name, DB_FUNCTION);
555
 
          break;
556
 
        }
557
 
 
558
 
    } /* if (docbook)... */
 
588
          insert_html_tag (END, "b");
 
589
          insert_html_tag (START, "var");
 
590
          break;
 
591
        }
 
592
    }
 
593
  else if (xml)
 
594
    xml_begin_def_term (base_type, category, defined_name, type_name,
 
595
        type_name2);
559
596
 
560
597
  current_indent += default_indentation_increment;
561
598
 
585
622
    }
586
623
 
587
624
  current_indent -= default_indentation_increment;
588
 
  close_single_paragraph ();
589
 
 
590
 
  if (html)
591
 
    {
592
 
      /* xx The single words (on, off) used here, should depend on
593
 
         documentlanguage and NOT on gettext  --kama.  */
594
 
      switch (base_type)
595
 
        {
596
 
        case deffn:
597
 
        case defvr:
598
 
        case deftp:
599
 
        case deftypefn:
600
 
        case deftypevr:
601
 
          add_word ("</i>"); /* close italic area for arguments */
602
 
          /* put the rest into the second column */
603
 
          add_word ("</td>\n");
604
 
          add_html_elt ("<td align=\"right\">");
605
 
          execute_string ("%s", category);
606
 
          break;
607
 
 
608
 
        case defcv:
609
 
          add_word ("</td>\n");
610
 
          add_html_elt ("<td align=\"right\">");
611
 
          execute_string ("%s %s %s", category, _("of"), type_name);
612
 
          break;
613
 
 
614
 
        case defop:
615
 
        case deftypemethod:
616
 
        case deftypeop:
617
 
          add_word ("</i>");
618
 
          add_word ("</td>\n");
619
 
          add_html_elt ("<td align=\"right\">");
620
 
          execute_string ("%s %s %s", category, _("on"), type_name);
621
 
          break;
622
 
 
623
 
        case deftypeivar:
624
 
          add_word ("</i>");
625
 
          add_word ("</td>\n");
626
 
          add_html_elt ("<td align=\"right\">");
627
 
          execute_string ("%s %s %s", category, _("of"), type_name);
628
 
          break;
629
 
        } /* switch (base_type)... */
630
 
 
631
 
      add_word ("</td>\n"); /* close second column */
632
 
      add_word ("</tr>\n"); /* close row */
633
 
 
634
 
      /* This is needed because I have to know if the next line is
635
 
         normal text or another @def..x.  If text follows, create a new
636
 
         table to get the indentation for the following text.
637
 
 
638
 
         This construction would fail if someone uses:
639
 
          @deffn
640
 
          @sp 2
641
 
          @deffnx
642
 
          .
643
 
          @end deffn
644
 
         But we don't care. */
645
 
      if (!looking_at ("@def"))
646
 
        {
647
 
          add_word ("</table>\n");
648
 
          add_html_elt ("<table width=\"95%\" align=\"center\">");
649
 
          add_word ("\n<tr><td>\n");
650
 
        }
651
 
 
652
 
    } /* if (html)... */
653
 
 
654
 
  /* Make an entry in the appropriate index. */
655
 
  switch (base_type)
656
 
    {
657
 
    case deffn:
658
 
    case deftypefn:
659
 
      execute_string ("@findex %s\n", defined_name);
660
 
      break;
661
 
    case defvr:
662
 
    case deftypevr:
663
 
    case defcv:
664
 
      execute_string ("@vindex %s\n", defined_name);
665
 
      break;
666
 
    case deftypeivar:
667
 
      execute_string ("@vindex %s %s %s\n", defined_name, _("of"), type_name);
668
 
      break;
669
 
    case defop:
670
 
    case deftypeop:
671
 
    case deftypemethod:
672
 
      execute_string ("@findex %s %s %s\n", defined_name, _("on"), type_name);
673
 
      break;
674
 
    case deftp:
675
 
      execute_string ("@tindex %s\n", defined_name);
676
 
      break;
 
625
  if (!html)
 
626
    close_single_paragraph ();
 
627
 
 
628
  /* Make an entry in the appropriate index.  (XML and
 
629
     Docbook already got their entries, so skip them.)  */
 
630
  if (!xml)
 
631
    switch (base_type)
 
632
      {
 
633
      case deffn:
 
634
      case deftypefn:
 
635
        execute_string ("@findex %s\n", defined_name);
 
636
        break;
 
637
      case defcv:
 
638
      case deftypecv:
 
639
      case deftypevr:
 
640
      case defvr:
 
641
        execute_string ("@vindex %s\n", defined_name);
 
642
        break;
 
643
      case deftypeivar:
 
644
        execute_string ("@vindex %s %s %s\n", defined_name, _("of"),
 
645
                        type_name);
 
646
        break;
 
647
      case defop:
 
648
      case deftypeop:
 
649
      case deftypemethod:
 
650
        execute_string ("@findex %s %s %s\n", defined_name, _("on"),
 
651
                        type_name);
 
652
        break;
 
653
      case deftp:
 
654
        execute_string ("@tindex %s\n", defined_name);
 
655
        break;
 
656
      }
 
657
 
 
658
  if (xml)
 
659
    xml_end_def_term ();
 
660
  else if (html)
 
661
    {
 
662
      inhibit_paragraph_indentation = 1;
 
663
      no_indent = 1;
 
664
      insert_html_tag (END, "var");
 
665
      insert_string ("<br>\n");
 
666
      /* Indent the definition a bit.  */
 
667
      add_html_block_elt ("<blockquote>");
 
668
      no_indent = 0;
 
669
      inhibit_paragraph_indentation = 0;
 
670
      paragraph_is_open = 0;
677
671
    }
678
672
 
679
673
  /* Deallocate the token list. */
692
686
   If the name of the calling command ends in `x', then this is an extra
693
687
   entry included in the body of an insertion of the same type. */
694
688
void
695
 
cm_defun ()
 
689
cm_defun (void)
696
690
{
697
 
  int x_p;
698
 
  enum insertion_type type;
699
 
  char *temp = xstrdup (command);
700
 
 
701
 
  x_p = (command[strlen (command) - 1] == 'x');
 
691
  int type;
 
692
  char *base_command = xstrdup (command);  /* command with any `x' removed */
 
693
  int x_p = (command[strlen (command) - 1] == 'x');
702
694
 
703
695
  if (x_p)
704
 
    temp[strlen (temp) - 1] = 0;
 
696
    base_command[strlen (base_command) - 1] = 0;
705
697
 
706
 
  type = find_type_from_name (temp);
707
 
  free (temp);
 
698
  type = find_type_from_name (base_command);
708
699
 
709
700
  /* If we are adding to an already existing insertion, then make sure
710
701
     that we are already in an insertion of type TYPE. */
711
 
  if (x_p && (!insertion_level || insertion_stack->insertion != type))
 
702
  if (x_p)
712
703
    {
713
 
      line_error (_("Must be in `%s' insertion to use `%sx'"),
714
 
                  command, command);
715
 
      discard_until ("\n");
716
 
      return;
 
704
      INSERTION_ELT *i = insertion_stack;
 
705
      /* Skip over ifclear and ifset conditionals.  */
 
706
      while (i && (i->insertion == ifset || i->insertion == ifclear))
 
707
        i = i->next;
 
708
        
 
709
      if (!i || i->insertion != type)
 
710
        {
 
711
          line_error (_("Must be in `@%s' environment to use `@%s'"),
 
712
                      base_command, command);
 
713
          discard_until ("\n");
 
714
          return;
 
715
        }
717
716
    }
718
717
 
719
718
  defun_internal (type, x_p);
 
719
  free (base_command);
720
720
}