Re: Man command not working with Vim 7

2006-06-27 Thread Benji Fisher
On Mon, Jun 26, 2006 at 10:56:48PM -0600, Trent Michael Gamblin wrote:
 Benji Fisher wrote:
 
 I think this is important, but I do not understand it completely.
 When I try
 
 $ man cvs | col -b | less
 
 or simply
 
 $ man cvs | less
 
 I get a similar error message, Error executing formatting or display
 command ...  after I exit less.  I guess that was sent to stderr?  (I
 am pretty sure that man is /usr/bin/man .)  So somehow vim is reading
 stderr into your buffer instead of stdout?
 
[snip]
 This will start up vim without your usual vimrc file.  Is the problem
 still there?  
 
 Almost the same thing. It first says Output is not a terminal then 
 when I type something
 it shows the same ugly buffer from my first post.
 
 If the problem goes away, maybe you have some weird
 setting for your 'shellredir' option or something.  What does
[snip]
 
 shell=/bin/bash
 shellredir=%s 21
 /bin/bash

 Well, that looks normal.  Eric Arnold's problem was along these
lines.

 Next, you can try (from an empty buffer)
 
 :r! man cvs
 
 or
 
 :r! man cvs | col -b
 
 Do you get the same error message, or do you get the man page?
  
 
 I get the same error messages and partial unformatted man page.
 
 Part of the error message is:
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip -c 
 '/usr/share/man/man1/cvs.1.gz') | /usr/bin/gtbll | /usr/bin/nroff -c 
 --legacy ISO-8859-1 -mandoc 2/dev/null | col -b | view -c 'set ft=man 
 nomod nolist' -) exited with status 256.
 No manual entry for cvs
 
 When I run that command from the shell I get the man page formatted 
 perfectly. So I wonder what program is exiting with status 256 and what 
 that particular error code means.
 
 BTW, I had to make a symbol link from gtbl to gtbll, since I didn't have 
 gtlbll.

 We are making progress:  the ftplugin/man.vim script is not the
culprit, there is something wrong with :r! .

 BTW, I am using FC2, so my system should be similar to yours.

 I get a similar error message to the one you quote when, from a
shell, I try

$ man cvs | less

but I only see the error after I quit less.  Do you *not* see it in this
context?  Not that I know what to do with the answer, but I am hoping
that our systems will work the same way and that we can narrow down
where that error message comes from.

 I do not have any great ideas at the moment (and in fact I am
pressed for time) but this might be worth trying:

$ vim -u NONE
:r! man cvs

:set shllquote? shellxquote?

HTH --Benji Fisher


Re: Man command not working with Vim 7

2006-06-26 Thread Benji Fisher
On Sun, Jun 25, 2006 at 08:16:54PM -0600, Trent Michael Gamblin wrote:
 I'm having trouble getting the Man command working with Vim. I have the 
 line:
 
