Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Dominique Pellé

Cesar Romani wrote:

 Dominique Pellé wrote:
...
 When putting a breakpoint at line term.c:1615,
 what is the value of 'term' variable? (output of gdb command: print term)

 Ex:

 (gdb) p term
 $1 = (char_u *) 0x946e25c xterm-256color

 $1 = (char_u *) 0xa0158c0 msys

 What is also the value of 'term' later at line 1866 where it crashes?

 $1 = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds

 Output of gdb command bt full might also be helpful.

 
 (gdb) bt full
 #0  0x004fd3a2 in set_termname (
    term=0x3a6c3532 Address 0x3a6c3532 out of bounds) at term.c:1866
        termp = (struct builtin_term *) 0x22f860
        builtin_first = 1
        try = 2
        termcap_cleared = 1
        width = 80
        height = 25
        error_msg = (char_u *) 0x0
        bs_p = (char_u *) 0x22f860 :\017R
        del_p = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds
 #1  0x3f5b455c in ?? ()
 No symbol table info available.
 #2  0x3a6c3532 in ?? ()
 No symbol table info available.
 ...
 #189 0x in ?? ()
 No symbol table info available.
 

I can't see any place where 'term' variable would be changed
other than when it's set to DEFAULT_TERM at line 1816 (but
that would not cause 'term' pointer to be incorrect).

So it leaves the possibility of a corrupted stack.

Can you put intermediate breakpoints (or execute line by line with
the next gdb command if you prefer) between line term.c:1615
(where 'term' pointer is still OK) and line term.c:1866 where 'term'
pointer becomes invalid so we can narrow it down? At each steps,
you can do print term in gdb to see when 'term' pointer starts to
become out of bounds.



 If I re-compile with CFLAGS = -g -O0 -Wall, vim executes fine on the
 console but not on rxvt:

 
 (gdb) run
 Starting program: C:\msys\1.0\home\Romer\msys\vim72\src/vim.exe
 [New thread 252.0xe14]
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 [New thread 252.0xe3c]

 Program received signal SIGSEGV, Segmentation fault.
 0x71084d3a in strcmp () from C:\msys\1.0\bin\msys-1.0.dll
 

 For the console TERM=cygwin and for rxvt TERM=msys

Ah. So if I understand correctly what you're saying:
- with -O0, Vim works in the cygwin console, but with -O2 it
  did not work in the cygwin console (correct?)
- In in rxvt, it still does not work even with -O0.  What is the
  stack where it crashes?  (output of gdb backtrace command).

Thanks
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Cesar Romani

Dominique Pellé wrote:
 Cesar Romani wrote:

 Dominique Pellé wrote:
 ...
 When putting a breakpoint at line term.c:1615,
 what is the value of 'term' variable? (output of gdb command: print
term)

 Ex:

 (gdb) p term
 $1 = (char_u *) 0x946e25c xterm-256color
 $1 = (char_u *) 0xa0158c0 msys

 What is also the value of 'term' later at line 1866 where it crashes?
 $1 = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds

 Output of gdb command bt full might also be helpful.
 
 (gdb) bt full
 #0  0x004fd3a2 in set_termname (
term=0x3a6c3532 Address 0x3a6c3532 out of bounds) at term.c:1866
termp = (struct builtin_term *) 0x22f860
builtin_first = 1
try = 2
termcap_cleared = 1
width = 80
height = 25
error_msg = (char_u *) 0x0
bs_p = (char_u *) 0x22f860 :\017R
del_p = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds
 #1  0x3f5b455c in ?? ()
 No symbol table info available.
 #2  0x3a6c3532 in ?? ()
 No symbol table info available.
 ...
 #189 0x in ?? ()
 No symbol table info available.
 

 I can't see any place where 'term' variable would be changed
 other than when it's set to DEFAULT_TERM at line 1816 (but
 that would not cause 'term' pointer to be incorrect).

 So it leaves the possibility of a corrupted stack.

 Can you put intermediate breakpoints (or execute line by line with
 the next gdb command if you prefer) between line term.c:1615
 (where 'term' pointer is still OK) and line term.c:1866 where 'term'
 pointer becomes invalid so we can narrow it down? At each steps,
 you can do print term in gdb to see when 'term' pointer starts to
 become out of bounds.


