checker of using python2

2017-01-14 Fir de Conversatie MURAOKA Taro
Hi the list and Bram.

I suggest to add checker of using Python 2.x

Python 2 will be retire 2020, and it is not so far.
https://pythonclock.org/
To stop using Python 2.x suddenly is not easy for Vim users.
Because it is difficult to know which scripts are using Python 2.
So vim may help to detect it.

I have wrote a patch for proof of the concept.
Please check it:
https://gist.github.com/koron/90f6b56b73c211e059a3b8ab1db335a9

My patch do three things:

1. Show a waring message at only once when Python 2.x is used.
2. The warning could be suppressed by 'nopy2warn' option.
3. :py2usingfrom shows list of files which use Python 2.x

Names for command and option which I added are not good, I think.
Please replace those by better names.

Best.
-- 
MURAOKA Taro 

-- 
-- 
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.


Inconsistency within indent/*.vim built-ins

2017-01-14 Fir de Conversatie yegortimoshenko
Hello!

Indent files for some languages (clojure.vim, scala.vim, sml.vim) set default 
shiftwidth, while others (most, including javascript.vim, ruby.vim) don't. This 
causes the latter to default to 1 tab per indentation level in Vim, even though 
e.g. JavaScript and Ruby is typically indented with 2 spaces in the wild. That 
could certainly use some streamlining, and I believe It'd be great if Vim used 
community-accepted standard indentation for all languages by default, but there 
might be a reverse-compatibility issue too.

Most indent files haven't been updated for the last 5 years, and I might be 
missing historical perspective.
So what do you think?

-- 
-- 
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 8.0.0187

2017-01-14 Fir de Conversatie Ken Takata
Hi,

2017/1/15 Sun 9:52:05 UTC+9 Cesar wrote:
> On 14/01/2017 02:12 p.m., Bram Moolenaar wrote:
>  >
>  > Patch 8.0.0187
>  > Problem:Building with a new Ruby version fails.
>  > Solution:   Use ruby_sysinit() instead of NtInitialize(). (Tomas Volf,
>  >  closes #1382)
>  > Files:  src/if_ruby.c
>  >
>  >
>  > *** ../vim-8.0.0186/src/if_ruby.c  2017-01-09 21:10:29.300184895 +0100
>  > --- src/if_ruby.c  2017-01-14 20:09:54.001642368 +0100
>  > ***
>  > *** 862,868 
>  > --- 862,872 
>  >int argc = 1;
>  >char *argv[] = {"gvim.exe"};
>  >char **argvp = argv;
>  > + # ifdef RUBY19_OR_LATER
>  > +  ruby_sysinit(,);
>  > + # else
>  >NtInitialize(,);
>  > + # endif
>  >#endif
>  >{
>  >#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
>  > *** ../vim-8.0.0186/src/version.c  2017-01-14 20:06:11.127087707 +0100
>  > --- src/version.c  2017-01-14 20:11:17.953098490 +0100
>  > ***
>  > *** 766,767 
>  > --- 766,769 
>  >{   /* Add new patch number below this line */
>  > + /**/
>  > + 187,
>  >/**/
>  >
> 
> I'm building vim on Windows 7 with MinGW. After compiling the latest
> pull I get:
> 
> 
> [...]
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x862): undefined reference to 
> `ruby_sysinit'
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x23fa): undefined reference to 
> `ruby_sysinit'
> collect2.exe: error: ld returned 1 exit status
> make: *** [gvim.exe] Error 1
> Error by compiling gvim.exe
> 
> 
> Many thanks in advance,

I think this patch should be reverted. As I wrote in the issue #1381, currently
no one maintains static linking to Ruby on Windows. The +ruby/dyn version on
Windows already uses ruby_sysinit() instead of NtInitialize(). See:
https://github.com/vim/vim/blob/fe6ce331d94c24ad745d0bf329ec0a65a5c07cc9/src/if_ruby.c#L598-L603

How about attached patch?

Regards,
Ken Takata

-- 
-- 
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.
# HG changeset patch
# Parent  ed9d2f4103ec083d72c42773f1589a6a964914e5

diff --git a/src/if_ruby.c b/src/if_ruby.c
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -199,6 +199,12 @@ static void ruby_vim_init(void);
 # endif
 #endif
 
+#if defined(RUBY19_OR_LATER) && !defined(DYNAMIC_RUBY)
+# ifdef WIN3264
+#  define NtInitialize			ruby_sysinit
+# endif
+#endif
+
 #if defined(DYNAMIC_RUBY) || defined(PROTO)
 # if defined(PROTO) && !defined(HINSTANCE)
 #  define HINSTANCE int		/* for generating prototypes */
