Re: [vim/vim] Speed up parsing vim script (#1589)

2017-03-23 Fir de Conversatie Nikolay Aleksandrovich Pavlov
2017-03-23 11:34 GMT+03:00 Dominique Pellé :
> @jamessan wrote:
>
> You could use something like gperf or triehash to generate the hash table at
> build time.
> gperf is widely available, but triehash is a simple Perl script with a
> permissive license,
> so it could probably just be included.
>
> I like it. If gperf is used, we can consider checking-in the generated C
> code,
> so regular users who compile Vim don't have to install gperf.
> Only developers who add new Ex commands (that's rare) would have to
> install gperf. I don't have experience with gperf but at first sight it
> looks simple to use and produce well optimized code.

Neovim has it as a build-time dependency, you may search for GPERF_CMD
in src/nvim/CMakeLists.txt, generated file (funcs.generated.h) is then
included in eval.c.

But I do not like the solution much:

1. What are keys? Do not forget that commands may be abbreviated.
2. You can’t use gperf for user commands. I think that ideally user
commands should use the same solution: currently it is O(N) linear
search, without even any optimizations built-in commands have!

Aren’t there some structures designed specifically for this (finding
word by its first N characters) task? E.g. trie/prefix tree. For
built-in commands that could be built at build time, for user commands
it should be built at runtime, finding actual command inside should
share code for both built-in and user commands.

>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Bram Moolenaar


I wrote:

> Hirohito Higashi wrote:
> 
> > > > > > My config:
> > > > > >   $ ./configure --with-features=huge --enable-gui=gnome2 
> > > > > > --enable-fail-if-missing
> > > > > > My env.:
> > > > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> > > > > > Vim version:
> > > > > >   8.0.502
> > > > > > 
> > > > > > Executed command:
> > > > > >   $ cd vim/src
> > > > > >   $ make test
> > > > > > 
> > > > > > Execution result:
> > > > > > I got the following error.
> > > > > > >8
> > > > > > Test results:
> > > > > > 
> > > > > > 
> > > > > > >From test_clientserver.vim:
> > > > > > Found errors in Test_client_server():
> > > > > > First run:
> > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > > 'XVIMTEST' does not match ''
> > > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > > connection to the X server @ function 
> > > > > > RunTheTest[24]..Test_client_server, line 19
> > > > > > Second run:
> > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > > 'XVIMTEST' does not match ''
> > > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > > connection to the X server @ function 
> > > > > > RunTheTest[24]..Test_client_server, line 19
> > > > > 
> > > > > Why is there no connection to the X server?  Anyway, we could catch 
> > > > > this
> > > > > error and give up.
> > > > 
> > > > There might be the case one builds vim on a headless system. I.e.
> > > > some build servers of distro's?
> > > 
> > > Can you try this patch:
> > > 
> > > 
> > > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim
> > > 2017-03-19 21:20:45.909034204 +0100
> > > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100
> > > @@ -11,6 +11,12 @@
> > >if cmd == ''
> > >  return
> > >endif
> > > +  try
> > > +call serverlist()
> > > +  catch /E240:/
> > > +" No connection to the X server, give up.
> > > +finish
> > > +  endtry
> > >  
> > >let name = 'XVIMTEST'
> > >let cmd .= ' --servername ' . name
> > 
> > In my environment, `:call serverlist()` always succeed and returns the 
> > empty string.
> > So, above patch does not change the situation.
> 
> It appears serverlist() can fail silently.
> 
> Try this check instead:
> 
>   func Test_client_server()
> let cmd = GetVimCommand()
> if cmd == ''
>   return
> endif
> if has('unix')
>   try
> call remote_send('xxx', '')
>   catch
> if v:exception =~ 'E240:'
>   " No connection to the X server, give up.
>   finish

That should be "return".

> endif
> " ignore other errors
>   endtry
> endif

-- 
Some of the well known MS-Windows errors:
EHUHUnexpected error
EUSER   User error, not our fault!
EGODHorrible problem, god knows what has happened
EERRErrornous error: nothing wrong

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] SAS syntax and indent scripts

2017-03-23 Fir de Conversatie Bram Moolenaar

Keny Hu wrote:

> I have talked to James Kidd who maintains the SAS syntax script. He kindly
> agreed to have me assume the maintenance task for him. Please let me know
> if this is okay with you.

Very good, thanks for taking over.


-- 
% cat /usr/include/sys/errno.h
#define EPERM   1   /* Operation not permitted */
#define ENOENT  2   /* No such file or directory */
#define ESRCH   3   /* No such process */
[...]
#define EMACS   666 /* Too many macros */
%

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

> > > > > My config:
> > > > >   $ ./configure --with-features=huge --enable-gui=gnome2 
> > > > > --enable-fail-if-missing
> > > > > My env.:
> > > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> > > > > Vim version:
> > > > >   8.0.502
> > > > > 
> > > > > Executed command:
> > > > >   $ cd vim/src
> > > > >   $ make test
> > > > > 
> > > > > Execution result:
> > > > > I got the following error.
> > > > > >8
> > > > > Test results:
> > > > > 
> > > > > 
> > > > > >From test_clientserver.vim:
> > > > > Found errors in Test_client_server():
> > > > > First run:
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > 'XVIMTEST' does not match ''
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > connection to the X server @ function 
> > > > > RunTheTest[24]..Test_client_server, line 19
> > > > > Second run:
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > 'XVIMTEST' does not match ''
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > connection to the X server @ function 
> > > > > RunTheTest[24]..Test_client_server, line 19
> > > > 
> > > > Why is there no connection to the X server?  Anyway, we could catch this
> > > > error and give up.
> > > 
> > > There might be the case one builds vim on a headless system. I.e.
> > > some build servers of distro's?
> > 
> > Can you try this patch:
> > 
> > 
> > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim  
> > 2017-03-19 21:20:45.909034204 +0100
> > +++ testdir/test_clientserver.vim   2017-03-22 22:19:57.761651837 +0100
> > @@ -11,6 +11,12 @@
> >if cmd == ''
> >  return
> >endif
> > +  try
> > +call serverlist()
> > +  catch /E240:/
> > +" No connection to the X server, give up.
> > +finish
> > +  endtry
> >  
> >let name = 'XVIMTEST'
> >let cmd .= ' --servername ' . name
> 
> In my environment, `:call serverlist()` always succeed and returns the empty 
> string.
> So, above patch does not change the situation.

It appears serverlist() can fail silently.

Try this check instead:

func Test_client_server()
  let cmd = GetVimCommand()
  if cmd == ''
return
  endif
  if has('unix')
try
  call remote_send('xxx', '')
catch
  if v:exception =~ 'E240:'
" No connection to the X server, give up.
finish
  endif
  " ignore other errors
endtry
  endif


-- 
Some of the well known MS-Windows errors:
ESLEEP  Operator fell asleep
ENOERR  No error yet
EDOLLAR OS too expensive
EWINDOWSMS-Windows loaded, system in danger

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0503

2017-03-23 Fir de Conversatie Bram Moolenaar

Patch 8.0.0503
Problem:Endless loop in updating folds with 32 bit ints.
Solution:   Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
Files:  src/fold.c


*** ../vim-8.0.0502/src/fold.c  2017-03-16 22:06:51.824726916 +0100
--- src/fold.c  2017-03-23 21:19:13.084212797 +0100
***
*** 2755,2761 
/* End of fold found, update the length when it got shorter. */
if (fp->fd_len != flp->lnum - fp->fd_top)
{
!   if (fp->fd_top + fp->fd_len > bot + 1)
{
/* fold continued below bot */
if (getlevel == foldlevelMarker
--- 2755,2761 
/* End of fold found, update the length when it got shorter. */
if (fp->fd_len != flp->lnum - fp->fd_top)
{
!   if (fp->fd_top + fp->fd_len - 1 > bot)
{
/* fold continued below bot */
if (getlevel == foldlevelMarker
*** ../vim-8.0.0502/src/version.c   2017-03-21 21:57:51.338404174 +0100
--- src/version.c   2017-03-23 21:20:47.115523702 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 503,
  /**/

-- 
Press any key to continue, press any other key to quit.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: foldRemove 32 bit wrap with MAXLNUM

2017-03-23 Fir de Conversatie Bram Moolenaar

Matthew Malcomson wrote:

> The recent patch for :move with folds calls `foldRemove()` with 
> `MAXLNUM` for the bottom of the range to remove.
> This seems like a logical way to say "Remove all folds below here".
> For 32 bits, `foldRemove()` can't handle `bot` being `MAXLNUM`, and goes 
> into an endless loop of allocation.
> 
> The patch below stops this endless allocation, by allowing 
> `foldRemove()` to take `MAXLNUM` and still work.
> 
> 
> diff --git a/src/fold.c b/src/fold.c
> index 305173918..3a1d44c2b 100644
> --- a/src/fold.c
> +++ b/src/fold.c
> @@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
>   {
>   /* 2: or 3: need to delete nested folds */
>   foldRemove(>fd_nested, top - fp->fd_top, bot - fp->fd_top);
> -if (fp->fd_top + fp->fd_len > bot + 1)
> +if (fp->fd_top + fp->fd_len - 1 > bot)
>   {
>   /* 3: need to split it. */
>   foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);

I'm glad you were able to locate the problem and fix it.  Thanks!

-- 
hundred-and-one symptoms of being an internet addict:
195. Your cat has its own home page.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] SAS syntax and indent scripts

2017-03-23 Fir de Conversatie Keny Hu
Hi Bram,

I have talked to James Kidd who maintains the SAS syntax script. He kindly
agreed to have me assume the maintenance task for him. Please let me know
if this is okay with you.

Best,

Zhen-Huan

On Mon, Mar 13, 2017 at 4:29 PM, Bram Moolenaar  wrote:

>
> Zhen-Huan Hu wrote:
>
> > I also found an issue in the indent script. Please use the latest one
> here:
> > http://www.vim.org/scripts/download_script.php?src_id=25030
> >
> > (Somehow, when I try to attach the file directly, I keep getting the
> > error from Google groups...)
>
> I'll include the update.  You can use a normal mail client to send
> messages to the group.  Attaching should work then.
>
> --
> hundred-and-one symptoms of being an internet addict:
> 113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits.
>
>  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net
>  \\\
> ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org
> ///
>  \\\help me help AIDS victims -- http://ICCF-Holland.org
> ///
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


sas.vim
Description: Binary data


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Kazunobu Kuriyama
2017-03-23 22:41 GMT+09:00 Elimar Riesebieter :

> * Kazunobu Kuriyama  [2017-03-23 21:58
> +0900]:
>
> > 2017-03-23 21:22 GMT+09:00 h_east :
> [...]
> > > > So, the result of test_clientserver looks as if the patch were not
> > > >included.  I'm wondering if the test was done with the patched
> > > >test_clientserver.vim.
>
> The patch is indeed applied. The built was done remote.
>
> > > As in mentoring a few hours ago, in my environment `:echo serverlist()`
> > > will not raise exceptions.
> > > Unfortunately, your guess is out of hand.
> > >
> >
> > I distinguish Elimar Riesebieter's issue from yours; the former is about
> a
> > headless system where X11 can't run; the latter about an environment
> where
> > the test suite tries to run X11 on a remote system (i.e., something
> > unusual) via an ssh connection from Windows and fails for some reason.
> >
> > I thought Bram tried to address the former issue.
>
> Of course yet, but IMHO both cases should be addressed.
>
> Elimar
> --
>

Personally, I don't think it's a good idea to run the test suite on a
system which is incapable of hosting the whole tests, because tests
executed on such a system should not deserve "ALL DONE."


> .~.
> /V\   L   I   N   U   X
>/( )\ >Phear the Penguin<
>^^-^^
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Elimar Riesebieter
* Kazunobu Kuriyama  [2017-03-23 21:58 +0900]:

> 2017-03-23 21:22 GMT+09:00 h_east :
[...]
> > > So, the result of test_clientserver looks as if the patch were not
> > >included.  I'm wondering if the test was done with the patched
> > >test_clientserver.vim.

The patch is indeed applied. The built was done remote.

> > As in mentoring a few hours ago, in my environment `:echo serverlist()`
> > will not raise exceptions.
> > Unfortunately, your guess is out of hand.
> >
> 
> I distinguish Elimar Riesebieter's issue from yours; the former is about a
> headless system where X11 can't run; the latter about an environment where
> the test suite tries to run X11 on a remote system (i.e., something
> unusual) via an ssh connection from Windows and fails for some reason.
> 
> I thought Bram tried to address the former issue.

Of course yet, but IMHO both cases should be addressed.

Elimar
-- 
.~.
/V\   L   I   N   U   X
   /( )\ >Phear the Penguin<
   ^^-^^

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Kazunobu Kuriyama
2017-03-23 21:22 GMT+09:00 h_east :

> Hi Kazunobu and all,
>
> 2017-3-23(Thu) 21:01:32 UTC+9 Kazunobu Kuriyama:
> > 2017-03-23 18:13 GMT+09:00 Elimar Riesebieter :
> >
> >
> > * Bram Moolenaar  [2017-03-22 22:30 +0100]:
> >
> >
> >
> >
> >
> > >
> >
> > > Elimar Riesebieter wrote:
> >
> > >
> >
> > > > > Hirohito Higashi wrote:
> >
> > > > >
> >
> > > > > > My config:
> >
> > > > > >   $ ./configure --with-features=huge --enable-gui=gnome2
> --enable-fail-if-missing
> >
> > > > > > My env.:
> >
> > > > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> >
> > > > > > Vim version:
> >
> > > > > >   8.0.502
> >
> > > > > >
> >
> > > > > > Executed command:
> >
> > > > > >   $ cd vim/src
> >
> > > > > >   $ make test
> >
> > > > > >
> >
> > > > > > Execution result:
> >
> > > > > > I got the following error.
> >
> > > > > > >8
> >
> > > > > > Test results:
> >
> > > > > >
> >
> > > > > >
> >
> > > > > > >From test_clientserver.vim:
> >
> > > > > > Found errors in Test_client_server():
> >
> > > > > > First run:
> >
> > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern
> 'XVIMTEST' does not match ''
> >
> > > > > > Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 19
> >
> > > > > > Second run:
> >
> > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern
> 'XVIMTEST' does not match ''
> >
> > > > > > Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 19
> >
> > > > >
> >
> > > > > Why is there no connection to the X server?  Anyway, we could
> catch this
> >
> > > > > error and give up.
> >
> > > >
> >
> > > > There might be the case one builds vim on a headless system. I.e.
> >
> > > > some build servers of distro's?
> >
> > >
> >
> > > Can you try this patch:
> >
> > >
> >
> > >
> >
> > > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim
> 2017-03-19 21:20:45.909034204 +0100
> >
> > > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837
> +0100
> >
> > > @@ -11,6 +11,12 @@
> >
> > >if cmd == ''
> >
> > >  return
> >
> > >endif
> >
> > > +  try
> >
> > > +call serverlist()
> >
> > > +  catch /E240:/
> >
> > > +" No connection to the X server, give up.
> >
> > > +finish
> >
> > > +  endtry
> >
> > >
> >
> > >let name = 'XVIMTEST'
> >
> > >let cmd .= ' --servername ' . name
> >
> >
> >
> > From test_quotestar.vim:
> >
> >   Found errors in Test_quotestar():
> >
> >   First run:
> >
> >   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11
> line 21: Pattern 'XVIMCLIPBOARD' does not match ''
> >
> >   Caught exception in Test_quotestar(): Vim(call):E240: No connection to
> the X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11,
> line 31
> >
> >   Second run:
> >
> >   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11
> line 21: Pattern 'XVIMCLIPBOARD' does not match ''
> >
> >   Caught exception in Test_quotestar(): Vim(call):E240: No connection to
> the X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11,
> line 31
> >
> >
> >
> > From test_clientserver.vim:
> >
> >   Found errors in Test_client_server():
> >
> >   First run:
> >
> >   function RunTheTest[24]..Test_client_server line 23: Pattern
> 'XVIMTEST' does not match ''
> >
> >   Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 25
> >
> >   Second run:
> >
> >   function RunTheTest[24]..Test_client_server line 23: Pattern
> 'XVIMTEST' does not match ''
> >
> >   Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 25
> >
> >
> >
> > Elimar
> >
> >
> >
> > Since test_quotestar hasn't been given any handling for E240 yet, the
> result is just what we are expecting.
> >
> >
> >
> > As for test_clientserver, however, the E240 exception should be caught
> and hence the test would be skipped gracefully if Bram's patch were
> included in test_clientserver.vim.
> >
> >
> > So, the result of test_clientserver looks as if the patch were not
> included.  I'm wondering if the test was done with the patched
> test_clientserver.vim.
>
> As in mentoring a few hours ago, in my environment `:echo serverlist()`
> will not raise exceptions.
> Unfortunately, your guess is out of hand.
>

I distinguish Elimar Riesebieter's issue from yours; the former is about a
headless system where X11 can't run; the latter about an environment where
the test suite tries to run X11 on a remote system (i.e., something
unusual) via an ssh connection from Windows and fails for some reason.

I thought Bram tried to address the former 

Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie h_east
Hi Kazunobu and all,

2017-3-23(Thu) 21:01:32 UTC+9 Kazunobu Kuriyama:
> 2017-03-23 18:13 GMT+09:00 Elimar Riesebieter :
> 
> 
> * Bram Moolenaar  [2017-03-22 22:30 +0100]:
> 
> 
> 
> 
> 
> >
> 
> > Elimar Riesebieter wrote:
> 
> >
> 
> > > > Hirohito Higashi wrote:
> 
> > > >
> 
> > > > > My config:
> 
> > > > >   $ ./configure --with-features=huge --enable-gui=gnome2 
> > > > >--enable-fail-if-missing
> 
> > > > > My env.:
> 
> > > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> 
> > > > > Vim version:
> 
> > > > >   8.0.502
> 
> > > > >
> 
> > > > > Executed command:
> 
> > > > >   $ cd vim/src
> 
> > > > >   $ make test
> 
> > > > >
> 
> > > > > Execution result:
> 
> > > > > I got the following error.
> 
> > > > > >8
> 
> > > > > Test results:
> 
> > > > >
> 
> > > > >
> 
> > > > > >From test_clientserver.vim:
> 
> > > > > Found errors in Test_client_server():
> 
> > > > > First run:
> 
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > 'XVIMTEST' does not match ''
> 
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > connection to the X server @ function 
> > > > > RunTheTest[24]..Test_client_server, line 19
> 
> > > > > Second run:
> 
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 
> > > > > 'XVIMTEST' does not match ''
> 
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No 
> > > > > connection to the X server @ function 
> > > > > RunTheTest[24]..Test_client_server, line 19
> 
> > > >
> 
> > > > Why is there no connection to the X server?  Anyway, we could catch this
> 
> > > > error and give up.
> 
> > >
> 
> > > There might be the case one builds vim on a headless system. I.e.
> 
> > > some build servers of distro's?
> 
> >
> 
> > Can you try this patch:
> 
> >
> 
> >
> 
> > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim        
> > 2017-03-19 21:20:45.909034204 +0100
> 
> > +++ testdir/test_clientserver.vim     2017-03-22 22:19:57.761651837 +0100
> 
> > @@ -11,6 +11,12 @@
> 
> >    if cmd == ''
> 
> >      return
> 
> >    endif
> 
> > +  try
> 
> > +    call serverlist()
> 
> > +  catch /E240:/
> 
> > +    " No connection to the X server, give up.
> 
> > +    finish
> 
> > +  endtry
> 
> >
> 
> >    let name = 'XVIMTEST'
> 
> >    let cmd .= ' --servername ' . name
> 
> 
> 
> From test_quotestar.vim:
> 
>   Found errors in Test_quotestar():
> 
>   First run:
> 
>   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line 
> 21: Pattern 'XVIMCLIPBOARD' does not match ''
> 
>   Caught exception in Test_quotestar(): Vim(call):E240: No connection to the 
> X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, line 31
> 
>   Second run:
> 
>   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line 
> 21: Pattern 'XVIMCLIPBOARD' does not match ''
> 
>   Caught exception in Test_quotestar(): Vim(call):E240: No connection to the 
> X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, line 31
> 
> 
> 
> From test_clientserver.vim:
> 
>   Found errors in Test_client_server():
> 
>   First run:
> 
>   function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' 
> does not match ''
> 
>   Caught exception in Test_client_server(): Vim(call):E240: No connection to 
> the X server @ function RunTheTest[24]..Test_client_server, line 25
> 
>   Second run:
> 
>   function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' 
> does not match ''
> 
>   Caught exception in Test_client_server(): Vim(call):E240: No connection to 
> the X server @ function RunTheTest[24]..Test_client_server, line 25
> 
> 
> 
> Elimar
> 
> 
> 
> Since test_quotestar hasn't been given any handling for E240 yet, the result 
> is just what we are expecting.
> 
> 
> 
> As for test_clientserver, however, the E240 exception should be caught and 
> hence the test would be skipped gracefully if Bram's patch were included in 
> test_clientserver.vim.
> 
> 
> So, the result of test_clientserver looks as if the patch were not included.  
> I'm wondering if the test was done with the patched test_clientserver.vim. 

As in mentoring a few hours ago, in my environment `:echo serverlist()` will 
not raise exceptions.
Unfortunately, your guess is out of hand.

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Kazunobu Kuriyama
2017-03-23 18:13 GMT+09:00 Elimar Riesebieter :

> * Bram Moolenaar  [2017-03-22 22:30 +0100]:
>
> >
> > Elimar Riesebieter wrote:
> >
> > > > Hirohito Higashi wrote:
> > > >
> > > > > My config:
> > > > >   $ ./configure --with-features=huge --enable-gui=gnome2
> --enable-fail-if-missing
> > > > > My env.:
> > > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> > > > > Vim version:
> > > > >   8.0.502
> > > > >
> > > > > Executed command:
> > > > >   $ cd vim/src
> > > > >   $ make test
> > > > >
> > > > > Execution result:
> > > > > I got the following error.
> > > > > >8
> > > > > Test results:
> > > > >
> > > > >
> > > > > >From test_clientserver.vim:
> > > > > Found errors in Test_client_server():
> > > > > First run:
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern
> 'XVIMTEST' does not match ''
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 19
> > > > > Second run:
> > > > > function RunTheTest[24]..Test_client_server line 17: Pattern
> 'XVIMTEST' does not match ''
> > > > > Caught exception in Test_client_server(): Vim(call):E240: No
> connection to the X server @ function RunTheTest[24]..Test_client_server,
> line 19
> > > >
> > > > Why is there no connection to the X server?  Anyway, we could catch
> this
> > > > error and give up.
> > >
> > > There might be the case one builds vim on a headless system. I.e.
> > > some build servers of distro's?
> >
> > Can you try this patch:
> >
> >
> > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim
> 2017-03-19 21:20:45.909034204 +0100
> > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100
> > @@ -11,6 +11,12 @@
> >if cmd == ''
> >  return
> >endif
> > +  try
> > +call serverlist()
> > +  catch /E240:/
> > +" No connection to the X server, give up.
> > +finish
> > +  endtry
> >
> >let name = 'XVIMTEST'
> >let cmd .= ' --servername ' . name
>
> From test_quotestar.vim:
>   Found errors in Test_quotestar():
>   First run:
>   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11
> line 21: Pattern 'XVIMCLIPBOARD' does not match ''
>   Caught exception in Test_quotestar(): Vim(call):E240: No connection to
> the X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11,
> line 31
>   Second run:
>   function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11
> line 21: Pattern 'XVIMCLIPBOARD' does not match ''
>   Caught exception in Test_quotestar(): Vim(call):E240: No connection to
> the X server @ function 
> RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11,
> line 31
>
> From test_clientserver.vim:
>   Found errors in Test_client_server():
>   First run:
>   function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST'
> does not match ''
>   Caught exception in Test_client_server(): Vim(call):E240: No connection
> to the X server @ function RunTheTest[24]..Test_client_server, line 25
>   Second run:
>   function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST'
> does not match ''
>   Caught exception in Test_client_server(): Vim(call):E240: No connection
> to the X server @ function RunTheTest[24]..Test_client_server, line 25
>
> Elimar
>

Since test_quotestar hasn't been given any handling for E240 yet, the
result is just what we are expecting.

As for test_clientserver, however, the E240 exception should be caught and
hence the test would be skipped gracefully if Bram's patch were included in
test_clientserver.vim.

So, the result of test_clientserver looks as if the patch were not
included.  I'm wondering if the test was done with the patched
test_clientserver.vim.

> --
>   We all know Linux is great... it does infinite loops in 5 seconds.
> -Linus Torvalds
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


foldRemove 32 bit wrap with MAXLNUM

2017-03-23 Fir de Conversatie Matthew Malcomson

Hello there,

The recent patch for :move with folds calls `foldRemove()` with 
`MAXLNUM` for the bottom of the range to remove.

This seems like a logical way to say "Remove all folds below here".
For 32 bits, `foldRemove()` can't handle `bot` being `MAXLNUM`, and goes 
into an endless loop of allocation.


The patch below stops this endless allocation, by allowing 
`foldRemove()` to take `MAXLNUM` and still work.



diff --git a/src/fold.c b/src/fold.c
index 305173918..3a1d44c2b 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
 {
 /* 2: or 3: need to delete nested folds */
 foldRemove(>fd_nested, top - fp->fd_top, bot - fp->fd_top);
-if (fp->fd_top + fp->fd_len > bot + 1)
+if (fp->fd_top + fp->fd_len - 1 > bot)
 {
 /* 3: need to split it. */
 foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swap file names

2017-03-23 Fir de Conversatie Dominique Pellé
Christian Brabandt wrote:

> On Mi, 22 Mär 2017, Marco Ippolito wrote:
>
>> Should editing .gitignore swap to ..gitignore.swp rather than .gitignore.swp?
>
> Why would you think so?


:help swapname says:

==
:sw[apname]*:sw* *:swapname*

The name of the swap file is normally the same as the file you are editing,
with the extension ".swp".
- On Unix, a '.' is prepended to swap file names in the same directory as the
  edited file.  This avoids that the swap file shows up in a directory
  listing.
===

The doc could be clearer to say that if the file name already starts with '.'
then the '.' is not preprended.

Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie Elimar Riesebieter
* Bram Moolenaar  [2017-03-22 22:30 +0100]:

> 
> Elimar Riesebieter wrote:
> 
> > > Hirohito Higashi wrote:
> > > 
> > > > My config:
> > > >   $ ./configure --with-features=huge --enable-gui=gnome2 
> > > > --enable-fail-if-missing
> > > > My env.:
> > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> > > > Vim version:
> > > >   8.0.502
> > > > 
> > > > Executed command:
> > > >   $ cd vim/src
> > > >   $ make test
> > > > 
> > > > Execution result:
> > > > I got the following error.
> > > > >8
> > > > Test results:
> > > > 
> > > > 
> > > > >From test_clientserver.vim:
> > > > Found errors in Test_client_server():
> > > > First run:
> > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' 
> > > > does not match ''
> > > > Caught exception in Test_client_server(): Vim(call):E240: No connection 
> > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19
> > > > Second run:
> > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' 
> > > > does not match ''
> > > > Caught exception in Test_client_server(): Vim(call):E240: No connection 
> > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19
> > > 
> > > Why is there no connection to the X server?  Anyway, we could catch this
> > > error and give up.
> > 
> > There might be the case one builds vim on a headless system. I.e.
> > some build servers of distro's?
> 
> Can you try this patch:
> 
> 
> --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim
> 2017-03-19 21:20:45.909034204 +0100
> +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100
> @@ -11,6 +11,12 @@
>if cmd == ''
>  return
>endif
> +  try
> +call serverlist()
> +  catch /E240:/
> +" No connection to the X server, give up.
> +finish
> +  endtry
>  
>let name = 'XVIMTEST'
>let cmd .= ' --servername ' . name

>From test_quotestar.vim:
  Found errors in Test_quotestar():
  First run:
  function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line 
21: Pattern 'XVIMCLIPBOARD' does not match ''
  Caught exception in Test_quotestar(): Vim(call):E240: No connection to the X 
server @ function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, 
line 31
  Second run:
  function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line 
21: Pattern 'XVIMCLIPBOARD' does not match ''
  Caught exception in Test_quotestar(): Vim(call):E240: No connection to the X 
server @ function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, 
line 31

>From test_clientserver.vim:
  Found errors in Test_client_server():
  First run:
  function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' does 
not match ''
  Caught exception in Test_client_server(): Vim(call):E240: No connection to 
the X server @ function RunTheTest[24]..Test_client_server, line 25
  Second run:
  function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' does 
not match ''
  Caught exception in Test_client_server(): Vim(call):E240: No connection to 
the X server @ function RunTheTest[24]..Test_client_server, line 25

Elimar
-- 
  We all know Linux is great... it does infinite loops in 5 seconds.
-Linus Torvalds

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances

2017-03-23 Fir de Conversatie h_east
Hi Bram,

2017-3-23(Thu) 6:31:02 UTC+9 Bram Moolenaar:
> Elimar Riesebieter wrote:
> 
> > > Hirohito Higashi wrote:
> > > 
> > > > My config:
> > > >   $ ./configure --with-features=huge --enable-gui=gnome2 
> > > > --enable-fail-if-missing
> > > > My env.:
> > > >   I am connecting to fedora 25 with ssh via PuTTY on Windows 7.
> > > > Vim version:
> > > >   8.0.502
> > > > 
> > > > Executed command:
> > > >   $ cd vim/src
> > > >   $ make test
> > > > 
> > > > Execution result:
> > > > I got the following error.
> > > > >8
> > > > Test results:
> > > > 
> > > > 
> > > > >From test_clientserver.vim:
> > > > Found errors in Test_client_server():
> > > > First run:
> > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' 
> > > > does not match ''
> > > > Caught exception in Test_client_server(): Vim(call):E240: No connection 
> > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19
> > > > Second run:
> > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' 
> > > > does not match ''
> > > > Caught exception in Test_client_server(): Vim(call):E240: No connection 
> > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19
> > > 
> > > Why is there no connection to the X server?  Anyway, we could catch this
> > > error and give up.
> > 
> > There might be the case one builds vim on a headless system. I.e.
> > some build servers of distro's?
> 
> Can you try this patch:
> 
> 
> --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim
> 2017-03-19 21:20:45.909034204 +0100
> +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100
> @@ -11,6 +11,12 @@
>if cmd == ''
>  return
>endif
> +  try
> +call serverlist()
> +  catch /E240:/
> +" No connection to the X server, give up.
> +finish
> +  endtry
>  
>let name = 'XVIMTEST'
>let cmd .= ' --servername ' . name

In my environment, `:call serverlist()` always succeed and returns the empty 
string.
So, above patch does not change the situation.

thanks.
--
Best regards,
Hirohito Higashi (a.k.a. h_east)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swap file names

2017-03-23 Fir de Conversatie Christian Brabandt
On Mi, 22 Mär 2017, Marco Ippolito wrote:

> Should editing .gitignore swap to ..gitignore.swp rather than .gitignore.swp?

Why would you think so?


Best,
Christian
-- 
Letzte Worte eines Software-Entwicklers:
  "Natürlich habe ich ein intaktes Backup."

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Swap file names

2017-03-23 Fir de Conversatie Marco Ippolito
Should editing .gitignore swap to ..gitignore.swp rather than .gitignore.swp?

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.