Breakpoint 1, set_termname (term=0xa0158c0 msys) at term.c:1615
1615if (term_is_builtin(term))
(gdb) p term
$1 = (char_u *) 0xa0158c0 msys
(gdb) n
1634for (try = builtin_first ? 0 : 1; try  3; ++try)
(gdb) p term
$2 = (char_u *) 0xa0158c0 msys
(gdb) n
1639if (try == 1)
(gdb) p term
$3 = (char_u *) 0xa0158c0 msys
(gdb) n
1762if (try == 2  builtin_first  termcap_cleared)
(gdb) p term
$4 = (char_u *) 0xa0158c0 msys
(gdb) n
1768termp = find_builtin_term(term);
(gdb) p term
$5 = (char_u *) 0xa0158c0 msys
(gdb) n
1769if (termp-bt_string == NULL)   /* did not find
it */
(gdb) p term
$6 = (char_u *) 0xa0158c0 msys
(gdb) n
1779if (try == 0)   /* try external
one */
(gdb) p term
$7 = (char_u *) 0xa0158c0 msys
(gdb) n
1780continue;
(gdb) p term
$8 = (char_u *) 0xa0158c0 msys
(gdb) n
1634for (try = builtin_first ? 0 : 1; try  3; ++try)
(gdb) p term
$9 = (char_u *) 0xa0158c0 msys
(gdb) n
1639if (try == 1)
(gdb) p term
$10 = (char_u *) 0xa0158c0 msys
(gdb) n
1675if ((error_msg = tgetent_error(tbuf, term)) == NULL)
(gdb) p term
$11 = (char_u *) 0xa0158c0 msys
(gdb) n
1677tp = tstrbuf;
(gdb) p term
$12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds


 If I re-compile with CFLAGS = -g -O0 -Wall, vim executes fine on the
 console but not on rxvt:

 
 (gdb) run
 Starting program: C:\msys\1.0\home\Romer\msys\vim72\src/vim.exe
 [New thread 252.0xe14]
 Vim: Warning: Output is not to a terminal
 Vim: Warning: Input is not from a terminal
 [New thread 252.0xe3c]

 Program received signal SIGSEGV, Segmentation fault.
 0x71084d3a in strcmp () from C:\msys\1.0\bin\msys-1.0.dll
 

 For the console TERM=cygwin and for rxvt TERM=msys

 Ah. So if I understand correctly what you're saying:
 - with -O0, Vim works in the cygwin console, but with -O2 it
   did not work in the cygwin console (correct?)

that's correct.

 - In in rxvt, it still does not work even with -O0.  What is the
   stack where it crashes?  (output of gdb backtrace command).


(gdb) backtrace
#0  0x71084d3a in strcmp () from C:\msys\1.0\bin\msys-1.0.dll
#1  0x0053a9d4 in set_termname (
term=0x5b455c3d Address 0x5b455c3d out of bounds) at term.c:1866
#2  0x69253a24 in ?? ()
#3  0x5b455c3d in ?? ()
...
#176 0x0022003a in ?? ()
#177 0x71004c7f in msys-1!_dll_c...@0 () from C:\msys\1.0\bin\msys-1.0.dll
(gdb) Cannot access memory at address 0x355b4560


Regards,
Cesar


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



patch : error using set novice

2009-06-07 Fir de Conversatie Patrick Texier
:set novice is interpreted as set vice to false and gives an E518:
unknown option: novice error. :set nonovice is correctly ignored.

novice is the only option starting with no.

Attached patch fixes this.
-- 
Patrick Texier

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



novice.patch
Description: set novice patch


Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Cesar Romani

Dominique Pellé wrote:
  Cesar Romani wrote:
 
  Dominique Pellé wrote:
  ...
  When putting a breakpoint at line term.c:1615,
  what is the value of 'term' variable? (output of gdb command: print
term)
 
  Ex:
 
  (gdb) p term
  $1 = (char_u *) 0x946e25c xterm-256color
  $1 = (char_u *) 0xa0158c0 msys
 
  What is also the value of 'term' later at line 1866 where it
crashes?
  $1 = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds
 
  Output of gdb command bt full might also be helpful.
  
  (gdb) bt full
  #0  0x004fd3a2 in set_termname (
 term=0x3a6c3532 Address 0x3a6c3532 out of bounds) at term.c:1866
 termp = (struct builtin_term *) 0x22f860
 builtin_first = 1
 try = 2
 termcap_cleared = 1
 width = 80
 height = 25
 error_msg = (char_u *) 0x0
 bs_p = (char_u *) 0x22f860 :\017R
 del_p = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of
