073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.201
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.201
073263
Problem:    'lispwords' is a global option.
073263
Solution:   Make 'lispwords' global-local. (Sung Pae)
073263
Files:	    runtime/doc/options.txt, runtime/optwin.vim, src/buffer.c,
073263
	    src/misc1.c, src/option.c, src/option.h, src/structs.h,
073263
	    src/testdir/test100.in, src/testdir/test100.ok
073263
073263
073263
*** ../vim-7.4.200/runtime/doc/options.txt	2014-02-23 23:38:58.820760280 +0100
073263
--- runtime/doc/options.txt	2014-03-12 18:20:30.748874299 +0100
073263
***************
073263
*** 4629,4635 ****
073263
  
073263
  						*'lispwords'* *'lw'*
073263
  'lispwords' 'lw'	string	(default is very long)
073263
! 			global
073263
  			{not in Vi}
073263
  			{not available when compiled without the |+lispindent|
073263
  			feature}
073263
--- 4629,4635 ----
073263
  
073263
  						*'lispwords'* *'lw'*
073263
  'lispwords' 'lw'	string	(default is very long)
073263
! 			global or local to buffer |global-local|
073263
  			{not in Vi}
073263
  			{not available when compiled without the |+lispindent|
073263
  			feature}
073263
*** ../vim-7.4.200/runtime/optwin.vim	2013-06-29 14:32:06.000000000 +0200
073263
--- runtime/optwin.vim	2014-03-12 18:20:30.748874299 +0100
073263
***************
073263
*** 855,861 ****
073263
    call append("$", "\t(local to buffer)")
073263
    call <SID>BinOptionL("lisp")
073263
    call append("$", "lispwords\twords that change how lisp indenting works")
073263
!   call <SID>OptionG("lw", &lw)
073263
  endif
073263
  
073263
  
073263
--- 855,861 ----
073263
    call append("$", "\t(local to buffer)")
073263
    call <SID>BinOptionL("lisp")
073263
    call append("$", "lispwords\twords that change how lisp indenting works")
073263
!   call <SID>OptionL("lw", &lw)
073263
  endif
073263
  
073263
  
073263
*** ../vim-7.4.200/src/buffer.c	2014-01-10 16:43:09.000000000 +0100
073263
--- src/buffer.c	2014-03-12 18:20:30.752874299 +0100
073263
***************
073263
*** 1978,1983 ****
073263
--- 1978,1986 ----
073263
  #endif
073263
      buf->b_p_ar = -1;
073263
      buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
073263
+ #ifdef FEAT_LISP
073263
+     clear_string_option(&buf->b_p_lw);
073263
+ #endif
073263
  }
073263
  
073263
  /*
073263
*** ../vim-7.4.200/src/misc1.c	2013-11-06 04:01:31.000000000 +0100
073263
--- src/misc1.c	2014-03-12 18:20:30.752874299 +0100
073263
***************
073263
*** 8879,8885 ****
073263
  {
073263
      char_u	buf[LSIZE];
073263
      int		len;
073263
!     char_u	*word = p_lispwords;
073263
  
073263
      while (*word != NUL)
073263
      {
073263
--- 8879,8885 ----
073263
  {
073263
      char_u	buf[LSIZE];
073263
      int		len;
073263
!     char_u	*word = *curbuf->b_p_lw != NUL ? curbuf->b_p_lw : p_lispwords;
073263
  
073263
      while (*word != NUL)
073263
      {
073263
*** ../vim-7.4.200/src/option.c	2014-01-14 16:54:53.000000000 +0100
073263
--- src/option.c	2014-03-12 18:20:30.752874299 +0100
073263
***************
073263
*** 134,139 ****
073263
--- 134,140 ----
073263
  #define PV_KP		OPT_BOTH(OPT_BUF(BV_KP))
073263
  #ifdef FEAT_LISP
073263
  # define PV_LISP	OPT_BUF(BV_LISP)
073263
+ # define PV_LW		OPT_BOTH(OPT_BUF(BV_LW))
073263
  #endif
073263
  #define PV_MA		OPT_BUF(BV_MA)
073263
  #define PV_ML		OPT_BUF(BV_ML)
073263
***************
073263
*** 1718,1724 ****
073263
  			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
073263
      {"lispwords",   "lw",   P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
073263
  #ifdef FEAT_LISP
073263
! 			    (char_u *)&p_lispwords, PV_NONE,
073263
  			    {(char_u *)LISPWORD_VALUE, (char_u *)0L}
073263
  #else
073263
  			    (char_u *)NULL, PV_NONE,
073263
--- 1719,1725 ----
073263
  			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
073263
      {"lispwords",   "lw",   P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
073263
  #ifdef FEAT_LISP
073263
! 			    (char_u *)&p_lispwords, PV_LW,
073263
  			    {(char_u *)LISPWORD_VALUE, (char_u *)0L}
073263
  #else
073263
  			    (char_u *)NULL, PV_NONE,
073263
***************
073263
*** 5412,5417 ****
073263
--- 5413,5421 ----
073263
      check_string_option(&buf->b_p_dict);
073263
      check_string_option(&buf->b_p_tsr);
073263
  #endif
073263
+ #ifdef FEAT_LISP
073263
+     check_string_option(&buf->b_p_lw);
073263
+ #endif
073263
  }
073263
  
073263
  /*
073263
***************
073263
*** 9879,9884 ****
073263
--- 9883,9893 ----
073263
  	case PV_UL:
073263
  	    buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
073263
  	    break;
073263
+ #ifdef FEAT_LISP
073263
+ 	case PV_LW:
073263
+ 	    clear_string_option(&buf->b_p_lw);
073263
+ 	    break;
073263
+ #endif
073263
      }
073263
  }
073263
  
073263
***************
073263
*** 9928,9933 ****
073263
--- 9937,9945 ----
073263
  	    case PV_STL:  return (char_u *)&(curwin->w_p_stl);
073263
  #endif
073263
  	    case PV_UL:   return (char_u *)&(curbuf->b_p_ul);
073263
+ #ifdef FEAT_LISP
073263
+ 	    case PV_LW:   return (char_u *)&(curbuf->b_p_lw);
073263
+ #endif
073263
  	}
073263
  	return NULL; /* "cannot happen" */
