updated for version 7.0g
diff --git a/src/GvimExt/GvimExt.reg b/src/GvimExt/GvimExt.reg
index 1e3a781..bb906e2 100644
--- a/src/GvimExt/GvimExt.reg
+++ b/src/GvimExt/GvimExt.reg
@@ -15,6 +15,6 @@
 [HKEY_LOCAL_MACHINE\Software\Vim\Gvim]
    "path"="gvim.exe"
 
-[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0f]
-   "DisplayName"="Vim 7.0f: Edit with Vim popup menu entry"
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0g]
+   "DisplayName"="Vim 7.0g: Edit with Vim popup menu entry"
    "UninstallString"="uninstal.exe"
diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt
index fa40c15..81ad970 100644
--- a/src/INSTALLmac.txt
+++ b/src/INSTALLmac.txt
@@ -43,9 +43,9 @@
 
  To overrule the architecture do this before running make:
 
- 	./configure --with-mac-arch=intel
+	./configure --with-mac-arch=intel
  or
- 	./configure --with-mac-arch=ppc
+	./configure --with-mac-arch=ppc
 
 
 1.2 X-Windows or Plain Text
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index d2a3e28..a13dce0 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -43,11 +43,11 @@
 Visual Studio installed a batch file called vcvars32.bat, which you must
 run to set up paths for nmake and MSVC.
 
-nmake -f Make_mvc.mak           console   Win32 SDK or Microsoft Visual C++
-nmake -f Make_mvc.mak GUI=yes   GUI       Microsoft Visual C++
-nmake -f Make_mvc.mak OLE=yes   OLE       Microsoft Visual C++
+nmake -f Make_mvc.mak		console   Win32 SDK or Microsoft Visual C++
+nmake -f Make_mvc.mak GUI=yes	GUI	  Microsoft Visual C++
+nmake -f Make_mvc.mak OLE=yes	OLE	  Microsoft Visual C++
 nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
-                                Perl, Python, etc.
+				Perl, Python, etc.
 
 Make_mvc.mak allows a Vim to be built with various different features and
 debug support.  Debugging with MS Devstudio is provided by Make_dvc.mak.
@@ -61,9 +61,9 @@
 far more configuration.) Make_ivc.mak can also be built with nmake.
 
 nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
-                                GUI       Microsoft Visual C++ 4.x or later
+				GUI	  Microsoft Visual C++ 4.x or later
 nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
-                                OLE       Microsoft Visual C++ 4.x or later
+				OLE	  Microsoft Visual C++ 4.x or later
 
 See the specific files for comments and options.
 
@@ -94,7 +94,7 @@
 To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
 execute the following commands in a cmd.exe window (the msvcsetup.bat batch
 file can be used):
-       
+
     set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
     call "%VCToolkitInstallDir%vcvars32.bat"
     set MSVCVer=7.1
@@ -104,7 +104,7 @@
 Now you can build Vim with Make_mvc.mak.
 
 
-Getting the Windows Platform SDK            *ms-platform-sdk*
+Getting the Windows Platform SDK	    *ms-platform-sdk*
 
 You will also need a copy of the Windows Platform SDK from
     http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
@@ -122,7 +122,7 @@
 which is needed to link Vim.
 
 
-Getting the .NET Framework 1.1 SDK          *dotnet-1.1-sdk*
+Getting the .NET Framework 1.1 SDK	    *dotnet-1.1-sdk*
 
 You need the .NET Framework 1.1 SDK from
     http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
@@ -131,7 +131,7 @@
 installing the .NET 1.1 SDK.
 
 
-Getting the WinDbg debugger                 *windbg-download*
+Getting the WinDbg debugger		    *windbg-download*
 
 The Debugging Tools for Windows can be downloaded from
     http://www.microsoft.com/whdc/devtools/debugging/default.mspx
@@ -242,7 +242,7 @@
 If you like, you can compile the 'mingw' Win32 version from the comfort of
 your Linux (or other unix) box.  To do this, you need to follow a few steps:
     1) Install the mingw32 cross-compiler. See
-        http://www.libsdl.org/extras/win32/cross/README.txt
+	http://www.libsdl.org/extras/win32/cross/README.txt
     2) get the *unix* version of the vim sources
     3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'.
     4) make -f Make_ming.mak gvim.exe
@@ -317,7 +317,7 @@
 8. Windows 3.1x
 ===============
 
-make -f Make_w16.mak             16 bit, Borland C++ 5.0
+make -f Make_w16.mak		 16 bit, Borland C++ 5.0
 
 Warning: Be sure to use the right make.exe.  It should be Borland make.
 
@@ -340,9 +340,9 @@
 Summary:
 ren Make_bc3.mak Makefile; make     16 bit, Borland C++ and Turbo C++
 ren Make_tcc.mak Makefile; make     16 bit, Turbo C
-make -f Make_djg.mak                32 bit, DJGPP 2.0
-make -f Make_bc5.mak                32 bit, Borland C++ 5.x (edit it to
-                                    define DOS)
+make -f Make_djg.mak		    32 bit, DJGPP 2.0
+make -f Make_bc5.mak		    32 bit, Borland C++ 5.x (edit it to
+				    define DOS)
 
 Warning: Be sure to use the right make.exe.  Microsoft C make doesn't work;
 Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak;
diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt
index c0ce311..512b665 100644
--- a/src/INSTALLvms.txt
+++ b/src/INSTALLvms.txt
@@ -1,7 +1,7 @@
 INSTALLvms.txt - Installation of Vim on OpenVMS
 
 Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
-Last change:  2006 Mar 02
+Last change:  2006 Apr 30
 
 This file contains instructions for compiling Vim on Openvms.
 If you already have an executable version of Vim, you don't need this.
@@ -303,7 +303,7 @@
      You need also the OpenVMS Porting Library:
      http://www.openvms.compaq.com/openvms/products/ips/porting.html
 
-     Source code for GTK and porting library that is used to build 
+     Source code for GTK and porting library that is used to build
      VMS executables at polarhome.com are at
      http://www.polarhome.com/vim/files/source/vms/
 
diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak
index e50a435..a1d92bd 100644
--- a/src/Make_bc5.mak
+++ b/src/Make_bc5.mak
@@ -54,9 +54,9 @@
 #   RUBY_VER_LONG  same, but in format with dot. (1.6)
 #   DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no)
 # MBYTE		no or yes: set to yes for multi-byte support (yes)
-#               NOTE: multi-byte support is broken in the Borland libraries,
-#               not everything will work properly!  Esp. handling multi-byte
-#               file names.
+#		NOTE: multi-byte support is broken in the Borland libraries,
+#		not everything will work properly!  Esp. handling multi-byte
+#		file names.
 # IME		no or yes: set to yes for multi-byte IME support (yes)
 #   DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
 # GETTEXT	no or yes: set to yes for multi-language support (yes)
@@ -80,7 +80,7 @@
 # CSCOPE	no or yes: include support for Cscope interface (yes)
 # NETBEANS	no or yes: include support for Netbeans interface (yes if GUI
 #		is yes)
-# NBDEBUG 	no or yes: include support for debugging Netbeans interface (no)
+# NBDEBUG	no or yes: include support for debugging Netbeans interface (no)
 # XPM		define to path to XPM dir to get support for loading XPM images.
 
 ### BOR: root of the BC installation
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index 5568174..4c757e1 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -1,6 +1,6 @@
 #
 # Makefile for VIM on Win32, using Cygnus gcc
-# Last updated by Dan Sharp.  Last Change: 2006 Mar 24
+# Last updated by Dan Sharp.  Last Change: 2006 Apr 30
 #
 # Also read INSTALLpc.txt!
 #
@@ -42,7 +42,7 @@
 # OPTIMIZE	SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
 # NETBEANS	no or yes: to include netbeans interface support (yes when GUI
 #		is yes)
-# NBDEBUG 	no or yes: to include netbeans interface debugging support (no)
+# NBDEBUG	no or yes: to include netbeans interface debugging support (no)
 # XPM		define to path to XPM dir to get XPM image support (not defined)
 #>>>>> choose options:
 ifndef GUI
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 895b7bc..07d2b20 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -2,7 +2,7 @@
 # Makefile for Vim on OpenVMS
 #
 # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
-# Last change:  2006 Apr 11
+# Last change:  2006 Apr 30
 #
 # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
 # with MMS and MMK
@@ -100,7 +100,7 @@
 .IFDEF VAX
 .IFDEF DECC	     # VAX with DECC
 CC_DEF  = cc # /decc # some system requires this switch
-                     # but when it is not required /ver might fail
+		     # but when it is not required /ver might fail
 PREFIX  = /prefix=all
 .ELSE		     # VAX with VAXC
 CC_DEF	= cc
@@ -391,7 +391,7 @@
 .IFDEF XPM
 	-@ write sys$output "using DECW/Motif/XPM environment."
 .ELSE
-        -@ write sys$output "using DECW/Motif environment."
+	-@ write sys$output "using DECW/Motif environment."
 .ENDIF
 	-@ write sys$output "creating OS_VMS_MOTIF.OPT file."
 	-@ open/write opt_file OS_VMS_MOTIF.OPT
diff --git a/src/Makefile b/src/Makefile
index 8572551..32f3a97 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -880,7 +880,7 @@
 
 ### Vim version (adjusted by a script)
 VIMMAJOR = 7
-VIMMINOR = 0f
+VIMMINOR = 0g
 
 ### Location of Vim files (should not need to be changed, and  {{{1
 ### some things might not work when they are changed!)
@@ -1113,7 +1113,7 @@
 
 ### Motif GUI
 MOTIF_SRC	= gui.c gui_motif.c gui_x11.c pty.c gui_beval.c \
-		  	gui_xmdlg.c gui_xmebw.c
+			gui_xmdlg.c gui_xmebw.c
 MOTIF_OBJ	= objects/gui.o objects/gui_motif.o objects/gui_x11.o \
 			objects/pty.o objects/gui_beval.o \
 			objects/gui_xmdlg.o objects/gui_xmebw.o
@@ -1764,7 +1764,7 @@
 
 # Install most of the runtime files
 installruntime: installrtbase installmacros installtutor installspell
-	
+
 # install the help files; first adjust the contents for the final location
 installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \
 		$(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \
@@ -2062,7 +2062,7 @@
 		$(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \
 		$(GVIMDIFFNAME) $(EVIEWNAME)
 
-installmanlinks: 
+installmanlinks:
 	-$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \
 		$(DEST_MAN) $(INSTALLMLARGS)
 
diff --git a/src/auto/configure b/src/auto/configure
index 319fd4e..35eea35 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -2983,7 +2983,7 @@
 
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-	        MACARCH="ppc"
+		MACARCH="ppc"
 		CPPFLAGS="$save_cppflags -arch ppc"
 		LDFLAGS="$save_ldflags -arch ppc"
 fi
@@ -3753,11 +3753,11 @@
     if test "X$PLTHOME" != "X"; then
 	echo "$as_me:$LINENO: result: \"$PLTHOME\"" >&5
 echo "${ECHO_T}\"$PLTHOME\"" >&6
-        vi_cv_path_mzscheme_pfx="$PLTHOME"
+	vi_cv_path_mzscheme_pfx="$PLTHOME"
     else
 	echo "$as_me:$LINENO: result: \"not set\"" >&5
 echo "${ECHO_T}\"not set\"" >&6
-	        # Extract the first word of "mzscheme", so it can be a program name with args.
+		# Extract the first word of "mzscheme", so it can be a program name with args.
 set dummy mzscheme; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
@@ -3797,30 +3797,30 @@
 fi
 
 
-		        if test "X$vi_cv_path_mzscheme" != "X"; then
+			if test "X$vi_cv_path_mzscheme" != "X"; then
 	  lsout=`ls -l $vi_cv_path_mzscheme`
 	  if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
 	    vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
 	  fi
 	fi
 
-        if test "X$vi_cv_path_mzscheme" != "X"; then
-                        echo "$as_me:$LINENO: checking MzScheme install prefix" >&5
+	if test "X$vi_cv_path_mzscheme" != "X"; then
+	    	    echo "$as_me:$LINENO: checking MzScheme install prefix" >&5
 echo $ECHO_N "checking MzScheme install prefix... $ECHO_C" >&6
 if test "${vi_cv_path_mzscheme_pfx+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
    vi_cv_path_mzscheme_pfx=`
-      	    ${vi_cv_path_mzscheme} -evm \
-            "(display (simplify-path		\
-              (build-path (call-with-values	\
-      	        (lambda () (split-path (find-system-path (quote exec-file)))) \
-      	        (lambda (base name must-be-dir?) base)) (quote up))))"`
+	    ${vi_cv_path_mzscheme} -evm \
+	    "(display (simplify-path		\
+	       (build-path (call-with-values	\
+		(lambda () (split-path (find-system-path (quote exec-file)))) \
+		(lambda (base name must-be-dir?) base)) (quote up))))"`
 fi
 echo "$as_me:$LINENO: result: $vi_cv_path_mzscheme_pfx" >&5
 echo "${ECHO_T}$vi_cv_path_mzscheme_pfx" >&6
 	    	    vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'`
-        fi
+	fi
     fi
   fi
 
@@ -3843,7 +3843,7 @@
     else
       MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzgc -lmzscheme"
       if test "$GCC" = yes; then
-		        MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
+			MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
       elif test "`(uname) 2>/dev/null`" = SunOS &&
 			       uname -r | grep '^5' >/dev/null; then
 	MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
@@ -7848,7 +7848,7 @@
       if test "`(uname) 2>/dev/null`" = FreeBSD; then
 	echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-        GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
+	GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
 	GNOME_LIBS="$GNOME_LIBS -pthread"
       else
 	echo "$as_me:$LINENO: result: no" >&5
diff --git a/src/configure.in b/src/configure.in
index 5c6dd51..9e500d9 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -135,7 +135,7 @@
 	AC_TRY_LINK([ ], [ ],
 	    AC_MSG_RESULT(yes); MACARCH="intel",
 	    AC_MSG_RESULT(no, using PowerPC)
-	        MACARCH="ppc"
+		MACARCH="ppc"
 		CPPFLAGS="$save_cppflags -arch ppc"
 		LDFLAGS="$save_ldflags -arch ppc"))
   elif test "x$MACARCH" = "xintel"; then
@@ -372,8 +372,8 @@
 
   AC_MSG_CHECKING(--with-plthome argument)
   AC_ARG_WITH(plthome,
-  	[  --with-plthome=PLTHOME   Use PLTHOME.],
-        with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
+	[  --with-plthome=PLTHOME   Use PLTHOME.],
+	with_plthome="$withval"; AC_MSG_RESULT($with_plthome),
 	with_plthome="";AC_MSG_RESULT("no"))
 
   if test "X$with_plthome" != "X"; then
@@ -382,33 +382,33 @@
     AC_MSG_CHECKING(PLTHOME environment var)
     if test "X$PLTHOME" != "X"; then
 	AC_MSG_RESULT("$PLTHOME")
-        vi_cv_path_mzscheme_pfx="$PLTHOME"
+	vi_cv_path_mzscheme_pfx="$PLTHOME"
     else
 	AC_MSG_RESULT("not set")
 	dnl -- try to find MzScheme executable
-        AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
+	AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
 
 	dnl resolve symbolic link, the executable is often elsewhere and there
 	dnl are no links for the include files.
-        if test "X$vi_cv_path_mzscheme" != "X"; then
+	if test "X$vi_cv_path_mzscheme" != "X"; then
 	  lsout=`ls -l $vi_cv_path_mzscheme`
 	  if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then
 	    vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'`
 	  fi
 	fi
 
-        if test "X$vi_cv_path_mzscheme" != "X"; then
-            dnl -- find where MzScheme thinks it was installed
-            AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
-            [ vi_cv_path_mzscheme_pfx=`
-      	    ${vi_cv_path_mzscheme} -evm \
-            "(display (simplify-path		\
-              (build-path (call-with-values	\
-      	        (lambda () (split-path (find-system-path (quote exec-file)))) \
-      	        (lambda (base name must-be-dir?) base)) (quote up))))"` ])
+	if test "X$vi_cv_path_mzscheme" != "X"; then
+	    dnl -- find where MzScheme thinks it was installed
+	    AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
+	    [ vi_cv_path_mzscheme_pfx=`
+	    ${vi_cv_path_mzscheme} -evm \
+	    "(display (simplify-path		\
+	       (build-path (call-with-values	\
+		(lambda () (split-path (find-system-path (quote exec-file)))) \
+		(lambda (base name must-be-dir?) base)) (quote up))))"` ])
 	    dnl Remove a trailing slash.
 	    vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'`
-        fi
+	fi
     fi
   fi
 
@@ -430,7 +430,7 @@
       if test "$GCC" = yes; then
 	dnl Make Vim remember the path to the library.  For when it's not in
 	dnl $LD_LIBRARY_PATH.
-        MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
+	MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
       elif test "`(uname) 2>/dev/null`" = SunOS &&
 			       uname -r | grep '^5' >/dev/null; then
 	MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
@@ -1486,13 +1486,13 @@
       GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
       GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
       GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
-     
+
       dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
       dnl This might not be the right way but it works for me...
       AC_MSG_CHECKING(for FreeBSD)
       if test "`(uname) 2>/dev/null`" = FreeBSD; then
 	AC_MSG_RESULT(yes, adding -pthread)
-        GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
+	GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
 	GNOME_LIBS="$GNOME_LIBS -pthread"
       else
 	AC_MSG_RESULT(no)
diff --git a/src/eval.c b/src/eval.c
index 388727f..945b460 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -198,7 +198,7 @@
  */
 static hashtab_T	func_hashtab;
 
-/* The names of packages that once were loaded is remembered. */
+/* The names of packages that once were loaded are remembered. */
 static garray_T		ga_loaded = {0, 0, sizeof(char_u *), 4, NULL};
 
 /* list heads for garbage collection */
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 2fc5d0a..2f4766d 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8813,6 +8813,11 @@
     char_u	*p;
 #endif
 
+    if (ex_normal_lock > 0)
+    {
+	EMSG(_(e_secure));
+	return;
+    }
     if (ex_normal_busy >= p_mmd)
     {
 	EMSG(_("E192: Recursive use of :normal too deep"));
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 376cbcc..3ac20ff 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4325,7 +4325,7 @@
 	return ExpandRTDir(pat, num_file, file, "compiler");
 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
     if (xp->xp_context == EXPAND_USER_LIST)
-        return ExpandUserList(xp, num_file, file);
+	return ExpandUserList(xp, num_file, file);
 # endif
 
     regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
diff --git a/src/fileio.c b/src/fileio.c
index 01953f3..9f24f69 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7762,7 +7762,7 @@
     int		findgroup;
     int		allgroups;
     int		patlen;
-    int	        is_buflocal;
+    int		is_buflocal;
     int		buflocal_nr;
     char_u	buflocal_pat[25];	/* for "<buffer=X>" */
 
@@ -8839,10 +8839,10 @@
 
     for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
 	if (ap->pat != NULL && ap->cmds != NULL
-            && (ap->buflocal_nr == 0
+	      && (ap->buflocal_nr == 0
 		? match_file_pat(NULL, ap->reg_prog,
 					  fname, sfname, tail, ap->allow_dirs)
-                : buf != NULL && ap->buflocal_nr == buf->b_fnum
+		: buf != NULL && ap->buflocal_nr == buf->b_fnum
 	   ))
 	{
 	    retval = TRUE;
diff --git a/src/getchar.c b/src/getchar.c
index 3b9d420..88e724f 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4335,11 +4335,26 @@
     char_u	*res;
     char_u	*p;
     char_u	*save_cmd;
+    pos_T	save_cursor;
 
     save_cmd = save_cmdline_alloc();
     if (save_cmd == NULL)
 	return NULL;
+
+    /* Forbid changing text or using ":normal" to avoid most of the bad side
+     * effects.  Also restore the cursor position. */
+    ++textlock;
+#ifdef FEAT_EX_EXTRA
+    ++ex_normal_lock;
+#endif
+    save_cursor = curwin->w_cursor;
     p = eval_to_string(str, NULL, FALSE);
+    --textlock;
+#ifdef FEAT_EX_EXTRA
+    --ex_normal_lock;
+#endif
+    curwin->w_cursor = save_cursor;
+
     restore_cmdline_alloc(save_cmd);
     if (p == NULL)
 	return NULL;
diff --git a/src/globals.h b/src/globals.h
index 867da5b..1287d24 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -937,6 +937,7 @@
 		    ;
 #ifdef FEAT_EX_EXTRA
 EXTERN int	ex_normal_busy INIT(= 0); /* recursivenes of ex_normal() */
+EXTERN int	ex_normal_lock INIT(= 0); /* forbid use of ex_normal() */
 #endif
 EXTERN int	stop_insert_mode;	/* for ":stopinsert" and 'insertmode' */
 
diff --git a/src/gui.c b/src/gui.c
index fe12864..7d11839 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4456,8 +4456,8 @@
     long_u	rgb = gui_mch_get_rgb(pixel);
 
     return  (int)(  (((rgb >> 16) & 0xff) * 299)
-	           + (((rgb >> 8) & 0xff) * 587)
-	           +  ((rgb	  & 0xff) * 114)) / 1000;
+		   + (((rgb >> 8) & 0xff) * 587)
+		   +  ((rgb	  & 0xff) * 114)) / 1000;
 }
 
 #if defined(FEAT_GUI_X11) || defined(PROTO)
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index 6c86948..cc75c67 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -291,7 +291,7 @@
      * immediately pass it to mainwin.
      */
     if (gtk_socket_id != 0)
-        gtk_widget_grab_focus(gui.drawarea);
+	gtk_widget_grab_focus(gui.drawarea);
 
     return TRUE;
 }
@@ -742,9 +742,9 @@
 		    menu,
 		    idx);
 
-            if (gtk_socket_id != 0)
-                gtk_signal_connect(GTK_OBJECT(menu->id), "focus_in_event",
-                        GTK_SIGNAL_FUNC(toolbar_button_focus_in_event), NULL);
+	    if (gtk_socket_id != 0)
+		gtk_signal_connect(GTK_OBJECT(menu->id), "focus_in_event",
+			GTK_SIGNAL_FUNC(toolbar_button_focus_in_event), NULL);
 
 	    CONVERT_TO_UTF8_FREE(text);
 	    CONVERT_TO_UTF8_FREE(tooltip);
