Subject: Re: bug#4826: 23.1; woman-manpath, woman-man.conf-path on MS Windows with Cygwin

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Oct 2009 11:40:31 +0200

> From: "Drew Adams" <[email-masked]>
> Date: Thu, 29 Oct 2009 14:51:36 -0700
> 
> Where should Emacs look? How about looking to the most common UNIX simulation
> for Windows? Look to the commonly used program that actually installs a UNIX
> manual on Windows. Where would you have Emacs look for a model - at your
> personal directory structure, which you mention as a counter-example?

GnuWin32 is the most popular and most up-to-date and actively
maintained collection of GNU utilities to native Windows, and its
archives come with man pages.  I think this qualifies as the
``commonly used program that actually installs a UNIX manual on
Windows''.  But GnuWin32 installs the man pages in the `man'
sub-directory under wherever you unzip the archives.  That doesn't
help to resolve this problem, unfortunately.  (As you might have
guessed, I install them under `D:/usr'.)

You suggest to cater to Cygwin first and foremost, but Cygwin defaults
are better suited to the Cygwin build of Emacs (and I believe there,
the current Unix defaults work out of the box anyway).  Native Windows
build of Emacs does not necessarily need to consider Cygwin as the
best default.

> This is already the approach we take for `woman-man.conf-path'. The default
> value for that user option, on Windows (emacs -Q), is ("C:/cygwin/lib"
> "C:/cygwin/etc"). Why do we use the Cygwin directories here? Because they
> provide a reasonable default behavior on Windows.

No, we use these directories for `woman-man.conf-path' because Cygwin
is about the only Windows collection of tools that brings a port of
`man' program which supports the `man' config files.  Other ports of
`man' don't have and don't support that file.

> And there is already code in woman.el that converts UNIX directories to
> Cygwin-Windows directories - see `woman-Cyg-to-Win' and
> `woman-parse-colon-path'. That code tries to do a good job of figuring out which
> Windows file names to use. Why shouldn't we do something similar for
> `woman-manpath'?

This is again Cygwin-specific, because Cygwin uses Unix-style path
lists where directories are separated by colons rather than by
semi-colons.  Native Windows tools will always use semi-colon
separated lists in MANPATH.

To summarize, I think the solution I suggested is the best:

> > If anything, I would suggest writing some code to look up the
> > directories in the default value on every drive that is on a local
> > hard disk, then perhaps do the same under /Cygwin on each drive.

This should work both for you and for me, and probably for most anyone
else.

Unfortunately, I'm too busy these days to implement it.  Volunteers
are welcome.