bounds
  #1  0x3f5b455c in ?? ()
  No symbol table info available.
  #2  0x3a6c3532 in ?? ()
  No symbol table info available.
  ...
  #189 0x in ?? ()
  No symbol table info available.
  
 
  I can't see any place where 'term' variable would be changed
  other than when it's set to DEFAULT_TERM at line 1816 (but
  that would not cause 'term' pointer to be incorrect).
 
  So it leaves the possibility of a corrupted stack.
 
  Can you put intermediate breakpoints (or execute line by line with
  the next gdb command if you prefer) between line term.c:1615
  (where 'term' pointer is still OK) and line term.c:1866 where 'term'
  pointer becomes invalid so we can narrow it down? At each steps,
  you can do print term in gdb to see when 'term' pointer starts to
  become out of bounds.


Breakpoint 1, set_termname (term=0xa0158c0 msys) at term.c:1615
1615if (term_is_builtin(term))
(gdb) p term
$1 = (char_u *) 0xa0158c0 msys
(gdb) n
1634for (try = builtin_first ? 0 : 1; try  3; ++try)
(gdb) p term
$2 = (char_u *) 0xa0158c0 msys
(gdb) n
1639if (try == 1)
(gdb) p term
$3 = (char_u *) 0xa0158c0 msys
(gdb) n
1762if (try == 2  builtin_first  termcap_cleared)
(gdb) p term
$4 = (char_u *) 0xa0158c0 msys
(gdb) n
1768termp = find_builtin_term(term);
(gdb) p term
$5 = (char_u *) 0xa0158c0 msys
(gdb) n
1769if (termp-bt_string == NULL)   /* did not find
it */
(gdb) p term
$6 = (char_u *) 0xa0158c0 msys
(gdb) n
1779if (try == 0)   /* try external
one */
(gdb) p term
$7 = (char_u *) 0xa0158c0 msys
(gdb) n
1780continue;
(gdb) p term
$8 = (char_u *) 0xa0158c0 msys
(gdb) n
1634for (try = builtin_first ? 0 : 1; try  3; ++try)
(gdb) p term
$9 = (char_u *) 0xa0158c0 msys
(gdb) n
1639if (try == 1)
(gdb) p term
$10 = (char_u *) 0xa0158c0 msys
(gdb) n
1675if ((error_msg = tgetent_error(tbuf, term)) == NULL)
(gdb) p term
$11 = (char_u *) 0xa0158c0 msys
(gdb) n
1677tp = tstrbuf;
(gdb) p term
$12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds


  If I re-compile with CFLAGS = -g -O0 -Wall, vim executes fine on the
  console but not on rxvt:
 
  
  (gdb) run
  Starting program: C:\msys\1.0\home\Romer\msys\vim72\src/vim.exe
  [New thread 252.0xe14]
  Vim: Warning: Output is not to a terminal
  Vim: Warning: Input is not from a terminal
  [New thread 252.0xe3c]
 
  Program received signal SIGSEGV, Segmentation fault.
  0x71084d3a in strcmp () from C:\msys\1.0\bin\msys-1.0.dll
  
 
  For the console TERM=cygwin and for rxvt TERM=msys
 
  Ah. So if I understand correctly what you're saying:
  - with -O0, Vim works in the cygwin console, but with -O2 it
did not work in the cygwin console (correct?)

that's correct.

  - In in rxvt, it still does not work even with -O0.  What is the
stack where it crashes?  (output of gdb backtrace command).


(gdb) backtrace
#0  0x71084d3a in strcmp () from C:\msys\1.0\bin\msys-1.0.dll
#1  0x0053a9d4 in set_termname (
term=0x5b455c3d Address 0x5b455c3d out of bounds) at term.c:1866
#2  0x69253a24 in ?? ()
#3  0x5b455c3d in ?? ()
...
#176 0x0022003a in ?? ()
#177 0x71004c7f in msys-1!_dll_c...@0 () from C:\msys\1.0\bin\msys-1.0.dll
(gdb) Cannot access memory at address 0x355b4560


Regards,
Cesar


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: patch : error using set novice

2009-06-07 Fir de Conversatie Andy Wokula

Patrick Texier schrieb:
 :set novice is interpreted as set vice to false and gives an E518:
 unknown option: novice error. :set nonovice is correctly ignored.
 
 novice is the only option starting with no.
 
 Attached patch fixes this.

Vim doesn't support 'novice', so who cares about the error message?

If you want to fix something, why don't you start with
   :h todo