@@ -1307,11 +1307,11 @@
     gui.browse_fname = NULL;
     if (gtk_dialog_run(GTK_DIALOG(fc)) == GTK_RESPONSE_ACCEPT)
     {
-        char *filename;
+	char *filename;
 
-        filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fc));
-        gui.browse_fname = (char_u *)g_strdup(filename);
-        g_free(filename);
+	filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(fc));
+	gui.browse_fname = (char_u *)g_strdup(filename);
+	g_free(filename);
     }
     gtk_widget_destroy(GTK_WIDGET(fc));
 
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index f7f9adc..c27ce7c 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -812,7 +812,7 @@
 
     /* make sure keyboard input goes to the draw area (if this is focus for a window) */
     if (widget != gui.drawarea)
-        gtk_widget_grab_focus(gui.drawarea);
+	gtk_widget_grab_focus(gui.drawarea);
 
     return TRUE;
 }
@@ -2843,21 +2843,21 @@
     if (using_gnome && widget != NULL)
     {
 # ifdef HAVE_GTK2
-        GtkWidget *parent;
+	GtkWidget *parent;
 	BonoboDockItem *dockitem;
 
 	parent	 = gtk_widget_get_parent(widget);
-        if (G_TYPE_FROM_INSTANCE(parent) == BONOBO_TYPE_DOCK_ITEM)
-        {
-            /* Only menu & toolbar are dock items.  Could tabline be?
-             * Seem to be only the 2 defined in GNOME */
-            widget = parent;
-            dockitem = BONOBO_DOCK_ITEM(widget);
+	if (G_TYPE_FROM_INSTANCE(parent) == BONOBO_TYPE_DOCK_ITEM)
+	{
+	    /* Only menu & toolbar are dock items.  Could tabline be?
+	     * Seem to be only the 2 defined in GNOME */
+	    widget = parent;
+	    dockitem = BONOBO_DOCK_ITEM(widget);
 
-            if (dockitem == NULL || dockitem->is_floating)
-                return 0;
-            item_orientation = bonobo_dock_item_get_orientation(dockitem);
-        }
+	    if (dockitem == NULL || dockitem->is_floating)
+		return 0;
+	    item_orientation = bonobo_dock_item_get_orientation(dockitem);
+	}
 # else
 	GnomeDockItem *dockitem;
 
@@ -2953,9 +2953,9 @@
      */
     if (!(force_width && force_height)  &&  init_window_hints_state > 0)
     {
-        /* Don't do it! */
-        init_window_hints_state = 2;
-        return;
+	/* Don't do it! */
+	init_window_hints_state = 2;
+	return;
     }
 
     /* This also needs to be done when the main window isn't there yet,
@@ -2978,19 +2978,19 @@
      */
     if (force_width && force_height)
     {
-        min_width  = force_width;
-        min_height = force_height;
+	min_width  = force_width;
+	min_height = force_height;
     }
     else
     {
-        min_width  = width  + MIN_COLUMNS * gui.char_width;
-        min_height = height + MIN_LINES   * gui.char_height;
+	min_width  = width  + MIN_COLUMNS * gui.char_width;
+	min_height = height + MIN_LINES   * gui.char_height;
     }
 
     /* Avoid an expose event when the size didn't change. */
     if (width != old_width
 	    || height != old_height
-            || min_width != old_min_width
+	    || min_width != old_min_width
 	    || min_height != old_min_height
 	    || gui.char_width != old_char_width
 	    || gui.char_height != old_char_height)
@@ -3002,8 +3002,8 @@
 	geometry.height_inc  = gui.char_height;
 	geometry.base_width  = width;
 	geometry.base_height = height;
-        geometry.min_width   = min_width;
-        geometry.min_height  = min_height;
+	geometry.min_width   = min_width;
+	geometry.min_height  = min_height;
 	geometry_mask	     = GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC
 			       |GDK_HINT_MIN_SIZE;
 # ifdef HAVE_GTK2
@@ -3016,12 +3016,12 @@
 	gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin,
 				      &geometry, geometry_mask);
 # endif
-        old_width       = width;
-        old_height      = height;
-        old_min_width   = min_width;
-        old_min_height  = min_height;
-        old_char_width  = gui.char_width;
-        old_char_height = gui.char_height;
+	old_width       = width;
+	old_height      = height;
+	old_min_width   = min_width;
+	old_min_height  = min_height;
+	old_char_width  = gui.char_width;
+	old_char_height = gui.char_height;
     }
 }
 
@@ -3346,7 +3346,7 @@
 	gtk_notebook_remove_page(GTK_NOTEBOOK(gui.tabline), nr);
 
     if (gtk_notebook_current_page(GTK_NOTEBOOK(gui.tabline)) != curtabidx)
-        gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), curtabidx);
+	gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), curtabidx);
 
     /* Make sure everything is in place before drawing text. */
     gui_mch_update();
@@ -3366,7 +3366,7 @@
 
     ignore_tabline_evt = TRUE;
     if (gtk_notebook_current_page(GTK_NOTEBOOK(gui.tabline)) != nr - 1)
-        gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), nr - 1);
+	gtk_notebook_set_page(GTK_NOTEBOOK(gui.tabline), nr - 1);
     ignore_tabline_evt = FALSE;
 }
 
@@ -3678,7 +3678,7 @@
     {
 	GtkWidget *page, *label, *event_box;
 
-        /* Add the first tab. */
+	/* Add the first tab. */
 	page = gtk_vbox_new(FALSE, 0);
 	gtk_widget_show(page);
 	gtk_container_add(GTK_CONTAINER(gui.tabline), page);
@@ -3692,12 +3692,12 @@
 	gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, event_box);
     }
     gtk_signal_connect(GTK_OBJECT(gui.tabline), "switch_page",
-                       GTK_SIGNAL_FUNC(on_select_tab), NULL);
+		       GTK_SIGNAL_FUNC(on_select_tab), NULL);
 
     /* Create a popup menu for the tab line and connect it. */
     tabline_menu = create_tabline_menu();
     gtk_signal_connect_object(GTK_OBJECT(gui.tabline), "button_press_event",
-              GTK_SIGNAL_FUNC(on_tabline_menu), GTK_OBJECT(tabline_menu));
+	    GTK_SIGNAL_FUNC(on_tabline_menu), GTK_OBJECT(tabline_menu));
 #endif
 
     gui.formwin = gtk_form_new();
@@ -3797,22 +3797,22 @@
      */
     if (gtk_socket_id == 0)
     {
-        gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
-                               GTK_SIGNAL_FUNC(focus_out_event), NULL);
-        gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
-                               GTK_SIGNAL_FUNC(focus_in_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
+			       GTK_SIGNAL_FUNC(focus_out_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
+			       GTK_SIGNAL_FUNC(focus_in_event), NULL);
     }
     else
     {
-        gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_out_event",
-                               GTK_SIGNAL_FUNC(focus_out_event), NULL);
-        gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_in_event",
-                               GTK_SIGNAL_FUNC(focus_in_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_out_event",
+			       GTK_SIGNAL_FUNC(focus_out_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_in_event",
+			       GTK_SIGNAL_FUNC(focus_in_event), NULL);
 #ifdef FEAT_GUI_TABLINE
-        gtk_signal_connect(GTK_OBJECT(gui.tabline), "focus_out_event",
-                               GTK_SIGNAL_FUNC(focus_out_event), NULL);
-        gtk_signal_connect(GTK_OBJECT(gui.tabline), "focus_in_event",
-                               GTK_SIGNAL_FUNC(focus_in_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.tabline), "focus_out_event",
+			       GTK_SIGNAL_FUNC(focus_out_event), NULL);
+	gtk_signal_connect(GTK_OBJECT(gui.tabline), "focus_in_event",
+			       GTK_SIGNAL_FUNC(focus_in_event), NULL);
 #endif /* FEAT_GUI_TABLINE */
     }
 
@@ -3906,7 +3906,7 @@
      * Widths seem to sort themselves out, don't ask me why.
      */
     if (gtk_socket_id != 0)
-        usable_height -= (gui.char_height - (gui.char_height/2)); /* sic. */
+	usable_height -= (gui.char_height - (gui.char_height/2)); /* sic. */
 
     gtk_form_freeze(GTK_FORM(gui.formwin));
     gui_resize_shell(event->width, usable_height);
@@ -3958,10 +3958,10 @@
 {
     if (init_window_hints_state == 1)
     {
-        /* Safe to use normal hints now */
-        init_window_hints_state = 0;
-        update_window_manager_hints(0, 0);
-        return FALSE;   /* stop timer */
+	/* Safe to use normal hints now */
+	init_window_hints_state = 0;
+	update_window_manager_hints(0, 0);
+	return FALSE;   /* stop timer */
     }
 
     /* Keep on trying */
@@ -4034,25 +4034,25 @@
 	vim_free(gui.geom);
 	gui.geom = NULL;
 
-        /* From now until everyone's stopped trying to set the window hints
-         * to their correct minimum values, stop them being set as we need
-         * them to remain at our required size for the parent GtkSocket to
-         * give us the right initial size.
-         */
+	/* From now until everyone's stopped trying to set the window hints
+	 * to their correct minimum values, stop them being set as we need
+	 * them to remain at our required size for the parent GtkSocket to
+	 * give us the right initial size.
+	 */
 	if (gtk_socket_id != 0  &&  (mask & WidthValue || mask & HeightValue))
-        {
-            guint pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
-            guint pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
+	{
+	    guint pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
+	    guint pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
 
 #ifdef HAVE_GTK2
-            pixel_width  += get_menu_tool_width();
-            pixel_height += get_menu_tool_height();
+	    pixel_width  += get_menu_tool_width();
+	    pixel_height += get_menu_tool_height();
 #endif
 
-            update_window_manager_hints(pixel_width, pixel_height);
-            init_window_hints_state = 1;
-            g_timeout_add(1000, check_startup_plug_hints, NULL);
-        }
+	    update_window_manager_hints(pixel_width, pixel_height);
+	    init_window_hints_state = 1;
+	    g_timeout_add(1000, check_startup_plug_hints, NULL);
+	}
     }
 
     gtk_form_set_size(GTK_FORM(gui.formwin),
@@ -4299,7 +4299,7 @@
 #else  /* HAVE_GTK2 */
     /* this will cause the proper resizement to happen too */
     if (gtk_socket_id == 0)
-        update_window_manager_hints(0, 0);
+	update_window_manager_hints(0, 0);
 
     /* With GTK+ 2, changing the size of the form widget doesn't resize
      * the window.  So let's do it the other way around and resize the
@@ -4308,9 +4308,9 @@
     height += get_menu_tool_height();
 
     if (gtk_socket_id == 0)
-        gtk_window_resize(GTK_WINDOW(gui.mainwin), width, height);
+	gtk_window_resize(GTK_WINDOW(gui.mainwin), width, height);
     else
-        update_window_manager_hints(width, height);
+	update_window_manager_hints(width, height);
 
 #if 0
     if (!resize_idle_installed)
@@ -7176,4 +7176,3 @@
 # endif /* !HAVE_GTK2 */
 
 #endif /* FEAT_SIGN_ICONS */
-
diff --git a/src/gui_mac.c b/src/gui_mac.c
index 2513224..a9e6f5c 100644
--- a/src/gui_mac.c
+++ b/src/gui_mac.c
@@ -14,8 +14,8 @@
 
 /*
  * NOTES: - Vim 7+ does not support classic MacOS. Please use Vim 6.x
- *        - Comments mentioning FAQ refer to the book:
- *          "Macworld Mac Programming FAQs" from "IDG Books"
+ *	  - Comments mentioning FAQ refer to the book:
+ *	    "Macworld Mac Programming FAQs" from "IDG Books"
  */
 
 /*
@@ -3817,10 +3817,10 @@
     static void
 draw_undercurl(int flags, int row, int col, int cells)
 {
-    int                 x;
-    int                 offset;
-    const static int    val[8] = {1, 0, 0, 0, 1, 2, 2, 2 };
-    int                 y = FILL_Y(row + 1) - 1;
+    int			x;
+    int			offset;
+    const static int	val[8] = {1, 0, 0, 0, 1, 2, 2, 2 };
+    int			y = FILL_Y(row + 1) - 1;
 
     RGBForeColor(&specialColor);
 
diff --git a/src/gui_motif.c b/src/gui_motif.c
index f7b32d5..e29dd2a 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -3223,12 +3223,12 @@
     Pixel       *hsp;
 {
     XtVaGetValues(toolBar,
-            XmNbackground, bgp,
-            XmNforeground, fgp,
-            XmNbottomShadowColor, bsp,
-            XmNtopShadowColor, tsp,
-            XmNhighlightColor, hsp,
-            NULL);
+	    XmNbackground, bgp,
+	    XmNforeground, fgp,
+	    XmNbottomShadowColor, bsp,
+	    XmNtopShadowColor, tsp,
+	    XmNhighlightColor, hsp,
+	    NULL);
 }
 
 # ifdef FEAT_FOOTER
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 4b4e9a9..711fe82 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -897,8 +897,8 @@
 		{
 		    LPNMTTDISPINFO	lpdi;
 		    POINT		pt;
-		    static char         *tt_text = NULL;
-		    static int          tt_text_len = 0;
+		    static char		*tt_text = NULL;
+		    static int		tt_text_len = 0;
 
 		    /*
 		     * Mouse is over the GUI tabline. Display the tooltip
@@ -2474,18 +2474,18 @@
     get_work_area(&workarea_rect);
 
     *screen_w = workarea_rect.right - workarea_rect.left
-	        - GetSystemMetrics(SM_CXFRAME) * 2;
+		- GetSystemMetrics(SM_CXFRAME) * 2;
 
     /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
      * the menubar for MSwin, we subtract it from the screen height, so that
      * the window size can be made to fit on the screen. */
     *screen_h = workarea_rect.bottom - workarea_rect.top
-	        - GetSystemMetrics(SM_CYFRAME) * 2
+		- GetSystemMetrics(SM_CYFRAME) * 2
 		- GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
-	        - gui_mswin_get_menu_height(FALSE)
+		- gui_mswin_get_menu_height(FALSE)
 #endif
-	        ;
+		;
 }
 
 
@@ -4417,27 +4417,28 @@
     hDll = GetModuleHandle(comctl_dll);
     if (hDll != NULL)
     {
-        DLLGETVERSIONPROC pGetVer;
-        pGetVer = (DLLGETVERSIONPROC)GetProcAddress(hDll, "DllGetVersion");
+	DLLGETVERSIONPROC pGetVer;
+	pGetVer = (DLLGETVERSIONPROC)GetProcAddress(hDll, "DllGetVersion");
 
-        if (pGetVer != NULL)
-        {
-            DLLVERSIONINFO dvi;
-            HRESULT hr;
+	if (pGetVer != NULL)
+	{
+	    DLLVERSIONINFO dvi;
+	    HRESULT hr;
 
-            ZeroMemory(&dvi, sizeof(dvi));
-            dvi.cbSize = sizeof(dvi);
+	    ZeroMemory(&dvi, sizeof(dvi));
+	    dvi.cbSize = sizeof(dvi);
 
-            hr = (*pGetVer)(&dvi);
+	    hr = (*pGetVer)(&dvi);
 
-            if (SUCCEEDED(hr)
+	    if (SUCCEEDED(hr)
 		    && (dvi.dwMajorVersion > 4
-		    || (dvi.dwMajorVersion == 4 && dvi.dwMinorVersion >= 70)))
+			|| (dvi.dwMajorVersion == 4
+						&& dvi.dwMinorVersion >= 70)))
 	    {
 		multiline_tip = TRUE;
 		return multiline_tip;
 	    }
-        }
+	}
 	else
 	{
 	    /* there is chance we have ancient CommCtl 4.70
diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c
index 70e7df7..820aeba 100644
--- a/src/gui_xmebw.c
+++ b/src/gui_xmebw.c
@@ -142,56 +142,56 @@
 {
     {
 	/* core_class fields */
-	/* superclass            */ (WidgetClass) & xmPushButtonClassRec,
-	/* class_name            */ "XmEnhancedButton",
-	/* widget_size           */ sizeof(XmEnhancedButtonRec),
-	/* class_initialize      */ NULL,
+	/* superclass		 */ (WidgetClass) & xmPushButtonClassRec,
+	/* class_name		 */ "XmEnhancedButton",
+	/* widget_size		 */ sizeof(XmEnhancedButtonRec),
+	/* class_initialize	 */ NULL,
 	/* class_part_initialize */ NULL,
-	/* class_inited          */ False,
-	/* initialize            */ Initialize,
-	/* initialize_hook       */ NULL,
-	/* realize               */ XtInheritRealize,
-	/* actions               */ actionsList,
-	/* num_actions           */ XtNumber(actionsList),
-	/* resources             */ resources,
-	/* num_resources         */ XtNumber(resources),
-	/* xrm_class             */ NULLQUARK,
-	/* compress_motion       */ True,
-	/* compress_exposure     */ XtExposeCompressMaximal,
-	/* compress_enterleave   */ True,
-	/* visible_interest      */ False,
-	/* destroy               */ Destroy,
-	/* resize                */ XtInheritResize,
-	/* expose                */ Redisplay,
-	/* set_values            */ SetValues,
-	/* set_values_hook       */ NULL,
-	/* set_values_almost     */ XtInheritSetValuesAlmost,
-	/* get_values_hook       */ NULL,
-	/* accept_focus          */ XtInheritAcceptFocus,
-	/* version               */ XtVersion,
-	/* callback_private      */ NULL,
-	/* tm_table              */ NULL,
-	/* query_geometry        */ NULL,
-	/* display_accelerator   */ XtInheritDisplayAccelerator,
-	/* extension             */ NULL
+	/* class_inited		 */ False,
+	/* initialize		 */ Initialize,
+	/* initialize_hook	 */ NULL,
+	/* realize		 */ XtInheritRealize,
+	/* actions		 */ actionsList,
+	/* num_actions		 */ XtNumber(actionsList),
+	/* resources		 */ resources,
+	/* num_resources	 */ XtNumber(resources),
+	/* xrm_class		 */ NULLQUARK,
+	/* compress_motion	 */ True,
+	/* compress_exposure	 */ XtExposeCompressMaximal,
+	/* compress_enterleave	 */ True,
+	/* visible_interest	 */ False,
+	/* destroy		 */ Destroy,
+	/* resize		 */ XtInheritResize,
+	/* expose		 */ Redisplay,
+	/* set_values		 */ SetValues,
+	/* set_values_hook	 */ NULL,
+	/* set_values_almost	 */ XtInheritSetValuesAlmost,
+	/* get_values_hook	 */ NULL,
+	/* accept_focus		 */ XtInheritAcceptFocus,
+	/* version		 */ XtVersion,
+	/* callback_private	 */ NULL,
+	/* tm_table		 */ NULL,
+	/* query_geometry	 */ NULL,
+	/* display_accelerator	 */ XtInheritDisplayAccelerator,
+	/* extension		 */ NULL
     },
 
     /* primitive_class fields */
     {
-	/* border highlight      */ BorderHighlight,
-	/* border_unhighlight    */ BorderUnhighlight,
-	/* translations          */ XtInheritTranslations,
-	/* arm and activate      */ XmInheritArmAndActivate,
-	/* synthetic resources   */ NULL,
-	/* number of syn res     */ 0,
-	/* extension             */ NULL,
+	/* border highlight	 */ BorderHighlight,
+	/* border_unhighlight	 */ BorderUnhighlight,
+	/* translations		 */ XtInheritTranslations,
+	/* arm and activate	 */ XmInheritArmAndActivate,
+	/* synthetic resources	 */ NULL,
+	/* number of syn res	 */ 0,
+	/* extension		 */ NULL,
     },
 
     /* label_class fields */
     {
-	/* setOverrideCallback   */ XmInheritSetOverrideCallback,
-	/* menuProcs             */ XmInheritMenuProc,
-	/* translations          */ XtInheritTranslations,
+	/* setOverrideCallback	 */ XmInheritSetOverrideCallback,
+	/* menuProcs		 */ XmInheritMenuProc,
+	/* translations		 */ XtInheritTranslations,
 	/* extension		 */ NULL,
     },
 
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 3b4c2d12..60c5e83 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -106,7 +106,7 @@
 # define OPT_MBFONT_USECOURIER  0
 # define OPT_MBFONT_ASCII       1
 # define OPT_MBFONT_REGULAR     2
-# define OPT_MBFONT_BOLD        3
+# define OPT_MBFONT_BOLD	3
 # define OPT_MBFONT_OBLIQUE     4
 # define OPT_MBFONT_BOLDOBLIQUE 5
 # define OPT_MBFONT_NUM_OPTIONS 6
@@ -1075,20 +1075,20 @@
 #define CS_JIS_C_1978   (0x01)
 #define CS_JIS_X_1983   (0x02)
 #define CS_JIS_X_1990   (0x04)
-#define CS_NEC          (0x08)
-#define CS_MSWINDOWS    (0x10)
-#define CS_CP932        (0x20)
-#define CS_KANJITALK6   (0x40)
+#define CS_NEC		(0x08)
+#define CS_MSWINDOWS	(0x10)
+#define CS_CP932	(0x20)
+#define CS_KANJITALK6	(0x40)
 #define CS_KANJITALK7   (0x80)
 
 /* Japanese encodings and charsets */
 static struct prt_ps_encoding_S j_encodings[] =
 {
     {"iso-2022-jp", NULL,       (CS_JIS_C_1978|CS_JIS_X_1983|CS_JIS_X_1990|
-                                                                    CS_NEC)},
-    {"euc-jp",      "EUC",      (CS_JIS_C_1978|CS_JIS_X_1983|CS_JIS_X_1990)},
-    {"sjis",        "RKSJ",     (CS_JIS_C_1978|CS_JIS_X_1983|CS_MSWINDOWS|
-                                                CS_KANJITALK6|CS_KANJITALK7)},
+								    CS_NEC)},
+    {"euc-jp",	    "EUC",	(CS_JIS_C_1978|CS_JIS_X_1983|CS_JIS_X_1990)},
+    {"sjis",	    "RKSJ",	(CS_JIS_C_1978|CS_JIS_X_1983|CS_MSWINDOWS|
+						CS_KANJITALK6|CS_KANJITALK7)},
     {"cp932",       "RKSJ",     CS_JIS_X_1983},
     {"ucs-2",       "UCS2",     CS_JIS_X_1990},
     {"utf-8",       "UTF8" ,    CS_JIS_X_1990}
