f7e795f
To: vim_dev@googlegroups.com
f7e795f
Subject: Patch 7.3.080
f7e795f
Fcc: outbox
f7e795f
From: Bram Moolenaar <Bram@moolenaar.net>
f7e795f
Mime-Version: 1.0
f7e795f
Content-Type: text/plain; charset=UTF-8
f7e795f
Content-Transfer-Encoding: 8bit
f7e795f
------------
f7e795f
f7e795f
Patch 7.3.080
f7e795f
Problem:    Spell doesn't work on VMS.
f7e795f
Solution:   Use different file names. (Zoltan Bartos, Zoltan Arpadffy)
f7e795f
Files:	    src/spell.c
f7e795f
f7e795f
f7e795f
*** ../vim-7.3.079/src/spell.c	2010-12-08 13:11:15.000000000 +0100
f7e795f
--- src/spell.c	2010-12-08 17:01:13.000000000 +0100
f7e795f
***************
f7e795f
*** 327,332 ****
f7e795f
--- 327,342 ----
f7e795f
  typedef long idx_T;
f7e795f
  #endif
f7e795f
  
f7e795f
+ #ifdef VMS
f7e795f
+ # define SPL_FNAME_TMPL  "%s_%s.spl"
f7e795f
+ # define SPL_FNAME_ADD   "_add."
f7e795f
+ # define SPL_FNAME_ASCII "_ascii."
f7e795f
+ #else
f7e795f
+ # define SPL_FNAME_TMPL  "%s.%s.spl"
f7e795f
+ # define SPL_FNAME_ADD   ".add."
f7e795f
+ # define SPL_FNAME_ASCII ".ascii."
f7e795f
+ #endif
f7e795f
+ 
f7e795f
  /* Flags used for a word.  Only the lowest byte can be used, the region byte
f7e795f
   * comes above it. */
f7e795f
  #define WF_REGION   0x01	/* region byte follows */
f7e795f
***************
f7e795f
*** 2471,2484 ****
f7e795f
  	 * Find the first spell file for "lang" in 'runtimepath' and load it.
f7e795f
  	 */
f7e795f
  	vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
f7e795f
! 					"spell/%s.%s.spl", lang, spell_enc());
f7e795f
  	r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
f7e795f
  
f7e795f
  	if (r == FAIL && *sl.sl_lang != NUL)
f7e795f
  	{
f7e795f
  	    /* Try loading the ASCII version. */
f7e795f
  	    vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
f7e795f
! 						  "spell/%s.ascii.spl", lang);
f7e795f
  	    r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
f7e795f
  
f7e795f
  #ifdef FEAT_AUTOCMD
f7e795f
--- 2481,2504 ----
f7e795f
  	 * Find the first spell file for "lang" in 'runtimepath' and load it.
f7e795f
  	 */
f7e795f
  	vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
f7e795f
! #ifdef VMS
f7e795f
! 					"spell/%s_%s.spl",
f7e795f
! #else
f7e795f
! 					"spell/%s.%s.spl",
f7e795f
! #endif
f7e795f
! 							   lang, spell_enc());
f7e795f
  	r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
f7e795f
  
f7e795f
  	if (r == FAIL && *sl.sl_lang != NUL)
f7e795f
  	{
f7e795f
  	    /* Try loading the ASCII version. */
f7e795f
  	    vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
f7e795f
! #ifdef VMS
f7e795f
! 						  "spell/%s_ascii.spl",
f7e795f
! #else
f7e795f
! 						  "spell/%s.ascii.spl",
f7e795f
! #endif
f7e795f
! 									lang);
f7e795f
  	    r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
f7e795f
  
f7e795f
  #ifdef FEAT_AUTOCMD
f7e795f
***************
f7e795f
*** 2496,2502 ****
f7e795f
  
f7e795f
      if (r == FAIL)
f7e795f
      {
f7e795f
! 	smsg((char_u *)_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
f7e795f
  						     lang, spell_enc(), lang);
f7e795f
      }
f7e795f
      else if (sl.sl_slang != NULL)
f7e795f
--- 2516,2527 ----
f7e795f
  
f7e795f
      if (r == FAIL)
f7e795f
      {
f7e795f
! 	smsg((char_u *)
f7e795f
! #ifdef VMS
f7e795f
! 	_("Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\""),
f7e795f
! #else
f7e795f
! 	_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
f7e795f
! #endif
f7e795f
  						     lang, spell_enc(), lang);
f7e795f
      }
f7e795f
      else if (sl.sl_slang != NULL)
f7e795f
***************
f7e795f
*** 2530,2536 ****
f7e795f
  int_wordlist_spl(fname)