SCNR,
Andy

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: patch : error using set novice

2009-06-07 Fir de Conversatie Bram Moolenaar


Patrick Texier wrote:

 :set novice is interpreted as set vice to false and gives an E518:
 unknown option: novice error. :set nonovice is correctly ignored.
 
 novice is the only option starting with no.
 
 Attached patch fixes this.

Thanks.  Nobody complained about this for ten years :-).

-- 
hundred-and-one symptoms of being an internet addict:
3. Your bookmark takes 15 minutes to scroll from top to bottom.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Bram Moolenaar


Cesar Romani wrote:

  Dominique Pellé wrote:
  ...
  When putting a breakpoint at line term.c:1615,
  what is the value of 'term' variable? (output of gdb command: print
 term)
 
  Ex:
 
  (gdb) p term
  $1 = (char_u *) 0x946e25c xterm-256color
  $1 = (char_u *) 0xa0158c0 msys
 
  What is also the value of 'term' later at line 1866 where it crashes?
  $1 = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds
 
  Output of gdb command bt full might also be helpful.
  
  (gdb) bt full
  #0  0x004fd3a2 in set_termname (
 term=0x3a6c3532 Address 0x3a6c3532 out of bounds) at term.c:1866
 termp = (struct builtin_term *) 0x22f860
 builtin_first = 1
 try = 2
 termcap_cleared = 1
 width = 80
 height = 25
 error_msg = (char_u *) 0x0
 bs_p = (char_u *) 0x22f860 :\017R
 del_p = (char_u *) 0x3a6c3532 Address 0x3a6c3532 out of bounds
  #1  0x3f5b455c in ?? ()
  No symbol table info available.
  #2  0x3a6c3532 in ?? ()
  No symbol table info available.
  ...
  #189 0x in ?? ()
  No symbol table info available.
  
 
  I can't see any place where 'term' variable would be changed
  other than when it's set to DEFAULT_TERM at line 1816 (but
  that would not cause 'term' pointer to be incorrect).
 
  So it leaves the possibility of a corrupted stack.
 
  Can you put intermediate breakpoints (or execute line by line with
  the next gdb command if you prefer) between line term.c:1615
  (where 'term' pointer is still OK) and line term.c:1866 where 'term'
  pointer becomes invalid so we can narrow it down? At each steps,
  you can do print term in gdb to see when 'term' pointer starts to
  become out of bounds.
 
 
 Breakpoint 1, set_termname (term=0xa0158c0 msys) at term.c:1615
 1615if (term_is_builtin(term))
 (gdb) p term
 $1 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1634for (try = builtin_first ? 0 : 1; try  3; ++try)
 (gdb) p term
 $2 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1639if (try == 1)
 (gdb) p term
 $3 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1762if (try == 2  builtin_first  termcap_cleared)
 (gdb) p term
 $4 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1768termp = find_builtin_term(term);
 (gdb) p term
 $5 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1769if (termp-bt_string == NULL)   /* did not find
 it */
 (gdb) p term
 $6 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1779if (try == 0)   /* try external
 one */
 (gdb) p term
 $7 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1780continue;
 (gdb) p term
 $8 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1634for (try = builtin_first ? 0 : 1; try  3; ++try)
 (gdb) p term
 $9 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1639if (try == 1)
 (gdb) p term
 $10 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1675if ((error_msg = tgetent_error(tbuf, term)) == NULL)
 (gdb) p term
 $11 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1677tp = tstrbuf;
 (gdb) p term
 $12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds
 

So tgetent_error() overwrites term.  Try increasing the value for
TBUFSZ in vim.h.  Check the documentation for tgetent() to find out what
the value should be.  My manpage doesn't say anything...

-- 
hundred-and-one symptoms of being an internet addict:
4. Your eyeglasses have a web site burned in on them.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: patch : error using set novice

2009-06-07 Fir de Conversatie Patrick Texier

Le Sun, 07 Jun 2009 19:55:07 +0200, Andy Wokula a écrit dans le message
4a2bfefb.6010...@yahoo.de :

 If you want to fix something, why don't you start with
:h todo

Yes, I'm working on some items but it takes more time.
-- 
Patrick Texier

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Dominique Pellé
Cesar Romani wrote:

 1675                if ((error_msg = tgetent_error(tbuf, term)) == NULL)
 (gdb) p term
 $11 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1677                    tp = tstrbuf;
 (gdb) p term
 $12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds


1/ OK, so the corruption happens in in tgetent_error(), most likely
in line 2158 but it might be worth putting a breaking point at line
term.c:2158 and print 'term' variable before  after executing
line term.c:2158 to confirm that corruption happens there.

2151 static char_u *
2152 tgetent_error(tbuf, term)
2153 char_u  *tbuf;
2154 char_u  *term;
2155 {
2156 int i;
2157
2158 i = TGETENT(tbuf, term);
2159 if (i  0   /* -1 is always an error */
2160 # ifdef TGETENT_ZERO_ERR
2161 || i == 0   /* sometimes zero is also an error */
2162 # endif
2163)


2/ Most likely not enough memory is allocated for tbuf, first
parameter of tgetent().  Size of buffer is defined in vim.h as follows:

1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
defined(__CYGWIN32__) || defined(_AIX)
1349 # define TBUFSZ 2048/* buffer size for termcap entry
*/
1350 #else
1351 # define TBUFSZ 1024/* buffer size for termcap entry */
1352 #endif


I suspect that on your system (mingw), it's using 1024 instead
of 2048. If so, the attached patch might fix it.  It adds
defined(__MINGW32__)  (__MINGW32__ is already used
in several places in Vim's code):

1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
defined(_AIX) \
1349   || defined(__CYGWIN32__) || defined(__MINGW32__)
1350 # define TBUFSZ 2048/* buffer size for termcap entry
*/
1351 #else
1352 # define TBUFSZ 1024/* buffer size for termcap entry */
1353 #endif


2/  I also see that some implementations accept NULL as first
argument of tgetent() and in which case buffer is internally
dynamically allocated (hence more secure, but not as portable):

See:
http://www.gnu.org/software/termutils/manual/termcap-1.3/html_node/termcap_4.html

quote:

  If you are using the GNU version of termcap, you can alternatively
  ask tgetent to allocate enough space. Pass a null pointer for buffer,
  and tgetent itself allocates the storage using malloc. There is no
  way to get the address that was allocated, and you shouldn't try
  to free the storage.

So if attached patch does not suffice, it might be worth trying to
replace tbuf with, i.e. try replacing lines term.c:1675:

if ((error_msg = tgetent_error(tbuf, term)) == NULL)

into...

if ((error_msg = tgetent_error(NULL, term)) == NULL)

Regards
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---

Index: vim.h
===
RCS file: /cvsroot/vim/vim7/src/vim.h,v
retrieving revision 1.106
diff -c -r1.106 vim.h
*** vim.h	14 May 2009 20:19:32 -	1.106
--- vim.h	7 Jun 2009 20:44:04 -
***
*** 593,599 
  
  /*
   * Terminal highlighting attribute bits.
!  * Attibutes above HL_ALL are used for syntax highlighting.
   */
  #define HL_NORMAL		0x00
  #define HL_INVERSE		0x01
--- 593,599 
  
  /*
   * Terminal highlighting attribute bits.
!  * Attributes above HL_ALL are used for syntax highlighting.
   */
  #define HL_NORMAL		0x00
  #define HL_INVERSE		0x01
***
*** 1259,1265 
  } hlf_T;
  
  /* The HL_FLAGS must be in the same order as the HLF_ enums!
!  * When chainging this also adjust the default for 'highlight'. */
  #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
  		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  		  'f', 'F', 'A', 'C', 'D', 'T', '', \
--- 1259,1265 
  } hlf_T;
  
  /* The HL_FLAGS must be in the same order as the HLF_ enums!
!  * When changing this also adjust the default for 'highlight'. */
  #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
  		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  		  'f', 'F', 'A', 'C', 'D', 'T', '', \
***
*** 1345,1351 
  # define MSG_BUF_CLEN  MSG_BUF_LEN	/* cell length */
  #endif
  
! #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) || defined(__CYGWIN32__) || defined(_AIX)
  # define TBUFSZ 2048		/* buffer size for termcap entry */
  #else
  # define TBUFSZ 1024		/* buffer size for termcap entry */
--- 1345,1352 
  # define MSG_BUF_CLEN  MSG_BUF_LEN	/* cell length */
  #endif
  
! #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) || defined(_AIX) \
!   || defined(__CYGWIN32__) || defined(__MINGW32__) 
  # define TBUFSZ 2048		/* buffer size for termcap entry */
  #else
  # define TBUFSZ 1024		/* buffer size for termcap entry */