@@ -1098,7 +1098,7 @@
     {"JIS_C_1978",  "78",       CS_JIS_C_1978},
     {"JIS_X_1983",  NULL,       CS_JIS_X_1983},
     {"JIS_X_1990",  "Hojo",     CS_JIS_X_1990},
-    {"NEC",         "Ext",      CS_NEC},
+    {"NEC",	    "Ext",	CS_NEC},
     {"MSWINDOWS",   "90ms",     CS_MSWINDOWS},
     {"CP932",       "90ms",     CS_JIS_X_1983},
     {"KANJITALK6",  "83pv",     CS_KANJITALK6},
@@ -1107,10 +1107,10 @@
 
 #define CS_GB_2312_80       (0x01)
 #define CS_GBT_12345_90     (0x02)
-#define CS_GBK2K            (0x04)
-#define CS_SC_MAC           (0x08)
-#define CS_GBT_90_MAC       (0x10)
-#define CS_GBK              (0x20)
+#define CS_GBK2K	    (0x04)
+#define CS_SC_MAC	    (0x08)
+#define CS_GBT_90_MAC	    (0x10)
+#define CS_GBK		    (0x20)
 #define CS_SC_ISO10646      (0x40)
 
 /* Simplified Chinese encodings and charsets */
@@ -1119,8 +1119,8 @@
     {"iso-2022",    NULL,       (CS_GB_2312_80|CS_GBT_12345_90)},
     {"gb18030",     NULL,       CS_GBK2K},
     {"euc-cn",      "EUC",      (CS_GB_2312_80|CS_GBT_12345_90|CS_SC_MAC|
-                                                                CS_GBT_90_MAC)},
-    {"gbk",         "EUC",      CS_GBK},
+								CS_GBT_90_MAC)},
+    {"gbk",	    "EUC",	CS_GBK},
     {"ucs-2",       "UCS2",     CS_SC_ISO10646},
     {"utf-8",       "UTF8",     CS_SC_ISO10646}
 };
@@ -1128,9 +1128,9 @@
 {
     {"GB_2312-80",  "GB",       CS_GB_2312_80},
     {"GBT_12345-90","GBT",      CS_GBT_12345_90},
-    {"MAC",         "GBpc",     CS_SC_MAC},
-    {"GBT-90_MAC",  "GBTpc",    CS_GBT_90_MAC},
-    {"GBK",         "GBK",      CS_GBK},
+    {"MAC",	    "GBpc",	CS_SC_MAC},
+    {"GBT-90_MAC",  "GBTpc",	CS_GBT_90_MAC},
+    {"GBK",	    "GBK",	CS_GBK},
     {"GB18030",     "GBK2K",    CS_GBK2K},
     {"ISO10646",    "UniGB",    CS_SC_ISO10646}
 };
@@ -1138,25 +1138,25 @@
 #define CS_CNS_PLANE_1      (0x01)
 #define CS_CNS_PLANE_2      (0x02)
 #define CS_CNS_PLANE_1_2    (0x04)
-#define CS_B5               (0x08)
-#define CS_ETEN             (0x10)
-#define CS_HK_GCCS          (0x20)
-#define CS_HK_SCS           (0x40)
-#define CS_HK_SCS_ETEN      (0x80)
-#define CS_MTHKL            (0x100)
-#define CS_MTHKS            (0x200)
-#define CS_DLHKL            (0x400)
-#define CS_DLHKS            (0x800)
-#define CS_TC_ISO10646      (0x1000)
+#define CS_B5		    (0x08)
+#define CS_ETEN		    (0x10)
+#define CS_HK_GCCS	    (0x20)
+#define CS_HK_SCS	    (0x40)
+#define CS_HK_SCS_ETEN	    (0x80)
+#define CS_MTHKL	    (0x100)
+#define CS_MTHKS	    (0x200)
+#define CS_DLHKL	    (0x400)
+#define CS_DLHKS	    (0x800)
+#define CS_TC_ISO10646	    (0x1000)
 
 /* Traditional Chinese encodings and charsets */
 static struct prt_ps_encoding_S tc_encodings[] =
 {
     {"iso-2022",    NULL,       (CS_CNS_PLANE_1|CS_CNS_PLANE_2)},
     {"euc-tw",      "EUC",      CS_CNS_PLANE_1_2},
-    {"big5",        "B5",       (CS_B5|CS_ETEN|CS_HK_GCCS|CS_HK_SCS|
-                                    CS_HK_SCS_ETEN|CS_MTHKL|CS_MTHKS|CS_DLHKL|
-                                                                    CS_DLHKS)},
+    {"big5",	    "B5",	(CS_B5|CS_ETEN|CS_HK_GCCS|CS_HK_SCS|
+				    CS_HK_SCS_ETEN|CS_MTHKL|CS_MTHKS|CS_DLHKL|
+								    CS_DLHKS)},
     {"cp950",       "B5",       CS_B5},
     {"ucs-2",       "UCS2",     CS_TC_ISO10646},
     {"utf-8",       "UTF8",     CS_TC_ISO10646},
@@ -1168,11 +1168,11 @@
     {"CNS_1992_1",  "CNS1",     CS_CNS_PLANE_1},
     {"CNS_1992_2",  "CNS2",     CS_CNS_PLANE_2},
     {"CNS_1993",    "CNS",      CS_CNS_PLANE_1_2},
-    {"BIG5",        NULL,       CS_B5},
-    {"CP950",       NULL,       CS_B5},
-    {"ETEN",        "ETen",     CS_ETEN},
-    {"HK_GCCS",     "HKgccs",   CS_HK_GCCS},
-    {"SCS",         "HKscs",    CS_HK_SCS},
+    {"BIG5",	    NULL,	CS_B5},
+    {"CP950",	    NULL,	CS_B5},
+    {"ETEN",	    "ETen",	CS_ETEN},
+    {"HK_GCCS",     "HKgccs",	CS_HK_GCCS},
+    {"SCS",	    "HKscs",	CS_HK_SCS},
     {"SCS_ETEN",    "ETHK",     CS_HK_SCS_ETEN},
     {"MTHKL",       "HKm471",   CS_MTHKL},
     {"MTHKS",       "HKm314",   CS_MTHKS},
@@ -1181,8 +1181,8 @@
     {"ISO10646",    "UniCNS",   CS_TC_ISO10646}
 };
 
-#define CS_KR_X_1992        (0x01)
-#define CS_KR_MAC           (0x02)
+#define CS_KR_X_1992	    (0x01)
+#define CS_KR_MAC	    (0x02)
 #define CS_KR_X_1992_MS     (0x04)
 #define CS_KR_ISO10646      (0x08)
 
@@ -1193,7 +1193,7 @@
     {"euc-kr",      "EUC",      (CS_KR_X_1992|CS_KR_MAC)},
     {"johab",       "Johab",    CS_KR_X_1992},
     {"cp1361",      "Johab",    CS_KR_X_1992},
-    {"uhc",         "UHC",      CS_KR_X_1992_MS},
+    {"uhc",	    "UHC",	CS_KR_X_1992_MS},
     {"cp949",       "UHC",      CS_KR_X_1992_MS},
     {"ucs-2",       "UCS2",     CS_KR_ISO10646},
     {"utf-8",       "UTF8",     CS_KR_ISO10646}
@@ -1202,7 +1202,7 @@
 {
     {"KS_X_1992",   "KSC",      CS_KR_X_1992},
     {"CP1361",      "KSC",      CS_KR_X_1992},
-    {"MAC",         "KSCpc",    CS_KR_MAC},
+    {"MAC",	    "KSCpc",	CS_KR_MAC},
     {"MSWINDOWS",   "KSCms",    CS_KR_X_1992_MS},
     {"CP949",       "KSCms",    CS_KR_X_1992_MS},
     {"WANSUNG",     "KSCms",    CS_KR_X_1992_MS},
@@ -1212,47 +1212,47 @@
 /* Collections of encodings and charsets for multi-byte printing */
 struct prt_ps_mbfont_S
 {
-    int                         num_encodings;
-    struct prt_ps_encoding_S    *encodings;
-    int                         num_charsets;
-    struct prt_ps_charset_S     *charsets;
-    char                        *ascii_enc;
-    char                        *defcs;
+    int				num_encodings;
+    struct prt_ps_encoding_S	*encodings;
+    int				num_charsets;
+    struct prt_ps_charset_S	*charsets;
+    char			*ascii_enc;
+    char			*defcs;
 };
 
 static struct prt_ps_mbfont_S prt_ps_mbfonts[] =
 {
     {
-        NUM_ELEMENTS(j_encodings),
-        j_encodings,
-        NUM_ELEMENTS(j_charsets),
-        j_charsets,
-        "jis_roman",
-        "JIS_X_1983"
+	NUM_ELEMENTS(j_encodings),
+	j_encodings,
+	NUM_ELEMENTS(j_charsets),
+	j_charsets,
+	"jis_roman",
+	"JIS_X_1983"
     },
     {
-        NUM_ELEMENTS(sc_encodings),
-        sc_encodings,
-        NUM_ELEMENTS(sc_charsets),
-        sc_charsets,
-        "gb_roman",
-        "GB_2312-80"
+	NUM_ELEMENTS(sc_encodings),
+	sc_encodings,
+	NUM_ELEMENTS(sc_charsets),
+	sc_charsets,
+	"gb_roman",
+	"GB_2312-80"
     },
     {
-        NUM_ELEMENTS(tc_encodings),
-        tc_encodings,
-        NUM_ELEMENTS(tc_charsets),
-        tc_charsets,
-        "cns_roman",
-        "BIG5"
+	NUM_ELEMENTS(tc_encodings),
+	tc_encodings,
+	NUM_ELEMENTS(tc_charsets),
+	tc_charsets,
+	"cns_roman",
+	"BIG5"
     },
     {
-        NUM_ELEMENTS(k_encodings),
-        k_encodings,
-        NUM_ELEMENTS(k_charsets),
-        k_charsets,
-        "ks_roman",
-        "KS_X_1992"
+	NUM_ELEMENTS(k_encodings),
+	k_encodings,
+	NUM_ELEMENTS(k_charsets),
+	k_charsets,
+	"ks_roman",
+	"KS_X_1992"
     }
 };
 #endif /* FEAT_MBYTE */
@@ -1299,19 +1299,19 @@
 #define PRT_RESOURCE_RESOURCE	    "Resource-"
 #define PRT_RESOURCE_PROCSET	    "ProcSet"
 #define PRT_RESOURCE_ENCODING	    "Encoding"
-#define PRT_RESOURCE_CMAP           "CMap"
+#define PRT_RESOURCE_CMAP	    "CMap"
 
 
 /* Data for table based DSC comment recognition, easy to extend if VIM needs to
  * read more comments. */
-#define PRT_DSC_MISC_TYPE           (-1)
-#define PRT_DSC_TITLE_TYPE          (1)
-#define PRT_DSC_VERSION_TYPE        (2)
+#define PRT_DSC_MISC_TYPE	    (-1)
+#define PRT_DSC_TITLE_TYPE	    (1)
+#define PRT_DSC_VERSION_TYPE	    (2)
 #define PRT_DSC_ENDCOMMENTS_TYPE    (3)
 
-#define PRT_DSC_TITLE	            "%%Title:"
-#define PRT_DSC_VERSION	            "%%Version:"
-#define PRT_DSC_ENDCOMMENTS         "%%EndComments:"
+#define PRT_DSC_TITLE		    "%%Title:"
+#define PRT_DSC_VERSION		    "%%Version:"
+#define PRT_DSC_ENDCOMMENTS	    "%%EndComments:"
 
 struct prt_dsc_comment_S
 {
@@ -1538,7 +1538,7 @@
     prt_write_file(prt_line_buffer);
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
-        sprintf((char *)prt_line_buffer, "/%s %d %f /_%s sffs\n",
+	sprintf((char *)prt_line_buffer, "/%s %d %f /_%s sffs\n",
 		       new_name, height, 500./prt_ps_courier_font.wx, new_name);
     else
 #endif
@@ -1704,7 +1704,7 @@
 		prt_do_moveto = FALSE;
 	    }
 
-            /* Underline length of text run */
+	    /* Underline length of text run */
 	    prt_write_real(prt_text_run, 2);
 	    prt_write_string("ul\n");
 	}
@@ -1712,18 +1712,18 @@
 	 * Note: we write text out raw - EBCDIC conversion is handled in the
 	 * PostScript world via the font encoding vector. */
 #ifdef FEAT_MBYTE
-        if (prt_out_mbyte)
-            prt_write_string("<");
-        else
+	if (prt_out_mbyte)
+	    prt_write_string("<");
+	else
 #endif
-            prt_write_string("(");
+	    prt_write_string("(");
 	prt_write_file_raw_len(prt_ps_buffer.ga_data, prt_ps_buffer.ga_len);
 #ifdef FEAT_MBYTE
-        if (prt_out_mbyte)
-            prt_write_string(">");
-        else
+	if (prt_out_mbyte)
+	    prt_write_string(">");
+	else
 #endif
-            prt_write_string(")");
+	    prt_write_string(")");
 	/* Add a moveto if need be and use the appropriate show procedure */
 	if (prt_do_moveto)
 	{
@@ -1800,19 +1800,19 @@
     index = prt_resfile.line_end + 1;
     while (index < prt_resfile.len)
     {
-        if (prt_resfile.buffer[index] != PSLF && prt_resfile.buffer[index]
-                                                                        != PSCR)
-            break;
-        index++;
+	if (prt_resfile.buffer[index] != PSLF && prt_resfile.buffer[index]
+									!= PSCR)
+	    break;
+	index++;
     }
     prt_resfile.line_start = index;
 
     while (index < prt_resfile.len)
     {
-        if (prt_resfile.buffer[index] == PSLF || prt_resfile.buffer[index]
-                                                                        == PSCR)
-            break;
-        index++;
+	if (prt_resfile.buffer[index] == PSLF || prt_resfile.buffer[index]
+									== PSCR)
+	    break;
+	index++;
     }
     prt_resfile.line_end = index;
 
@@ -1827,10 +1827,10 @@
 {
     /* Force not equal if string is longer than remainder of line */
     if (len > (prt_resfile.line_end - (prt_resfile.line_start + offset)))
-        return 1;
+	return 1;
 
     return STRNCMP(&prt_resfile.buffer[prt_resfile.line_start + offset],
-                                                                string, len);
+								string, len);
 }
 
     static int
@@ -1842,9 +1842,9 @@
     index = prt_resfile.line_start + offset;
     while (index < prt_resfile.line_end)
     {
-        if (isspace(prt_resfile.buffer[index]))
-            return index - prt_resfile.line_start;
-        index++;
+	if (isspace(prt_resfile.buffer[index]))
+	    return index - prt_resfile.line_start;
+	index++;
     }
     return -1;
 }
@@ -1858,9 +1858,9 @@
     index = prt_resfile.line_start + offset;
     while (index < prt_resfile.line_end)
     {
-        if (!isspace(prt_resfile.buffer[index]))
-            return index - prt_resfile.line_start;
-        index++;
+	if (!isspace(prt_resfile.buffer[index]))
+	    return index - prt_resfile.line_start;
+	index++;
     }
     return -1;
 }
@@ -1876,37 +1876,37 @@
 
     /* Move to start of next line */
     if (!prt_resfile_next_line())
-        return FALSE;
+	return FALSE;
 
     /* DSC comments always start %% */
     if (prt_resfile_strncmp(0, "%%", 2) != 0)
-        return FALSE;
+	return FALSE;
 
     /* Find type of DSC comment */
     for (comment = 0; comment < NUM_ELEMENTS(prt_dsc_table); comment++)
-        if (prt_resfile_strncmp(0, prt_dsc_table[comment].string,
-                                            prt_dsc_table[comment].len) == 0)
-            break;
+	if (prt_resfile_strncmp(0, prt_dsc_table[comment].string,
+					    prt_dsc_table[comment].len) == 0)
+	    break;
 
     if (comment != NUM_ELEMENTS(prt_dsc_table))
     {
-        /* Return type of comment */
-        p_dsc_line->type = prt_dsc_table[comment].type;
-        offset = prt_dsc_table[comment].len;
+	/* Return type of comment */
+	p_dsc_line->type = prt_dsc_table[comment].type;
+	offset = prt_dsc_table[comment].len;
     }
     else
     {
-        /* Unrecognised DSC comment, skip to ws after comment leader */
-        p_dsc_line->type = PRT_DSC_MISC_TYPE;
-        offset = prt_resfile_skip_nonws(0);
-        if (offset == -1)
-            return FALSE;
+	/* Unrecognised DSC comment, skip to ws after comment leader */
+	p_dsc_line->type = PRT_DSC_MISC_TYPE;
+	offset = prt_resfile_skip_nonws(0);
+	if (offset == -1)
+	    return FALSE;
     }
 
     /* Skip ws to comment value */
     offset = prt_resfile_skip_ws(offset);
     if (offset == -1)
-        return FALSE;
+	return FALSE;
 
     p_dsc_line->string = &prt_resfile.buffer[prt_resfile.line_start + offset];
     p_dsc_line->len = prt_resfile.line_end - (prt_resfile.line_start + offset);
@@ -1921,10 +1921,10 @@
 prt_open_resource(resource)
     struct prt_ps_resource_S *resource;
 {
-    int         offset;
-    int         seen_all;
-    int         seen_title;
-    int         seen_version;
+    int		offset;
+    int		seen_all;
+    int		seen_title;
+    int		seen_version;
     FILE	*fd_resource;
     struct prt_dsc_line_S dsc_line;
 
@@ -1938,7 +1938,7 @@
 
     /* Parse first line to ensure valid resource file */
     prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u),
-                                            PRT_FILE_BUFFER_LEN, fd_resource);
+					    PRT_FILE_BUFFER_LEN, fd_resource);
     if (ferror(fd_resource))
     {
 	EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
@@ -1950,7 +1950,7 @@
     prt_resfile.line_end = -1;
     prt_resfile.line_start = 0;
     if (!prt_resfile_next_line())
-        return FALSE;
+	return FALSE;
 
     offset = 0;
 
@@ -1967,10 +1967,10 @@
     offset += (int)STRLEN(PRT_RESOURCE_HEADER);
     offset = prt_resfile_skip_nonws(offset);
     if (offset == -1)
-        return FALSE;
+	return FALSE;
     offset = prt_resfile_skip_ws(offset);
     if (offset == -1)
-        return FALSE;
+	return FALSE;
 
     if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE,
 				     (int)STRLEN(PRT_RESOURCE_RESOURCE)) != 0)
@@ -2008,31 +2008,31 @@
     seen_all = FALSE;
     while (!seen_all && prt_next_dsc(&dsc_line))
     {
-        switch (dsc_line.type)
-        {
-        case PRT_DSC_TITLE_TYPE:
-            vim_strncpy(resource->title, dsc_line.string, dsc_line.len);
-            seen_title = TRUE;
-            if (seen_version)
-                seen_all = TRUE;
-            break;
+	switch (dsc_line.type)
+	{
+	case PRT_DSC_TITLE_TYPE:
+	    vim_strncpy(resource->title, dsc_line.string, dsc_line.len);
+	    seen_title = TRUE;
+	    if (seen_version)
+		seen_all = TRUE;
+	    break;
 
-        case PRT_DSC_VERSION_TYPE:
-            vim_strncpy(resource->version, dsc_line.string, dsc_line.len);
-            seen_version = TRUE;
-            if (seen_title)
-                seen_all = TRUE;
-            break;
+	case PRT_DSC_VERSION_TYPE:
+	    vim_strncpy(resource->version, dsc_line.string, dsc_line.len);
+	    seen_version = TRUE;
+	    if (seen_title)
+		seen_all = TRUE;
+	    break;
 
-        case PRT_DSC_ENDCOMMENTS_TYPE:
-            /* Wont find title or resource after this comment, stop searching */
-            seen_all = TRUE;
-            break;
+	case PRT_DSC_ENDCOMMENTS_TYPE:
+	    /* Wont find title or resource after this comment, stop searching */
+	    seen_all = TRUE;
+	    break;
 
-        case PRT_DSC_MISC_TYPE:
-            /* Not interested in whatever comment this line had */
-            break;
-        }
+	case PRT_DSC_MISC_TYPE:
+	    /* Not interested in whatever comment this line had */
+	    break;
+	}
     }
 
     if (!seen_title || !seen_version)
@@ -2151,10 +2151,10 @@
     int     i;
 
     prt_dsc_resources(resource, "font",
-                                    ps_font->ps_fontname[PRT_PS_FONT_ROMAN]);
+				    ps_font->ps_fontname[PRT_PS_FONT_ROMAN]);
     for (i = PRT_PS_FONT_BOLD ; i <= PRT_PS_FONT_BOLDOBLIQUE ; i++)
-        if (ps_font->ps_fontname[i] != NULL)
-            prt_dsc_resources(NULL, "font", ps_font->ps_fontname[i]);
+	if (ps_font->ps_fontname[i] != NULL)
+	    prt_dsc_resources(NULL, "font", ps_font->ps_fontname[i]);
 }
 
     static void
@@ -2228,18 +2228,18 @@
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        int     i;
+	int     i;
 
-        /* Free off all CID font names created, but first clear duplicate
-         * pointers to the same string (when the same font is used for more than
-         * one style).
-         */
-        for (i = PRT_PS_FONT_ROMAN; i <= PRT_PS_FONT_BOLDOBLIQUE; i++)
-        {
-            if (prt_ps_mb_font.ps_fontname[i] != NULL)
-                vim_free(prt_ps_mb_font.ps_fontname[i]);
-            prt_ps_mb_font.ps_fontname[i] = NULL;
-        }
+	/* Free off all CID font names created, but first clear duplicate
+	 * pointers to the same string (when the same font is used for more than
+	 * one style).
+	 */
+	for (i = PRT_PS_FONT_ROMAN; i <= PRT_PS_FONT_BOLDOBLIQUE; i++)
+	{
+	    if (prt_ps_mb_font.ps_fontname[i] != NULL)
+		vim_free(prt_ps_mb_font.ps_fontname[i]);
+	    prt_ps_mb_font.ps_fontname[i] = NULL;
+	}
     }
 
     if (prt_do_conv)
