Karsten Hopp 611d6f
To: vim_dev@googlegroups.com
Karsten Hopp 611d6f
Subject: Patch 7.4.108
Karsten Hopp 611d6f
Fcc: outbox
Karsten Hopp 611d6f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 611d6f
Mime-Version: 1.0
Karsten Hopp 611d6f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 611d6f
Content-Transfer-Encoding: 8bit
Karsten Hopp 611d6f
------------
Karsten Hopp 611d6f
Karsten Hopp 611d6f
Patch 7.4.108
Karsten Hopp 611d6f
Problem:    "zG" and "zW" leave temp files around on MS-Windows.
Karsten Hopp 611d6f
Solution:   Delete the temp files when exiting. (Ken Takata)
Karsten Hopp 611d6f
Files:	    src/memline.c, src/proto/spell.pro, src/spell.c
Karsten Hopp 611d6f
Karsten Hopp 611d6f
Karsten Hopp 611d6f
*** ../vim-7.4.107/src/memline.c	2013-11-04 02:53:46.000000000 +0100
Karsten Hopp 611d6f
--- src/memline.c	2013-11-28 17:27:06.000000000 +0100
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 841,848 ****
Karsten Hopp 611d6f
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
Karsten Hopp 611d6f
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
Karsten Hopp 611d6f
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
Karsten Hopp 611d6f
  #ifdef TEMPDIRNAMES
Karsten Hopp 611d6f
!     vim_deltempdir();	    /* delete created temp directory */
Karsten Hopp 611d6f
  #endif
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
--- 841,851 ----
Karsten Hopp 611d6f
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
Karsten Hopp 611d6f
  	ml_close(buf, del_file && ((buf->b_flags & BF_PRESERVED) == 0
Karsten Hopp 611d6f
  				 || vim_strchr(p_cpo, CPO_PRESERVE) == NULL));
Karsten Hopp 611d6f
+ #ifdef FEAT_SPELL
Karsten Hopp 611d6f
+     spell_delete_wordlist();	/* delete the internal wordlist */
Karsten Hopp 611d6f
+ #endif
Karsten Hopp 611d6f
  #ifdef TEMPDIRNAMES
Karsten Hopp 611d6f
!     vim_deltempdir();		/* delete created temp directory */
Karsten Hopp 611d6f
  #endif
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
*** ../vim-7.4.107/src/proto/spell.pro	2013-08-10 13:37:26.000000000 +0200
Karsten Hopp 611d6f
--- src/proto/spell.pro	2013-11-28 17:25:59.000000000 +0100
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 3,8 ****
Karsten Hopp 611d6f
--- 3,9 ----
Karsten Hopp 611d6f
  int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, hlf_T *attrp));
Karsten Hopp 611d6f
  void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
Karsten Hopp 611d6f
  char_u *did_set_spelllang __ARGS((win_T *wp));
Karsten Hopp 611d6f
+ void spell_delete_wordlist __ARGS((void));
Karsten Hopp 611d6f
  void spell_free_all __ARGS((void));
Karsten Hopp 611d6f
  void spell_reload __ARGS((void));
Karsten Hopp 611d6f
  int spell_check_msm __ARGS((void));
Karsten Hopp 611d6f
*** ../vim-7.4.107/src/spell.c	2013-11-21 17:42:26.000000000 +0100
Karsten Hopp 611d6f
--- src/spell.c	2013-11-28 17:25:59.000000000 +0100
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 2180,2188 ****
Karsten Hopp 611d6f
      char_u	*endp;
Karsten Hopp 611d6f
      hlf_T	attr;
Karsten Hopp 611d6f
      int		len;
Karsten Hopp 611d6f
! # ifdef FEAT_SYN_HL
Karsten Hopp 611d6f
      int		has_syntax = syntax_present(wp);
Karsten Hopp 611d6f
! # endif
Karsten Hopp 611d6f
      int		col;
Karsten Hopp 611d6f
      int		can_spell;
Karsten Hopp 611d6f
      char_u	*buf = NULL;
Karsten Hopp 611d6f
--- 2180,2188 ----
Karsten Hopp 611d6f
      char_u	*endp;
Karsten Hopp 611d6f
      hlf_T	attr;
Karsten Hopp 611d6f
      int		len;
Karsten Hopp 611d6f
! #ifdef FEAT_SYN_HL
Karsten Hopp 611d6f
      int		has_syntax = syntax_present(wp);
Karsten Hopp 611d6f
! #endif
Karsten Hopp 611d6f
      int		col;
Karsten Hopp 611d6f
      int		can_spell;
Karsten Hopp 611d6f
      char_u	*buf = NULL;
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 2280,2286 ****
Karsten Hopp 611d6f
  						     : p - buf)
Karsten Hopp 611d6f
  						  > wp->w_cursor.col)))
Karsten Hopp 611d6f
  		    {
Karsten Hopp 611d6f
! # ifdef FEAT_SYN_HL
Karsten Hopp 611d6f
  			if (has_syntax)
Karsten Hopp 611d6f
  			{
Karsten Hopp 611d6f
  			    col = (int)(p - buf);
Karsten Hopp 611d6f
--- 2280,2286 ----
Karsten Hopp 611d6f
  						     : p - buf)
Karsten Hopp 611d6f
  						  > wp->w_cursor.col)))
