monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Please review nvm.man-page


From: Stephen Leake
Subject: Re: [Monotone-devel] Please review nvm.man-page
Date: Mon, 23 Aug 2010 05:48:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt)

Thomas Keller <address@hidden> writes:

> Am 21.08.10 15:20, schrieb Stephen Leake:

>> Trying that shed some light on the 'popen' problem; the error message
>> about 'can't find nroff' is the one from the DOS shell (cmd.exe), not
>> the one from MinGW sh. So 'popen' is running 'cmd.exe', rather than
>> 'sh', contrary to the IEEE standard. Which explains why '|' doesn't work
>> in MinGW 'mtn man'.
>
> Again, I know almost nothing about win32 in this regard, but I know that
> there is some kind of pipe support in cmd.exe, so I guess its just
> missing mingw's path to actually find nroff and friends. Maybe some `set
> PATH=%PATH%;c:\path\to\detected\mingw` before the actual command call
> helps then? It would be easier if mingw would automatically add itself
> to the path though or have another environment variable we could just
> re-use...

I did some more experimenting. PATH is inherited properly, but 'popen'
is running cmd.exe. So to get | to work, we need to invoke bash
explicitly.

This almost works (from bash under Emacs), but it loses all the headers:

function get_man_page_formatter_command()
   local term_width = guess_terminal_width() - 2
   local path = "c:/bin"
   -- On MinGW, 'popen' runs 'cmd.exe' with the inherited path; run Cygwin bash 
from there
   return string.format("bash -c nroff -man -rLL=%dn | less -R", term_width)
end

$ ./mtn man --formatted
monotone  - a distributed version control system mtn 
[options...]
command [arguments...]  monotone is a highly reliable, very  
cus-
tomizable distributed version control system that provides light-
weight branches, history-sensitive merging and a  flexible  trust
setup. monotone has an easy-to-learn command set and comes with a
rich interface for scripting purposes and thorough documentation.

...

Running the same command in a DOS shell gives the same output. I messed
around with varios nroff options, but could not improve things.

I suggest we keep the ability to run 'popen' in the MinGW build of mtn;
someone may be inspired to write a shell script that actually works, or
MinGW may get an nroff port.

I added a note to monotone.texi explaining about 'cmd.exe', in the
get_man_page_formatter_command hook documentation.

I think nvm.man-page is ready to propagate to main.

--
-- Stephe



reply via email to

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