@@ -2334,11 +2334,11 @@
     {
 	prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width;
 #ifdef FEAT_MBYTE
-        /* If we are outputting multi-byte characters then line numbers will be
-         * printed with half width characters
-         */
-        if (prt_out_mbyte)
-            prt_number_width /= 2;
+	/* If we are outputting multi-byte characters then line numbers will be
+	 * printed with half width characters
+	 */
+	if (prt_out_mbyte)
+	    prt_number_width /= 2;
 #endif
 	prt_left_margin += prt_number_width;
     }
@@ -2359,7 +2359,7 @@
 
     fontname = (char *)alloc(name_len + 1);
     if (fontname == NULL)
-        return FALSE;
+	return FALSE;
     vim_strncpy((char_u *)fontname, name, name_len);
     prt_ps_mb_font.ps_fontname[font] = fontname;
 
@@ -2418,12 +2418,12 @@
     p_mbenc = p_cmap->encodings;
     for (mbenc = 0; mbenc < p_cmap->num_encodings; mbenc++)
     {
-        if (STRNICMP(p_mbenc->encoding, p_encoding, enc_len) == 0)
-        {
-            *pp_mbenc = p_mbenc;
-            return TRUE;
-        }
-        p_mbenc++;
+	if (STRNICMP(p_mbenc->encoding, p_encoding, enc_len) == 0)
+	{
+	    *pp_mbenc = p_mbenc;
+	    return TRUE;
+	}
+	p_mbenc++;
     }
     return FALSE;
 }
@@ -2440,17 +2440,17 @@
 
     /* Look for recognised character set, using default if one is not given */
     if (*p_charset == NUL)
-        p_charset = p_cmap->defcs;
+	p_charset = p_cmap->defcs;
     char_len = (int)STRLEN(p_charset);
     p_mbchar = p_cmap->charsets;
     for (mbchar = 0; mbchar < p_cmap->num_charsets; mbchar++)
     {
-        if (STRNICMP(p_mbchar->charset, p_charset, char_len) == 0)
-        {
-            *pp_mbchar = p_mbchar;
-            return TRUE;
-        }
-        p_mbchar++;
+	if (STRNICMP(p_mbchar->charset, p_charset, char_len) == 0)
+	{
+	    *pp_mbchar = p_mbchar;
+	    return TRUE;
+	}
+	p_mbchar++;
     }
     return FALSE;
 }
@@ -2473,8 +2473,8 @@
     double      top;
     double      bottom;
 #ifdef FEAT_MBYTE
-    int         props;
-    int         cmap = 0;
+    int		props;
+    int		cmap = 0;
     char_u	*p_encoding;
     struct prt_ps_encoding_S *p_mbenc;
     struct prt_ps_encoding_S *p_mbenc_first;
@@ -2505,7 +2505,7 @@
 #ifdef FEAT_MBYTE
     p_encoding = enc_skip(p_penc);
     if (*p_encoding == NUL)
-        p_encoding = enc_skip(p_enc);
+	p_encoding = enc_skip(p_enc);
 
     /* Look for recognised multi-byte coding, and if the charset is recognised.
      * This is to cope with the fact that various unicode encodings are
@@ -2514,119 +2514,119 @@
     props = enc_canon_props(p_encoding);
     if (!(props & ENC_8BIT) && (*p_penc != NUL || *p_pmcs != NUL))
     {
-        p_mbenc_first = NULL;
-        p_mbchar = NULL;
-        for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
-            if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
+	p_mbenc_first = NULL;
+	p_mbchar = NULL;
+	for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
+	    if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
 								    &p_mbenc))
-            {
-                if (p_mbenc_first == NULL)
-                    p_mbenc_first = p_mbenc;
-                if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap],
+	    {
+		if (p_mbenc_first == NULL)
+		    p_mbenc_first = p_mbenc;
+		if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap],
 								   &p_mbchar))
-                    break;
-            }
+		    break;
+	    }
 
-        /* Use first encoding matched if no charset matched */
-        if (p_mbchar == NULL && p_mbenc_first != NULL)
-            p_mbenc = p_mbenc_first;
+	/* Use first encoding matched if no charset matched */
+	if (p_mbchar == NULL && p_mbenc_first != NULL)
+	    p_mbenc = p_mbenc_first;
     }
 
     prt_out_mbyte = (p_mbenc != NULL);
     if (prt_out_mbyte)
     {
-        /* Build CMap name - will be same for all multi-byte fonts used */
-        prt_cmap[0] = NUL;
+	/* Build CMap name - will be same for all multi-byte fonts used */
+	prt_cmap[0] = NUL;
 
-        prt_custom_cmap = (p_mbchar == NULL);
-        if (!prt_custom_cmap)
-        {
-            /* Check encoding and character set are compatible */
-            if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0)
-            {
-                EMSG(_("E673: Incompatible multi-byte encoding and character set."));
-                return FALSE;
-            }
+	prt_custom_cmap = (p_mbchar == NULL);
+	if (!prt_custom_cmap)
+	{
+	    /* Check encoding and character set are compatible */
+	    if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0)
+	    {
+		EMSG(_("E673: Incompatible multi-byte encoding and character set."));
+		return FALSE;
+	    }
 
-            /* Add charset name if not empty */
-            if (p_mbchar->cmap_charset != NULL)
-            {
-                vim_strncpy((char_u *)prt_cmap,
+	    /* Add charset name if not empty */
+	    if (p_mbchar->cmap_charset != NULL)
+	    {
+		vim_strncpy((char_u *)prt_cmap,
 		      (char_u *)p_mbchar->cmap_charset, sizeof(prt_cmap) - 3);
-                STRCAT(prt_cmap, "-");
-            }
-        }
-        else
-        {
-            /* Add custom CMap character set name */
-            if (*p_pmcs == NUL)
-            {
-                EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
-                return FALSE;
-            }
-            vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3);
-            STRCAT(prt_cmap, "-");
-        }
+		STRCAT(prt_cmap, "-");
+	    }
+	}
+	else
+	{
+	    /* Add custom CMap character set name */
+	    if (*p_pmcs == NUL)
+	    {
+		EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
+		return FALSE;
+	    }
+	    vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3);
+	    STRCAT(prt_cmap, "-");
+	}
 
-        /* CMap name ends with (optional) encoding name and -H for horizontal */
-        if (p_mbenc->cmap_encoding != NULL && STRLEN(prt_cmap)
+	/* CMap name ends with (optional) encoding name and -H for horizontal */
+	if (p_mbenc->cmap_encoding != NULL && STRLEN(prt_cmap)
 		      + STRLEN(p_mbenc->cmap_encoding) + 3 < sizeof(prt_cmap))
-        {
-            STRCAT(prt_cmap, p_mbenc->cmap_encoding);
-            STRCAT(prt_cmap, "-");
-        }
-        STRCAT(prt_cmap, "H");
+	{
+	    STRCAT(prt_cmap, p_mbenc->cmap_encoding);
+	    STRCAT(prt_cmap, "-");
+	}
+	STRCAT(prt_cmap, "H");
 
-        if (!mbfont_opts[OPT_MBFONT_REGULAR].present)
-        {
-            EMSG(_("E675: No default font specified for multi-byte printing."));
-            return FALSE;
-        }
+	if (!mbfont_opts[OPT_MBFONT_REGULAR].present)
+	{
+	    EMSG(_("E675: No default font specified for multi-byte printing."));
+	    return FALSE;
+	}
 
-        /* Derive CID font names with fallbacks if not defined */
-        if (!prt_build_cid_fontname(PRT_PS_FONT_ROMAN,
-                                    mbfont_opts[OPT_MBFONT_REGULAR].string,
-                                    mbfont_opts[OPT_MBFONT_REGULAR].strlen))
-            return FALSE;
-        if (mbfont_opts[OPT_MBFONT_BOLD].present)
-            if (!prt_build_cid_fontname(PRT_PS_FONT_BOLD,
-                                        mbfont_opts[OPT_MBFONT_BOLD].string,
-                                        mbfont_opts[OPT_MBFONT_BOLD].strlen))
-                return FALSE;
-        if (mbfont_opts[OPT_MBFONT_OBLIQUE].present)
-            if (!prt_build_cid_fontname(PRT_PS_FONT_OBLIQUE,
-                                        mbfont_opts[OPT_MBFONT_OBLIQUE].string,
-                                        mbfont_opts[OPT_MBFONT_OBLIQUE].strlen))
-                return FALSE;
-        if (mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].present)
-            if (!prt_build_cid_fontname(PRT_PS_FONT_BOLDOBLIQUE,
+	/* Derive CID font names with fallbacks if not defined */
+	if (!prt_build_cid_fontname(PRT_PS_FONT_ROMAN,
+				    mbfont_opts[OPT_MBFONT_REGULAR].string,
+				    mbfont_opts[OPT_MBFONT_REGULAR].strlen))
+	    return FALSE;
+	if (mbfont_opts[OPT_MBFONT_BOLD].present)
+	    if (!prt_build_cid_fontname(PRT_PS_FONT_BOLD,
+					mbfont_opts[OPT_MBFONT_BOLD].string,
+					mbfont_opts[OPT_MBFONT_BOLD].strlen))
+		return FALSE;
+	if (mbfont_opts[OPT_MBFONT_OBLIQUE].present)
+	    if (!prt_build_cid_fontname(PRT_PS_FONT_OBLIQUE,
+					mbfont_opts[OPT_MBFONT_OBLIQUE].string,
+					mbfont_opts[OPT_MBFONT_OBLIQUE].strlen))
+		return FALSE;
+	if (mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].present)
+	    if (!prt_build_cid_fontname(PRT_PS_FONT_BOLDOBLIQUE,
 				   mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].string,
 				  mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].strlen))
-                return FALSE;
+		return FALSE;
 
-        /* Check if need to use Courier for ASCII code range, and if so pick up
-         * the encoding to use */
-        prt_use_courier = mbfont_opts[OPT_MBFONT_USECOURIER].present &&
-            (TOLOWER_ASC(mbfont_opts[OPT_MBFONT_USECOURIER].string[0]) == 'y');
-        if (prt_use_courier)
-        {
-            /* Use national ASCII variant unless ASCII wanted */
-            if (mbfont_opts[OPT_MBFONT_ASCII].present &&
-                (TOLOWER_ASC(mbfont_opts[OPT_MBFONT_ASCII].string[0]) == 'y'))
-                prt_ascii_encoding = "ascii";
-            else
-                prt_ascii_encoding = prt_ps_mbfonts[cmap].ascii_enc;
-        }
+	/* Check if need to use Courier for ASCII code range, and if so pick up
+	 * the encoding to use */
+	prt_use_courier = mbfont_opts[OPT_MBFONT_USECOURIER].present &&
+	    (TOLOWER_ASC(mbfont_opts[OPT_MBFONT_USECOURIER].string[0]) == 'y');
+	if (prt_use_courier)
+	{
+	    /* Use national ASCII variant unless ASCII wanted */
+	    if (mbfont_opts[OPT_MBFONT_ASCII].present &&
+		(TOLOWER_ASC(mbfont_opts[OPT_MBFONT_ASCII].string[0]) == 'y'))
+		prt_ascii_encoding = "ascii";
+	    else
+		prt_ascii_encoding = prt_ps_mbfonts[cmap].ascii_enc;
+	}
 
-        prt_ps_font = &prt_ps_mb_font;
+	prt_ps_font = &prt_ps_mb_font;
     }
     else
 #endif
     {
 #ifdef FEAT_MBYTE
-        prt_use_courier = FALSE;
+	prt_use_courier = FALSE;
 #endif
-        prt_ps_font = &prt_ps_courier_font;
+	prt_ps_font = &prt_ps_courier_font;
     }
 
     /*
@@ -2780,7 +2780,7 @@
     prt_bufsiz = psettings->chars_per_line;
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
-        prt_bufsiz *= 2;
+	prt_bufsiz *= 2;
 #endif
     ga_init2(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz);
 
@@ -2873,7 +2873,7 @@
     prt_dsc_start();
     prt_dsc_textline("Title", (char *)psettings->jobname);
     if (!get_user_name((char_u *)buffer, 256))
-        STRCPY(buffer, "Unknown");
+	STRCPY(buffer, "Unknown");
     prt_dsc_textline("For", buffer);
     prt_dsc_textline("Creator", VIM_VERSION_LONG);
     /* Note: to ensure Clean8bit I don't think we can use LC_TIME */
@@ -2929,14 +2929,14 @@
 #ifdef FEAT_MBYTE
     if (!prt_out_mbyte || prt_use_courier)
 #endif
-        prt_dsc_font_resource("DocumentNeededResources", &prt_ps_courier_font);
+	prt_dsc_font_resource("DocumentNeededResources", &prt_ps_courier_font);
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        prt_dsc_font_resource((prt_use_courier ? NULL
-                                 : "DocumentNeededResources"), &prt_ps_mb_font);
-        if (!prt_custom_cmap)
-            prt_dsc_resources(NULL, "cmap", prt_cmap);
+	prt_dsc_font_resource((prt_use_courier ? NULL
+				 : "DocumentNeededResources"), &prt_ps_mb_font);
+	if (!prt_custom_cmap)
+	    prt_dsc_resources(NULL, "cmap", prt_cmap);
     }
 #endif
 
@@ -2953,16 +2953,16 @@
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        /* Look for required version of multi-byte printing procset */
-        if (!prt_find_resource("cidfont", &res_cidfont))
-        {
-            EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
-            return FALSE;
-        }
-        if (!prt_open_resource(&res_cidfont))
-            return FALSE;
-        if (!prt_check_resource(&res_cidfont, PRT_CID_PROLOG_VERSION))
-            return FALSE;
+	/* Look for required version of multi-byte printing procset */
+	if (!prt_find_resource("cidfont", &res_cidfont))
+	{
+	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
+	    return FALSE;
+	}
+	if (!prt_open_resource(&res_cidfont))
+	    return FALSE;
+	if (!prt_check_resource(&res_cidfont, PRT_CID_PROLOG_VERSION))
+	    return FALSE;
     }
 #endif
 
@@ -2975,64 +2975,64 @@
     if (!prt_out_mbyte)
     {
 #endif
-        p_encoding = enc_skip(p_penc);
-        if (*p_encoding == NUL
-                || !prt_find_resource((char *)p_encoding, &res_encoding))
-        {
-            /* 'printencoding' not set or not supported - find alternate */
+	p_encoding = enc_skip(p_penc);
+	if (*p_encoding == NUL
+		|| !prt_find_resource((char *)p_encoding, &res_encoding))
+	{
+	    /* 'printencoding' not set or not supported - find alternate */
 #ifdef FEAT_MBYTE
-            int		props;
+	    int		props;
 
-            p_encoding = enc_skip(p_enc);
-            props = enc_canon_props(p_encoding);
-            if (!(props & ENC_8BIT)
-                    || !prt_find_resource((char *)p_encoding, &res_encoding))
-                /* 8-bit 'encoding' is not supported */
+	    p_encoding = enc_skip(p_enc);
+	    props = enc_canon_props(p_encoding);
+	    if (!(props & ENC_8BIT)
+		    || !prt_find_resource((char *)p_encoding, &res_encoding))
+		/* 8-bit 'encoding' is not supported */
 #endif
-                {
-                /* Use latin1 as default printing encoding */
-                p_encoding = (char_u *)"latin1";
-                if (!prt_find_resource((char *)p_encoding, &res_encoding))
-                {
-                    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
-                            p_encoding);
-                    return FALSE;
-                }
-            }
-        }
-        if (!prt_open_resource(&res_encoding))
-            return FALSE;
-        /* For the moment there are no checks on encoding resource files to
-         * perform */
+		{
+		/* Use latin1 as default printing encoding */
+		p_encoding = (char_u *)"latin1";
+		if (!prt_find_resource((char *)p_encoding, &res_encoding))
+		{
+		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+			    p_encoding);
+		    return FALSE;
+		}
+	    }
+	}
+	if (!prt_open_resource(&res_encoding))
+	    return FALSE;
+	/* For the moment there are no checks on encoding resource files to
+	 * perform */
 #ifdef FEAT_MBYTE
     }
     else
     {
-        p_encoding = enc_skip(p_penc);
-        if (*p_encoding == NUL)
-            p_encoding = enc_skip(p_enc);
-        if (prt_use_courier)
-        {
-            /* Include ASCII range encoding vector */
-            if (!prt_find_resource(prt_ascii_encoding, &res_encoding))
-            {
-                EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+	p_encoding = enc_skip(p_penc);
+	if (*p_encoding == NUL)
+	    p_encoding = enc_skip(p_enc);
+	if (prt_use_courier)
+	{
+	    /* Include ASCII range encoding vector */
+	    if (!prt_find_resource(prt_ascii_encoding, &res_encoding))
+	    {
+		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
 							  prt_ascii_encoding);
-                return FALSE;
-            }
-            if (!prt_open_resource(&res_encoding))
-                return FALSE;
-            /* For the moment there are no checks on encoding resource files to
-             * perform */
-        }
+		return FALSE;
+	    }
+	    if (!prt_open_resource(&res_encoding))
+		return FALSE;
+	    /* For the moment there are no checks on encoding resource files to
+	     * perform */
+	}
     }
 
     prt_conv.vc_type = CONV_NONE;
     if (!(enc_canon_props(p_enc) & enc_canon_props(p_encoding) & ENC_8BIT)) {
-        /* Set up encoding conversion if required */
+	/* Set up encoding conversion if required */
 	if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding))
 	{
-            EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
+	    EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
 		    p_encoding);
 	    return FALSE;
 	}
@@ -3042,15 +3042,15 @@
 
     if (prt_out_mbyte && prt_custom_cmap)
     {
-        /* Find user supplied CMap */
-        if (!prt_find_resource(prt_cmap, &res_cmap))
-        {
-            EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+	/* Find user supplied CMap */
+	if (!prt_find_resource(prt_cmap, &res_cmap))
+	{
+	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
 								    prt_cmap);
-            return FALSE;
-        }
-        if (!prt_open_resource(&res_cmap))
-            return FALSE;
+	    return FALSE;
+	}
+	if (!prt_open_resource(&res_cmap))
+	    return FALSE;
     }
 #endif
 
@@ -3062,26 +3062,26 @@
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        STRCPY(buffer, res_cidfont.title);
-        STRCAT(buffer, " ");
-        STRCAT(buffer, res_cidfont.version);
-        prt_dsc_resources(NULL, "procset", buffer);
+	STRCPY(buffer, res_cidfont.title);
+	STRCAT(buffer, " ");
+	STRCAT(buffer, res_cidfont.version);
+	prt_dsc_resources(NULL, "procset", buffer);
 
-        if (prt_custom_cmap)
-        {
-            STRCPY(buffer, res_cmap.title);
-            STRCAT(buffer, " ");
-            STRCAT(buffer, res_cmap.version);
-            prt_dsc_resources(NULL, "cmap", buffer);
-        }
+	if (prt_custom_cmap)
+	{
+	    STRCPY(buffer, res_cmap.title);
+	    STRCAT(buffer, " ");
+	    STRCAT(buffer, res_cmap.version);
+	    prt_dsc_resources(NULL, "cmap", buffer);
+	}
     }
     if (!prt_out_mbyte || prt_use_courier)
 #endif
     {
-        STRCPY(buffer, res_encoding.title);
-        STRCAT(buffer, " ");
-        STRCAT(buffer, res_encoding.version);
-        prt_dsc_resources(NULL, "encoding", buffer);
+	STRCPY(buffer, res_encoding.title);
+	STRCAT(buffer, " ");
+	STRCAT(buffer, res_encoding.version);
+	prt_dsc_resources(NULL, "encoding", buffer);
     }
     prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
 #ifdef FEAT_SYN_HL
@@ -3101,14 +3101,14 @@
 #ifdef FEAT_MBYTE
     if (!prt_out_mbyte || prt_use_courier)
 #endif
-        prt_dsc_font_resource("PageResources", &prt_ps_courier_font);
+	prt_dsc_font_resource("PageResources", &prt_ps_courier_font);
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        prt_dsc_font_resource((prt_use_courier ? NULL : "PageResources"),
-                                                            &prt_ps_mb_font);
-        if (!prt_custom_cmap)
-            prt_dsc_resources(NULL, "cmap", prt_cmap);
+	prt_dsc_font_resource((prt_use_courier ? NULL : "PageResources"),
+							    &prt_ps_mb_font);
+	if (!prt_custom_cmap)
+	    prt_dsc_resources(NULL, "cmap", prt_cmap);
     }
 #endif
 
@@ -3128,21 +3128,21 @@
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
-        /* Add CID font procset, and any user supplied CMap */
-        if (!prt_add_resource(&res_cidfont))
-            return FALSE;
-        if (prt_custom_cmap && !prt_add_resource(&res_cmap))
-            return FALSE;
+	/* Add CID font procset, and any user supplied CMap */
+	if (!prt_add_resource(&res_cidfont))
+	    return FALSE;
+	if (prt_custom_cmap && !prt_add_resource(&res_cmap))
+	    return FALSE;
     }
 #endif
 
 #ifdef FEAT_MBYTE
     if (!prt_out_mbyte || prt_use_courier)
 #endif
-        /* There will be only one Roman font encoding to be included in the PS
-         * file. */
-        if (!prt_add_resource(&res_encoding))
-            return FALSE;
+	/* There will be only one Roman font encoding to be included in the PS
+	 * file. */
+	if (!prt_add_resource(&res_encoding))
+	    return FALSE;
 
     prt_dsc_noarg("EndProlog");
 