@@ -865,11 +871,7 @@ static int ensure_ruby_initialized(void)
 	int argc = 1;
 	char *argv[] = {"gvim.exe"};
 	char **argvp = argv;
-# ifdef RUBY19_OR_LATER
-	ruby_sysinit(, );
-# else
 	NtInitialize(, );
-# endif
 #endif
 	{
 #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)


Re: Patch 8.0.0187

2017-01-14 Fir de Conversatie Taro MURAOKA

> I'm building vim on Windows 7 with MinGW. After compiling the latest
> pull I get:
> 
> 
> [...]
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x862): undefined reference to 
> `ruby_sysinit'
> gobjZi686/if_ruby.o:if_ruby.c:(.text+0x23fa): undefined reference to 
> `ruby_sysinit'
> collect2.exe: error: ld returned 1 exit status
> make: *** [gvim.exe] Error 1
> Error by compiling gvim.exe
> 
> 
> Many thanks in advance,
> 
> -- 
> Cesar


I have wrote an attached patch to fix this.
Please try it.

-- 
-- 
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.
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 509d2f6..afa27ab 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -303,6 +303,7 @@ static void ruby_vim_init(void);
 # define ruby_init_loadpath		dll_ruby_init_loadpath
 # ifdef WIN3264
 #  define NtInitialize			dll_NtInitialize
+#  define ruby_sysinit			dll_ruby_sysinit
 #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
 #   define rb_w32_snprintf		dll_rb_w32_snprintf
 #  endif
@@ -405,6 +406,7 @@ static void (*dll_ruby_init) (void);
 static void (*dll_ruby_init_loadpath) (void);
 # ifdef WIN3264
 static void (*dll_NtInitialize) (int*, char***);
+static void (*dll_ruby_sysinit) (int*, char***);
 #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
 static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
 #  endif
@@ -594,13 +596,11 @@ static struct
 {"ruby_init", (RUBY_PROC*)_ruby_init},
 {"ruby_init_loadpath", (RUBY_PROC*)_ruby_init_loadpath},
 # ifdef WIN3264
-{
 #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19
-"NtInitialize",
+{"NtInitialize", (RUBY_PROC*)_NtInitialize},
 #  else
-"ruby_sysinit",
+{"ruby_sysinit", (RUBY_PROC*)_ruby_sysinit},
 #  endif
-			(RUBY_PROC*)_NtInitialize},
 #  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
 {"rb_w32_snprintf", (RUBY_PROC*)_rb_w32_snprintf},
 #  endif


Re: Patch 8.0.0187

2017-01-14 Fir de Conversatie Cesar Romani

