. make vgrind 8-bit clean; note that it still implicitly assumes
ISO-8859-1, since the characters are simply being passed on to groff . introduce an option to override the silly default to `psroff' as the post-processor . document the new option
This commit is contained in:
parent
b8e251a56d
commit
71503758d4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18164
@ -565,14 +565,14 @@ putKcp (start, end, force)
|
||||
if (i > 0) {
|
||||
ps("\\*(+K");
|
||||
do
|
||||
putcp(*start++);
|
||||
putcp((unsigned char)*start++);
|
||||
while (--i > 0);
|
||||
ps("\\*(-K");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
putcp (*start++);
|
||||
putcp ((unsigned char)*start++);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,10 @@ or
|
||||
.Pp
|
||||
In regular mode
|
||||
.Nm vgrind
|
||||
accepts input files, processes them, and passes them to
|
||||
.Xr troff 1
|
||||
for output.
|
||||
accepts input files, processes them, and passes them to the postprocessor
|
||||
for output,
|
||||
.Xr psroff 1
|
||||
by default.
|
||||
.Pp
|
||||
In both modes
|
||||
.Nm vgrind
|
||||
@ -122,6 +123,8 @@ specifies the language to use. Currently known are
|
||||
C
|
||||
.Pf ( Fl l Ns Ar c
|
||||
or the default),
|
||||
.Tn C++
|
||||
.Pq Fl l Ns Ar c++ ,
|
||||
.Tn CSH
|
||||
.Pq Fl l Ns Ar csh ,
|
||||
.Tn SHELL
|
||||
@ -139,6 +142,12 @@ and
|
||||
.Pq Fl l Ns Ar I .
|
||||
.It Fl n
|
||||
forces no keyword bolding
|
||||
.It Fl p Ar postproc
|
||||
use
|
||||
.Ar postproc
|
||||
to post-process the output,
|
||||
.Xr psroff 1
|
||||
by default.
|
||||
.It Fl s
|
||||
specifies a point size to use on output (exactly the same as the argument
|
||||
of a .ps)
|
||||
|
@ -41,6 +41,7 @@ set f=''
|
||||
set head=""
|
||||
set vf=/usr/libexec/vfontedpr
|
||||
set tm=/usr/share/tmac
|
||||
set postproc=psroff
|
||||
top:
|
||||
if ($#argv > 0) then
|
||||
switch ($1:q)
|
||||
@ -88,6 +89,17 @@ if ($#argv > 0) then
|
||||
goto top
|
||||
endif
|
||||
|
||||
case -p:
|
||||
if ($#argv < 2) then
|
||||
echo "vgrind: $1:q option must have argument"
|
||||
goto done
|
||||
else
|
||||
set postproc="$2"
|
||||
shift
|
||||
shift
|
||||
goto top
|
||||
endif
|
||||
|
||||
case -*:
|
||||
set options = "$options $1:q"
|
||||
shift
|
||||
@ -116,10 +128,10 @@ if (-r index) then
|
||||
else
|
||||
if ("$head" != "") then
|
||||
$vf $options -h "$head" $files | \
|
||||
sh -c "psroff -rx1 $voptions -i -mvgrind 2>> xindex"
|
||||
sh -c "$postproc -rx1 $voptions -i -mvgrind 2>> xindex"
|
||||
else
|
||||
$vf $options $files | \
|
||||
sh -c "psroff -rx1 $voptions -i -mvgrind 2>> xindex"
|
||||
sh -c "$postproc -rx1 $voptions -i -mvgrind 2>> xindex"
|
||||
endif
|
||||
endif
|
||||
sort -df +0 -2 xindex >index
|
||||
@ -133,9 +145,9 @@ else
|
||||
endif
|
||||
else
|
||||
if ("$head" != "") then
|
||||
$vf $options -h "$head" $files | psroff -i $voptions -mvgrind
|
||||
$vf $options -h "$head" $files | $postproc -i $voptions -mvgrind
|
||||
else
|
||||
$vf $options $files | psroff -i $voptions -mvgrind
|
||||
$vf $options $files | $postproc -i $voptions -mvgrind
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user