@@ -3168,82 +3168,82 @@
 #ifdef FEAT_MBYTE
     if (!prt_out_mbyte || prt_use_courier)
     {
-        /* When using Courier for ASCII range when printing multi-byte, need to
-         * pick up ASCII encoding to use with it. */
-        if (prt_use_courier)
-            p_encoding = (char_u *)prt_ascii_encoding;
+	/* When using Courier for ASCII range when printing multi-byte, need to
+	 * pick up ASCII encoding to use with it. */
+	if (prt_use_courier)
+	    p_encoding = (char_u *)prt_ascii_encoding;
 #endif
-        prt_dsc_resources("IncludeResource", "font",
-                          prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]);
-        prt_def_font("F0", (char *)p_encoding, (int)prt_line_height,
-                     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]);
-        prt_dsc_resources("IncludeResource", "font",
-                          prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]);
-        prt_def_font("F1", (char *)p_encoding, (int)prt_line_height,
-                     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]);
-        prt_dsc_resources("IncludeResource", "font",
-                          prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
-        prt_def_font("F2", (char *)p_encoding, (int)prt_line_height,
-                     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
-        prt_dsc_resources("IncludeResource", "font",
-                          prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
-        prt_def_font("F3", (char *)p_encoding, (int)prt_line_height,
-                     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+	prt_dsc_resources("IncludeResource", "font",
+			  prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+	prt_def_font("F0", (char *)p_encoding, (int)prt_line_height,
+		     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+	prt_dsc_resources("IncludeResource", "font",
+			  prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]);
+	prt_def_font("F1", (char *)p_encoding, (int)prt_line_height,
+		     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]);
+	prt_dsc_resources("IncludeResource", "font",
+			  prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+	prt_def_font("F2", (char *)p_encoding, (int)prt_line_height,
+		     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+	prt_dsc_resources("IncludeResource", "font",
+			  prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+	prt_def_font("F3", (char *)p_encoding, (int)prt_line_height,
+		     prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
 #ifdef FEAT_MBYTE
     }
     if (prt_out_mbyte)
     {
-        /* Define the CID fonts to be used in the job.  Typically CJKV fonts do
-         * not have an italic form being a western style, so where no font is
-         * defined for these faces VIM falls back to an existing face.
-         * Note: if using Courier for the ASCII range then the printout will
-         * have bold/italic/bolditalic regardless of the setting of printmbfont.
-         */
-        prt_dsc_resources("IncludeResource", "font",
-                          prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
-        if (!prt_custom_cmap)
-            prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
-        prt_def_cidfont("CF0", (int)prt_line_height,
-                        prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+	/* Define the CID fonts to be used in the job.	Typically CJKV fonts do
+	 * not have an italic form being a western style, so where no font is
+	 * defined for these faces VIM falls back to an existing face.
+	 * Note: if using Courier for the ASCII range then the printout will
+	 * have bold/italic/bolditalic regardless of the setting of printmbfont.
+	 */
+	prt_dsc_resources("IncludeResource", "font",
+			  prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+	if (!prt_custom_cmap)
+	    prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
+	prt_def_cidfont("CF0", (int)prt_line_height,
+			prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]);
 
-        if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD] != NULL)
-        {
-            prt_dsc_resources("IncludeResource", "font",
-                              prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]);
-            if (!prt_custom_cmap)
-                prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
-            prt_def_cidfont("CF1", (int)prt_line_height,
-                            prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]);
-        }
-        else
-            /* Use ROMAN for BOLD */
-            prt_dup_cidfont("CF0", "CF1");
+	if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD] != NULL)
+	{
+	    prt_dsc_resources("IncludeResource", "font",
+			      prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]);
+	    if (!prt_custom_cmap)
+		prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
+	    prt_def_cidfont("CF1", (int)prt_line_height,
+			    prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]);
+	}
+	else
+	    /* Use ROMAN for BOLD */
+	    prt_dup_cidfont("CF0", "CF1");
 
-        if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE] != NULL)
-        {
-            prt_dsc_resources("IncludeResource", "font",
-                              prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
-            if (!prt_custom_cmap)
-                prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
-            prt_def_cidfont("CF2", (int)prt_line_height,
-                            prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
-        }
-        else
-            /* Use ROMAN for OBLIQUE */
-            prt_dup_cidfont("CF0", "CF2");
+	if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE] != NULL)
+	{
+	    prt_dsc_resources("IncludeResource", "font",
+			      prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+	    if (!prt_custom_cmap)
+		prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
+	    prt_def_cidfont("CF2", (int)prt_line_height,
+			    prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+	}
+	else
+	    /* Use ROMAN for OBLIQUE */
+	    prt_dup_cidfont("CF0", "CF2");
 
-        if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE] != NULL)
-        {
-            prt_dsc_resources("IncludeResource", "font",
-                              prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
-            if (!prt_custom_cmap)
-                prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
-            prt_def_cidfont("CF3", (int)prt_line_height,
-                            prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
-        }
-        else
-            /* Use BOLD for BOLDOBLIQUE */
-            prt_dup_cidfont("CF1", "CF3");
+	if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE] != NULL)
+	{
+	    prt_dsc_resources("IncludeResource", "font",
+			      prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+	    if (!prt_custom_cmap)
+		prt_dsc_resources("IncludeResource", "cmap", prt_cmap);
+	    prt_def_cidfont("CF3", (int)prt_line_height,
+			    prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+	}
+	else
+	    /* Use BOLD for BOLDOBLIQUE */
+	    prt_dup_cidfont("CF1", "CF3");
     }
 #endif
 
@@ -3328,10 +3328,10 @@
 #ifdef FEAT_MBYTE
     prt_in_ascii = !prt_out_mbyte;
     if (prt_out_mbyte)
-        prt_write_string("CF0 sf\n");
+	prt_write_string("CF0 sf\n");
     else
 #endif
-        prt_write_string("F0 sf\n");
+	prt_write_string("F0 sf\n");
     prt_fgcol = PRCOLOR_BLACK;
     prt_bgcol = PRCOLOR_WHITE;
     prt_font = PRT_PS_FONT_ROMAN;
@@ -3393,8 +3393,8 @@
     float       char_width;
     float       next_pos;
 #ifdef FEAT_MBYTE
-    int         in_ascii;
-    int         half_width;
+    int		in_ascii;
+    int		half_width;
 #endif
 
     char_width = prt_char_width;
@@ -3409,47 +3409,47 @@
      */
     if (prt_use_courier)
     {
-        in_ascii = (len == 1 && *p < 0x80);
-        if (prt_in_ascii)
-        {
-            if (!in_ascii)
-            {
-                /* No longer in ASCII range - need to switch font */
-                prt_in_ascii = FALSE;
-                prt_need_font = TRUE;
-                prt_attribute_change = TRUE;
-            }
-        }
-        else if (in_ascii)
-        {
-            /* Now in ASCII range - need to switch font */
-            prt_in_ascii = TRUE;
-            prt_need_font = TRUE;
-            prt_attribute_change = TRUE;
-        }
+	in_ascii = (len == 1 && *p < 0x80);
+	if (prt_in_ascii)
+	{
+	    if (!in_ascii)
+	    {
+		/* No longer in ASCII range - need to switch font */
+		prt_in_ascii = FALSE;
+		prt_need_font = TRUE;
+		prt_attribute_change = TRUE;
+	    }
+	}
+	else if (in_ascii)
+	{
+	    /* Now in ASCII range - need to switch font */
+	    prt_in_ascii = TRUE;
+	    prt_need_font = TRUE;
+	    prt_attribute_change = TRUE;
+	}
     }
     if (prt_out_mbyte)
     {
-        half_width = ((*mb_ptr2cells)(p) == 1);
-        if (half_width)
-            char_width /= 2;
-        if (prt_half_width)
-        {
-            if (!half_width)
-            {
-                prt_half_width = FALSE;
-                prt_pos_x += prt_char_width/4;
-                prt_need_moveto = TRUE;
-                prt_attribute_change = TRUE;
-            }
-        }
-        else if (half_width)
-        {
-            prt_half_width = TRUE;
-            prt_pos_x += prt_char_width/4;
-            prt_need_moveto = TRUE;
-            prt_attribute_change = TRUE;
-        }
+	half_width = ((*mb_ptr2cells)(p) == 1);
+	if (half_width)
+	    char_width /= 2;
+	if (prt_half_width)
+	{
+	    if (!half_width)
+	    {
+		prt_half_width = FALSE;
+		prt_pos_x += prt_char_width/4;
+		prt_need_moveto = TRUE;
+		prt_attribute_change = TRUE;
+	    }
+	}
+	else if (half_width)
+	{
+	    prt_half_width = TRUE;
+	    prt_pos_x += prt_char_width/4;
+	    prt_need_moveto = TRUE;
+	    prt_attribute_change = TRUE;
+	}
     }
 #endif
 
@@ -3473,14 +3473,14 @@
 	if (prt_need_font)
 	{
 #ifdef FEAT_MBYTE
-            if (!prt_in_ascii)
-                prt_write_string("CF");
-            else
+	    if (!prt_in_ascii)
+		prt_write_string("CF");
+	    else
 #endif
-                prt_write_string("F");
-            prt_write_int(prt_font);
-            prt_write_string("sf\n");
-            prt_need_font = FALSE;
+		prt_write_string("F");
+	    prt_write_int(prt_font);
+	    prt_write_string("sf\n");
+	    prt_need_font = FALSE;
 	}
 	if (prt_need_fgcol)
 	{
@@ -3529,60 +3529,60 @@
 
     if (prt_out_mbyte)
     {
-        /* Multi-byte character strings are represented more efficiently as hex
-         * strings when outputting clean 8 bit PS.
-         */
-        do
-        {
-           ch = prt_hexchar[(unsigned)(*p) >> 4];
-           ga_append(&prt_ps_buffer, ch);
-           ch = prt_hexchar[(*p) & 0xf];
-           ga_append(&prt_ps_buffer, ch);
-           p++;
-        }
-        while (--len);
+	/* Multi-byte character strings are represented more efficiently as hex
+	 * strings when outputting clean 8 bit PS.
+	 */
+	do
+	{
+	    ch = prt_hexchar[(unsigned)(*p) >> 4];
+	    ga_append(&prt_ps_buffer, ch);
+	    ch = prt_hexchar[(*p) & 0xf];
+	    ga_append(&prt_ps_buffer, ch);
+	    p++;
+	}
+	while (--len);
     }
     else
 #endif
     {
-        /* Add next character to buffer of characters to output.
-         * Note: One printed character may require several PS characters to
-         * represent it, but we only count them as one printed character.
-         */
-        ch = *p;
-        if (ch < 32 || ch == '(' || ch == ')' || ch == '\\')
-        {
-            /* Convert non-printing characters to either their escape or octal
-             * sequence, ensures PS sent over a serial line does not interfere
-             * with the comms protocol.  Note: For EBCDIC we need to write out
-             * the escape sequences as ASCII codes!
+	/* Add next character to buffer of characters to output.
+	 * Note: One printed character may require several PS characters to
+	 * represent it, but we only count them as one printed character.
+	 */
+	ch = *p;
+	if (ch < 32 || ch == '(' || ch == ')' || ch == '\\')
+	{
+	    /* Convert non-printing characters to either their escape or octal
+	     * sequence, ensures PS sent over a serial line does not interfere
+	     * with the comms protocol.  Note: For EBCDIC we need to write out
+	     * the escape sequences as ASCII codes!
 	     * Note 2: Char codes < 32 are identical in EBCDIC and ASCII AFAIK!
 	     */
-            ga_append(&prt_ps_buffer, IF_EB('\\', 0134));
-            switch (ch)
-            {
-                case BS:   ga_append(&prt_ps_buffer, IF_EB('b', 0142)); break;
-                case TAB:  ga_append(&prt_ps_buffer, IF_EB('t', 0164)); break;
-                case NL:   ga_append(&prt_ps_buffer, IF_EB('n', 0156)); break;
-                case FF:   ga_append(&prt_ps_buffer, IF_EB('f', 0146)); break;
-                case CAR:  ga_append(&prt_ps_buffer, IF_EB('r', 0162)); break;
-                case '(':  ga_append(&prt_ps_buffer, IF_EB('(', 0050)); break;
-                case ')':  ga_append(&prt_ps_buffer, IF_EB(')', 0051)); break;
-                case '\\': ga_append(&prt_ps_buffer, IF_EB('\\', 0134)); break;
+	    ga_append(&prt_ps_buffer, IF_EB('\\', 0134));
+	    switch (ch)
+	    {
+		case BS:   ga_append(&prt_ps_buffer, IF_EB('b', 0142)); break;
+		case TAB:  ga_append(&prt_ps_buffer, IF_EB('t', 0164)); break;
+		case NL:   ga_append(&prt_ps_buffer, IF_EB('n', 0156)); break;
+		case FF:   ga_append(&prt_ps_buffer, IF_EB('f', 0146)); break;
+		case CAR:  ga_append(&prt_ps_buffer, IF_EB('r', 0162)); break;
+		case '(':  ga_append(&prt_ps_buffer, IF_EB('(', 0050)); break;
+		case ')':  ga_append(&prt_ps_buffer, IF_EB(')', 0051)); break;
+		case '\\': ga_append(&prt_ps_buffer, IF_EB('\\', 0134)); break;
 
-                default:
-                           sprintf((char *)ch_buff, "%03o", (unsigned int)ch);
+		default:
+			   sprintf((char *)ch_buff, "%03o", (unsigned int)ch);
 #ifdef EBCDIC
-                           ebcdic2ascii(ch_buff, 3);
+			   ebcdic2ascii(ch_buff, 3);
 #endif
-                           ga_append(&prt_ps_buffer, ch_buff[0]);
-                           ga_append(&prt_ps_buffer, ch_buff[1]);
-                           ga_append(&prt_ps_buffer, ch_buff[2]);
-                           break;
-            }
-        }
-        else
-            ga_append(&prt_ps_buffer, ch);
+			   ga_append(&prt_ps_buffer, ch_buff[0]);
+			   ga_append(&prt_ps_buffer, ch_buff[1]);
+			   ga_append(&prt_ps_buffer, ch_buff[2]);
+			   break;
+	    }
+	}
+	else
+	    ga_append(&prt_ps_buffer, ch);
     }
 
 #ifdef FEAT_MBYTE
@@ -3597,7 +3597,7 @@
     /* The downside of fp - use relative error on right margin check */
     next_pos = prt_pos_x + prt_char_width;
     need_break = (next_pos > prt_right_margin) &&
-                    ((next_pos - prt_right_margin) > (prt_right_margin*1e-5));
+		    ((next_pos - prt_right_margin) > (prt_right_margin*1e-5));
 
     if (need_break)
 	prt_flush_buffer();
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index 4874851..706f4ca 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -823,7 +823,7 @@
 	    return -1;
 	}
 #endif
-        startup_mzscheme();
+	startup_mzscheme();
 
 	if (mzscheme_io_init())
 	    return -1;
@@ -911,7 +911,7 @@
     if (!value)
     {
 	value = extract_exn_message(exn);
-        /* Got an exn? */
+	/* Got an exn? */
 	if (value)
 	{
 	    scheme_display(value, curerr);  /*  Send to stderr-vim */
@@ -952,7 +952,8 @@
 {
     if (buf->b_mzscheme_ref)
     {
-        vim_mz_buffer *bp;
+	vim_mz_buffer *bp;
+
 	bp = buf->b_mzscheme_ref;
 	bp->buf = INVALID_BUFFER_VALUE;
 	buf->b_mzscheme_ref = NULL;
@@ -1083,16 +1084,16 @@
     {
 	char *e =
 	    "(lambda (thunk) "
-	        "(with-handlers ([void (lambda (exn) (cons #f exn))]) "
+		"(with-handlers ([void (lambda (exn) (cons #f exn))]) "
 		"(cons #t (thunk))))";
 
-        /* make sure we have a namespace with the standard syntax: */
+	/* make sure we have a namespace with the standard syntax: */
 	Scheme_Env *env = (Scheme_Env *)scheme_make_namespace(0, NULL);
 	add_vim_exn(env);
 
-        exn_catching_apply = scheme_eval_string(e, env);
+	exn_catching_apply = scheme_eval_string(e, env);
 	exn_p = scheme_lookup_global(scheme_intern_symbol("exn?"), env);
-        exn_message = scheme_lookup_global(
+	exn_message = scheme_lookup_global(
 		scheme_intern_symbol("exn-message"), env);
     }
 }
@@ -1346,14 +1347,14 @@
     case 1:
 	return scheme_make_integer_value(value);
     case 0:
-        rval = scheme_make_string(strval);
+	rval = scheme_make_string(strval);
 	vim_free(strval);
 	return rval;
     case -1:
     case -2:
-        raise_vim_exn(_("hidden option"));
+	raise_vim_exn(_("hidden option"));
     case -3:
-        raise_vim_exn(_("unknown option"));
+	raise_vim_exn(_("unknown option"));
     }
     /* unreachable */
     return scheme_void;
@@ -1445,7 +1446,7 @@
     list = scheme_null;
 
     for (w = firstwin; w != NULL; w = w->w_next)
-        if (w->w_buffer == buf->buf)
+	if (w->w_buffer == buf->buf)
 	    list = scheme_make_pair(window_new(w), list);
 
     return list;
@@ -1506,7 +1507,7 @@
 	scheme_signal_error(_("window index is out of range"));
 
     for (win = firstwin; win != NULL; win = win->w_next, --fnum)
-        if (fnum == 1)	    /* to be 1-based */
+	if (fnum == 1)	    /* to be 1-based */
 	    return window_new(win);
 
     return scheme_false;
@@ -1681,7 +1682,7 @@
     fnum = SCHEME_INT_VAL(GUARANTEE_INTEGER(prim->name, 0));
 
     for (buf = firstbuf; buf; buf = buf->b_next)
-        if (buf->b_fnum == fnum)
+	if (buf->b_fnum == fnum)
 	    return buffer_new(buf);
 
     return scheme_false;
@@ -1786,7 +1787,7 @@
      * then we can get at it in buf_freeall() in vim.
      */
     if (buf->b_mzscheme_ref)
-        return buf->b_mzscheme_ref;
+	return buf->b_mzscheme_ref;
 
     self = scheme_malloc_fail_ok(scheme_malloc, sizeof(vim_mz_buffer));
 
@@ -1863,12 +1864,12 @@
      * Handle some error conditions
      */
     if (lo < 0)
-        lo = 0;
+	lo = 0;
 
     if (hi < 0)
 	hi = 0;
     if (hi < lo)
-        hi = lo;
+	hi = lo;
 
     n = hi - lo;
 
@@ -1918,7 +1919,7 @@
 #endif
     n = SCHEME_INT_VAL(GUARANTEE_INTEGER(prim->name, 0));
     if (!SCHEME_STRINGP(argv[1]) && !SCHEME_FALSEP(argv[1]))
-        scheme_wrong_type(prim->name, "string or #f", 1, argc, argv);
+	scheme_wrong_type(prim->name, "string or #f", 1, argc, argv);
     line = argv[1];
     buf = get_buffer_arg(prim->name, 2, argc, argv);
 
@@ -2072,11 +2073,11 @@
     rest = line_list;
     for (i = 0; i < new_len; ++i)
     {
-        line = SCHEME_CAR(rest);
+	line = SCHEME_CAR(rest);
 	rest = SCHEME_CDR(rest);
 	if (!SCHEME_STRINGP(line))
 	    scheme_wrong_type(prim->name, "string-list", 2, argc, argv);
-        array[i] = string_to_line(line);
+	array[i] = string_to_line(line);
     }
 
     savebuf = curbuf;
@@ -2085,7 +2086,7 @@
     if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
     {
 	curbuf = savebuf;
-        raise_vim_exn(_("cannot save undo information"));
+	raise_vim_exn(_("cannot save undo information"));
     }
 
     /*
@@ -2100,7 +2101,7 @@
 	    curbuf = savebuf;
 	    raise_vim_exn(_("cannot delete line"));
 	}
-        extra--;
+	extra--;
     }
 
     /*
@@ -2122,14 +2123,14 @@
      */
     while (i < new_len)
     {
-        if (ml_append((linenr_T)(lo + i - 1),
+	if (ml_append((linenr_T)(lo + i - 1),
 		(char_u *)array[i], 0, FALSE) == FAIL)
 	{
 	    curbuf = savebuf;
-            raise_vim_exn(_("cannot insert line"));
+	    raise_vim_exn(_("cannot insert line"));
 	}
-        ++i;
-        ++extra;
+	++i;
+	++extra;
     }
 
     /*
@@ -2186,7 +2187,7 @@
     buf = get_buffer_arg(prim->name, 2, argc, argv);
 
     if (n != 0)	    /* 0 can be used in insert */
-        check_line_range(n, buf->buf);
+	check_line_range(n, buf->buf);
     if (SCHEME_STRINGP(list))
     {
 	str = string_to_line(list);
@@ -2229,9 +2230,9 @@
     rest = list;
     for (i = 0; i < size; ++i)
     {
-        line = SCHEME_CAR(rest);
-        rest = SCHEME_CDR(rest);
-        array[i] = string_to_line(line);
+	line = SCHEME_CAR(rest);
+	rest = SCHEME_CDR(rest);
+	array[i] = string_to_line(line);
     }
 
     savebuf = curbuf;
@@ -2240,20 +2241,20 @@
     if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
     {
 	curbuf = savebuf;
-        raise_vim_exn(_("cannot save undo information"));
+	raise_vim_exn(_("cannot save undo information"));
     }
     else
     {
-        for (i = 0; i < size; ++i)
-            if (ml_append((linenr_T)(n + i), (char_u *)array[i],
+	for (i = 0; i < size; ++i)
+	    if (ml_append((linenr_T)(n + i), (char_u *)array[i],
 			0, FALSE) == FAIL)
 	    {
 		curbuf = savebuf;
-	        raise_vim_exn(_("cannot insert line"));
+		raise_vim_exn(_("cannot insert line"));
 	    }
 
-        if (i > 0)
-            appended_lines_mark((linenr_T)n, (long)i);
+	if (i > 0)
+	    appended_lines_mark((linenr_T)n, (long)i);
     }
 
     curbuf = savebuf;
diff --git a/src/if_python.c b/src/if_python.c
index dbbe602..e0fd348 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -453,15 +453,15 @@
 #ifdef DYNAMIC_PYTHON
     if (hinstPython && Py_IsInitialized())
     {
-        Python_RestoreThread();	    /* enter python */
-        Py_Finalize();
+	Python_RestoreThread();	    /* enter python */
+	Py_Finalize();
     }
     end_dynamic_python();
 #else
     if (Py_IsInitialized())
     {
-        Python_RestoreThread();	    /* enter python */
-        Py_Finalize();
+	Python_RestoreThread();	    /* enter python */
+	Py_Finalize();
     }
 #endif
 
@@ -1105,9 +1105,9 @@
     /* Avoid infinite recursion */
     if (depth > 100)
     {
-        Py_INCREF(Py_None);
-        result = Py_None;
-        return result;
+	Py_INCREF(Py_None);
+	result = Py_None;
+	return result;
     }
 
     /* Check if we run into a recursive loop.  The item must be in lookupDict
@@ -1115,28 +1115,28 @@
     sprintf(ptrBuf, "%ld", (long)our_tv);
     result = PyDict_GetItemString(lookupDict, ptrBuf);
     if (result != NULL)
-        Py_INCREF(result);
+	Py_INCREF(result);
     else if (our_tv->v_type == VAR_STRING)
     {
-        result = Py_BuildValue("s", our_tv->vval.v_string);
-        PyDict_SetItemString(lookupDict, ptrBuf, result);
+	result = Py_BuildValue("s", our_tv->vval.v_string);
+	PyDict_SetItemString(lookupDict, ptrBuf, result);
     }
     else if (our_tv->v_type == VAR_NUMBER)
     {
-        char buf[NUMBUFLEN];
+	char buf[NUMBUFLEN];
 
 	/* For backwards compatibility numbers are stored as strings. */
-        sprintf(buf, "%ld", (long)our_tv->vval.v_number);
-        result = Py_BuildValue("s", buf);
-        PyDict_SetItemString(lookupDict, ptrBuf, result);
+	sprintf(buf, "%ld", (long)our_tv->vval.v_number);
+	result = Py_BuildValue("s", buf);
+	PyDict_SetItemString(lookupDict, ptrBuf, result);
     }
     else if (our_tv->v_type == VAR_LIST)
     {
-        list_T		*list = our_tv->vval.v_list;
-        listitem_T	*curr;
+	list_T		*list = our_tv->vval.v_list;
+	listitem_T	*curr;
 
-        result = PyList_New(0);
-        PyDict_SetItemString(lookupDict, ptrBuf, result);
+	result = PyList_New(0);
+	PyDict_SetItemString(lookupDict, ptrBuf, result);
 
 	if (list != NULL)
 	{
@@ -1150,8 +1150,8 @@
     }
     else if (our_tv->v_type == VAR_DICT)
     {
-        result = PyDict_New();
-        PyDict_SetItemString(lookupDict, ptrBuf, result);
+	result = PyDict_New();
+	PyDict_SetItemString(lookupDict, ptrBuf, result);
 
 	if (our_tv->vval.v_dict != NULL)
 	{
@@ -1176,8 +1176,8 @@
     }
     else
     {
-        Py_INCREF(Py_None);
-        result = Py_None;
+	Py_INCREF(Py_None);
+	result = Py_None;
     }
 
     return result;
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 78ccc00..29c62b8 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -571,9 +571,9 @@
 
     for (b = firstbuf; b != NULL; b = b->b_next)
     {
-        /*  Deleted buffers should not be counted
-         *    SegPhault - 01/07/05 */
-        if (b->b_p_bl)
+	/*  Deleted buffers should not be counted
+	 *    SegPhault - 01/07/05 */
+	if (b->b_p_bl)
 	    n++;
     }
 
@@ -587,15 +587,15 @@
 
     for (b = firstbuf; b != NULL; b = b->b_next)
     {
-        /*  Deleted buffers should not be counted
-         *    SegPhault - 01/07/05 */
-        if (!b->b_p_bl)
+	/*  Deleted buffers should not be counted
+	 *    SegPhault - 01/07/05 */
+	if (!b->b_p_bl)
 	    continue;
 
-        if (n == 0)
+	if (n == 0)
 	    return buffer_new(b);
 
-        n--;
+	n--;
     }
     return Qnil;
 }
@@ -685,9 +685,9 @@
 	if (u_savedel(n, 1) == OK) {
 	    ml_delete(n, 0);
 
-            /* Changes to non-active buffers should properly refresh
-             *   SegPhault - 01/09/05 */
-            deleted_lines_mark(n, 1L);
+	    /* Changes to non-active buffers should properly refresh
+	     *   SegPhault - 01/09/05 */
+	    deleted_lines_mark(n, 1L);
 
 	    changed();
 	}
@@ -712,11 +712,11 @@
 	if (u_inssub(n + 1) == OK) {
 	    ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
 
-            /*  Changes to non-active buffers should properly refresh screen
-             *    SegPhault - 12/20/04 */
-            appended_lines_mark(n, 1L);
+	    /*  Changes to non-active buffers should properly refresh screen
+	     *    SegPhault - 12/20/04 */
+	    appended_lines_mark(n, 1L);
 
-            changed();
+	    changed();
 	}
 	curbuf = savebuf;
 	update_curbuf(NOT_VALID);
diff --git a/src/installman.sh b/src/installman.sh
index 9943109..25a24e6 100755
--- a/src/installman.sh
+++ b/src/installman.sh
@@ -3,16 +3,16 @@
 #
 # arguments:
 # 1  what: "install", "uninstall" or "xxd"
-# 2  target directory                      e.g., "/usr/local/man/it/man1"
+# 2  target directory			   e.g., "/usr/local/man/it/man1"
 # 3  language addition			   e.g., "" or "-it"
 # 4  vim location as used in manual pages  e.g., "/usr/local/share/vim"
-# 5  runtime dir for menu.vim et al.       e.g., "/usr/local/share/vim/vim70"
-# 6  runtime dir for global vimrc file     e.g., "/usr/local/share/vim"
-# 7  source dir for help files             e.g., "../runtime/doc"
-# 8  mode bits for manpages                e.g., "644"
-# 9  vim exe name                          e.g., "vim"
-# 10 name of vimdiff exe                   e.g., "vimdiff"
-# 11 name of evim exe                      e.g., "evim"
+# 5  runtime dir for menu.vim et al.	   e.g., "/usr/local/share/vim/vim70"
+# 6  runtime dir for global vimrc file	   e.g., "/usr/local/share/vim"
+# 7  source dir for help files		   e.g., "../runtime/doc"
+# 8  mode bits for manpages		   e.g., "644"
+# 9  vim exe name			   e.g., "vim"
+# 10 name of vimdiff exe		   e.g., "vimdiff"
+# 11 name of evim exe			   e.g., "evim"
 
 errstatus=0
 
diff --git a/src/installml.sh b/src/installml.sh
index 0de60ad..e6dc3d8 100644
--- a/src/installml.sh
+++ b/src/installml.sh
@@ -4,20 +4,20 @@
 # arguments:
 # 1  what: "install" or "uninstall"
 # 2  also do GUI pages: "yes" or ""
-# 3  target directory                e.g., "/usr/local/man/it/man1"
-# 4  vim exe name                    e.g., "vim"
-# 5  vimdiff exe name                e.g., "vimdiff"
-# 6  evim exe name                   e.g., "evim"
-# 7  ex exe name                     e.g., "ex"
-# 8  view exe name                   e.g., "view"
-# 9  rvim exe name                   e.g., "rvim"
-# 10 rview exe name                  e.g., "rview"
-# 11 gvim exe name                   e.g., "gvim"
-# 12 gview exe name                  e.g., "gview"
-# 13 rgvim exe name                  e.g., "rgvim"
-# 14 rgview exe name                 e.g., "rgview"
-# 15 gvimdiff exe name               e.g., "gvimdiff"
-# 16 eview exe name                  e.g., "eview"
+# 3  target directory		     e.g., "/usr/local/man/it/man1"
+# 4  vim exe name		     e.g., "vim"
+# 5  vimdiff exe name		     e.g., "vimdiff"
+# 6  evim exe name		     e.g., "evim"
+# 7  ex exe name		     e.g., "ex"
+# 8  view exe name		     e.g., "view"
+# 9  rvim exe name		     e.g., "rvim"
+# 10 rview exe name		     e.g., "rview"
+# 11 gvim exe name		     e.g., "gvim"
+# 12 gview exe name		     e.g., "gview"
+# 13 rgvim exe name		     e.g., "rgvim"
+# 14 rgview exe name		     e.g., "rgview"
+# 15 gvimdiff exe name		     e.g., "gvimdiff"
+# 16 eview exe name		     e.g., "eview"
 
 errstatus=0
 
diff --git a/src/mbyte.c b/src/mbyte.c
index 2114654..e1c5947 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -2201,8 +2201,8 @@
     if (a < 128 && (cmp_flags & CMP_KEEPASCII))
 	return TOUPPER_ASC(a);
 
-#if defined(HAVE_TOWUPPER) && defined(__STDC__ISO_10646__)
-    /* If towupper() is availble and handles Unicode, use it. */
+#if defined(HAVE_TOWUPPER) && defined(__STDC_ISO_10646__)
+    /* If towupper() is available and handles Unicode, use it. */
     if (!(cmp_flags & CMP_INTERNAL))
 	return towupper(a);
 #endif
@@ -2234,7 +2234,7 @@
     if (a < 128 && (cmp_flags & CMP_KEEPASCII))
 	return TOLOWER_ASC(a);
 
-#if defined(HAVE_TOWLOWER) && defined(__STDC__ISO_10646__)
+#if defined(HAVE_TOWLOWER) && defined(__STDC_ISO_10646__)
     /* If towlower() is available and handles Unicode, use it. */
     if (!(cmp_flags & CMP_INTERNAL))
 	return towlower(a);
diff --git a/src/menu.c b/src/menu.c
index 8b45395..dac4754 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1489,7 +1489,7 @@
 	case 'a':			/* amenu */
 	    modes = MENU_INSERT_MODE | MENU_CMDLINE_MODE | MENU_NORMAL_MODE
 				    | MENU_VISUAL_MODE | MENU_SELECT_MODE
-                                    | MENU_OP_PENDING_MODE;
+				    | MENU_OP_PENDING_MODE;
 	    break;
 	case 'n':
 	    if (*cmd != 'o')		/* nmenu, not noremenu */
@@ -1555,10 +1555,10 @@
 #ifdef FEAT_VISUAL
     else if (VIsual_active)
     {
-        if (VIsual_select)
-            idx = MENU_INDEX_SELECT;
-        else
-            idx = MENU_INDEX_VISUAL;
+	if (VIsual_select)
+	    idx = MENU_INDEX_SELECT;
+	else
+	    idx = MENU_INDEX_VISUAL;
     }
 #endif
     else if (state == HITRETURN || state == ASKMORE)
@@ -1727,8 +1727,8 @@
 #ifdef FEAT_VISUAL
     if (VIsual_active)
     {
-        if (VIsual_select)
-            return MENU_INDEX_SELECT;
+	if (VIsual_select)
+	    return MENU_INDEX_SELECT;
 	return MENU_INDEX_VISUAL;
     }
 #endif
diff --git a/src/message.c b/src/message.c
index c67d47d..a242a26 100644
--- a/src/message.c
+++ b/src/message.c
@@ -3519,9 +3519,9 @@
 	else
 	{
 	    len += (int)(STRLEN(message)
-                        + 2			/* for the NL's */
-                        + STRLEN(buttons)
-                        + 3);	        	/* for the ": " and NUL */
+			+ 2			/* for the NL's */
+			+ STRLEN(buttons)
+			+ 3);			/* for the ": " and NUL */
 	    lenhotkey++;			/* for the NUL */
 
 	    /* If no hotkey is specified first char is used. */
@@ -4450,10 +4450,10 @@
 		zero_padding = 0;  /* turn zero padding off for non-numeric
 				      convers. */
 		justify_left = 1;
-		min_field_width = 0;                /* reset flags */
+		min_field_width = 0;		    /* reset flags */
 
 		/* discard the unrecognized conversion, just keep *
-		 * the unrecognized conversion character          */
+		 * the unrecognized conversion character	  */
 		str_arg = p;
 		str_arg_l = 0;
 		if (*p != NUL)
diff --git a/src/misc1.c b/src/misc1.c
index 4f0ef02..5ce1167 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -5147,7 +5147,7 @@
     if (len == 6 && STRNCMP(p, "static", 6) == 0)
     {
 	p = skipwhite(p + 6);
-        len = (int)(skiptowhite(p) - p);
+	len = (int)(skiptowhite(p) - p);
     }
     if (len == 6 && STRNCMP(p, "struct", 6) == 0)
 	p = skipwhite(p + 6);
@@ -5459,7 +5459,7 @@
  *    do
  *       nothing;
  *    while (foo
- *             && bar);  <-- here
+ *	       && bar);  <-- here
  * Adjust the cursor to the line with "while".
  */
     static int
@@ -5558,7 +5558,7 @@
      * '{' or '}' and start below it.  This handles the following situations:
      *	a = cond ?
      *	      func() :
-     *	           asdf;
+     *		   asdf;
      *	func::foo()
      *	      : something
      *	{}
@@ -7542,7 +7542,7 @@
 			 * When a terminated line starts with "else" skip to
 			 * the matching "if":
 			 *       else 3;
-			 *           indent this;
+			 *	     indent this;
 			 * Need to use the scope of this "else".  XXX
 			 * If whilelevel != 0 continue looking for a "do {".
 			 */
diff --git a/src/ops.c b/src/ops.c
index 732323e..71edc5e 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -4349,7 +4349,11 @@
     int		use_sandbox = was_set_insecurely((char_u *)"formatexpr",
 								   OPT_LOCAL);
     int		r;
-    char_u	buf[NUMBUFLEN];
+#ifdef FEAT_MBYTE
+    char_u	buf[MB_MAXBYTES];
+#else
+    char_u	buf[2];
+#endif
 
     /*
      * Set v:lnum to the first line number and v:count to the number of lines.
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index 9193443..9da8c3e 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -1,69 +1,69 @@
 /* buffer.c */
-int open_buffer __ARGS((int read_stdin, exarg_T *eap));
-int buf_valid __ARGS((buf_T *buf));
-void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
-void buf_clear_file __ARGS((buf_T *buf));
-void buf_freeall __ARGS((buf_T *buf, int del_buf, int wipe_buf));
-void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
-void handle_swap_exists __ARGS((buf_T *old_curbuf));
-char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
-int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
-void set_curbuf __ARGS((buf_T *buf, int action));
-void enter_buffer __ARGS((buf_T *buf));
-buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
-void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
-int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
-void buflist_getfpos __ARGS((void));
-buf_T *buflist_findname_exp __ARGS((char_u *fname));
-buf_T *buflist_findname __ARGS((char_u *ffname));
-int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
-int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
-buf_T *buflist_findnr __ARGS((int nr));
-char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
-void get_winopts __ARGS((buf_T *buf));
-pos_T *buflist_findfpos __ARGS((buf_T *buf));
-linenr_T buflist_findlnum __ARGS((buf_T *buf));
-void buflist_list __ARGS((exarg_T *eap));
-int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
-int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
-void buf_set_name __ARGS((int fnum, char_u *name));
-void buf_name_changed __ARGS((buf_T *buf));
-buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
-char_u *getaltfname __ARGS((int errmsg));
-int buflist_add __ARGS((char_u *fname, int flags));
-void buflist_slash_adjust __ARGS((void));
-void buflist_altfpos __ARGS((void));
-int otherfile __ARGS((char_u *ffname));
-void buf_setino __ARGS((buf_T *buf));
-void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
-void col_print __ARGS((char_u *buf, int col, int vcol));
-void maketitle __ARGS((void));
-void resettitle __ARGS((void));
-void free_titles __ARGS((void));
-int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
-void get_rel_pos __ARGS((win_T *wp, char_u *str));
-int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
-char_u *fix_fname __ARGS((char_u *fname));
-void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
-char_u *alist_name __ARGS((aentry_T *aep));
-void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
-void ex_buffer_all __ARGS((exarg_T *eap));
-void do_modelines __ARGS((int flags));
-int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
-void write_viminfo_bufferlist __ARGS((FILE *fp));
-char *buf_spname __ARGS((buf_T *buf));
-void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
-int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
-int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
-linenr_T buf_delsign __ARGS((buf_T *buf, int id));
-int buf_findsign __ARGS((buf_T *buf, int id));
-int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
-int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
-int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
-void buf_delete_all_signs __ARGS((void));
-void sign_list_placed __ARGS((buf_T *rbuf));
-void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
-void set_buflisted __ARGS((int on));
-int buf_contents_changed __ARGS((buf_T *buf));
-void wipe_buffer __ARGS((buf_T *buf, int aucmd));
+extern int open_buffer __ARGS((int read_stdin, exarg_T *eap));
+extern int buf_valid __ARGS((buf_T *buf));
+extern void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
+extern void buf_clear_file __ARGS((buf_T *buf));
+extern void buf_freeall __ARGS((buf_T *buf, int del_buf, int wipe_buf));
+extern void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
+extern void handle_swap_exists __ARGS((buf_T *old_curbuf));
+extern char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
+extern int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
+extern void set_curbuf __ARGS((buf_T *buf, int action));
+extern void enter_buffer __ARGS((buf_T *buf));
+extern buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
+extern void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
+extern int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
+extern void buflist_getfpos __ARGS((void));
+extern buf_T *buflist_findname_exp __ARGS((char_u *fname));
+extern buf_T *buflist_findname __ARGS((char_u *ffname));
+extern int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
+extern int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
+extern buf_T *buflist_findnr __ARGS((int nr));
+extern char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
+extern void get_winopts __ARGS((buf_T *buf));
+extern pos_T *buflist_findfpos __ARGS((buf_T *buf));
+extern linenr_T buflist_findlnum __ARGS((buf_T *buf));
+extern void buflist_list __ARGS((exarg_T *eap));
+extern int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
+extern int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
+extern void buf_set_name __ARGS((int fnum, char_u *name));
+extern void buf_name_changed __ARGS((buf_T *buf));
+extern buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
+extern char_u *getaltfname __ARGS((int errmsg));
+extern int buflist_add __ARGS((char_u *fname, int flags));
+extern void buflist_slash_adjust __ARGS((void));
+extern void buflist_altfpos __ARGS((void));
+extern int otherfile __ARGS((char_u *ffname));
+extern void buf_setino __ARGS((buf_T *buf));
+extern void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
+extern void col_print __ARGS((char_u *buf, int col, int vcol));
+extern void maketitle __ARGS((void));
+extern void resettitle __ARGS((void));
+extern void free_titles __ARGS((void));
+extern int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
+extern void get_rel_pos __ARGS((win_T *wp, char_u *str));
+extern int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
+extern char_u *fix_fname __ARGS((char_u *fname));
+extern void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
+extern char_u *alist_name __ARGS((aentry_T *aep));
+extern void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
+extern void ex_buffer_all __ARGS((exarg_T *eap));
+extern void do_modelines __ARGS((int flags));
+extern int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
+extern void write_viminfo_bufferlist __ARGS((FILE *fp));
+extern char *buf_spname __ARGS((buf_T *buf));
+extern void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
+extern int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
+extern int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
+extern linenr_T buf_delsign __ARGS((buf_T *buf, int id));
+extern int buf_findsign __ARGS((buf_T *buf, int id));
+extern int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
+extern int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
+extern int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
+extern void buf_delete_all_signs __ARGS((void));
+extern void sign_list_placed __ARGS((buf_T *rbuf));
+extern void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+extern void set_buflisted __ARGS((int on));
+extern int buf_contents_changed __ARGS((buf_T *buf));
+extern void wipe_buffer __ARGS((buf_T *buf, int aucmd));
 /* vim: set ft=c : */
diff --git a/src/proto/charset.pro b/src/proto/charset.pro
index 4b6890d..a6f4802 100644
--- a/src/proto/charset.pro
+++ b/src/proto/charset.pro
@@ -1,56 +1,56 @@
 /* charset.c */
-int init_chartab __ARGS((void));
-int buf_init_chartab __ARGS((buf_T *buf, int global));
-void trans_characters __ARGS((char_u *buf, int bufsize));
-char_u *transstr __ARGS((char_u *s));
-char_u *str_foldcase __ARGS((char_u *str, int orglen, char_u *buf, int buflen));
-char_u *transchar __ARGS((int c));
-char_u *transchar_byte __ARGS((int c));
-void transchar_nonprint __ARGS((char_u *buf, int c));
-void transchar_hex __ARGS((char_u *buf, int c));
-int byte2cells __ARGS((int b));
-int char2cells __ARGS((int c));
-int ptr2cells __ARGS((char_u *p));
-int vim_strsize __ARGS((char_u *s));
-int vim_strnsize __ARGS((char_u *s, int len));
-int chartabsize __ARGS((char_u *p, colnr_T col));
-int linetabsize __ARGS((char_u *s));
-int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
-int vim_isIDc __ARGS((int c));
-int vim_iswordc __ARGS((int c));
-int vim_iswordp __ARGS((char_u *p));
-int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
-int vim_isfilec __ARGS((int c));
-int vim_isprintc __ARGS((int c));
-int vim_isprintc_strict __ARGS((int c));
-int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
-int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col));
-int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
-int in_win_border __ARGS((win_T *wp, colnr_T vcol));
-void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
-colnr_T getvcol_nolist __ARGS((pos_T *posp));
-void getvvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
-void getvcols __ARGS((win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *right));
-char_u *skipwhite __ARGS((char_u *p));
-char_u *skipdigits __ARGS((char_u *p));
-char_u *skiphex __ARGS((char_u *p));
-char_u *skiptodigit __ARGS((char_u *p));
-char_u *skiptohex __ARGS((char_u *p));
-int vim_isdigit __ARGS((int c));
-int vim_isxdigit __ARGS((int c));
-int vim_islower __ARGS((int c));
-int vim_isupper __ARGS((int c));
-int vim_toupper __ARGS((int c));
-int vim_tolower __ARGS((int c));
-char_u *skiptowhite __ARGS((char_u *p));
-char_u *skiptowhite_esc __ARGS((char_u *p));
-long getdigits __ARGS((char_u **pp));
-int vim_isblankline __ARGS((char_u *lbuf));
-void vim_str2nr __ARGS((char_u *start, int *hexp, int *len, int dooct, int dohex, long *nptr, unsigned long *unptr));
-int hex2nr __ARGS((int c));
-int hexhex2nr __ARGS((char_u *p));
-int rem_backslash __ARGS((char_u *str));
-void backslash_halve __ARGS((char_u *p));
-char_u *backslash_halve_save __ARGS((char_u *p));
-void ebcdic2ascii __ARGS((char_u *buffer, int len));
+extern int init_chartab __ARGS((void));
+extern int buf_init_chartab __ARGS((buf_T *buf, int global));
+extern void trans_characters __ARGS((char_u *buf, int bufsize));
+extern char_u *transstr __ARGS((char_u *s));
+extern char_u *str_foldcase __ARGS((char_u *str, int orglen, char_u *buf, int buflen));
+extern char_u *transchar __ARGS((int c));
+extern char_u *transchar_byte __ARGS((int c));
+extern void transchar_nonprint __ARGS((char_u *buf, int c));
+extern void transchar_hex __ARGS((char_u *buf, int c));
+extern int byte2cells __ARGS((int b));
+extern int char2cells __ARGS((int c));
+extern int ptr2cells __ARGS((char_u *p));
+extern int vim_strsize __ARGS((char_u *s));
+extern int vim_strnsize __ARGS((char_u *s, int len));
+extern int chartabsize __ARGS((char_u *p, colnr_T col));
+extern int linetabsize __ARGS((char_u *s));
+extern int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
+extern int vim_isIDc __ARGS((int c));
+extern int vim_iswordc __ARGS((int c));
+extern int vim_iswordp __ARGS((char_u *p));
+extern int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
+extern int vim_isfilec __ARGS((int c));
+extern int vim_isprintc __ARGS((int c));
+extern int vim_isprintc_strict __ARGS((int c));
+extern int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
+extern int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col));
+extern int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
+extern int in_win_border __ARGS((win_T *wp, colnr_T vcol));
+extern void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+extern colnr_T getvcol_nolist __ARGS((pos_T *posp));
+extern void getvvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+extern void getvcols __ARGS((win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *right));
+extern char_u *skipwhite __ARGS((char_u *p));
+extern char_u *skipdigits __ARGS((char_u *p));
+extern char_u *skiphex __ARGS((char_u *p));
+extern char_u *skiptodigit __ARGS((char_u *p));
+extern char_u *skiptohex __ARGS((char_u *p));
+extern int vim_isdigit __ARGS((int c));
+extern int vim_isxdigit __ARGS((int c));
+extern int vim_islower __ARGS((int c));
+extern int vim_isupper __ARGS((int c));
+extern int vim_toupper __ARGS((int c));
+extern int vim_tolower __ARGS((int c));
+extern char_u *skiptowhite __ARGS((char_u *p));
+extern char_u *skiptowhite_esc __ARGS((char_u *p));
+extern long getdigits __ARGS((char_u **pp));
+extern int vim_isblankline __ARGS((char_u *lbuf));
+extern void vim_str2nr __ARGS((char_u *start, int *hexp, int *len, int dooct, int dohex, long *nptr, unsigned long *unptr));
+extern int hex2nr __ARGS((int c));
+extern int hexhex2nr __ARGS((char_u *p));
+extern int rem_backslash __ARGS((char_u *str));
+extern void backslash_halve __ARGS((char_u *p));
+extern char_u *backslash_halve_save __ARGS((char_u *p));
+extern void ebcdic2ascii __ARGS((char_u *buffer, int len));
 /* vim: set ft=c : */
diff --git a/src/proto/ex_getln.pro b/src/proto/ex_getln.pro
index f5feb20..6dd06ff 100644
--- a/src/proto/ex_getln.pro
+++ b/src/proto/ex_getln.pro
@@ -1,56 +1,56 @@
 /* ex_getln.c */
-char_u *getcmdline __ARGS((int firstc, long count, int indent));
-char_u *getcmdline_prompt __ARGS((int firstc, char_u *prompt, int attr, int xp_context, char_u *xp_arg));
-int text_locked __ARGS((void));
-void text_locked_msg __ARGS((void));
-int curbuf_locked __ARGS((void));
-char_u *getexline __ARGS((int c, void *dummy, int indent));
-char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent));
-int cmdline_overstrike __ARGS((void));
-int cmdline_at_end __ARGS((void));
-colnr_T cmdline_getvcol_cursor __ARGS((void));
-void free_cmdline_buf __ARGS((void));
-void putcmdline __ARGS((int c, int shift));
-void unputcmdline __ARGS((void));
-int put_on_cmdline __ARGS((char_u *str, int len, int redraw));
-char_u *save_cmdline_alloc __ARGS((void));
-void restore_cmdline_alloc __ARGS((char_u *p));
-void cmdline_paste_str __ARGS((char_u *s, int literally));
-void redrawcmdline __ARGS((void));
-void redrawcmd __ARGS((void));
-void compute_cmdrow __ARGS((void));
-void gotocmdline __ARGS((int clr));
-char_u *ExpandOne __ARGS((expand_T *xp, char_u *str, char_u *orig, int options, int mode));
-void ExpandInit __ARGS((expand_T *xp));
-void ExpandCleanup __ARGS((expand_T *xp));
-void ExpandEscape __ARGS((expand_T *xp, char_u *str, int numfiles, char_u **files, int options));
-void tilde_replace __ARGS((char_u *orig_pat, int num_files, char_u **files));
-char_u *sm_gettail __ARGS((char_u *s));
-char_u *addstar __ARGS((char_u *fname, int len, int context));
-void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
-int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
-int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int))));
-char_u *globpath __ARGS((char_u *path, char_u *file));
-void init_history __ARGS((void));
-int get_histtype __ARGS((char_u *name));
-void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
-int get_history_idx __ARGS((int histype));
-char_u *get_cmdline_str __ARGS((void));
-int get_cmdline_pos __ARGS((void));
-int set_cmdline_pos __ARGS((int pos));
-int get_cmdline_type __ARGS((void));
-char_u *get_history_entry __ARGS((int histype, int idx));
-int clr_history __ARGS((int histype));
-int del_history_entry __ARGS((int histype, char_u *str));
-int del_history_idx __ARGS((int histype, int idx));
-void remove_key_from_history __ARGS((void));
-int get_list_range __ARGS((char_u **str, int *num1, int *num2));
-void ex_history __ARGS((exarg_T *eap));
-void prepare_viminfo_history __ARGS((int asklen));
-int read_viminfo_history __ARGS((vir_T *virp));
-void finish_viminfo_history __ARGS((void));
-void write_viminfo_history __ARGS((FILE *fp));
-void cmd_pchar __ARGS((int c, int offset));
-int cmd_gchar __ARGS((int offset));
-char_u *script_get __ARGS((exarg_T *eap, char_u *cmd));
+extern char_u *getcmdline __ARGS((int firstc, long count, int indent));
+extern char_u *getcmdline_prompt __ARGS((int firstc, char_u *prompt, int attr, int xp_context, char_u *xp_arg));
+extern int text_locked __ARGS((void));
+extern void text_locked_msg __ARGS((void));
+extern int curbuf_locked __ARGS((void));
+extern char_u *getexline __ARGS((int c, void *dummy, int indent));
+extern char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent));
+extern int cmdline_overstrike __ARGS((void));
+extern int cmdline_at_end __ARGS((void));
+extern colnr_T cmdline_getvcol_cursor __ARGS((void));
+extern void free_cmdline_buf __ARGS((void));
+extern void putcmdline __ARGS((int c, int shift));
+extern void unputcmdline __ARGS((void));
+extern int put_on_cmdline __ARGS((char_u *str, int len, int redraw));
+extern char_u *save_cmdline_alloc __ARGS((void));
+extern void restore_cmdline_alloc __ARGS((char_u *p));
+extern void cmdline_paste_str __ARGS((char_u *s, int literally));
+extern void redrawcmdline __ARGS((void));
+extern void redrawcmd __ARGS((void));
+extern void compute_cmdrow __ARGS((void));
+extern void gotocmdline __ARGS((int clr));
+extern char_u *ExpandOne __ARGS((expand_T *xp, char_u *str, char_u *orig, int options, int mode));
+extern void ExpandInit __ARGS((expand_T *xp));
+extern void ExpandCleanup __ARGS((expand_T *xp));
+extern void ExpandEscape __ARGS((expand_T *xp, char_u *str, int numfiles, char_u **files, int options));
+extern void tilde_replace __ARGS((char_u *orig_pat, int num_files, char_u **files));
+extern char_u *sm_gettail __ARGS((char_u *s));
+extern char_u *addstar __ARGS((char_u *fname, int len, int context));
+extern void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
+extern int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
+extern int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int))));
+extern char_u *globpath __ARGS((char_u *path, char_u *file));
+extern void init_history __ARGS((void));
+extern int get_histtype __ARGS((char_u *name));
+extern void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
+extern int get_history_idx __ARGS((int histype));
+extern char_u *get_cmdline_str __ARGS((void));
+extern int get_cmdline_pos __ARGS((void));
+extern int set_cmdline_pos __ARGS((int pos));
+extern int get_cmdline_type __ARGS((void));
+extern char_u *get_history_entry __ARGS((int histype, int idx));
+extern int clr_history __ARGS((int histype));
+extern int del_history_entry __ARGS((int histype, char_u *str));
+extern int del_history_idx __ARGS((int histype, int idx));
+extern void remove_key_from_history __ARGS((void));
+extern int get_list_range __ARGS((char_u **str, int *num1, int *num2));
+extern void ex_history __ARGS((exarg_T *eap));
+extern void prepare_viminfo_history __ARGS((int asklen));
+extern int read_viminfo_history __ARGS((vir_T *virp));
+extern void finish_viminfo_history __ARGS((void));
+extern void write_viminfo_history __ARGS((FILE *fp));
+extern void cmd_pchar __ARGS((int c, int offset));
+extern int cmd_gchar __ARGS((int offset));
+extern char_u *script_get __ARGS((exarg_T *eap, char_u *cmd));
 /* vim: set ft=c : */
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index 7183eaf..b1f02fa 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -1,65 +1,65 @@
 /* getchar.c */
