Karsten Hopp 7ed73b
To: vim-dev@vim.org
Karsten Hopp 7ed73b
Subject: Patch 7.2.146
Karsten Hopp 7ed73b
Fcc: outbox
Karsten Hopp 7ed73b
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 7ed73b
Mime-Version: 1.0
Karsten Hopp 7ed73b
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 7ed73b
Content-Transfer-Encoding: 8bit
Karsten Hopp 7ed73b
------------
Karsten Hopp 7ed73b
Karsten Hopp 7ed73b
Patch 7.2.146
Karsten Hopp 7ed73b
Problem:    v:warningmsg isn't used for all warnings.
Karsten Hopp 7ed73b
Solution:   Set v:warningmsg for relevant warnings. (Ingo Karkat)
Karsten Hopp 7ed73b
Files:	    src/fileio.c, src/misc1.c, src/option.c
Karsten Hopp 7ed73b
Karsten Hopp 7ed73b
Karsten Hopp 7ed73b
*** ../vim-7.2.145/src/fileio.c	Wed Mar 11 13:09:30 2009
Karsten Hopp 7ed73b
--- src/fileio.c	Wed Mar 18 15:03:46 2009
Karsten Hopp 7ed73b
***************
Karsten Hopp 7ed73b
*** 6647,6652 ****
Karsten Hopp 7ed73b
--- 6647,6657 ----
Karsten Hopp 7ed73b
  	    tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
Karsten Hopp 7ed73b
  							+ STRLEN(mesg2) + 2));
Karsten Hopp 7ed73b
  	    sprintf((char *)tbuf, mesg, path);
Karsten Hopp 7ed73b
+ #ifdef FEAT_EVAL
Karsten Hopp 7ed73b
+ 	    /* Set warningmsg here, before the unimportant and output-specific
Karsten Hopp 7ed73b
+ 	     * mesg2 has been appended. */
Karsten Hopp 7ed73b
+ 	    set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
Karsten Hopp 7ed73b
+ #endif
Karsten Hopp 7ed73b
  #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
Karsten Hopp 7ed73b
  	    if (can_reload)
