[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Introduction

From: Keith MARSHALL
Subject: Re: [Groff] Introduction
Date: Wed, 19 Oct 2005 10:38:06 +0100

Werner Lemberg wrote:
>> In the case of SGR sequences, unless the user specifically uses
>> the `--enable-sgr' option, [...]
> Keith, maybe you've sent this as a private mail to David ...

Not intentionally.  Looks like I hit "Reply" instead of "Reply-to-All",
forgetting that groff list mailings don't set the "Reply-to" header
appropriately :-(  Could this be altered, as say, the SourceForge mail
lists do?

> (who has replied accidentally to the list)?  It looks interesting,
> so I ask you to send the full text to the list.

The full text of my original message is reproduced below.  (Note that
where I cite `--with-nroff="/path/to/nroff -Tlatin1"' for configuration
of man's default nroff command, that should have been

  --with-nroff="/path/to/nroff -Tlatin1 -mandoc"



Quoting dialogue between David Evans and Werner Lemberg,
concerning the handling of SGR escape sequences in manpages:

> However, I think a better idea would be to do it through the
> configure script.  Did I overlook an option already present?

> What shall the *groff* configure script do?  Shouldn't this be rather
> something in the *man* configure script?

> The removal of the escape characters, etc., for a compatible output
> with OpenBSD's default, (this would be a configure option).  For
> now, I guess a simple note (to the INSTALL file) that man -R needs
> to be set globally to the system profile.

I agree with Werner;  this is a `man' configuration option, not one
for `groff'.

I am currently working on a port of `man' for the MinGW project.  As
a fundamental part of that port, I've opted for a reimplementation of
the configure script, from the ground up, using `autoconf';  (the
existing script is hand crafted, falls into many of the traps that
`autoconf' has long ago learned to avoid, and is, quite frankly, a
complete disaster on the Win32 platform).

When `man' is invoked, a search is performed in the `man' directories,
and then a command pipeline, culminating in `nroff <options> | $PAGER',
is constructed, and invoked via a `system()' call.  It's those options
passed by `man' to `nroff', coupled with any also specified for the
PAGER, that determine the handling of SGR escape sequences, so it
doesn't seem appropriate to try to control them when configuring

As part of the `man' configuration, the commands to run both `nroff'
and a default PAGER, together with the appropriate set of options for
each, are identified, and stored in a prototype `man.conf'.  In my new
configure script, I provide options such as `--with-nroff=command',
`--with-pager=command' and `--enable-sgr', to allow the user to
control the configuration of these;  my defaults are:--

   --with-nroff="/path/to/nroff -Tlatin1"
   --with-pager="/path/to/less -is"

with the `/path/to/programs' being determined by standard `autoconf'
PATH searches.

In the case of SGR sequences, unless the user specifically uses the
`--enable-sgr' option, `configure' will attempt to run the specified
`nroff' command, to format a minimal manpage, and `grep' the output for
an identifiable SGR sequence, before adding the `-c' option to the
configured `nroff' command.

As noted above, all this configuration info goes in the `man.conf' file.
This may be modified, even after installation, to adjust the behaviour
of `man';  `groff' documentation indicates how it may be necessary to
adjust the settings in `man.conf', and also identifies alternative
mechanisms for achieving similar effects, through environment variable
settings.  IMHO, this is as far as `groff' should be expected to go,
in this respect.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]