-void free_buff __ARGS((struct buffheader *buf));
-char_u *get_recorded __ARGS((void));
-char_u *get_inserted __ARGS((void));
-int stuff_empty __ARGS((void));
-void typeahead_noflush __ARGS((int c));
-void flush_buffers __ARGS((int typeahead));
-void ResetRedobuff __ARGS((void));
-void saveRedobuff __ARGS((void));
-void restoreRedobuff __ARGS((void));
-void AppendToRedobuff __ARGS((char_u *s));
-void AppendToRedobuffLit __ARGS((char_u *str, int len));
-void AppendCharToRedobuff __ARGS((int c));
-void AppendNumberToRedobuff __ARGS((long n));
-void stuffReadbuff __ARGS((char_u *s));
-void stuffReadbuffLen __ARGS((char_u *s, long len));
-void stuffReadbuffSpec __ARGS((char_u *s));
-void stuffcharReadbuff __ARGS((int c));
-void stuffnumReadbuff __ARGS((long n));
-int start_redo __ARGS((long count, int old_redo));
-int start_redo_ins __ARGS((void));
-void stop_redo_ins __ARGS((void));
-int ins_typebuf __ARGS((char_u *str, int noremap, int offset, int nottyped, int silent));
-void ins_char_typebuf __ARGS((int c));
-int typebuf_changed __ARGS((int tb_change_cnt));
-int typebuf_typed __ARGS((void));
-int typebuf_maplen __ARGS((void));
-void del_typebuf __ARGS((int len, int offset));
-int alloc_typebuf __ARGS((void));
-void free_typebuf __ARGS((void));
-int save_typebuf __ARGS((void));
-void save_typeahead __ARGS((tasave_T *tp));
-void restore_typeahead __ARGS((tasave_T *tp));
-void openscript __ARGS((char_u *name, int directly));
-void close_all_scripts __ARGS((void));
-int using_script __ARGS((void));
-void before_blocking __ARGS((void));
-void updatescript __ARGS((int c));
-int vgetc __ARGS((void));
-int safe_vgetc __ARGS((void));
-int vpeekc __ARGS((void));
-int vpeekc_nomap __ARGS((void));
-int vpeekc_any __ARGS((void));
-int char_avail __ARGS((void));
-void vungetc __ARGS((int c));
-int inchar __ARGS((char_u *buf, int maxlen, long wait_time, int tb_change_cnt));
-int fix_input_buffer __ARGS((char_u *buf, int len, int script));
-int input_available __ARGS((void));
-int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
-int get_map_mode __ARGS((char_u **cmdp, int forceit));
-void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
-void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
-int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
-int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
-char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
-int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
-int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
-char_u *vim_strsave_escape_csi __ARGS((char_u *p));
-int makemap __ARGS((FILE *fd, buf_T *buf));
-int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
-void check_map_keycodes __ARGS((void));
-char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
-void init_mappings __ARGS((void));
-void add_map __ARGS((char_u *map, int mode));
+extern void free_buff __ARGS((struct buffheader *buf));
+extern char_u *get_recorded __ARGS((void));
+extern char_u *get_inserted __ARGS((void));
+extern int stuff_empty __ARGS((void));
+extern void typeahead_noflush __ARGS((int c));
+extern void flush_buffers __ARGS((int typeahead));
+extern void ResetRedobuff __ARGS((void));
+extern void saveRedobuff __ARGS((void));
+extern void restoreRedobuff __ARGS((void));
+extern void AppendToRedobuff __ARGS((char_u *s));
+extern void AppendToRedobuffLit __ARGS((char_u *str, int len));
+extern void AppendCharToRedobuff __ARGS((int c));
+extern void AppendNumberToRedobuff __ARGS((long n));
+extern void stuffReadbuff __ARGS((char_u *s));
+extern void stuffReadbuffLen __ARGS((char_u *s, long len));
+extern void stuffReadbuffSpec __ARGS((char_u *s));
+extern void stuffcharReadbuff __ARGS((int c));
+extern void stuffnumReadbuff __ARGS((long n));
+extern int start_redo __ARGS((long count, int old_redo));
+extern int start_redo_ins __ARGS((void));
+extern void stop_redo_ins __ARGS((void));
+extern int ins_typebuf __ARGS((char_u *str, int noremap, int offset, int nottyped, int silent));
+extern void ins_char_typebuf __ARGS((int c));
+extern int typebuf_changed __ARGS((int tb_change_cnt));
+extern int typebuf_typed __ARGS((void));
+extern int typebuf_maplen __ARGS((void));
+extern void del_typebuf __ARGS((int len, int offset));
+extern int alloc_typebuf __ARGS((void));
+extern void free_typebuf __ARGS((void));
+extern int save_typebuf __ARGS((void));
+extern void save_typeahead __ARGS((tasave_T *tp));
+extern void restore_typeahead __ARGS((tasave_T *tp));
+extern void openscript __ARGS((char_u *name, int directly));
+extern void close_all_scripts __ARGS((void));
+extern int using_script __ARGS((void));
+extern void before_blocking __ARGS((void));
+extern void updatescript __ARGS((int c));
+extern int vgetc __ARGS((void));
+extern int safe_vgetc __ARGS((void));
+extern int vpeekc __ARGS((void));
+extern int vpeekc_nomap __ARGS((void));
+extern int vpeekc_any __ARGS((void));
+extern int char_avail __ARGS((void));
+extern void vungetc __ARGS((int c));
+extern int inchar __ARGS((char_u *buf, int maxlen, long wait_time, int tb_change_cnt));
+extern int fix_input_buffer __ARGS((char_u *buf, int len, int script));
+extern int input_available __ARGS((void));
+extern int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
+extern int get_map_mode __ARGS((char_u **cmdp, int forceit));
+extern void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
+extern void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
+extern int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
+extern int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
+extern char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
+extern int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
+extern int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
+extern char_u *vim_strsave_escape_csi __ARGS((char_u *p));
+extern int makemap __ARGS((FILE *fd, buf_T *buf));
+extern int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
+extern void check_map_keycodes __ARGS((void));
+extern char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
+extern void init_mappings __ARGS((void));
+extern void add_map __ARGS((char_u *map, int mode));
 /* vim: set ft=c : */