Karsten Hopp 7ed73b
  	    {
Karsten Hopp 7ed73b
*** ../vim-7.2.145/src/misc1.c	Thu Nov 20 17:09:09 2008
Karsten Hopp 7ed73b
--- src/misc1.c	Wed Mar 18 15:06:59 2009
Karsten Hopp 7ed73b
***************
Karsten Hopp 7ed73b
*** 2955,2960 ****
Karsten Hopp 7ed73b
--- 2955,2962 ----
Karsten Hopp 7ed73b
      int	    col;		/* column for message; non-zero when in insert
Karsten Hopp 7ed73b
  				   mode and 'showmode' is on */
Karsten Hopp 7ed73b
  {
Karsten Hopp 7ed73b
+     static char *w_readonly = N_("W10: Warning: Changing a readonly file");
Karsten Hopp 7ed73b
+ 
Karsten Hopp 7ed73b
      if (curbuf->b_did_warn == FALSE
Karsten Hopp 7ed73b
  	    && curbufIsChanged() == 0
Karsten Hopp 7ed73b
  #ifdef FEAT_AUTOCMD
Karsten Hopp 7ed73b
***************
Karsten Hopp 7ed73b
*** 2977,2984 ****
Karsten Hopp 7ed73b
  	if (msg_row == Rows - 1)
Karsten Hopp 7ed73b
  	    msg_col = col;
Karsten Hopp 7ed73b
  	msg_source(hl_attr(HLF_W));
Karsten Hopp 7ed73b
! 	MSG_PUTS_ATTR(_("W10: Warning: Changing a readonly file"),
Karsten Hopp 7ed73b
! 						   hl_attr(HLF_W) | MSG_HIST);
Karsten Hopp 7ed73b
  	msg_clr_eos();
Karsten Hopp 7ed73b
  	(void)msg_end();
Karsten Hopp 7ed73b
  	if (msg_silent == 0 && !silent_mode)
Karsten Hopp 7ed73b
--- 2979,2988 ----
Karsten Hopp 7ed73b
  	if (msg_row == Rows - 1)
Karsten Hopp 7ed73b
  	    msg_col = col;
Karsten Hopp 7ed73b
  	msg_source(hl_attr(HLF_W));
Karsten Hopp 7ed73b
! 	MSG_PUTS_ATTR(_(w_readonly), hl_attr(HLF_W) | MSG_HIST);
Karsten Hopp 7ed73b
! #ifdef FEAT_EVAL
Karsten Hopp 7ed73b
! 	set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_readonly), -1);
Karsten Hopp 7ed73b
! #endif
Karsten Hopp 7ed73b
  	msg_clr_eos();
Karsten Hopp 7ed73b
  	(void)msg_end();
Karsten Hopp 7ed73b
  	if (msg_silent == 0 && !silent_mode)
Karsten Hopp 7ed73b
*** ../vim-7.2.145/src/option.c	Wed Mar 18 14:19:28 2009
Karsten Hopp 7ed73b
--- src/option.c	Wed Mar 18 15:06:11 2009
Karsten Hopp 7ed73b
***************
Karsten Hopp 7ed73b
*** 7563,7571 ****
Karsten Hopp 7ed73b
  	     * set. */
Karsten Hopp 7ed73b
  	    if (STRCMP(p_enc, "utf-8") != 0)
Karsten Hopp 7ed73b
  	    {
Karsten Hopp 7ed73b
  		msg_source(hl_attr(HLF_W));
Karsten Hopp 7ed73b
! 		MSG_ATTR(_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"),
Karsten Hopp 7ed73b
! 			hl_attr(HLF_W));
Karsten Hopp 7ed73b
  	    }
Karsten Hopp 7ed73b
  
Karsten Hopp 7ed73b
  # ifdef FEAT_MBYTE
Karsten Hopp 7ed73b
--- 7563,7575 ----
Karsten Hopp 7ed73b
  	     * set. */
Karsten Hopp 7ed73b
  	    if (STRCMP(p_enc, "utf-8") != 0)
Karsten Hopp 7ed73b
  	    {
Karsten Hopp 7ed73b
+ 		static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
Karsten Hopp 7ed73b
+ 
Karsten Hopp 7ed73b
  		msg_source(hl_attr(HLF_W));
Karsten Hopp 7ed73b
! 		MSG_ATTR(_(w_arabic), hl_attr(HLF_W));
Karsten Hopp 7ed73b
! #ifdef FEAT_EVAL
Karsten Hopp 7ed73b
! 		set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_arabic), -1);
Karsten Hopp 7ed73b
! #endif
Karsten Hopp 7ed73b
  	    }
Karsten Hopp 7ed73b
  
Karsten Hopp 7ed73b
  # ifdef FEAT_MBYTE
Karsten Hopp 7ed73b
*** ../vim-7.2.145/src/version.c	Wed Mar 18 14:30:46 2009
Karsten Hopp 7ed73b
--- src/version.c	Wed Mar 18 15:38:27 2009
Karsten Hopp 7ed73b
***************
Karsten Hopp 7ed73b
*** 678,679 ****
Karsten Hopp 7ed73b
--- 678,681 ----
Karsten Hopp 7ed73b
  {   /* Add new patch number below this line */
Karsten Hopp 7ed73b
+ /**/
Karsten Hopp 7ed73b
+     146,
Karsten Hopp 7ed73b
  /**/
Karsten Hopp 7ed73b
Karsten Hopp 7ed73b
-- 
Karsten Hopp 7ed73b
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 7ed73b
238. You think faxes are old-fashioned.
Karsten Hopp 7ed73b
Karsten Hopp 7ed73b
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 7ed73b
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 7ed73b
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 7ed73b
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///