[Top][All Lists]
[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 [1mmtn
[4m[22m[options...][0m
[4mcommand[24m [4m[arguments...][24m 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
- Re: [Monotone-devel] Please review nvm.man-page, (continued)
- Re: [Monotone-devel] Please review nvm.man-page, Stephen Leake, 2010/08/19
- Re: [Monotone-devel] Please review nvm.man-page, Thomas Keller, 2010/08/20
- Re: [Monotone-devel] Please review nvm.man-page, Stephen Leake, 2010/08/21
- Message not available
- Message not available
- Re: [Monotone-devel] Please review nvm.man-page, Thomas Keller, 2010/08/21
- Re: [Monotone-devel] Please review nvm.man-page,
Stephen Leake <=
- Re: [Monotone-devel] Please review nvm.man-page, Thomas Moschny, 2010/08/23
- Re: [Monotone-devel] Please review nvm.man-page, Stephen Leake, 2010/08/23
- Re: [Monotone-devel] Please review nvm.man-page, Thomas Keller, 2010/08/23
- Re: [Monotone-devel] Please review nvm.man-page, Stephen Leake, 2010/08/24
- Re: [Monotone-devel] Please review nvm.man-page, Thomas Keller, 2010/08/24
Re: [Monotone-devel] Please review nvm.man-page, Thomas Moschny, 2010/08/20