diff --git a/src/proto/normal.pro b/src/proto/normal.pro
index 55e8163..8280e45 100644
--- a/src/proto/normal.pro
+++ b/src/proto/normal.pro
@@ -1,26 +1,26 @@
 /* normal.c */
-void init_normal_cmds __ARGS((void));
-void normal_cmd __ARGS((oparg_T *oap, int toplevel));
-void do_pending_operator __ARGS((cmdarg_T *cap, int old_col, int gui_yank));
-int do_mouse __ARGS((oparg_T *oap, int c, int dir, long count, int fixindent));
-void check_visual_highlight __ARGS((void));
-void end_visual_mode __ARGS((void));
-void reset_VIsual_and_resel __ARGS((void));
-void reset_VIsual __ARGS((void));
-int find_ident_under_cursor __ARGS((char_u **string, int find_type));
-int find_ident_at_pos __ARGS((win_T *wp, linenr_T lnum, colnr_T startcol, char_u **string, int find_type));
-void clear_showcmd __ARGS((void));
-int add_to_showcmd __ARGS((int c));
-void add_to_showcmd_c __ARGS((int c));
-void push_showcmd __ARGS((void));
-void pop_showcmd __ARGS((void));
-void do_check_scrollbind __ARGS((int check));
-void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
-int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags));
-void scroll_redraw __ARGS((int up, long count));
-void handle_tabmenu __ARGS((void));
-void do_nv_ident __ARGS((int c1, int c2));
-int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
-void start_selection __ARGS((void));
-void may_start_select __ARGS((int c));
+extern void init_normal_cmds __ARGS((void));
+extern void normal_cmd __ARGS((oparg_T *oap, int toplevel));
+extern void do_pending_operator __ARGS((cmdarg_T *cap, int old_col, int gui_yank));
+extern int do_mouse __ARGS((oparg_T *oap, int c, int dir, long count, int fixindent));
+extern void check_visual_highlight __ARGS((void));
+extern void end_visual_mode __ARGS((void));
+extern void reset_VIsual_and_resel __ARGS((void));
+extern void reset_VIsual __ARGS((void));
+extern int find_ident_under_cursor __ARGS((char_u **string, int find_type));
+extern int find_ident_at_pos __ARGS((win_T *wp, linenr_T lnum, colnr_T startcol, char_u **string, int find_type));
+extern void clear_showcmd __ARGS((void));
+extern int add_to_showcmd __ARGS((int c));
+extern void add_to_showcmd_c __ARGS((int c));
+extern void push_showcmd __ARGS((void));
+extern void pop_showcmd __ARGS((void));
+extern void do_check_scrollbind __ARGS((int check));
+extern void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
+extern int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags));
+extern void scroll_redraw __ARGS((int up, long count));
+extern void handle_tabmenu __ARGS((void));
+extern void do_nv_ident __ARGS((int c1, int c2));
+extern int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
+extern void start_selection __ARGS((void));
+extern void may_start_select __ARGS((int c));
 /* vim: set ft=c : */
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
index d1669a0..d6216b9 100644
--- a/src/proto/ops.pro
+++ b/src/proto/ops.pro
@@ -1,61 +1,61 @@
 /* ops.c */
-int get_op_type __ARGS((int char1, int char2));
-int op_on_lines __ARGS((int op));
-int get_op_char __ARGS((int optype));
-int get_extra_op_char __ARGS((int optype));
-void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
-void shift_line __ARGS((int left, int round, int amount));
-void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
-int get_expr_register __ARGS((void));
-void set_expr_line __ARGS((char_u *new_line));
-char_u *get_expr_line __ARGS((void));
-char_u *get_expr_line_src __ARGS((void));
-int valid_yank_reg __ARGS((int regname, int writing));
-void get_yank_register __ARGS((int regname, int writing));
-int may_get_selection __ARGS((int regname));
-void *get_register __ARGS((int name, int copy));
-void put_register __ARGS((int name, void *reg));
-int yank_register_mline __ARGS((int regname));
-int do_record __ARGS((int c));
-int do_execreg __ARGS((int regname, int colon, int addcr));
-int insert_reg __ARGS((int regname, int literally));
-int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
-int cmdline_paste_reg __ARGS((int regname, int literally));
-void adjust_clip_reg __ARGS((int *rp));
-int op_delete __ARGS((oparg_T *oap));
-int op_replace __ARGS((oparg_T *oap, int c));
-void op_tilde __ARGS((oparg_T *oap));
-int swapchar __ARGS((int op_type, pos_T *pos));
-void op_insert __ARGS((oparg_T *oap, long count1));
-int op_change __ARGS((oparg_T *oap));
-void init_yank __ARGS((void));
-void clear_registers __ARGS((void));
-int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
-void do_put __ARGS((int regname, int dir, long count, int flags));
-void adjust_cursor_eol __ARGS((void));
-int preprocs_left __ARGS((void));
-int get_register_name __ARGS((int num));
-void ex_display __ARGS((exarg_T *eap));
-void do_do_join __ARGS((long count, int insert_space));
-int do_join __ARGS((int insert_space));
-void op_format __ARGS((oparg_T *oap, int keep_cursor));
-void op_formatexpr __ARGS((oparg_T *oap));
-int fex_format __ARGS((linenr_T lnum, long count, int c));
-void format_lines __ARGS((linenr_T line_count));
-int paragraph_start __ARGS((linenr_T lnum));
-int do_addsub __ARGS((int command, linenr_T Prenum1));
-int read_viminfo_register __ARGS((vir_T *virp, int force));
-void write_viminfo_registers __ARGS((FILE *fp));
-void x11_export_final_selection __ARGS((void));
-void clip_free_selection __ARGS((VimClipboard *cbd));
-void clip_get_selection __ARGS((VimClipboard *cbd));
-void clip_yank_selection __ARGS((int type, char_u *str, long len, VimClipboard *cbd));
-int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
-void dnd_yank_drag_data __ARGS((char_u *str, long len));
-char_u get_reg_type __ARGS((int regname, long *reglen));
-char_u *get_reg_contents __ARGS((int regname, int allowexpr, int expr_src));
-void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
-void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
-void clear_oparg __ARGS((oparg_T *oap));
-void cursor_pos_info __ARGS((void));
+extern int get_op_type __ARGS((int char1, int char2));
+extern int op_on_lines __ARGS((int op));
+extern int get_op_char __ARGS((int optype));
+extern int get_extra_op_char __ARGS((int optype));
+extern void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
+extern void shift_line __ARGS((int left, int round, int amount));
+extern void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
+extern int get_expr_register __ARGS((void));
+extern void set_expr_line __ARGS((char_u *new_line));
+extern char_u *get_expr_line __ARGS((void));
+extern char_u *get_expr_line_src __ARGS((void));
+extern int valid_yank_reg __ARGS((int regname, int writing));
+extern void get_yank_register __ARGS((int regname, int writing));
+extern int may_get_selection __ARGS((int regname));
+extern void *get_register __ARGS((int name, int copy));
+extern void put_register __ARGS((int name, void *reg));
+extern int yank_register_mline __ARGS((int regname));
+extern int do_record __ARGS((int c));
+extern int do_execreg __ARGS((int regname, int colon, int addcr));
+extern int insert_reg __ARGS((int regname, int literally));
+extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
+extern int cmdline_paste_reg __ARGS((int regname, int literally));
+extern void adjust_clip_reg __ARGS((int *rp));
+extern int op_delete __ARGS((oparg_T *oap));
+extern int op_replace __ARGS((oparg_T *oap, int c));
+extern void op_tilde __ARGS((oparg_T *oap));
+extern int swapchar __ARGS((int op_type, pos_T *pos));
+extern void op_insert __ARGS((oparg_T *oap, long count1));
+extern int op_change __ARGS((oparg_T *oap));
+extern void init_yank __ARGS((void));
+extern void clear_registers __ARGS((void));
+extern int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
+extern void do_put __ARGS((int regname, int dir, long count, int flags));
+extern void adjust_cursor_eol __ARGS((void));
+extern int preprocs_left __ARGS((void));
+extern int get_register_name __ARGS((int num));
+extern void ex_display __ARGS((exarg_T *eap));
+extern void do_do_join __ARGS((long count, int insert_space));
+extern int do_join __ARGS((int insert_space));
+extern void op_format __ARGS((oparg_T *oap, int keep_cursor));
+extern void op_formatexpr __ARGS((oparg_T *oap));
+extern int fex_format __ARGS((linenr_T lnum, long count, int c));
+extern void format_lines __ARGS((linenr_T line_count));
+extern int paragraph_start __ARGS((linenr_T lnum));
+extern int do_addsub __ARGS((int command, linenr_T Prenum1));
+extern int read_viminfo_register __ARGS((vir_T *virp, int force));
+extern void write_viminfo_registers __ARGS((FILE *fp));
+extern void x11_export_final_selection __ARGS((void));
+extern void clip_free_selection __ARGS((VimClipboard *cbd));
+extern void clip_get_selection __ARGS((VimClipboard *cbd));
+extern void clip_yank_selection __ARGS((int type, char_u *str, long len, VimClipboard *cbd));
+extern int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
+extern void dnd_yank_drag_data __ARGS((char_u *str, long len));
+extern char_u get_reg_type __ARGS((int regname, long *reglen));
+extern char_u *get_reg_contents __ARGS((int regname, int allowexpr, int expr_src));
+extern void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
+extern void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
+extern void clear_oparg __ARGS((oparg_T *oap));
+extern void cursor_pos_info __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/proto/window.pro b/src/proto/window.pro
index 45a90b8..ad40a52 100644
--- a/src/proto/window.pro
+++ b/src/proto/window.pro
@@ -1,62 +1,62 @@
 /* window.c */