On 14/01/2017 02:12 p.m., Bram Moolenaar wrote:
>
> Patch 8.0.0187
> Problem:Building with a new Ruby version fails.
> Solution:   Use ruby_sysinit() instead of NtInitialize(). (Tomas Volf,
>  closes #1382)
> Files:  src/if_ruby.c
>
>
> *** ../vim-8.0.0186/src/if_ruby.c  2017-01-09 21:10:29.300184895 +0100
> --- src/if_ruby.c  2017-01-14 20:09:54.001642368 +0100
> ***
> *** 862,868 
> --- 862,872 
>int argc = 1;
>char *argv[] = {"gvim.exe"};
>char **argvp = argv;
> + # ifdef RUBY19_OR_LATER
> +  ruby_sysinit(,);
> + # else
>NtInitialize(,);
> + # endif
>#endif
>{
>#if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
> *** ../vim-8.0.0186/src/version.c  2017-01-14 20:06:11.127087707 +0100
> --- src/version.c  2017-01-14 20:11:17.953098490 +0100
> ***
> *** 766,767 
> --- 766,769 
>{   /* Add new patch number below this line */
> + /**/
> + 187,
>/**/
>

I'm building vim on Windows 7 with MinGW. After compiling the latest
pull I get:


[...]
gobjZi686/if_ruby.o:if_ruby.c:(.text+0x862): undefined reference to 
`ruby_sysinit'
gobjZi686/if_ruby.o:if_ruby.c:(.text+0x23fa): undefined reference to 
`ruby_sysinit'

collect2.exe: error: ld returned 1 exit status
make: *** [gvim.exe] Error 1
Error by compiling gvim.exe


Many thanks in advance,

--
Cesar

--
--
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 8.0.0181

2017-01-14 Fir de Conversatie Masanori Misono
Hi Bram,

2017年1月14日土曜日 23時21分21秒 UTC+9 Bram Moolenaar:
> Hirohito Higashi wrote:
> 
> > Hi Bram,
> > 
> > 2017-1-14(Sat) 22:54:57 UTC+9 Bram Moolenaar:
> > > Patch 8.0.0181
> > > Summary:with cursorbind set cursor column highlighting is off
> > > Problem:When 'cursorbind' and 'cursorcolumn' are both on, the column
> > > highlignt in non-current windows is wrong.
> > > Solution:   Add validate_cursor(). (Masanori Misono, closes #1372)
> > > Files:  src/move.c
> > > 
> > > 
> > > *** ../vim-8.0.0180/src/move.c2016-11-06 15:25:37.693627473 +0100
> > > --- src/move.c2017-01-12 22:32:01.408155308 +0100
> > > ***
> > > *** 2841,2846 
> > > --- 2841,2850 
> > >   restart_edit_save = restart_edit;
> > >   restart_edit = TRUE;
> > >   check_cursor();
> > > + # ifdef FEAT_SYN_HL
> > > + if (curwin->w_p_cuc)
> > > + validate_cursor();
> > > + # endif
> > >   restart_edit = restart_edit_save;
> > >   # ifdef FEAT_MBYTE
> > >   /* Correct cursor for multi-byte character. */
> > > *** ../vim-8.0.0180/src/version.c 2017-01-14 14:36:03.229775080 +0100
> > > --- src/version.c 2017-01-14 14:53:33.111310935 +0100
> > > ***
> > > *** 766,767 
> > > --- 766,769 
> > >   {   /* Add new patch number below this line */
> > > + /**/
> > > + 181,
> > >   /**/
> > 
> > Is the following patch correct?
> > https://groups.google.com/d/msg/vim_dev/afsWQ48bfn0/xF-mCefjBwAJ
> 
> It works for me.
> 
> -- 
> God made the integers; all else is the work of Man.
>   -- Kronecker
> 
>  /// 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///


If we only set cursorbind and cursorline only, validate_cursor() is not called.
Maybe we need to do something like following:

diff --git a/src/move.c b/src/move.c
index 86b19aafc..ff522c02c 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2841,10 +2841,12 @@ do_check_cursorbind(void)
restart_edit_save = restart_edit;
restart_edit = TRUE;
check_cursor();
+   if (curwin->w_p_crb
 # ifdef FEAT_SYN_HL
-   if (curwin->w_p_cuc)
-   validate_cursor();
+  || curwin->w_p_cuc
 # endif
+  )
+   validate_cursor();
restart_edit = restart_edit_save;
 # ifdef FEAT_MBYTE
/* Correct cursor for multi-byte character. */


-- 
Best regards,
Masanori Misono

-- 
-- 
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.0187

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0187
Problem:Building with a new Ruby version fails.
Solution:   Use ruby_sysinit() instead of NtInitialize(). (Tomas Volf,
closes #1382)
Files:  src/if_ruby.c


*** ../vim-8.0.0186/src/if_ruby.c   2017-01-09 21:10:29.300184895 +0100
--- src/if_ruby.c   2017-01-14 20:09:54.001642368 +0100
***
*** 862,868 
--- 862,872 
int argc = 1;
char *argv[] = {"gvim.exe"};
char **argvp = argv;
+ # ifdef RUBY19_OR_LATER
+   ruby_sysinit(, );
+ # else
NtInitialize(, );
+ # endif
  #endif
{
  #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
*** ../vim-8.0.0186/src/version.c   2017-01-14 20:06:11.127087707 +0100
--- src/version.c   2017-01-14 20:11:17.953098490 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 187,
  /**/

-- 
There is a fine line between courage and foolishness.
Unfortunately, it's not a fence.

 /// 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.0186

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0186
Problem:The error message from assert_notequal() is confusing.
Solution:   Only mention the expected value.
Files:  src/eval.c, src/testdir/test_assert.vim


*** ../vim-8.0.0185/src/eval.c  2017-01-12 20:06:30.148523006 +0100
--- src/eval.c  2017-01-14 18:40:19.035549604 +0100
***
*** 9256,9261 
--- 9256,9263 
  {
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
ga_concat(gap, (char_u *)"Pattern ");
+   else if (atype == ASSERT_NOTEQUAL)
+   ga_concat(gap, (char_u *)"Expected not equal to ");
else
ga_concat(gap, (char_u *)"Expected ");
if (exp_str == NULL)
***
*** 9265,9280 
}
else
ga_concat_esc(gap, exp_str);
!   if (atype == ASSERT_MATCH)
!   ga_concat(gap, (char_u *)" does not match ");
!   else if (atype == ASSERT_NOTMATCH)
!   ga_concat(gap, (char_u *)" does match ");
!   else if (atype == ASSERT_NOTEQUAL)
!   ga_concat(gap, (char_u *)" differs from ");
!   else
!   ga_concat(gap, (char_u *)" but got ");
!   ga_concat_esc(gap, tv2string(got_tv, , numbuf, 0));
!   vim_free(tofree);
  }
  }
  
--- 9267,9283 
}
else
ga_concat_esc(gap, exp_str);
!   if (atype != ASSERT_NOTEQUAL)
!   {
!   if (atype == ASSERT_MATCH)
!   ga_concat(gap, (char_u *)" does not match ");
!   else if (atype == ASSERT_NOTMATCH)
!   ga_concat(gap, (char_u *)" does match ");
!   else
!   ga_concat(gap, (char_u *)" but got ");
!   ga_concat_esc(gap, tv2string(got_tv, , numbuf, 0));
!   vim_free(tofree);
!   }
  }
  }
  
*** ../vim-8.0.0185/src/testdir/test_assert.vim 2016-12-04 13:37:38.425300719 
+0100
--- src/testdir/test_assert.vim 2017-01-14 19:22:57.331531549 +0100
***
*** 32,38 
call assert_notequal([1, 2, 3], s)
  
call assert_notequal('foo', s)
!   call assert_match("Expected 'foo' differs from 'foo'", v:errors[0])
call remove(v:errors, 0)
  endfunc
  
--- 32,38 
call assert_notequal([1, 2, 3], s)
  
call assert_notequal('foo', s)
!   call assert_match("Expected not equal to 'foo'", v:errors[0])
call remove(v:errors, 0)
  endfunc
  
*** ../vim-8.0.0185/src/version.c   2017-01-14 19:38:32.449616516 +0100
--- src/version.c   2017-01-14 20:05:13.187463800 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 186,
  /**/

-- 
GOD: That is your purpose Arthur ... the Quest for the Holy Grail ...
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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.0185

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0185 (after 8.0.0184)
Problem:The system() test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
Files:  src/testdir/test_system.vim


*** ../vim-8.0.0184/src/testdir/test_system.vim 2017-01-14 19:24:48.654828136 
+0100
--- src/testdir/test_system.vim 2017-01-14 19:37:00.270198712 +0100
***
*** 48,53 
--- 48,57 
  endfunction
  
  function! Test_system_exmode()
+   if !has('unix')
+ return
+   endif
+ 
let cmd=" -es -u NONE -c 'source Xscript' +q; echo $?"
" Need to put this in a script, "catch" isn't found after an unknown
" function.
*** ../vim-8.0.0184/src/version.c   2017-01-14 19:24:48.654828136 +0100
--- src/version.c   2017-01-14 19:37:57.389837923 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 185,
  /**/

-- 
   In war we're tough and able.
   Quite indefatigable
   Between our quests
   We sequin vests
   And impersonate Clark Gable
   It's a busy life in Camelot.
   I have to push the pram a lot.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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.0184

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0184
Summary:when an error is caught Vim still exits with non-zero result
Problem:When in Ex mode and an error is caught by try-catch, Vim still
exits with a non-zero exit code.
Solution:   Don't set ex_exitval when inside a try-catch. (partly by Christian
Brabandt)
Files:  src/message.c, src/testdir/test_system.vim


*** ../vim-8.0.0183/src/message.c   2016-12-01 15:34:04.087413921 +0100
--- src/message.c   2017-01-14 18:41:43.735026080 +0100
***
*** 578,585 
return TRUE;
  
  called_emsg = TRUE;
- if (emsg_silent == 0)
-   ex_exitval = 1;
  
  /*
   * If "emsg_severe" is TRUE: When an error exception is to be thrown,
--- 578,583 
***
*** 642,647 
--- 640,647 
return TRUE;
}
  
+   ex_exitval = 1;
+ 
/* Reset msg_silent, an error causes messages to be switched back on. */
msg_silent = 0;
cmd_silent = FALSE;
*** ../vim-8.0.0183/src/testdir/test_system.vim 2017-01-08 14:14:34.732591613 
+0100
--- src/testdir/test_system.vim 2017-01-14 19:15:58.686163819 +0100
***
*** 46,48 
--- 46,85 
  
call assert_fails('call system("wc -l", 9)', 'E86:')
  endfunction
+ 
+ function! Test_system_exmode()
+   let cmd=" -es -u NONE -c 'source Xscript' +q; echo $?"
+   " Need to put this in a script, "catch" isn't found after an unknown
+   " function.
+   call writefile(['try', 'call doesnotexist()', 'catch', 'endtry'], 'Xscript')
+   let a = system(v:progpath . cmd)
+   call assert_equal('0', a[0])
+   call assert_equal(0, v:shell_error)
+ 
+   " Error before try does set error flag.
+   call writefile(['call nosuchfunction()', 'try', 'call doesnotexist()', 
'catch', 'endtry'], 'Xscript')
+   let a = system(v:progpath . cmd)
+   call assert_notequal('0', a[0])
+ 
+   let cmd=" -es -u NONE -c 'source Xscript' +q"
+   let a = system(v:progpath . cmd)
+   call assert_notequal(0, v:shell_error)
+ 
+   let cmd=" -es -u NONE -c 'call doesnotexist()' +q; echo $?"
+   let a = system(v:progpath. cmd)
+   call assert_notequal(0, a[0])
+ 
+   let cmd=" -es -u NONE -c 'call doesnotexist()' +q"
+   let a = system(v:progpath. cmd)
+   call assert_notequal(0, v:shell_error)
+ 
+   let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q; echo $?"
+   let a = system(v:progpath. cmd)
+   call assert_notequal(0, a[0])
+ 
+   let cmd=" -es -u NONE -c 'call doesnotexist()|let a=1' +q"
+   let a = system(v:progpath. cmd)
+   call assert_notequal(0, v:shell_error)
+ 
+   call delete('Xscript')
+ endfunc
*** ../vim-8.0.0183/src/version.c   2017-01-14 17:04:33.950973940 +0100
--- src/version.c   2017-01-14 19:17:26.177613410 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 184,
  /**/

-- 
   We're knights of the Round Table
   Our shows are formidable
   But many times
   We're given rhymes
   That are quite unsingable
   We're opera mad in Camelot
   We sing from the diaphragm a lot.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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.0183

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0183
Summary:ubsan warns for unaligned address
Problem:Ubsan warns for using a pointer that is not aligned.
Solution:   First copy the address. (Yegappan Lakshmanan)
Files:  src/channel.c


*** ../vim-8.0.0182/src/channel.c   2017-01-10 15:15:32.882134134 +0100
--- src/channel.c   2017-01-14 17:01:34.220082253 +0100
***
*** 710,716 
channel_free(channel);
return NULL;
  }