***
*** 1427,1433 
  #ifdef FEAT_MBYTE
  /* We need to call mb_stricmp() even 

Re: patch : error using set novice

2009-06-07 Fir de Conversatie Dominique Pellé

Andy Wokula wrote:

 Patrick Texier schrieb:
 :set novice is interpreted as set vice to false and gives an E518:
 unknown option: novice error. :set nonovice is correctly ignored.

 novice is the only option starting with no.

 Attached patch fixes this.

 Vim doesn't support 'novice', so who cares about the error message?

 If you want to fix something, why don't you start with
   :h todo

 SCNR,
 Andy


That's a bit harsh.  Even if Vi option novice is not supported by
Vim, Vim's documentation explicitly says that no error should be
given when trying to set it. Yet :set novice actually gives an error:

  E518: Unknown option: novice.

So it's a legitimate bug in my opinion (even if it's a low priority one).

See :help missing-options:

--- 8 --- cut here --- 8 --- cut here --- 8 ---
2. Missing options
*missing-options*

These options are in the Unix Vi, but not in Vim.  If you try to set one of
them you won't get an error message, but the value is not used and
cannot be printed.

autoprint (ap)  boolean (default on)*'autoprint'* *'ap'*
beautify (bf)   boolean (default off)   *'beautify'* *'bf'*
flash (fl)  boolean (default ??)*'flash'* *'fl'*
graphic (gr)boolean (default off)   *'graphic'* *'gr'*
hardtabs (ht)   number  (default 8) *'hardtabs'* *'ht'*
number of spaces that a Tab moves on the display
mesgboolean (default on)*'mesg'*
novice  boolean (default off)   *'novice'*
openboolean (default on)*'open'*
optimize (op)   boolean (default off)   *'optimize'* *'op'*
redraw  boolean (default off)   *'redraw'*
slowopen (slow) boolean (default off)   *'slowopen'* *'slow'*
sourceany   boolean (default off)   *'sourceany'*
w300number  (default 23)*'w300'*
w1200   number  (default 23)*'w1200'*
w9600   number  (default 23)*'w9600'*
--- 8 --- cut here --- 8 --- cut here --- 8 ---

Regards
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Cesar Romani

Dominique Pellé wrote:
 Cesar Romani wrote:

 1675if ((error_msg = tgetent_error(tbuf, term)) == NULL)
 (gdb) p term
 $11 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1677tp = tstrbuf;
 (gdb) p term
 $12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds


 1/ OK, so the corruption happens in in tgetent_error(), most likely
 in line 2158 but it might be worth putting a breaking point at line
 term.c:2158 and print 'term' variable before  after executing
 line term.c:2158 to confirm that corruption happens there.

 2151 static char_u *
 2152 tgetent_error(tbuf, term)
 2153 char_u  *tbuf;
 2154 char_u  *term;
 2155 {
 2156 int i;
 2157
 2158 i = TGETENT(tbuf, term);
 2159 if (i  0   /* -1 is always an error */
 2160 # ifdef TGETENT_ZERO_ERR
 2161 || i == 0   /* sometimes zero is also an error */
 2162 # endif
 2163)

