changeset 632:b6632d553df3 v7.0182

updated for version 7.0182
author vimboss
date Thu, 19 Jan 2006 22:16:24 +0000
parents 68a196b7504d
children 7437be625546
files runtime/doc/options.txt runtime/doc/starting.txt runtime/doc/syntax.txt runtime/doc/tags runtime/doc/todo.txt runtime/doc/version7.txt runtime/doc/windows.txt runtime/syntax/java.vim runtime/syntax/m4.vim src/edit.c src/ex_cmds.c src/ex_getln.c src/globals.h src/gui_gtk_x11.c src/structs.h src/undo.c src/version.h
diffstat 17 files changed, 200 insertions(+), 144 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.0aa.  Last change: 2006 Jan 04
+*options.txt*	For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1982,11 +1982,11 @@ A jump table for the options with a shor
 			C-indenting.
 								*cpo--*
 		-	When included, a vertical movement command fails when
-			it would above the first line or below the last line.
-			Without it the cursor moves to the first or last line,
-			unless it already was in that line.
+			it would go above the first line or below the last
+			line.  Without it the cursor moves to the first or
+			last line, unless it already was in that line.
 			Applies to the commands "-", "k", CTRL-P, "+", "j",
-			CTRL-N and CTRL-J.
+			CTRL-N, CTRL-J and ":1234".
 								*cpo-+*
 		+	When included, a ":write file" command will reset the
 			'modified' flag of the buffer, even though the buffer
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt*  For Vim version 7.0aa.  Last change: 2005 Dec 04
+*starting.txt*  For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -799,8 +799,9 @@ 4. Load the plugin scripts.					*load-pl
 	- The |--noplugin| command line argument is used.
 	- The "-u NONE" command line argument is used |-u|.
 	- When Vim was compiled without the |+eval| feature.
-	Note that using "-c set noloadplugins" doesn't work, because the
-	commands from the command line have not been executed yet.
+	Note that using "-c 'set noloadplugins'" doesn't work, because the
+	commands from the command line have not been executed yet.  You can
+	use "--cmd 'set noloadplugins'" |--cmd|.
 
 5. Set 'shellpipe' and 'shellredir'
 	The 'shellpipe' and 'shellredir' options are set according to the
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.0aa.  Last change: 2005 Dec 31
+*syntax.txt*	For Vim version 7.0aa.  Last change: 2006 Jan 17
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1884,6 +1884,13 @@ If you want to fold blocks in if stateme
 
 	:let perl_fold_blocks = 1
 