! memcpy((char *)_addr, host->h_addr, host->h_length);
  
  /* On Mac and Solaris a zero timeout almost never works.  At least wait
   * one millisecond. Let's do it for all systems, because we don't know why
--- 710,723 
channel_free(channel);
return NULL;
  }
! {
!   char*p;
! 
!   /* When using host->h_addr directly ubsan warns for it to not be
!* aligned.  First copy the pointer to aviod that. */
!   memcpy(, >h_addr, sizeof(p));
!   memcpy((char *)_addr, p, host->h_length);
! }
  
  /* On Mac and Solaris a zero timeout almost never works.  At least wait
   * one millisecond. Let's do it for all systems, because we don't know why
*** ../vim-8.0.0182/src/version.c   2017-01-14 15:52:42.889489220 +0100
--- src/version.c   2017-01-14 16:58:58.469042689 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 183,
  /**/

-- 
   We're knights of the round table
   We dance whene'er we're able
   We do routines and chorus scenes
   With footwork impeccable.
   We dine well here in Camelot
   We eat ham and jam and spam a lot.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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 8.0.0182

2017-01-14 Fir de Conversatie h_east
Hi Bram,

Thanks for the correct fix!

--
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.


Patch 8.0.0182

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0182
Problem:When 'cursorbind' and 'cursorline' are set, but 'cursorcolumn' is
not, then the cursor line highlighting is not updated. (Hirohito
Higashi)
Solution:   Call redraw_later() with NOT_VALID.
Files:  src/move.c