Breakpoint 1, tgetent_error (tbuf=0x22f834 ¤ú\, term=0xa0158c0 msys)
at term.c:2158
2158i = TGETENT(tbuf, term);
(gdb) p term
$1 = (char_u *) 0xa0158c0 msys
(gdb) n
2159if (i  0   /* -1 is always an error */
(gdb) p term
$2 = (char_u *) 0xa0158c0 msys
(gdb) n
2181return NULL;
(gdb) p term
$3 = (char_u *) 0xa0158c0 msys
(gdb) n
2182}
(gdb) p term
$4 = (char_u *) 0xa0158c0 msys
(gdb) n
set_termname (term=0x5b455c3d Address 0x5b455c3d out of bounds)
at term.c:1677
1677tp = tstrbuf;
(gdb) p term
$5 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds

 2/ Most likely not enough memory is allocated for tbuf, first
 parameter of tgetent().  Size of buffer is defined in vim.h as follows:

 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
 defined(__CYGWIN32__) || defined(_AIX)
 1349 # define TBUFSZ 2048/* buffer size for termcap entry
 */
 1350 #else
 1351 # define TBUFSZ 1024/* buffer size for termcap entry */
 1352 #endif


 I suspect that on your system (mingw), it's using 1024 instead
 of 2048. If so, the attached patch might fix it.  It adds
 defined(__MINGW32__)  (__MINGW32__ is already used
 in several places in Vim's code):

 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
 defined(_AIX) \
 1349   || defined(__CYGWIN32__) || defined(__MINGW32__)
 1350 # define TBUFSZ 2048/* buffer size for termcap entry
 */
 1351 #else
 1352 # define TBUFSZ 1024/* buffer size for termcap entry */
 1353 #endif

Your patch works only if I change __MINGW32__ by __MSYS__ or if I add
|| defined(__MSYS__)

There is one problem: The backspace key doesn't delete the precedent
character. That was also the case on the console before applying the
patch.
On the old vim version installed on the system the backspace key works
fine.

Regards,
Cesar


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Dominique Pellé

Cesar Romani wrote:

 Dominique Pellé wrote:

 I suspect that on your system (mingw), it's using 1024 instead
 of 2048. If so, the attached patch might fix it.  It adds
 defined(__MINGW32__)  (__MINGW32__ is already used
 in several places in Vim's code):

 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
 defined(_AIX) \
 1349   || defined(__CYGWIN32__) || defined(__MINGW32__)
 1350 # define TBUFSZ 2048            /* buffer size for termcap entry
 */
 1351 #else
 1352 # define TBUFSZ 1024            /* buffer size for termcap entry */
 1353 #endif

 Your patch works only if I change __MINGW32__ by __MSYS__ or if I add
 || defined(__MSYS__)

 There is one problem: The backspace key doesn't delete the precedent
 character. That was also the case on the console before applying the
 patch.
 On the old vim version installed on the system the backspace key works
 fine.

 Regards,
 Cesar


Good to hear that patch works (with __MSYS__).  I see that the source
code of Vim never uses __MSYS__ yet.  I've never tried msys myself.

Regarding the delete key not working, can you delete with CTRL-h?
Did you also read :help fixdel?  It contains useful tips when delete
key does not work.

Regards
-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Syntax files

2009-06-07 Fir de Conversatie Chris Ruprecht

Greetings.

Many moons ago, I co-wrote a syntax file for editing Progress 4GL  
files (.p/.i/.w extensions). The guy that used to maintain the file  
(Phil Uren) is no longer using Progress and told me a while back that  
I can take ownership.
How do I do that though? I have a new file, updated for later versions  
of the language, but how do I get this into the current release?

best regards,
chris
-- 
chris ruprecht
database grunt and bit pusher extraordinaíre


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Dasn

 Breakpoint 1, set_termname (term=0xa0158c0 msys) at term.c:1615
 1615if (term_is_builtin(term))
 (gdb) p term
 $1 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1634for (try = builtin_first ? 0 : 1; try  3; ++try)
 (gdb) p term
 $2 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1639if (try == 1)
 (gdb) p term
 $3 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1762if (try == 2  builtin_first  termcap_cleared)
 (gdb) p term
 $4 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1768termp = find_builtin_term(term);
 (gdb) p term
 $5 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1769if (termp-bt_string == NULL)   /* did not find
 it */
 (gdb) p term
 $6 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1779if (try == 0)   /* try external
 one */
 (gdb) p term
 $7 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1780continue;
 (gdb) p term
 $8 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1634for (try = builtin_first ? 0 : 1; try  3; ++try)
 (gdb) p term
 $9 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1639if (try == 1)
 (gdb) p term
 $10 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1675if ((error_msg = tgetent_error(tbuf, term)) == NULL)
 (gdb) p term
 $11 = (char_u *) 0xa0158c0 msys
 (gdb) n
 1677tp = tstrbuf;
 (gdb) p term
 $12 = (char_u *) 0x5b455c3d Address 0x5b455c3d out of bounds

Anyway, I bet you would love the 'display' command of gdb. e.g:
(gdb) display term
(gdb) n
..

-- 
Dasn


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Cesar Romani

Dominique Pellé wrote:
 Cesar Romani wrote:
 Dominique Pellé wrote:

 I suspect that on your system (mingw), it's using 1024 instead
 of 2048. If so, the attached patch might fix it.  It adds
 defined(__MINGW32__)  (__MINGW32__ is already used
 in several places in Vim's code):

 1348 #if defined(AMIGA) || defined(__linux__) || defined(__QNX__) ||
 defined(_AIX) \
 1349   || defined(__CYGWIN32__) || defined(__MINGW32__)
 1350 # define TBUFSZ 2048/* buffer size for termcap entry
 */
 1351 #else
 1352 # define TBUFSZ 1024/* buffer size for termcap entry */
 1353 #endif
 Your patch works only if I change __MINGW32__ by __MSYS__ or if I add
 || defined(__MSYS__)

 There is one problem: The backspace key doesn't delete the precedent
 character. That was also the case on the console before applying the
 patch.
 On the old vim version installed on the system the backspace key works
 fine.

 Regards,
 Cesar


 Good to hear that patch works (with __MSYS__).  I see that the source
 code of Vim never uses __MSYS__ yet.  I've never tried msys myself.

 Regarding the delete key not working, can you delete with CTRL-h?
 Did you also read :help fixdel?  It contains useful tips when delete
 key does not work.

Thanks a lot for your help.
Actually when I press backspace, it behaves like the cursor left and
when I press escape the characters left behind are deleted.
CTRL-h cannot delete either, neither :fixdel can fix the backspace.
But When I create a .vimrc file with null content in my home directory,
the backspace works, strange!

Best regards,
Cesar


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: vim 7.2 compiles fine on MSYS but it doesn't execute

2009-06-07 Fir de Conversatie Matt Wozniski

On Sun, Jun 7, 2009 at 10:07 PM, Cesar Romani wrote:

 Thanks a lot for your help.
 Actually when I press backspace, it behaves like the cursor left and
 when I press escape the characters left behind are deleted.
 CTRL-h cannot delete either, neither :fixdel can fix the backspace.
 But When I create a .vimrc file with null content in my home directory,
 the backspace works, strange!

That's actually the expected behavior; see :help compatible-default
and :help cpo-v

The upshot is that when you don't have a vimrc, vim defaults to vi
compatibility, and Backspaced characters remain visible on the screen
in Insert mode, and when you do have a vimrc you no longer get the
somewhat irritating vi-compatible behavior; instead the characters
are erased from the screen right away.

~Matt

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



[patch] fixed compilation warning on cygwin

2009-06-07 Fir de Conversatie Dominique Pellé
When compiling vim-7.2.196 on Cygwin, I see the following
compilation warning:

xxd.c: In function `main':
xxd.c:607: warning: implicit declaration of function `setmode'

Function setmode() is declared in /usr/include/io.h but io.h
is not included for cygwin.  Attached patch fixes it.

-- Dominique

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



fix-warning-xxd.c.7.2.196.patch
Description: Binary data


Using cscope with Vim source

2009-06-07 Fir de Conversatie Tony Mechelynck

I tried to understand how to use cscope (with the Vim source as a set of 
sources to apply it to). Bram, correct me if I'm wrong.

The following assumes $VIMSRC has been set (e.g. in the vimrc) to the 
top-level directory of the Vim source  runtime distribution (on my 
system, currently ~/.build/vim/vim72 )

- First of all, build the database (done once).

:new
:lcd $VIMSRC/src
:!cscope -bv ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c

I have searched the src/Makefile for a target doing this kind of stuff 
(the way the tags target builds a Vim tagfile for the same source) but 
have failed.

It's not clear to me whether to repeat this after the sources change, 
I'll have to read the cscope manpage in more detail (it seems to say 
cscope is clever enough to update the database if the sources have 
changed, but can I rely on that?)

BTW, here cscope --version anwsers:
cscope: version 15.6

- Once per session (done manually when starting to use it). First two 
lines are of course not needed if already done by building the database 
as shown above. Last line (setting 'cscopequickfix') can be in vimrc. It 
is of course the useful setting given at :help csqf with no quotes 
(also no single quotes around 'csqf').

:new
:lcd $VIMSRC/src
:cs add cscope.out
 use quickfix for most common queries
:set csqf=s-,c-,d-,i-,t-,e-

- Find where a symbol is defined (with an example from a recent vim_dev 
thread)

:cs find g TBUFSZ

- Find where symbol is used (using the same symbol)

:cs find s TBUFSZ

etc.


Best regards,
Tony.
-- 
Jacquin's Postulate on Democratic Government:
No man's life, liberty, or property are safe while the
legislature is in session.

--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Using cscope with Vim source

2009-06-07 Fir de Conversatie Sergey Khorev

Hi,

 It's not clear to me whether to repeat this after the sources change, 
 I'll have to read the cscope manpage in more detail (it seems to say 
 cscope is clever enough to update the database if the sources have 
 changed, but can I rely on that?)

No, Vim executes cscope with cscopeprg -dl -f databasename where 
cscopeprg is the value of 
'cscopeprg' option.

-d option prevents cscope from rebuilding its database.


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---