+To avoid folding packages or subs when perl_fold is let, let the appropriate
+variable(s): >
+
+ 	:unlet perl_nofold_packages
+ 	:unlet perl_nofold_subs
+
+
 
 PHP3 and PHP4		*php.vim* *php3.vim* *ft-php-syntax* *ft-php3-syntax*
 
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5349,7 +5349,6 @@ hebrew	hebrew.txt	/*hebrew*
 hebrew.txt	hebrew.txt	/*hebrew.txt*
 help	various.txt	/*help*
 help-context	help.txt	/*help-context*
-help-tags	tags	1
 help-translated	various.txt	/*help-translated*
 help-xterm-window	various.txt	/*help-xterm-window*
 help.txt	help.txt	/*help.txt*
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Jan 14
+*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -30,12 +30,6 @@ be worked on, but only if you sponsor Vi
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-When the file "" exists, then ":!ls aap<Tab>" should put backslashes before
-'&', ';', '<' and '>'.
-
-Evaluating CTRL-R = in the sandbox causes trouble (G. Sumner Hayes).  Can the
-rules for the commandline window be used?
-
 Evaluate 'balloonexpr' in the sandbox only when it was set from an unsafe
 place (e.g., modeline)?  Patch from Sumner Hayes, Jan 12.  Also use for other
 options?
@@ -43,6 +37,13 @@ options?
 ":saveas asdf.c" should set 'filetype' to c when it's empty.  Also for ":w
 asdf.c" when it sets the buffer filename.
 
+When ":cclose" is used the buffer is not wiped out and is no longer recognized
+as a quickfix buffer, thus it's not reused either.
+
+Patch to support lists and dicts for the Python interface. (G. Sumner Hayes,
+Jan 12).  Docs in a previous patch.
+Use free_tv() instead of clear_tv() and vim_free().
+
 ccomplete:
 - When using page-up/page-down in menu it sometimes jumps more than a page.
 - When an option is set: In completion mode and the user types (identifier)
@@ -125,10 +126,6 @@ global_event_filter() for GTK.
 Is it easy to have an item in a pattern that matches with a mark location?
 Similar to |/\%>l| and |/\%c|.  (Benji Fisher)
 
-Patch to support lists and dicts for the Python interface. (G. Sumner Hayes,
-Jan 12).  Docs in a previous patch.
-Use free_tv() instead of clear_tv() and vim_free().
-
 Win32 installer: Default _vimrc contains absolute path to diff.exe.  After
 upgrading it becomes invalid.  Fix it automatically somehow?  Use $VIMRUNTIME
 in the path instead of filling it the path?  At least give a clear error
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Jan 14
+*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1527,8 +1527,9 @@ When 'esckeys' is not set don't send the
 string, because it may cause trouble in Insert mode.
 
 When evaluating an expression for CTRL-R = on the command line it was possible
-to open a new window, resulting in errors for incremental search, and many
-other nasty things were possible.  Now evaluate the expression in the sandbox
+to call a function that opens a new window, resulting in errors for
+incremental search, and many other nasty things were possible.  Now set
+"cmdline_busy" and disallow changing the buffer or jumpting to another window
 to protect from unexpected behavior.  Same for CTRL-\ e.
 
 "d(" deleted the character under the cursor, while the documentation specified
@@ -1566,4 +1567,11 @@ Added mf_set_dirty().
 Expanding wildcards in a command like ":e aap;<>!" didn't work.  Put
 backslashes before characters that are special to the shell. (Adri Verhoef)
 
+A CursorHold autocommand would cause a message to be cleared.  Don't show the
+special key for the event for 'showcmd'.
+
+When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r
+!cmd foo<Tab>" also escape characters that are special for the shell:
+"!;&()<>".
+
  vim:tw=78:ts=8:ft=help:norl:
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt*   For Vim version 7.0aa.  Last change: 2005 Apr 01
+*windows.txt*   For Vim version 7.0aa.  Last change: 2006 Jan 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1100,18 +1100,18 @@ help		Contains a help file.  Will only b
 
 directory	Displays directory contents.  Can be used by a file explorer
 		plugin.  The buffer is created with these settings: >
-			:set buftype=nowrite
-			:set bufhidden=delete
-			:set noswapfile
+			:setlocal buftype=nowrite
+			:setlocal bufhidden=delete
+			:setlocal noswapfile
 <		The buffer name is the name of the directory and is adjusted
 		when using the |:cd| command.
 
 scratch		Contains text that can be discarded at any time.  It is kept
 		when closing the window, it must be deleted explicitly.
 		Settings: >
-			:set buftype=nofile
-			:set bufhidden=hide
-			:set noswapfile
+			:setlocal buftype=nofile
+			:setlocal bufhidden=hide
+			:setlocal noswapfile
 <		The buffer name can be used to identify the buffer.
 
 						*unlisted-buffer*
@@ -1119,7 +1119,7 @@ unlisted	The buffer is not in the buffer
 		normal editing, but to show a help file, remember a file name
 		or marks.  The ":bdelete" command will also set this option,
 		thus it doesn't completely delete the buffer.  Settings: >
-			:set nobuflisted
+			:setlocal nobuflisted
 <
 
  vim:tw=78:ts=8:ft=help:norl:
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -2,7 +2,7 @@
 " Language:     Java
 " Maintainer:   Claudio Fleiner <claudio@fleiner.com>
 " URL:		http://www.fleiner.com/vim/syntax/java.vim
-" Last Change:  2005 Nov 04
+" Last Change:  2006 Jan 15
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -65,48 +65,42 @@ syn match   javaUserLabelRef	"\k\+" cont
 syn match   javaVarArg          "\.\.\."
 syn keyword javaScopeDecl	public protected private abstract
 
-if exists("java_highlight_java_lang_ids") || exists("java_highlight_java_lang") || exists("java_highlight_all")
+if exists("java_highlight_java_lang_ids")
+  let java_highlight_all=1
+endif
+if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("java_highlight_java_lang") 
   " java.lang.*
   syn match javaLangClass "\<System\>"
-  syn keyword javaLangClass  Cloneable Comparable Runnable Boolean Byte Class
-  syn keyword javaLangClass  Character CharSequence ClassLoader Compiler Double Float
-  syn keyword javaLangClass  Integer InheritableThreadLocal Long Math Number Object Package Process
-  syn keyword javaLangClass  Runtime RuntimePermission InheritableThreadLocal
-  syn keyword javaLangClass  SecurityManager Short String StrictMath StackTraceElement
-  syn keyword javaLangClass  StringBuffer Thread ThreadGroup
-  syn keyword javaLangClass  ThreadLocal Throwable Void ArithmeticException
-  syn keyword javaLangClass  ArrayIndexOutOfBoundsException AssertionError
-  syn keyword javaLangClass  ArrayStoreException ClassCastException
-  syn keyword javaLangClass  ClassNotFoundException
-  syn keyword javaLangClass  CloneNotSupportedException Exception
-  syn keyword javaLangClass  IllegalAccessException
-  syn keyword javaLangClass  IllegalArgumentException
-  syn keyword javaLangClass  IllegalMonitorStateException
-  syn keyword javaLangClass  IllegalStateException
-  syn keyword javaLangClass  IllegalThreadStateException
-  syn keyword javaLangClass  IndexOutOfBoundsException
-  syn keyword javaLangClass  InstantiationException InterruptedException
-  syn keyword javaLangClass  NegativeArraySizeException NoSuchFieldException
-  syn keyword javaLangClass  NoSuchMethodException NullPointerException
-  syn keyword javaLangClass  NumberFormatException RuntimeException
-  syn keyword javaLangClass  SecurityException StringIndexOutOfBoundsException
-  syn keyword javaLangClass  UnsupportedOperationException
-  syn keyword javaLangClass  AbstractMethodError ClassCircularityError
-  syn keyword javaLangClass  ClassFormatError Error ExceptionInInitializerError
-  syn keyword javaLangClass  IllegalAccessError InstantiationError
-  syn keyword javaLangClass  IncompatibleClassChangeError InternalError
-  syn keyword javaLangClass  LinkageError NoClassDefFoundError
-  syn keyword javaLangClass  NoSuchFieldError NoSuchMethodError
-  syn keyword javaLangClass  OutOfMemoryError StackOverflowError
-  syn keyword javaLangClass  ThreadDeath UnknownError UnsatisfiedLinkError
-  syn keyword javaLangClass  UnsupportedClassVersionError VerifyError
-  syn keyword javaLangClass  VirtualMachineError
+  syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException
+  syn cluster javaTop add=javaR_JavaLang
+  syn cluster javaClasses add=javaR_JavaLang
+  JavaHiLink javaR_JavaLang javaR_Java
+  syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary
+  syn cluster javaTop add=javaC_JavaLang
+  syn cluster javaClasses add=javaC_JavaLang
+  JavaHiLink javaC_JavaLang javaC_Java
+  syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError
+  syn cluster javaTop add=javaE_JavaLang
+  syn cluster javaClasses add=javaE_JavaLang
+  JavaHiLink javaE_JavaLang javaE_Java
+  syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException
+  syn cluster javaTop add=javaX_JavaLang
+  syn cluster javaClasses add=javaX_JavaLang
+  JavaHiLink javaX_JavaLang javaX_Java
+
+  JavaHiLink javaR_Java javaR_
+  JavaHiLink javaC_Java javaC_
+  JavaHiLink javaE_Java javaE_
+  JavaHiLink javaX_Java javaX_
+  JavaHiLink javaX_		     javaExceptions
+  JavaHiLink javaR_		     javaExceptions
+  JavaHiLink javaE_		     javaExceptions
+  JavaHiLink javaC_		     javaConstant
+
   syn keyword javaLangObject clone equals finalize getClass hashCode
   syn keyword javaLangObject notify notifyAll toString wait
-  JavaHiLink javaLangClass		     javaConstant
   JavaHiLink javaLangObject		     javaConstant
-  syn cluster javaTop add=javaLangObject,javaLangClass
-  syn cluster javaClasses add=javaLangClass
+  syn cluster javaTop add=javaLangObject
 endif
 
 if filereadable(expand("<sfile>:p:h")."/javaid.vim")
@@ -162,13 +156,15 @@ if !exists("java_ignore_javadoc") && mai
   " syntax coloring for javadoc comments (HTML)
   syntax include @javaHtml <sfile>:p:h/html.vim
   unlet b:current_syntax
-  syn region  javaDocComment    start="/\*\*"  end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaTodo,@Spell
-  syn region  javaCommentTitle  contained matchgroup=javaDocComment start="/\*\*"   matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags
+  syn region  javaDocComment    start="/\*\*"  end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
+  syn region  javaCommentTitle  contained matchgroup=javaDocComment start="/\*\*"   matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
 
-  syn region javaDocTags  contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
-  syn match  javaDocTags  contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
-  syn match  javaDocParam contained "\s\S\+"
-  syn match  javaDocTags  contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+  syn region javaDocTags         contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
+  syn match  javaDocTags         contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
+  syn match  javaDocParam        contained "\s\S\+"
+  syn match  javaDocTags         contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+  syn region javaDocSeeTag       contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam
+  syn match  javaDocSeeTagParam  contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
   syntax case match
 endif
 
@@ -323,6 +319,7 @@ if version >= 508 || !exists("did_java_s
   JavaHiLink javaCommentTitle		SpecialComment
   JavaHiLink javaDocTags		Special
   JavaHiLink javaDocParam		Function
+  JavaHiLink javaDocSeeTagParam		Function
   JavaHiLink javaCommentStar		javaComment
 
   JavaHiLink javaType			Type
--- a/runtime/syntax/m4.vim
+++ b/runtime/syntax/m4.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:		M4
-" Maintainer:	Claudio Fleiner
+" Maintainer:	Claudio Fleiner (claudio@fleiner.com)
 " URL:			http://www.fleiner.com/vim/syntax/m4.vim
-" Last Change:	2001 Apr 26
+" Last Change:	2005 Jan 15
 
 " This file will highlight user function calls if they use only
 " capital letters and have at least one argument (i.e. the '('
@@ -23,9 +23,9 @@ endif
 " define the m4 syntax
 syn match  m4Variable contained "\$\d\+"
 syn match  m4Special  contained "$[@*#]"
-syn match  m4Comment  "dnl\>.*" contains=SpellErrors
-syn match  m4Constants "\(\<m4_\)\=__file__"
-syn match  m4Constants "\(\<m4_\)\=__line__"
+syn match  m4Comment  "\<\(m4_\)\=dnl\>.*" contains=SpellErrors
+syn match  m4Constants "\<\(m4_\)\=__file__"
+syn match  m4Constants "\<\(m4_\)\=__line__"
 syn keyword m4Constants divnum sysval m4_divnum m4_sysval
 syn region m4Paren    matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
 syn region m4Command  matchgroup=m4Function  start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
--- a/src/edit.c
+++ b/src/edit.c
@@ -289,6 +289,13 @@ edit(cmdchar, startln, count)
 	return FALSE;
     }
 #endif
+    /* Don't allow changes in the buffer while editing the cmdline.  The
+     * caller of getcmdline() may get confused. */
+    if (cmdline_busy)
+    {
+	EMSG(_(e_secure));
+	return FALSE;
+    }
 
 #ifdef FEAT_INS_EXPAND
     ins_compl_clear();	    /* clear stuff for CTRL-X mode */
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2841,11 +2841,11 @@ check_readonly(forceit, buf)
 }
 
 /*
- * try to abandon current file and edit a new or existing file
- * 'fnum' is the number of the file, if zero use ffname/sfname
+ * Try to abandon current file and edit a new or existing file.
+ * 'fnum' is the number of the file, if zero use ffname/sfname.
  *
- * return 1 for "normal" error, 2 for "not written" error, 0 for success
- * -1 for succesfully opening another file
+ * Return 1 for "normal" error, 2 for "not written" error, 0 for success
+ * -1 for succesfully opening another file.
  * 'lnum' is the line number for the cursor in the new file (if non-zero).
  */
     int