*** ../vim-8.0.0181/src/move.c  2017-01-14 14:54:23.950998102 +0100
--- src/move.c  2017-01-14 15:47:51.319280794 +0100
***
*** 2851,2857 
if (has_mbyte)
mb_adjust_cursor();
  # endif
!   redraw_later(VALID);
  
/* Only scroll when 'scrollbind' hasn't done this. */
if (!curwin->w_p_scb)
--- 2851,2857 
if (has_mbyte)
mb_adjust_cursor();
  # endif
!   redraw_later(curwin->w_p_cul ? NOT_VALID : VALID);
  
/* Only scroll when 'scrollbind' hasn't done this. */
if (!curwin->w_p_scb)
*** ../vim-8.0.0181/src/version.c   2017-01-14 14:54:23.950998102 +0100
--- src/version.c   2017-01-14 15:51:53.017795521 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 182,
  /**/

-- 
GALAHAD:   Camelot ...
LAUNCELOT: Camelot ...
GAWAIN:It's only a model.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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 8.0.0181

2017-01-14 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

> Here is a patch.  (Attached)

Thanks, but that does not appear to solve the problem.
Looks like we need to use NOT_VALID for redraw_later().


-- 
This sentence is not sure that it exists, but if it does, it will
certainly consider the possibility that other sentences exist.

 /// 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 8.0.0181