Karsten Hopp 611d6f
  		    {
Karsten Hopp 611d6f
! #ifdef FEAT_SYN_HL
Karsten Hopp 611d6f
  			if (has_syntax)
Karsten Hopp 611d6f
  			{
Karsten Hopp 611d6f
  			    col = (int)(p - buf);
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 4701,4707 ****
Karsten Hopp 611d6f
      return flags;
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
! # if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Free all languages.
Karsten Hopp 611d6f
   */
Karsten Hopp 611d6f
--- 4701,4725 ----
Karsten Hopp 611d6f
      return flags;
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
! /*
Karsten Hopp 611d6f
!  * Delete the internal wordlist and its .spl file.
Karsten Hopp 611d6f
!  */
Karsten Hopp 611d6f
!     void
Karsten Hopp 611d6f
! spell_delete_wordlist()
Karsten Hopp 611d6f
! {
Karsten Hopp 611d6f
!     char_u	fname[MAXPATHL];
Karsten Hopp 611d6f
! 
Karsten Hopp 611d6f
!     if (int_wordlist != NULL)
Karsten Hopp 611d6f
!     {
Karsten Hopp 611d6f
! 	mch_remove(int_wordlist);
Karsten Hopp 611d6f
! 	int_wordlist_spl(fname);
Karsten Hopp 611d6f
! 	mch_remove(fname);
Karsten Hopp 611d6f
! 	vim_free(int_wordlist);
Karsten Hopp 611d6f
! 	int_wordlist = NULL;
Karsten Hopp 611d6f
!     }
Karsten Hopp 611d6f
! }
Karsten Hopp 611d6f
! 
Karsten Hopp 611d6f
! #if defined(FEAT_MBYTE) || defined(EXITFREE) || defined(PROTO)
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Free all languages.
Karsten Hopp 611d6f
   */
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 4710,4716 ****
Karsten Hopp 611d6f
  {
Karsten Hopp 611d6f
      slang_T	*slang;
Karsten Hopp 611d6f
      buf_T	*buf;
Karsten Hopp 611d6f
-     char_u	fname[MAXPATHL];
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
      /* Go through all buffers and handle 'spelllang'. <VN> */
Karsten Hopp 611d6f
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
Karsten Hopp 611d6f
--- 4728,4733 ----
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 4723,4746 ****
Karsten Hopp 611d6f
  	slang_free(slang);
Karsten Hopp 611d6f
      }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
!     if (int_wordlist != NULL)
Karsten Hopp 611d6f
!     {
Karsten Hopp 611d6f
! 	/* Delete the internal wordlist and its .spl file */
Karsten Hopp 611d6f
! 	mch_remove(int_wordlist);
Karsten Hopp 611d6f
! 	int_wordlist_spl(fname);
Karsten Hopp 611d6f
! 	mch_remove(fname);
Karsten Hopp 611d6f
! 	vim_free(int_wordlist);
Karsten Hopp 611d6f
! 	int_wordlist = NULL;
Karsten Hopp 611d6f
!     }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
      vim_free(repl_to);
Karsten Hopp 611d6f
      repl_to = NULL;
Karsten Hopp 611d6f
      vim_free(repl_from);
Karsten Hopp 611d6f
      repl_from = NULL;
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
! # endif
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
! # if defined(FEAT_MBYTE) || defined(PROTO)
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Clear all spelling tables and reload them.
Karsten Hopp 611d6f
   * Used after 'encoding' is set and when ":mkspell" was used.
Karsten Hopp 611d6f
--- 4740,4755 ----
Karsten Hopp 611d6f
  	slang_free(slang);
Karsten Hopp 611d6f
      }
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
!     spell_delete_wordlist();
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
      vim_free(repl_to);
Karsten Hopp 611d6f
      repl_to = NULL;
Karsten Hopp 611d6f
      vim_free(repl_from);
Karsten Hopp 611d6f
      repl_from = NULL;
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
! #endif
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
! #if defined(FEAT_MBYTE) || defined(PROTO)
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Clear all spelling tables and reload them.
Karsten Hopp 611d6f
   * Used after 'encoding' is set and when ":mkspell" was used.
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 4773,4779 ****
Karsten Hopp 611d6f
  	}
Karsten Hopp 611d6f
      }
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
! # endif
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Reload the spell file "fname" if it's loaded.
Karsten Hopp 611d6f
--- 4782,4788 ----
Karsten Hopp 611d6f
  	}
Karsten Hopp 611d6f
      }
Karsten Hopp 611d6f
  }
Karsten Hopp 611d6f
! #endif
Karsten Hopp 611d6f
  
Karsten Hopp 611d6f
  /*
Karsten Hopp 611d6f
   * Reload the spell file "fname" if it's loaded.
Karsten Hopp 611d6f
*** ../vim-7.4.107/src/version.c	2013-11-28 17:04:38.000000000 +0100
Karsten Hopp 611d6f
--- src/version.c	2013-11-28 17:26:31.000000000 +0100
Karsten Hopp 611d6f
***************
Karsten Hopp 611d6f
*** 740,741 ****
Karsten Hopp 611d6f
--- 740,743 ----
Karsten Hopp 611d6f
  {   /* Add new patch number below this line */
Karsten Hopp 611d6f
+ /**/
Karsten Hopp 611d6f
+     108,
Karsten Hopp 611d6f
  /**/
Karsten Hopp 611d6f
Karsten Hopp 611d6f
-- 
Karsten Hopp 611d6f
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 611d6f
9. All your daydreaming is preoccupied with getting a faster connection to the
Karsten Hopp 611d6f
   net: 28.8...ISDN...cable modem...T1...T3.
Karsten Hopp 611d6f
Karsten Hopp 611d6f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 611d6f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 611d6f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 611d6f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///