-void do_window __ARGS((int nchar, long Prenum, int xchar));
-int win_split __ARGS((int size, int flags));
-int win_valid __ARGS((win_T *win));
-int win_count __ARGS((void));
-int make_windows __ARGS((int count, int vertical));
-void win_move_after __ARGS((win_T *win1, win_T *win2));
-void win_equal __ARGS((win_T *next_curwin, int current, int dir));
-void close_windows __ARGS((buf_T *buf, int keep_curwin));
-void win_close __ARGS((win_T *win, int free_buf));
-void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
-void win_free_all __ARGS((void));
-void close_others __ARGS((int message, int forceit));
-void curwin_init __ARGS((void));
-int win_alloc_first __ARGS((void));
-void win_init_size __ARGS((void));
-void free_tabpage __ARGS((tabpage_T *tp));
-int win_new_tabpage __ARGS((int after));
-int may_open_tabpage __ARGS((void));
-int make_tabpages __ARGS((int maxcount));
-int valid_tabpage __ARGS((tabpage_T *tpc));
-tabpage_T *find_tabpage __ARGS((int n));
-int tabpage_index __ARGS((tabpage_T *ftp));
-void goto_tabpage __ARGS((int n));
-void goto_tabpage_tp __ARGS((tabpage_T *tp));
-void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp));
-void tabpage_move __ARGS((int nr));
-void win_goto __ARGS((win_T *wp));
-win_T *win_find_nr __ARGS((int winnr));
-void win_enter __ARGS((win_T *wp, int undo_sync));
-win_T *buf_jump_open_win __ARGS((buf_T *buf));
-win_T *buf_jump_open_tab __ARGS((buf_T *buf));
-int win_alloc_lines __ARGS((win_T *wp));
-void win_free_lsize __ARGS((win_T *wp));
-void shell_new_rows __ARGS((void));
-void shell_new_columns __ARGS((void));
-void win_size_save __ARGS((garray_T *gap));
-void win_size_restore __ARGS((garray_T *gap));
-int win_comp_pos __ARGS((void));
-void win_setheight __ARGS((int height));
-void win_setheight_win __ARGS((int height, win_T *win));
-void win_setwidth __ARGS((int width));
-void win_setwidth_win __ARGS((int width, win_T *wp));
-void win_setminheight __ARGS((void));
-void win_drag_status_line __ARGS((win_T *dragwin, int offset));
-void win_drag_vsep_line __ARGS((win_T *dragwin, int offset));
-void win_comp_scroll __ARGS((win_T *wp));
-void command_height __ARGS((void));
-void last_status __ARGS((int morewin));
-int tabline_height __ARGS((void));
-char_u *grab_file_name __ARGS((long count, linenr_T *file_lnum));
-char_u *file_name_at_cursor __ARGS((int options, long count, linenr_T *file_lnum));
-char_u *file_name_in_line __ARGS((char_u *line, int col, int options, long count, char_u *rel_fname, linenr_T *file_lnum));
-char_u *find_file_name_in_path __ARGS((char_u *ptr, int len, int options, long count, char_u *rel_fname));
-int path_with_url __ARGS((char_u *fname));
-int vim_isAbsName __ARGS((char_u *name));
-int vim_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
-int min_rows __ARGS((void));
-int only_one_window __ARGS((void));
-void check_lnums __ARGS((int do_curwin));
-int win_hasvertsplit __ARGS((void));
+extern void do_window __ARGS((int nchar, long Prenum, int xchar));
+extern int win_split __ARGS((int size, int flags));
+extern int win_valid __ARGS((win_T *win));
+extern int win_count __ARGS((void));
+extern int make_windows __ARGS((int count, int vertical));
+extern void win_move_after __ARGS((win_T *win1, win_T *win2));
+extern void win_equal __ARGS((win_T *next_curwin, int current, int dir));
+extern void close_windows __ARGS((buf_T *buf, int keep_curwin));
+extern void win_close __ARGS((win_T *win, int free_buf));
+extern void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
+extern void win_free_all __ARGS((void));
+extern void close_others __ARGS((int message, int forceit));
+extern void curwin_init __ARGS((void));
+extern int win_alloc_first __ARGS((void));
+extern void win_init_size __ARGS((void));
+extern void free_tabpage __ARGS((tabpage_T *tp));
+extern int win_new_tabpage __ARGS((int after));
+extern int may_open_tabpage __ARGS((void));
+extern int make_tabpages __ARGS((int maxcount));
+extern int valid_tabpage __ARGS((tabpage_T *tpc));
+extern tabpage_T *find_tabpage __ARGS((int n));
+extern int tabpage_index __ARGS((tabpage_T *ftp));
+extern void goto_tabpage __ARGS((int n));
+extern void goto_tabpage_tp __ARGS((tabpage_T *tp));
+extern void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp));
+extern void tabpage_move __ARGS((int nr));
+extern void win_goto __ARGS((win_T *wp));
+extern win_T *win_find_nr __ARGS((int winnr));
+extern void win_enter __ARGS((win_T *wp, int undo_sync));
+extern win_T *buf_jump_open_win __ARGS((buf_T *buf));
+extern win_T *buf_jump_open_tab __ARGS((buf_T *buf));
+extern int win_alloc_lines __ARGS((win_T *wp));
+extern void win_free_lsize __ARGS((win_T *wp));
+extern void shell_new_rows __ARGS((void));
+extern void shell_new_columns __ARGS((void));
+extern void win_size_save __ARGS((garray_T *gap));
+extern void win_size_restore __ARGS((garray_T *gap));
+extern int win_comp_pos __ARGS((void));
+extern void win_setheight __ARGS((int height));
+extern void win_setheight_win __ARGS((int height, win_T *win));
+extern void win_setwidth __ARGS((int width));
+extern void win_setwidth_win __ARGS((int width, win_T *wp));
+extern void win_setminheight __ARGS((void));
+extern void win_drag_status_line __ARGS((win_T *dragwin, int offset));
+extern void win_drag_vsep_line __ARGS((win_T *dragwin, int offset));
+extern void win_comp_scroll __ARGS((win_T *wp));
+extern void command_height __ARGS((void));
+extern void last_status __ARGS((int morewin));
+extern int tabline_height __ARGS((void));
+extern char_u *grab_file_name __ARGS((long count, linenr_T *file_lnum));
+extern char_u *file_name_at_cursor __ARGS((int options, long count, linenr_T *file_lnum));
+extern char_u *file_name_in_line __ARGS((char_u *line, int col, int options, long count, char_u *rel_fname, linenr_T *file_lnum));
+extern char_u *find_file_name_in_path __ARGS((char_u *ptr, int len, int options, long count, char_u *rel_fname));
+extern int path_with_url __ARGS((char_u *fname));
+extern int vim_isAbsName __ARGS((char_u *name));
+extern int vim_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+extern int min_rows __ARGS((void));
+extern int only_one_window __ARGS((void));
+extern void check_lnums __ARGS((int do_curwin));
+extern int win_hasvertsplit __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/quickfix.c b/src/quickfix.c
index 739b894..95cf8f7 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3071,9 +3071,9 @@
 				regmatch.startpos[0].col + 1,
 				FALSE,      /* vis_col */
 				NULL,	    /* search pattern */
-				0,          /* nr */
-				0,          /* type */
-				TRUE        /* valid */
+				0,	    /* nr */
+				0,	    /* type */
+				TRUE	    /* valid */
 				) == FAIL)
 		    {
 			got_int = TRUE;
diff --git a/src/regexp.c b/src/regexp.c
index 2cd3120..3b5a148 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -101,8 +101,8 @@
  *		       +----------------------+
  *		       V		      |
  * <aa>\+	BRANCH <aa> --> BRANCH --> BACK  BRANCH --> NOTHING --> END
- *		     |	             |	         ^		        ^
- *		     |	             +-----------+		        |
+ *		     |		     |		 ^			^
+ *		     |		     +-----------+			|
  *		     +--------------------------------------------------+
  *
  *
@@ -1930,7 +1930,7 @@
 			      }
 
 			      if (i < 0)
-			          EMSG_M_RET_NULL(
+				  EMSG_M_RET_NULL(
 					_("E678: Invalid character after %s%%[dxouU]"),
 					reg_magic == MAGIC_ALL);
 #ifdef FEAT_MBYTE
@@ -2834,7 +2834,7 @@
  * Return -1 if there is no valid hex number.
  * The position is updated:
  *     blahblah\%x20asdf
- *         before-^ ^-after
+ *	   before-^ ^-after
  * The parameter controls the maximum number of input characters. This will be
  * 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence.
  */
@@ -2893,7 +2893,7 @@
  * numbers > 377 correctly (for example, 400 is treated as 40) and doesn't
  * treat 8 or 9 as recognised characters. Position is updated:
  *     blahblah\%o210asdf
- *         before-^  ^-after
+ *	   before-^  ^-after
  */
     static int
 getoctchrs()
diff --git a/src/screen.c b/src/screen.c
index 8c52aad..f57adc04 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -9335,8 +9335,8 @@
     n = 0;
     do
     {
-        lnum /= 10;
-        ++n;
+	lnum /= 10;
+	++n;
     } while (lnum > 0);
 
     /* 'numberwidth' gives the minimal width plus one */
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 3bbd964..26ba30c 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -25,7 +25,7 @@
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
 		test56.out test57.out test58.out test59.out test60.out \
-		test61.out
+		test61.out test62.out
 
 .SUFFIXES: .in .out
 
@@ -106,3 +106,4 @@
 test59.out: test59.in
 test60.out: test60.in
 test61.out: test61.in
+test62.out: test62.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index eec1f9b..99d89f7 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -19,7 +19,7 @@
 		test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out \
 		test55.out test56.out test57.out test58.out test59.out \
-		test60.out test61.out
+		test60.out test61.out test62.out
 
 SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test8.out test9.out test11.out test13.out test14.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 15f8d33..423fc80 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -25,7 +25,7 @@
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
 		test56.out test57.out test58.out test59.out test60.out \
-		test61.out
+		test61.out test62.out
 
 .SUFFIXES: .in .out
 
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 57101fc..cef07e9 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2006 Mar 15
+# Last change:  2006 Apr 30
 #
 # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX.
 # Edit the lines in the Configuration section below to select.
@@ -59,7 +59,7 @@
 	 test43.out test44.out test45.out test46.out \
 	 test48.out test51.out test53.out test54.out test55.out \
 	 test56.out test57.out test58.out test59.out test60.out \
-	 test61.out
+	 test61.out test62.out
 
 .IFDEF WANT_GUI
 SCRIPT_GUI = test16.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 4064cc1..747b187 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -15,7 +15,7 @@
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test49.out test51.out test52.out test53.out \
 		test54.out test55.out test56.out test57.out test58.out \
-		test59.out test60.out test61.out
+		test59.out test60.out test61.out test62.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test34.in b/src/testdir/test34.in
index 6760700..4781fec 100644
--- a/src/testdir/test34.in
+++ b/src/testdir/test34.in
@@ -1,4 +1,5 @@
-Test for user functions
+Test for user functions.
+Also test an <expr> mapping calling a function.
 
 STARTTEST
 :so small.vim
@@ -18,6 +19,27 @@
 :  exe "let g:" . a:divname . " = ". a:n1 / a:n2
 :  return "ok"
 :endfunction
+:func Expr1()
+:  normal! v
+:  return "111"
+:endfunc
+:func Expr2()
+:  call search('XX', 'b')
+:  return "222"
+:endfunc
+:func ListItem()
+:  let g:counter += 1
+:  return g:counter . '. '
+:endfunc
+:func ListReset()
+:  let g:counter = 0
+:  return ''
+:endfunc
+:let counter = 0
+:inoremap <expr> ( ListItem()
+:inoremap <expr> [ ListReset()
+:imap <expr> + Expr1()
+:imap <expr> * Expr2()
 :let retval = "nop"
 /^here
 C=Table("xxx", 4, "asdf")
@@ -25,7 +47,12 @@
  =retval
  =Compute(45, 5, "retval")
  =retval
-:.wq! test.out
+
+XX+-XX
+---*---
+(one
+(two
+[(one again:$-5,$wq! test.out
 ENDTEST
 
 here
diff --git a/src/testdir/test34.ok b/src/testdir/test34.ok
index 6dab52f..368ae10 100644
--- a/src/testdir/test34.ok
+++ b/src/testdir/test34.ok
@@ -1 +1,6 @@
 xxx4asdf fail nop ok 9
+XX111XX
+---222---
+1. one
+2. two
+1. one again
diff --git a/src/testdir/test62.in b/src/testdir/test62.in
new file mode 100644
index 0000000..e507c6a
--- /dev/null
+++ b/src/testdir/test62.in
@@ -0,0 +1,32 @@
+Tests for tab pages
+
+STARTTEST
+:so small.vim
+:" Simple test for opening and closing a tab page
+:tabnew
+:let nr = tabpagenr()
+:q
+:call append(line('$'), 'tab page ' . nr)
+:"
+:" Open three tab pages and use ":tabdo"
+:0tabnew
+:1tabnew
+:888tabnew
+:tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
+:tabclose! 2
+:tabrewind
+:let line1 = getline('$')
+:undo
+:q
+:tablast
+:let line2 = getline('$')
+:q!
+:call append(line('$'), line1)
+:call append(line('$'), line2)
+:"
+:"
+:/^Results/,$w! test.out
+:qa!
+ENDTEST
+
+Results:
diff --git a/src/testdir/test62.ok b/src/testdir/test62.ok
new file mode 100644
index 0000000..57438ed
--- /dev/null
+++ b/src/testdir/test62.ok
@@ -0,0 +1,5 @@
+Results:
+tab page 2
+this is tab page 3
+this is tab page 1
+this is tab page 4
diff --git a/src/version.h b/src/version.h
index 939a118..0243df9 100644
--- a/src/version.h
+++ b/src/version.h
@@ -19,9 +19,9 @@
 #define VIM_VERSION_MINOR_STR		"0"
 #define VIM_VERSION_100	    (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
 
-#define VIM_VERSION_BUILD		 260
-#define VIM_VERSION_BUILD_BCD		0x104
-#define VIM_VERSION_BUILD_STR		"260"
+#define VIM_VERSION_BUILD		 261
+#define VIM_VERSION_BUILD_BCD		0x105
+#define VIM_VERSION_BUILD_STR		"261"
 #define VIM_VERSION_PATCHLEVEL		 0
 #define VIM_VERSION_PATCHLEVEL_STR	"0"
 /* Used by MacOS port should be one of: development, alpha, beta, final */
@@ -33,8 +33,8 @@
  * VIM_VERSION_MEDIUM is used for the startup-screen.
  * VIM_VERSION_LONG is used for the ":version" command and "Vim -h".
  */
-#define VIM_VERSION_NODOT	"vim70f"
-#define VIM_VERSION_SHORT	"7.0f"
-#define VIM_VERSION_MEDIUM	"7.0f05 BETA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0f05 BETA (2006 Apr 29)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0f05 BETA (2006 Apr 29, compiled "
+#define VIM_VERSION_NODOT	"vim70g"
+#define VIM_VERSION_SHORT	"7.0g"
+#define VIM_VERSION_MEDIUM	"7.0g BETA"
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0g BETA (2006 Apr 30)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0g BETA (2006 Apr 30, compiled "
diff --git a/src/vim.h b/src/vim.h
index 937fc6a..3ee12bf 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -253,7 +253,7 @@
 /* if we're compiling in C++ (currently only KVim), the system
  * headers must have the correct prototypes or nothing will build.
  * conversely, our prototypes might clash due to throw() specifiers and
- * cause compilation failures even though the headers are correct.  for
+ * cause compilation failures even though the headers are correct.  For
  * a concrete example, gcc-3.2 enforces exception specifications, and
  * glibc-2.2.5 has them in their system headers.
  */
@@ -352,7 +352,7 @@
 # define PRINTF_HEX_LONG_U "0x%Ix"
 #else
 typedef unsigned long	long_u;
-typedef	         long	long_i;
+typedef		 long	long_i;
 # define SCANF_HEX_LONG_U  "%lx"
 # define PRINTF_HEX_LONG_U "0x%lx"
 #endif
diff --git a/src/window.c b/src/window.c
index 718ce2e..7ba9e22 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1995,7 +1995,6 @@
     int		free_buf;
 {
     win_T	*wp;
-    buf_T	*old_curbuf = curbuf;
 #ifdef FEAT_AUTOCMD
     int		other_buffer = FALSE;
 #endif
@@ -2010,6 +2009,30 @@
 	return;
     }
 
+    /*
+     * When closing the last window in a tab page first go to another tab
+     * page and then close the window and the tab page.  This avoids that
+     * curwin and curtab are not invalid while we are freeing memory, they may
+     * be used in GUI events.
+     */
+    if (firstwin == lastwin)
+    {
+	goto_tabpage_tp(alt_tabpage());
+	redraw_tabline = TRUE;
+
+	/* Safety check: Autocommands may have closed the window when jumping
+	 * to the other tab page. */
+	if (valid_tabpage(prev_curtab) && prev_curtab->tp_firstwin == win)
+	{
+	    int	    h = tabline_height();
+
+	    win_close_othertab(win, free_buf, prev_curtab);
+	    if (h != tabline_height())
+		shell_new_rows();
+	}
+	return;
+    }
+
     /* When closing the help window, try restoring a snapshot after closing
      * the window.  Otherwise clear the snapshot, it's now invalid. */
     if (win->w_buffer->b_help)
@@ -2057,40 +2080,6 @@
     if (!win_valid(win) || last_window() || curtab != prev_curtab)
 	return;
 
-    /* When closing the last window in a tab page go to another tab page. This
-     * must be done before freeing memory to avoid that "topframe" becomes
-     * invalid (it may be used in GUI events). */
-    if (firstwin == lastwin)
-    {
-	tabpage_T   *ptp = NULL;
-	tabpage_T   *tp;
-	tabpage_T   *atp = alt_tabpage();
-
-	/* We don't do the window resizing stuff, let enter_tabpage() take
-	 * care of entering a window in another tab page. */
-	enter_tabpage(atp, old_curbuf);
-
-	for (tp = first_tabpage; tp != NULL && tp != prev_curtab;
-							     tp = tp->tp_next)
-	    ptp = tp;
-	if (tp != prev_curtab || tp->tp_firstwin != win)
-	{
-	    /* Autocommands must have closed it when jumping to the other tab
-	     * page. */
-	    return;
-	}
-
-	(void)win_free_mem(win, &dir, tp);
-
-	if (ptp == NULL)
-	    first_tabpage = tp->tp_next;
-	else
-	    ptp->tp_next = tp->tp_next;
-	free_tabpage(tp);
-
-	return;
-    }
-
     /* Free the memory used for the window. */
     wp = win_free_mem(win, &dir, NULL);
 
@@ -2174,7 +2163,8 @@
  * Close window "win" in tab page "tp", which is not the current tab page.
  * This may be the last window ih that tab page and result in closing the tab,
  * thus "tp" may become invalid!
- * Called must check if buffer is hidden.
+ * Caller must check if buffer is hidden and whether the tabline needs to be
+ * updated.
  */
     void
 win_close_othertab(win, free_buf, tp)
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 42bcdaa..7700ecf 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -278,7 +278,7 @@
 #if 0	/* this doesn't work when there is normal text after the hex codes in
 	   the last line that looks like hex */
       if (c == ' ' || c == '\n' || c == '\t')  /* allow multiple spaces */
-        continue;
+	continue;
 #endif
 
       n3 = n2;