summaryrefslogtreecommitdiff
path: root/support/emacs-modes/cweave.ch
blob: 38c4050e07fa3a614cef592c3fa755b4a00419bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%
%  cweave.ch  by Mark Motl for the purpose of separating the index
%  and module names into files INDEX.tex and MODULE_NAMES.tex
%  respectively.  These are used in the web-mode for gnu-emacs.

@x
@* Introduction.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.

@d banner "This is CWEAVE ($Revision: 1.9 $)\n"
@y
@* Introduction.
The ``banner line'' defined here should be changed whenever \.{CWEAVE}
is modified.

@d banner "CWEAVE ($Rev: 1.9 $), writes INDEX.tex and MODULE_NAMES.tex\n"
@z


@x
@ @c phase_three() {
if (no_xref) {
  finish_line();
  out_str("\\vfill\\end");
  finish_line();
}
else {
  phase=3; printf("\nWriting the index...");
  if (change_exists) {
    finish_line(); @<Tell about changed modules@>;
  }
  finish_line(); out_str("\\inx"); finish_line();
@.\\inx@>
  @<Do the first pass of sorting@>;
  @<Sort and output the index@>;
  out_str("\\fin"); finish_line();
@.\\fin@>
  @<Output all the module names@>;
  out_str("\\con"); finish_line();
@.\\con@>
}
printf("Done.");
check_complete(); /* was all of the change file used? */
}
@y
@ @c phase_three() {
if (no_xref) {
  finish_line();
  out_str("\\vfill\\end");
  finish_line();
}
else {
  phase=3; printf("\nWriting the index...");
  finish_line(); 
  out_str("\\input INDEX"); finish_line(); finish_line();
  out_str("\\input MODULE_NAMES"); finish_line(); fclose(tex_file);
  if ((tex_file=fopen("INDEX.tex","w"))==NULL)
    fatal("! Cannot open ouput file ","INDEX.tex");  
  if (change_exists) { @<Tell about changed modules@>;
    finish_line(); finish_line(); }
  out_str("\\inx"); finish_line();
@.\\inx@>
  @<Do the first pass of sorting@>;
  @<Sort and output the index@>;
  out_str("\\fin"); finish_line(); fclose(tex_file);
@.\\fin@>
  if ((tex_file=fopen("MODULE_NAMES.tex","w"))==NULL)
    fatal("! Cannot open ouput file ","MODULE_NAMES.tex");  
  @<Output all the module names@>;
  out_str("\\con"); finish_line(); fclose(tex_file);
@.\\con@>
}
printf("Done.");
check_complete(); /* was all of the change file used? */
}
@z