073263
      }
073263
***************
073263
*** 9994,9999 ****
073263
--- 10006,10015 ----
073263
  #endif
073263
  	case PV_UL:	return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL
073263
  				    ? (char_u *)&(curbuf->b_p_ul) : p->var;
073263
+ #ifdef FEAT_LISP
073263
+ 	case PV_LW:	return *curbuf->b_p_lw != NUL
073263
+ 				    ? (char_u *)&(curbuf->b_p_lw) : p->var;
073263
+ #endif
073263
  
073263
  #ifdef FEAT_ARABIC
073263
  	case PV_ARAB:	return (char_u *)&(curwin->w_p_arab);
073263
***************
073263
*** 10567,10572 ****
073263
--- 10583,10591 ----
073263
  #ifdef FEAT_PERSISTENT_UNDO
073263
  	    buf->b_p_udf = p_udf;
073263
  #endif
073263
+ #ifdef FEAT_LISP
073263
+ 	    buf->b_p_lw = empty_option;
073263
+ #endif
073263
  
073263
  	    /*
073263
  	     * Don't copy the options set by ex_help(), use the saved values,
073263
*** ../vim-7.4.200/src/option.h	2014-01-10 15:32:17.000000000 +0100
073263
--- src/option.h	2014-03-12 18:20:30.752874299 +0100
073263
***************
073263
*** 990,995 ****
073263
--- 990,996 ----
073263
      , BV_KP
073263
  #ifdef FEAT_LISP
073263
      , BV_LISP
073263
+     , BV_LW
073263
  #endif
073263
      , BV_MA
073263
      , BV_ML
073263
*** ../vim-7.4.200/src/structs.h	2014-02-23 22:52:33.372764715 +0100
073263
--- src/structs.h	2014-03-12 18:20:30.752874299 +0100
073263
***************
073263
*** 1641,1646 ****
073263
--- 1641,1649 ----
073263
  #ifdef FEAT_PERSISTENT_UNDO
073263
      int		b_p_udf;	/* 'undofile' */
073263
  #endif
073263
+ #ifdef FEAT_LISP
073263
+     char_u	*b_p_lw;	/* 'lispwords' local value */
073263
+ #endif
073263
  
073263
      /* end of buffer options */
073263
  
073263
*** ../vim-7.4.200/src/testdir/test100.in	2013-11-07 03:25:51.000000000 +0100
073263
--- src/testdir/test100.in	2014-03-12 18:25:27.792878851 +0100
073263
***************
073263
*** 1,4 ****
073263
! Tests for 'undolevel' setting being global-local
073263
  
073263
  STARTTEST
073263
  :so small.vim
073263
--- 1,4 ----
073263
! Tests for 'undolevel' and 'lispwords' settings being global-local
073263
  
073263
  STARTTEST
073263
  :so small.vim
073263
***************
073263
*** 37,42 ****
073263
--- 37,50 ----
073263
  :call UndoLevel()
073263
  :%w >> test.out
073263
  :"sleep 10
073263
+ :"
073263
+ :" Testing 'lispwords'
073263
+ :"
073263
+ :setglobal lispwords=foo,bar,baz
073263
+ :setlocal lispwords-=foo | setlocal lispwords+=quux
073263
+ :redir >> test.out | echon "\nTesting 'lispwords' local value" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
073263
+ :setlocal lispwords<
073263
+ :redir >> test.out | echon "\nTesting 'lispwords' value reset" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
073263
  :qa!
073263
  ENDTEST
073263
  
073263
*** ../vim-7.4.200/src/testdir/test100.ok	2013-11-07 03:25:51.000000000 +0100
073263
--- src/testdir/test100.ok	2014-03-12 18:25:27.792878851 +0100
073263
***************
073263
*** 39,41 ****
073263
--- 39,51 ----
073263
  
073263
    undolevels=50 global
073263
    undolevels=-123456 local
073263
+ 
073263
+ Testing 'lispwords' local value
073263
+   lispwords=foo,bar,baz
073263
+   lispwords=bar,baz,quux
073263
+ bar,baz,quux
073263
+ 
073263
+ Testing 'lispwords' value reset
073263
+   lispwords=foo,bar,baz
073263
+   lispwords=foo,bar,baz
073263
+ foo,bar,baz
073263
*** ../vim-7.4.200/src/version.c	2014-03-12 17:56:42.960852421 +0100
073263
--- src/version.c	2014-03-12 18:19:13.720873119 +0100
073263
***************
073263
*** 740,741 ****
073263
--- 740,743 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     201,
073263
  /**/
073263
073263
-- 
073263
Lawmakers made it obligatory for everybody to take at least one bath
073263
each week -- on Saturday night.
073263
		[real standing law in Vermont, United States of America]
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///