@@ -2861,10 +2861,8 @@ getfile(fnum, ffname, sfname, setpm, lnu
     int		retval;
     char_u	*free_me = NULL;
 
-#ifdef FEAT_CMDWIN
-    if (cmdwin_type != 0)
+    if (editing_cmdline())
 	return 1;
-#endif
 
     if (fnum == 0)
     {
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -258,6 +258,9 @@ getcmdline(firstc, count, indent)
     }
     xpc.xp_context = EXPAND_NOTHING;
     xpc.xp_backslash = XP_BS_NONE;
+#ifndef BACKSLASH_IN_FILENAME
+    xpc.xp_shell = FALSE;
+#endif
 
 #if defined(FEAT_EVAL)
     if (ccline.input_fn)
@@ -658,17 +661,13 @@ getcmdline(firstc, count, indent)
 		restore_cmdline(&save_ccline);
 		if (c == '=')
 		{
-		    /* Need to save and restore ccline.  And go into the
-		     * sandbox to avoid nasty things like going to another
-		     * buffer when evaluating an expression. */
+		    /* Need to save and restore ccline.  And set cmdline_busy
+		     * to avoid nasty things like going to another buffer when
+		     * evaluating an expression. */
 		    save_cmdline(&save_ccline);
-#ifdef HAVE_SANDBOX
-		    ++sandbox;
-#endif
+		    ++cmdline_busy;
 		    p = get_expr_line();
-#ifdef HAVE_SANDBOX
-		    --sandbox;
-#endif
+		    --cmdline_busy;
 		    restore_cmdline(&save_ccline);
 
 		    if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK)
@@ -1875,6 +1874,35 @@ getcmdline_prompt(firstc, prompt, attr, 
 }
 #endif
 
+/*
+ * Return TRUE when the command line is being edited.  That means the current
+ * buffer and window can't be changed.
+ */
+    int
+editing_cmdline()
+{
+#ifdef FEAT_CMDWIN
+    if (cmdwin_type != 0)
+	return TRUE;
+#endif
+    return cmdline_busy;
+}
+
+/*
+ * Give an error message for a command that isn't allowed while the cmdline
+ * window is open or editing the cmdline in another way.
+ */
+    void
+editing_cmdline_msg()
+{
+#ifdef FEAT_CMDWIN
+    if (cmdwin_type != 0)
+	EMSG(_(e_cmdwin));
+    else
+#endif
+	EMSG(_(e_secure));
+}
+
     static int
 cmdline_charsize(idx)
     int		idx;
@@ -2786,17 +2814,12 @@ cmdline_paste(regname, literally)
     regname = may_get_selection(regname);
 #endif
 
-    /* Need to save and restore ccline.  And go into the sandbox to avoid
-     * nasty things like going to another buffer when evaluating an
-     * expression. */
+    /* Need to save and restore ccline.  And set cmdline_busy to avoid nasty
+     * things like going to another buffer when evaluating an expression. */
     save_cmdline(&save_ccline);
-#ifdef HAVE_SANDBOX
-    ++sandbox;
-#endif
+    ++cmdline_busy;
     i = get_spec_reg(regname, &arg, &allocated, TRUE);
-#ifdef HAVE_SANDBOX
-    --sandbox;
-#endif
+    --cmdline_busy;
     restore_cmdline(&save_ccline);
 
     if (i)
@@ -3368,8 +3391,14 @@ ExpandInit(xp)
     expand_T	*xp;
 {
     xp->xp_backslash = XP_BS_NONE;
+#ifndef BACKSLASH_IN_FILENAME
+    xp->xp_shell = FALSE;
+#endif
     xp->xp_numfiles = -1;
     xp->xp_files = NULL;
+#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+    xp->xp_arg = NULL;
+#endif
 }
 
 /*
@@ -3446,7 +3475,8 @@ ExpandEscape(xp, str, numfiles, files, o
 		    p = vim_strsave_escaped(files[i], buf);
 		}
 #else
-		p = vim_strsave_escaped(files[i], PATH_ESC_CHARS);
+		p = vim_strsave_escaped(files[i],
+			     xp->xp_shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS);
 #endif
 		if (p != NULL)
 		{
@@ -4527,8 +4557,9 @@ globpath(path, file)
     if (buf == NULL)
 	return NULL;
 
+    ExpandInit(&xpc);
     xpc.xp_context = EXPAND_FILES;
-    xpc.xp_backslash = XP_BS_NONE;
+
     ga_init2(&ga, 1, 100);
 
     /* Loop over all entries in {path}. */
--- a/src/globals.h
+++ b/src/globals.h
@@ -86,6 +86,8 @@ EXTERN int	clear_cmdline INIT(= FALSE);	
 #if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
 EXTERN int	cmdline_star INIT(= FALSE);	/* cmdline is crypted */
 #endif
+EXTERN int	cmdline_busy INIT(= FALSE);	/* editing the cmdline */
+
 EXTERN int	exec_from_reg INIT(= FALSE);	/* executing register */
 
 EXTERN int	screen_cleared INIT(= FALSE);	/* screen has been cleared */
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2328,7 +2328,6 @@ sm_client_die(GnomeClient *client, gpoin
     vim_strncpy(IObuff,
 		    _("Vim: Received \"die\" request from session manager\n"),
 	    IOSIZE - 1);
-    deadly_exit = TRUE;
     preserve_exit();
 }
 
--- a/src/structs.h
+++ b/src/structs.h
@@ -401,6 +401,10 @@ typedef struct expand
     int		xp_scriptID;		/* SID for completion function */
 #endif
     int		xp_backslash;		/* one of the XP_BS_ values */
+#ifndef BACKSLASH_IN_FILENAME
+    int		xp_shell;		/* for a shell command more characters
+					   need to be escaped */
+#endif
     int		xp_numfiles;		/* number of files found by
 						    file name completion */
     char_u	**xp_files;		/* list of files */
--- a/src/undo.c
+++ b/src/undo.c
@@ -52,6 +52,7 @@
 
 static u_entry_T *u_get_headentry __ARGS((void));
 static void u_getbot __ARGS((void));
+static int undo_allowed __ARGS((void));
 static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
 static void u_doit __ARGS((int count));
 static void u_undoredo __ARGS((void));
@@ -156,6 +157,40 @@ u_savedel(lnum, nlines)
 			nlines == curbuf->b_ml.ml_line_count ? 2 : lnum));
 }
 