2017-01-14 Fir de Conversatie h_east
Hi Bram,

Here is a patch.  (Attached)

--
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.
diff --git a/src/move.c b/src/move.c
index 86b19aa..e1ca9fc 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2842,7 +2842,7 @@ do_check_cursorbind(void)
 	restart_edit = TRUE;
 	check_cursor();
 # ifdef FEAT_SYN_HL
-	if (curwin->w_p_cuc)
+	if (curwin->w_p_cuc || curwin->w_p_cul)
 		validate_cursor();
 # endif
 	restart_edit = restart_edit_save;


Re: Patch 8.0.0181

2017-01-14 Fir de Conversatie h_east
hi Bram,

> It works for me.

The following setting is no works.  (set 'cursorline' without 'cursorcolumn')
:set cursorbind cursorline nocursorcolumn

--
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 8.0.0181

2017-01-14 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

> Hi Bram,
> 
> 2017-1-14(Sat) 22:54:57 UTC+9 Bram Moolenaar:
> > Patch 8.0.0181
> > Summary:with cursorbind set cursor column highlighting is off
> > Problem:When 'cursorbind' and 'cursorcolumn' are both on, the column
> > highlignt in non-current windows is wrong.
> > Solution:   Add validate_cursor(). (Masanori Misono, closes #1372)
> > Files:  src/move.c
> > 
> > 
> > *** ../vim-8.0.0180/src/move.c  2016-11-06 15:25:37.693627473 +0100
> > --- src/move.c  2017-01-12 22:32:01.408155308 +0100
> > ***
> > *** 2841,2846 
> > --- 2841,2850 
> > restart_edit_save = restart_edit;
> > restart_edit = TRUE;
> > check_cursor();
> > + # ifdef FEAT_SYN_HL
> > +   if (curwin->w_p_cuc)
> > +   validate_cursor();
> > + # endif
> > restart_edit = restart_edit_save;
> >   # ifdef FEAT_MBYTE
> > /* Correct cursor for multi-byte character. */
> > *** ../vim-8.0.0180/src/version.c   2017-01-14 14:36:03.229775080 +0100
> > --- src/version.c   2017-01-14 14:53:33.111310935 +0100
> > ***
> > *** 766,767 
> > --- 766,769 
> >   {   /* Add new patch number below this line */
> > + /**/
> > + 181,
> >   /**/
> 
> Is the following patch correct?
> https://groups.google.com/d/msg/vim_dev/afsWQ48bfn0/xF-mCefjBwAJ

It works for me.

-- 
God made the integers; all else is the work of Man.
-- Kronecker

 /// 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: YML formatting inconsistent bug

2017-01-14 Fir de Conversatie Bram Moolenaar

Kay Hendry wrote:

> On Thursday, September 8, 2016 at 9:00:02 PM UTC+8, Christian Brabandt wrote:
> > For runtime file bugs, it is recommended to contact the maintainer
> > first.
> 
> I did, no reply. :(
> 
> Any other ways to track this or push it along?
> 
> Can't believe I'm the only one editing YAML files in frustration with vim8.

Is this about the indent file?  It's maintained by Nikolai Pavlov, who
is always very active.

-- 
Women are probably the main cause of free software starvation.

 /// 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 8.0.0181

2017-01-14 Fir de Conversatie h_east
Hi Bram,

2017-1-14(Sat) 22:54:57 UTC+9 Bram Moolenaar:
> Patch 8.0.0181
> Summary:with cursorbind set cursor column highlighting is off
> Problem:When 'cursorbind' and 'cursorcolumn' are both on, the column
> highlignt in non-current windows is wrong.
> Solution:   Add validate_cursor(). (Masanori Misono, closes #1372)
> Files:  src/move.c
> 
> 
> *** ../vim-8.0.0180/src/move.c2016-11-06 15:25:37.693627473 +0100
> --- src/move.c2017-01-12 22:32:01.408155308 +0100
> ***
> *** 2841,2846 
> --- 2841,2850 
>   restart_edit_save = restart_edit;
>   restart_edit = TRUE;
>   check_cursor();
> + # ifdef FEAT_SYN_HL
> + if (curwin->w_p_cuc)
> + validate_cursor();
> + # endif
>   restart_edit = restart_edit_save;
>   # ifdef FEAT_MBYTE
>   /* Correct cursor for multi-byte character. */
> *** ../vim-8.0.0180/src/version.c 2017-01-14 14:36:03.229775080 +0100
> --- src/version.c 2017-01-14 14:53:33.111310935 +0100
> ***
> *** 766,767 
> --- 766,769 
>   {   /* Add new patch number below this line */
> + /**/
> + 181,
>   /**/

Is the following patch correct?
https://groups.google.com/d/msg/vim_dev/afsWQ48bfn0/xF-mCefjBwAJ

--
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.


Patch 8.0.0181

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0181
Summary:with cursorbind set cursor column highlighting is off
Problem:When 'cursorbind' and 'cursorcolumn' are both on, the column
highlignt in non-current windows is wrong.
Solution:   Add validate_cursor(). (Masanori Misono, closes #1372)
Files:  src/move.c


*** ../vim-8.0.0180/src/move.c  2016-11-06 15:25:37.693627473 +0100
--- src/move.c  2017-01-12 22:32:01.408155308 +0100
***
*** 2841,2846 
--- 2841,2850 
restart_edit_save = restart_edit;
restart_edit = TRUE;
check_cursor();
+ # ifdef FEAT_SYN_HL
+   if (curwin->w_p_cuc)
+   validate_cursor();
+ # endif
restart_edit = restart_edit_save;
  # ifdef FEAT_MBYTE
/* Correct cursor for multi-byte character. */
*** ../vim-8.0.0180/src/version.c   2017-01-14 14:36:03.229775080 +0100
--- src/version.c   2017-01-14 14:53:33.111310935 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 181,
  /**/

-- 
ARTHUR: This new learning amazes me, Sir Bedevere.  Explain again how sheep's
bladders may be employed to prevent earthquakes.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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.0180

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0180
Summary:error E937 is used twice
Problem:Error E937 is used both for duplicate key in JSON and for trying
to delete a buffer that is in use.
Solution:   Rename the JSON error to E938. (Norio Takagi, closes #1376)
Files:  src/json.c, src/testdir/test_json.vim


*** ../vim-8.0.0179/src/json.c  2017-01-11 21:50:04.884673277 +0100
--- src/json.c  2017-01-14 14:30:10.879950714 +0100
***
*** 936,942 
&& dict_find(top_item->jd_tv.vval.v_dict,
 top_item->jd_key, -1) != NULL)
{
!   EMSG2(_("E937: Duplicate key in JSON: \"%s\""),
 top_item->jd_key);
clear_tv(_item->jd_key_tv);
clear_tv(cur_item);
--- 936,942 
&& dict_find(top_item->jd_tv.vval.v_dict,
 top_item->jd_key, -1) != NULL)
{
!   EMSG2(_("E938: Duplicate key in JSON: \"%s\""),
 top_item->jd_key);
clear_tv(_item->jd_key_tv);
clear_tv(cur_item);
*** ../vim-8.0.0179/src/testdir/test_json.vim   2017-01-11 21:50:04.884673277 
+0100
--- src/testdir/test_json.vim   2017-01-14 14:30:10.879950714 +0100
***
*** 152,158 
call assert_fails('call json_decode("blah")', "E474:")
call assert_fails('call json_decode("true blah")', "E488:")
call assert_fails('call json_decode("")', "E474:")
!   call assert_fails('call json_decode("{\"a\":1,\"a\":2}")', "E937:")
  
call assert_fails('call json_decode("{")', "E474:")
call assert_fails('call json_decode("{foobar}")', "E474:")
--- 152,158 
call assert_fails('call json_decode("blah")', "E474:")
call assert_fails('call json_decode("true blah")', "E488:")
call assert_fails('call json_decode("")', "E474:")
!   call assert_fails('call json_decode("{\"a\":1,\"a\":2}")', "E938:")
  
call assert_fails('call json_decode("{")', "E474:")
call assert_fails('call json_decode("{foobar}")', "E474:")
*** ../vim-8.0.0179/src/version.c   2017-01-14 14:28:26.964592279 +0100
--- src/version.c   2017-01-14 14:34:25.614377859 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 180,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
10E. You start counting in hex.

 /// 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.0179

2017-01-14 Fir de Conversatie Bram Moolenaar

Patch 8.0.0179
Problem:'formatprg' is a global option but the value may depend on the
type of buffer. (Sung Pae)
Solution:   Make 'formatprg' global-local. (closes #1380)
Files:  src/structs.h, src/option.h, src/option.c, src/normal.c,
runtime/doc/options.txt, src/testdir/test_normal.vim


*** ../vim-8.0.0178/src/structs.h   2016-12-01 15:34:04.083413947 +0100
--- src/structs.h   2017-01-14 13:17:26.843045672 +0100
***
*** 2097,2102 
--- 2097,2103 
  long_ub_p_inde_flags; /* flags for 'indentexpr' */
  char_u*b_p_indk;  /* 'indentkeys' */
  #endif
+ char_u*b_p_fp;/* 'formatprg' */
  #if defined(FEAT_EVAL)
  char_u*b_p_fex;   /* 'formatexpr' */
  long_ub_p_fex_flags;  /* flags for 'formatexpr' */
*** ../vim-8.0.0178/src/option.h2016-08-29 22:42:20.0 +0200
--- src/option.h2017-01-14 13:24:42.368328907 +0100
***
*** 1029,1034 
--- 1029,1035 
  , BV_EP
  , BV_ET
  , BV_FENC
+ , BV_FP
  #ifdef FEAT_EVAL
  , BV_BEXPR
  , BV_FEX
*** ../vim-8.0.0178/src/option.c2016-12-03 15:13:16.415147422 +0100
--- src/option.c2017-01-14 13:46:43.788096973 +0100
***
*** 107,112 
--- 107,113 
  #if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
  # define PV_BEXPR OPT_BOTH(OPT_BUF(BV_BEXPR))
  #endif
+ #define PV_FP OPT_BOTH(OPT_BUF(BV_FP))
  #ifdef FEAT_EVAL
  # define PV_FEX   OPT_BUF(BV_FEX)
  #endif
***
*** 1258,1264 
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
 (char_u *)0L} SCRIPTID_INIT},
  {"formatprg",   "fp",   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
!   (char_u *)_fp, PV_NONE,
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
  {"fsync",   "fs",   P_BOOL|P_SECURE|P_VI_DEF,
  #ifdef HAVE_FSYNC
--- 1259,1265 
{(char_u *)"^\\s*\\d\\+[\\]:.)}\\t ]\\s*",
 (char_u *)0L} SCRIPTID_INIT},
  {"formatprg",   "fp",   P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
!   (char_u *)_fp, PV_FP,
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
  {"fsync",   "fs",   P_BOOL|P_SECURE|P_VI_DEF,
  #ifdef HAVE_FSYNC
***
*** 5481,5486 
--- 5482,5488 
  #if defined(FEAT_CRYPT)
  check_string_option(>b_p_cm);
  #endif
+ check_string_option(>b_p_fp);
  #if defined(FEAT_EVAL)
  check_string_option(>b_p_fex);
  #endif
***
*** 10175,10180 
--- 10177,10185 
clear_string_option(>b_p_tsr);
break;
  #endif
+   case PV_FP:
+   clear_string_option(>b_p_fp);
+   break;
  #ifdef FEAT_QUICKFIX
case PV_EFM:
clear_string_option(>b_p_efm);
***
*** 10228,10233 
--- 10233,10239 
  {
switch ((int)p->indir)
{
+   case PV_FP:   return (char_u *)&(curbuf->b_p_fp);
  #ifdef FEAT_QUICKFIX
case PV_EFM:  return (char_u *)&(curbuf->b_p_efm);
case PV_GP:   return (char_u *)&(curbuf->b_p_gp);
***
*** 10308,10313 
--- 10314,10321 
case PV_TSR:return *curbuf->b_p_tsr != NUL
? (char_u *)&(curbuf->b_p_tsr) : p->var;
  #endif
+   case PV_FP: return *curbuf->b_p_fp != NUL
+   ? (char_u *)&(curbuf->b_p_fp) : p->var;
  #ifdef FEAT_QUICKFIX
case PV_EFM:return *curbuf->b_p_efm != NUL
? (char_u *)&(curbuf->b_p_efm) : p->var;
***
*** 10873,10878 
--- 10881,10887 
buf->b_p_inde = vim_strsave(p_inde);
buf->b_p_indk = vim_strsave(p_indk);
  #endif
+   buf->b_p_fp = empty_option;
  #if defined(FEAT_EVAL)
buf->b_p_fex = vim_strsave(p_fex);
  #endif
*** ../vim-8.0.0178/src/normal.c2016-11-05 21:55:09.840208445 +0100
--- src/normal.c2017-01-14 14:20:29.951540624 +0100
***
*** 1984,1990 
op_formatexpr(oap); /* use expression */
else
  #endif
!   if (*p_fp != NUL)
op_colon(oap);  /* use external command */
else
op_format(oap, FALSE);  /* use internal function */
--- 1984,1990 
op_formatexpr(oap); /* use expression */
else
  #endif
!   if (*p_fp != NUL || *curbuf->b_p_fp != NUL)
op_colon(oap);  /* use external command */
else
op_format(oap, FALSE);  /* use internal function */
***
*** 2197,2206 
  }
  else if (oap->op_type == OP_FORMAT)
  {
!   if (*p_fp == NUL)
!   stuffReadbuff((char_u *)"fmt");
!   else