Re: Gtags plugin fails at call to system function using vim 6.4

2006-03-14 Thread Jason Hood
Arra Avakian <[EMAIL PROTECTED]> wrote:
(02/03/2006 00:14)

>This line in gtags.vim seems to be the problem:
>
>let stuff = system(cmd . '>' . tmpfile)

This is a problem in the DOS/Win versions of vim,
since the system command performs its own
redirection, which overrides the above.  A work-
around for the Win32 CMD.EXE version can be
achieved by replacing the above line with:

call system(cmd . '>' . tmpfile . "& exit")

This is not recommended as a permanent
solution and you should still ask the vim
mailing lists/forums for a better solution.

Jason.
-- 
Send instant messages to your online friends http://au.messenger.yahoo.com 



___
Bug-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-global


Re: Gtags plugin fails at call to system function using vim 6.4

2006-03-10 Thread Arra Avakian

Sorry, I left out important info:
I am running using vim/gvim on Windows
XP professional.
The output (captured with redir) from
the first call to :Gtags is

Error detected while processing function
7_RunGlobal:
line   72:
E40: Can't open errorfile C:\DOCUME~1\aavakian\LOCALS~1\Temp\VIA4EF.tmp
Error detected while processing function
7_RunGlobal:
line   80:
E42: No Errors

The shell variable values (unchanged
from defaults):

nocscopetag        
  isprint=@,~-255     shellcmdflag=/c     wildchar=
  cscopetagorder=0    joinspaces
         shellquote=        
wildcharm=0
nocscopeverbose      
key=              noshellslash  
       wildignore=
  debug=      
       keymap=            
shellxquote=      nowildmenu
  shell=C:\WINDOWS\system32\cmd.exe
  shellpipe=>%s 2>&1
  shellredir=>%s 2>&1


The output of the vim :version:

VIM - Vi IMproved 6.4 (2005 Oct 15,
compiled Oct 15 2005 16:15:14)
MS-Windows 32 bit GUI version with
OLE support
Compiled by [EMAIL PROTECTED]
Big version with GUI.  Features
included (+) or not (-):
+arabic +autocmd +balloon_eval +browse
++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl
+cmdline_hist +cmdline_info +comments
+cryptv +cscope +dialog_con_gui +diff
+digraphs -dnd -ebcdic +emacs_tags +eval
+ex_extra +extra_search +farsi +file_in_path
+find_in_path +folding -footer
+gettext/dyn -hangul_input +iconv/dyn
+insert_expand +jumplist +keymap +langmap
 +libcall +linebreak +lispindent
+listcmds +localmap +menu +mksession
+modify_fname +mouse +mouseshape +multi_byte_ime/dyn
+multi_lang +netbeans_intg
 +ole -osfiletype +path_extra
+perl/dyn -postscript +printer +python/dyn
+quickfix +rightleft +ruby/dyn +scrollbind
+signs +smartindent -sniff
+statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white
+tcl/dyn -tgetent -termresponse +textobjects
+title +toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra
+viminfo +vreplace +wildignore
+wildmenu +windows +writebackup -xfontset
-xim -xterm_save +xpm_w32
   system vimrc file: "$VIM\vimrc"
     user vimrc file:
"$HOME\_vimrc"
 2nd user vimrc file: "$VIM\_vimrc"
      user exrc file:
"$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$VIM\_gvimrc"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -DWIN32
 -D_WIN32 -I. -Iproto -DHAVE_PATHDEF -DWI
N32   -DFEAT_CSCOPE    
  -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Ox -DNDEBUG /Zi
  -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT
-DFEAT_BIG /Zi /Fd.\ObjC/
Linking: link /RELEASE /nologo /subsystem:console
/incremental:no /nodefaultlib:
libc advapi32.lib shell32.lib gdi32.lib
comdlg32.lib ole32.lib uuid.lib  libc.li
b   user32.lib      
   /PDB:.\ObjC/vim.pdb -debug:full -debugtype:cv,fixup

Thanks,
Arra





Arra Avakian/AbInitio 
03/01/2006 09:14 AM




To
[email protected]


cc



Subject
Gtags plugin fails at call
to system function using vim 6.4







This line in gtags.vim seems to be the
problem:

    let stuff = system(cmd
. '>' . tmpfile)

I am using vim/gvim version 6.4 and
ctags 5.5.4.
The tags file from ctags works just
fine.
If I use the global command from the
command line, its seems to work OK.
The problem is that in the above line,
stuff is set with the output of global,
but the tmpfile is not created, i.e.
the output redirection does not happen.
(I have determined this by running debug
and stepping through the :Gtags
function.) The result is a msg "No
errors" and an empty Errors list window
opens, even though the corresponding
global command produces output
when run from the command line.

I have experimented using the above
form of the system function, and it
does not redirect to the tmpfile. Looking
at the vim help for the system
function, it appears that the Gtags.vim
usage of redirection is not really
supported, instead it is showing use
of the vim 'shellredir' option and
and (unavailable?) {tmp} file. Here
are the lines from vim :help system:

         
      The command executed is constructed using
several options:
        'shell'
'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote'
         
      ({tmp} is an automatically generated file
name).

So now I am stuck:
1. the Gtags usage of the system function
does not cause redirection,
2. the documented system function does
not seem to give access to the {tmp} output.

Should I try to modify function! s:RunGlobal(...)
to use the output in variable stuff?
Is there a way to get the output of
the command run by system into a known file?

Help!

Thanks in advance.

Arra Avakian

ForwardSourceID:NT59FE
   
___
Bug-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-global