diff options
author | wlemb <wlemb> | 2003-04-18 06:37:18 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2003-04-18 06:37:18 +0000 |
commit | 722725db5f8e2cbc9490e7b5900dda324592b94e (patch) | |
tree | e1050a3a47eb3645a8d9189baa5961168f2a549c | |
parent | 2250faa6dbcc2143b10ae0729c4fabff0093cab7 (diff) | |
download | groff-722725db5f8e2cbc9490e7b5900dda324592b94e.tar.gz |
Add option -r to soelim to avoid emission of `.lf' lines.
Add option -t to produces TeX comment lines instead of `.lf' lines.
* src/preproc/soelim/soelim.cpp: New global variables `raw_flag'
and `tex_flag'.
(usage): Updated.
(main): Handle `-r' and `-t'.
(set_location): Handle `raw_flag' and `tex_flag'.
* src/preproc/soelim/soelim.man, NEWS: Updated.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | NEWS | 8 | ||||
-rw-r--r-- | src/preproc/soelim/soelim.cpp | 19 | ||||
-rw-r--r-- | src/preproc/soelim/soelim.man | 22 |
4 files changed, 56 insertions, 5 deletions
@@ -1,3 +1,15 @@ +2003-04-17 Hartmut Henkel <hartmut_henkel@gmx.de> + + Add option -r to soelim to avoid emission of `.lf' lines. + Add option -t to produces TeX comment lines instead of `.lf' lines. + + * src/preproc/soelim/soelim.cpp: New global variables `raw_flag' + and `tex_flag'. + (usage): Updated. + (main): Handle `-r' and `-t'. + (set_location): Handle `raw_flag' and `tex_flag'. + * src/preproc/soelim/soelim.man, NEWS: Updated. + 2003-04-17 Werner LEMBERG <wl@gnu.org> * tmac/hyphenex.sh: Replaced with... @@ -140,6 +140,14 @@ Refer o The environment variable `REFER' to override the name of the default database isn't new but hasn't been documented before. +Soelim +------ + +o New option `-r' to avoid emission of `.lf' lines. + +o New option `-t' to emit TeX comment lines (giving current file and the + line number) instead of `.lf' lines. + Afmtodit -------- diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp index a32d62e2..96ad6dd1 100644 --- a/src/preproc/soelim/soelim.cpp +++ b/src/preproc/soelim/soelim.cpp @@ -33,6 +33,8 @@ static size_t include_list_length; static const char **include_list; int compatible_flag = 0; +int raw_flag = 0; +int tex_flag = 0; extern int interpret_lf_args(const char *); extern "C" const char *Version_string; @@ -60,7 +62,7 @@ include_path_append(const char *path) void usage(FILE *stream) { - fprintf(stream, "usage: %s [ -vC ] [ -I file ] [ files ]\n", program_name); + fprintf(stream, "usage: %s [ -Crtv ] [ -I file ] [ files ]\n", program_name); } int main(int argc, char **argv) @@ -73,7 +75,7 @@ int main(int argc, char **argv) { "version", no_argument, 0, 'v' }, { NULL, 0, 0, 0 } }; - while ((opt = getopt_long(argc, argv, "CI:v", long_options, NULL)) != EOF) + while ((opt = getopt_long(argc, argv, "CI:rtv", long_options, NULL)) != EOF) switch (opt) { case 'v': { @@ -87,6 +89,12 @@ int main(int argc, char **argv) case 'I': include_path_append(optarg); break; + case 'r': + raw_flag = 1; + break; + case 't': + tex_flag = 1; + break; case CHAR_MAX + 1: // --help usage(stdout); exit(0); @@ -111,7 +119,12 @@ int main(int argc, char **argv) void set_location() { - printf(".lf %d %s\n", current_lineno, current_filename); + if(!raw_flag) { + if(!tex_flag) + printf(".lf %d %s\n", current_lineno, current_filename); + else + printf("%% file %s, line %d\n", current_filename, current_lineno); + } } void do_so(const char *line) diff --git a/src/preproc/soelim/soelim.man b/src/preproc/soelim/soelim.man index cf363d5c..7663e3bf 100644 --- a/src/preproc/soelim/soelim.man +++ b/src/preproc/soelim/soelim.man @@ -1,5 +1,5 @@ .ig -Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc. +Copyright (C) 1989-2000, 2001, 2003 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -17,12 +17,14 @@ translations approved by the Free Software Foundation instead of in the original English. .. .TH @G@SOELIM @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" +. .SH NAME @g@soelim \- interpret .so requests in groff input +. .SH SYNOPSIS .B @g@soelim [ -.B \-Cv +.B \-Crtv ] [ .BI \-I dir @@ -30,10 +32,12 @@ the original English. [ .IR files \|.\|.\|.\| ] +. .PP It is possible to have whitespace between the .B \-I command line option and its parameter. +. .SH DESCRIPTION .B @g@soelim reads @@ -53,6 +57,7 @@ should be invoked with the .B \-s option of .BR groff . +. .PP Note that there must be no whitespace between the leading dot and the two characters `s' and `o'. Otherwise, only @@ -62,12 +67,14 @@ interprets the request (and .B soelim ignores it). +. .SH OPTIONS .TP .B \-C Recognize .B .so even when followed by a character other than space or newline. +. .TP .BI \-I dir This option may be used to specify a directory to search for @@ -78,9 +85,20 @@ The current directory is always searched first. This option may be specified more than once, the directories will be searched in the order specified. No directory search is performed for files specified using an absolute path. +. +.TP +.B \-r +Do not add .lf requests (for general use, with non-groff files). +. +.TP +.B \-t +Don't emit .lf requests but TeX comment lines (starting with `%') giving +the current file and line number. +. .TP .B \-v Print the version number. +. .SH "SEE ALSO" .BR groff (@MAN1EXT@) . |