runtime ftplugin/man.vim
 
 in my ~/.vimrc. When I type :Man man page I get this:
 
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 ^M
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip 
 -c '/usr/sNo manual entry for va_arg
 -stdin-2[readonly]2157L,-5815C1;24r?12;25h?12l?25h27mmH2J1;1H35mSTDARG(3)
 
 33mSYNOPSISm
 35m   #include m31mstdarg.hm11;8H32mvoidm 
 36mva_startm(32mva_listm ap, las
 
 It looks like some errors followed by the beginning of the man page. Can 
 anyone help me?
 Thanks. Have a nice day.

 What version of vim and what OS are you using?

 Unless someone has a better idea, I need more information to figure
this out.  You can try

:redir  vimlog.txt
:12 verbose Man cvs
:redir END

and then look at vimlog.txt or send it to the list.

HTH --Benji Fisher


Re: Man command not working with Vim 7

2006-06-26 Thread Charles E Campbell Jr

Eric Arnold wrote:


I was having some problems getting manpageview to work on Windows:


Thank you for the feedback!  I'll look into it (I hope) later on my 
WinXP machine.

Do you use cygwin?

Regards,
Chip Campbell



Re: Man command not working with Vim 7

2006-06-26 Thread Eric Arnold

On 6/26/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote:

Eric Arnold wrote:

 I was having some problems getting manpageview to work on Windows:

Thank you for the feedback!  I'll look into it (I hope) later on my
WinXP machine.
Do you use cygwin?


Yes.


Re: Man command not working with Vim 7

2006-06-26 Thread Benji Fisher
On Sun, Jun 25, 2006 at 08:16:54PM -0600, Trent Michael Gamblin wrote:
 I'm having trouble getting the Man command working with Vim. I have the 
 line:
 
runtime ftplugin/man.vim
 
 in my ~/.vimrc. When I type :Man man page I get this:
 
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 ^M
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip 
 -c '/usr/sNo manual entry for va_arg
 -stdin-2[readonly]2157L,-5815C1;24r?12;25h?12l?25h27mmH2J1;1H35mSTDARG(3)
 
 33mSYNOPSISm
 35m   #include m31mstdarg.hm11;8H32mvoidm 
 36mva_startm(32mva_listm ap, las
 
 
 It looks like some errors followed by the beginning of the man page. Can 
 anyone help me?
 Thanks. Have a nice day.

On Mon, Jun 26, 2006 at 04:47:19PM -0600, Trent Michael Gamblin wrote:
 Benji Fisher wrote:
 
 What version of vim and what OS are you using?
 
 Unless someone has a better idea, I need more information to figure
 this out.  You can try
 
 :redir  vimlog.txt
 :12 verbose Man cvs
 :redir END
 
 and then look at vimlog.txt or send it to the list.
 
 I'm using Vim 7.0 and Fedora Core 4. Here is the output of the commands 
 you wrote, which
 doesn't show anything to me:
 
[snip]
 continuing in BufEnter Auto commands for *
 
 calling function SNR6_GetPage..SNR6_GetCmdArg
 
 function SNR6_GetPage..SNR6_GetCmdArg returning 'cvs'
 
 continuing in function SNR6_GetPage
 
 Calling shell to execute: (/usr/bin/man cvs | col -b) /tmp/v364103/2 21
 17 more lines
[snip]
 
 I have also tried the manpageview script suggested but I get
 Vim: Warning: Output is not to a terminal
 And then the only thing I can do is Ctrl-Z and kill vim
 
 I would appreciate any help very much. Thanks.

 I understand some of what is going on, but not all.

 The part I did not snip seems to be where the problem is.  When I
try it, I get something similar but with 1323 more lines, presumably the
whole man page, instead of 17 lines.

 The GetPage() function is defined in the default ftplugin/man.vim ;
the SNR6_ part means that it is a script-local function (defined as
s:GetPage() ) and this is the sixth script that was :source'd when you
started vim.  (You can confirm this with :scriptnames .)  Looking at
$VIMRUNTIME/ftplugin/man.vim and the definition of s:GetPage() (well, it
is defined as SIDGetPage(), close enough), I see the line

  silent exec r!/usr/bin/man .s:GetCmdArg(sect, page). | col -b

and this is what calls man cvs, filters it through col -b (to remove
backspaces and other nasties), and reads it into the empty buffer.

 I think this is important, but I do not understand it completely.
When I try

$ man cvs | col -b | less

or simply

$ man cvs | less

I get a similar error message, Error executing formatting or display
command ...  after I exit less.  I guess that was sent to stderr?  (I
am pretty sure that man is /usr/bin/man .)  So somehow vim is reading
stderr into your buffer instead of stdout?

 Again, maybe someone else can figure this out.  If not, here are
some more things to try as we attempt to figure out what is going wrong.

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

This will start up vim without your usual vimrc file.  Is the problem
still there?  If the problem goes away, maybe you have some weird
setting for your 'shellredir' option or something.  What does

:set shell? shellredir?
:echo $SHELL

tell you?

 Next, you can try (from an empty buffer)

:r! man cvs

or

:r! man cvs | col -b

Do you get the same error message, or do you get the man page?

HTH --Benji Fisher


Re: Man command not working with Vim 7

2006-06-26 Thread Eric Arnold

This

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

worked for me,  and

:r! man cvs | col -b

failed with my normal   .vimrc   , so I tracked it down to needing:

set shellxquote=\

The backslash is required.  I had shellxquote='  for other situations.
I seems like I've got some shell commands which require different
settings  :-(


Re: Man command not working with Vim 7

2006-06-26 Thread Trent Michael Gamblin

Benji Fisher wrote:


I understand some of what is going on, but not all.

The part I did not snip seems to be where the problem is.  When I
try it, I get something similar but with 1323 more lines, presumably the
whole man page, instead of 17 lines.

The GetPage() function is defined in the default ftplugin/man.vim ;
the SNR6_ part means that it is a script-local function (defined as
s:GetPage() ) and this is the sixth script that was :source'd when you
started vim.  (You can confirm this with :scriptnames .)  Looking at
$VIMRUNTIME/ftplugin/man.vim and the definition of s:GetPage() (well, it
is defined as SIDGetPage(), close enough), I see the line

 silent exec r!/usr/bin/man .s:GetCmdArg(sect, page). | col -b

and this is what calls man cvs, filters it through col -b (to remove
backspaces and other nasties), and reads it into the empty buffer.

I think this is important, but I do not understand it completely.
When I try

$ man cvs | col -b | less

or simply

$ man cvs | less

I get a similar error message, Error executing formatting or display
command ...  after I exit less.  I guess that was sent to stderr?  (I
am pretty sure that man is /usr/bin/man .)  So somehow vim is reading
stderr into your buffer instead of stdout?

Again, maybe someone else can figure this out.  If not, here are
some more things to try as we attempt to figure out what is going wrong.

$ vim -u NONE
:runtime ftplugin/man.vim
:Man cvs

This will start up vim without your usual vimrc file.  Is the problem
still there?  

Almost the same thing. It first says Output is not a terminal then 
when I type something

it shows the same ugly buffer from my first post.


If the problem goes away, maybe you have some weird
setting for your 'shellredir' option or something.  What does

:set shell? shellredir?
:echo $SHELL

tell you?
 



shell=/bin/bash
shellredir=%s 21
/bin/bash


Next, you can try (from an empty buffer)

:r! man cvs

or

:r! man cvs | col -b

Do you get the same error message, or do you get the man page?
 


I get the same error messages and partial unformatted man page.

Part of the error message is:
Error executing formatting or display command.
System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip -c 
'/usr/share/man/man1/cvs.1.gz') | /usr/bin/gtbll | /usr/bin/nroff -c 
--legacy ISO-8859-1 -mandoc 2/dev/null | col -b | view -c 'set ft=man 
nomod nolist' -) exited with status 256.

No manual entry for cvs

When I run that command from the shell I get the man page formatted 
perfectly. So I wonder what program is exiting with status 256 and what 
that particular error code means.


BTW, I had to make a symbol link from gtbl to gtbll, since I didn't have 
gtlbll.


Thanks for your help.