diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/emacs-modes/cweave.ch |
Initial commit
Diffstat (limited to 'support/emacs-modes/cweave.ch')
-rw-r--r-- | support/emacs-modes/cweave.ch | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/support/emacs-modes/cweave.ch b/support/emacs-modes/cweave.ch new file mode 100644 index 0000000000..38c4050e07 --- /dev/null +++ b/support/emacs-modes/cweave.ch @@ -0,0 +1,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 |