f7e795f
      char_u	    *fname;
f7e795f
  {
f7e795f
!     vim_snprintf((char *)fname, MAXPATHL, "%s.%s.spl",
f7e795f
  						  int_wordlist, spell_enc());
f7e795f
  }
f7e795f
  
f7e795f
--- 2555,2561 ----
f7e795f
  int_wordlist_spl(fname)
f7e795f
      char_u	    *fname;
f7e795f
  {
f7e795f
!     vim_snprintf((char *)fname, MAXPATHL, SPL_FNAME_TMPL,
f7e795f
  						  int_wordlist, spell_enc());
f7e795f
  }
f7e795f
  
f7e795f
***************
f7e795f
*** 2785,2792 ****
f7e795f
  	if (lp->sl_fname == NULL)
f7e795f
  	    goto endFAIL;
f7e795f
  
f7e795f
! 	/* Check for .add.spl. */
f7e795f
! 	lp->sl_add = strstr((char *)gettail(fname), ".add.") != NULL;
f7e795f
      }
f7e795f
      else
f7e795f
  	lp = old_lp;
f7e795f
--- 2810,2817 ----
f7e795f
  	if (lp->sl_fname == NULL)
f7e795f
  	    goto endFAIL;
f7e795f
  
f7e795f
! 	/* Check for .add.spl (_add.spl for VMS). */
f7e795f
! 	lp->sl_add = strstr((char *)gettail(fname), SPL_FNAME_ADD) != NULL;
f7e795f
      }
f7e795f
      else
f7e795f
  	lp = old_lp;
f7e795f
***************
f7e795f
*** 9109,9116 ****
f7e795f
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
f7e795f
  	    innames = &fnames[0];
f7e795f
  	    incount = 1;
f7e795f
! 	    vim_snprintf((char *)wfname, sizeof(wfname), "%s.%s.spl", fnames[0],
f7e795f
! 			     spin.si_ascii ? (char_u *)"ascii" : spell_enc());
f7e795f
  	}
f7e795f
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
f7e795f
  	{
f7e795f
--- 9134,9141 ----
f7e795f
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
f7e795f
  	    innames = &fnames[0];
f7e795f
  	    incount = 1;
f7e795f
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
f7e795f
! 		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
f7e795f
  	}
f7e795f
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
f7e795f
  	{
f7e795f
***************
f7e795f
*** 9119,9133 ****
f7e795f
  	}
f7e795f
  	else
f7e795f
  	    /* Name should be language, make the file name from it. */
f7e795f
! 	    vim_snprintf((char *)wfname, sizeof(wfname), "%s.%s.spl", fnames[0],
f7e795f
! 			     spin.si_ascii ? (char_u *)"ascii" : spell_enc());
f7e795f
  
f7e795f
  	/* Check for .ascii.spl. */
f7e795f
! 	if (strstr((char *)gettail(wfname), ".ascii.") != NULL)
f7e795f
  	    spin.si_ascii = TRUE;
f7e795f
  
f7e795f
  	/* Check for .add.spl. */
f7e795f
! 	if (strstr((char *)gettail(wfname), ".add.") != NULL)
f7e795f
  	    spin.si_add = TRUE;
f7e795f
      }
f7e795f
  
f7e795f
--- 9144,9158 ----
f7e795f
  	}
f7e795f
  	else
f7e795f
  	    /* Name should be language, make the file name from it. */
f7e795f
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
f7e795f
! 		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
f7e795f
  
f7e795f
  	/* Check for .ascii.spl. */
f7e795f
! 	if (strstr((char *)gettail(wfname), SPL_FNAME_ASCII) != NULL)
f7e795f
  	    spin.si_ascii = TRUE;
f7e795f
  
f7e795f
  	/* Check for .add.spl. */
f7e795f
! 	if (strstr((char *)gettail(wfname), SPL_FNAME_ADD) != NULL)
f7e795f
  	    spin.si_add = TRUE;
f7e795f
      }
f7e795f
  
f7e795f
*** ../vim-7.3.079/src/version.c	2010-12-08 14:54:58.000000000 +0100
f7e795f
--- src/version.c	2010-12-08 16:58:03.000000000 +0100
f7e795f
***************
f7e795f
*** 716,717 ****
f7e795f
--- 716,719 ----
f7e795f
  {   /* Add new patch number below this line */
f7e795f
+ /**/
f7e795f
+     80,
f7e795f
  /**/
f7e795f
f7e795f
-- 
f7e795f
hundred-and-one symptoms of being an internet addict:
f7e795f
5. You find yourself brainstorming for new subjects to search.
f7e795f
f7e795f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
f7e795f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
f7e795f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
f7e795f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///