+/*
+ * Return TRUE when undo is allowed.  Otherwise give an error message and
+ * return FALSE.
+ */
+    static int
+undo_allowed()
+{
+    /* Don't allow changes when 'modifiable' is off.  */
+    if (!curbuf->b_p_ma)
+    {
+	EMSG(_(e_modifiable));
+	return FALSE;
+    }
+
+#ifdef HAVE_SANDBOX
+    /* In the sandbox it's not allowed to change the text. */
+    if (sandbox != 0)
+    {
+	EMSG(_(e_sandbox));
+	return FALSE;
+    }
+#endif
+
+    /* Don't allow changes in the buffer while editing the cmdline.  The
+     * caller of getcmdline() may get confused. */
+    if (cmdline_busy)
+    {
+	EMSG(_(e_secure));
+	return FALSE;
+    }
+
+    return TRUE;
+}
+
     static int
 u_savecommon(top, bot, newbot)
     linenr_T	top, bot;
@@ -168,27 +203,10 @@ u_savecommon(top, bot, newbot)
     u_entry_T		*prev_uep;
     long		size;
 
-    /*
-     * Don't allow changes when 'modifiable' is off.  Letting the
-     * undo fail is a crude way to make all change commands fail.
-     */
-    if (!curbuf->b_p_ma)
-    {
-	EMSG(_(e_modifiable));
+    /* When making changes is not allowed return FAIL.  It's a crude way to
+     * make all change commands fail. */
+    if (!undo_allowed())
 	return FAIL;
-    }
-
-#ifdef HAVE_SANDBOX
-    /*
-     * In the sandbox it's not allowed to change the text.  Letting the
-     * undo fail is a crude way to make all change commands fail.
-     */
-    if (sandbox != 0)
-    {
-	EMSG(_(e_sandbox));
-	return FAIL;
-    }
-#endif
 
 #ifdef FEAT_NETBEANS_INTG
     /*
@@ -484,20 +502,8 @@ u_redo(count)
 u_doit(count)
     int count;
 {
-    /* Don't allow changes when 'modifiable' is off. */
-    if (!curbuf->b_p_ma)
-    {
-	EMSG(_(e_modifiable));
+    if (!undo_allowed())
 	return;
-    }
-#ifdef HAVE_SANDBOX
-    /* In the sandbox it's not allowed to change the text. */
-    if (sandbox != 0)
-    {
-	EMSG(_(e_sandbox));
-	return;
-    }
-#endif
 
     u_newcount = 0;
     u_oldcount = 0;
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 14)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 14, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 19)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 19, compiled "