updated for version 7.0163
diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt
index 8b944c3..adb1ca1 100644
--- a/src/INSTALLmac.txt
+++ b/src/INSTALLmac.txt
@@ -15,12 +15,7 @@
  1.1. Carbon interface
  1.2. X (Athena, GTK, Motif) or plain text.
 
-2 MacOS Classic
- 2.1. CodeWarrior
- 2.2. MPW
-
-NOTE: The Carbon version can only be compiled properly under
-      MacOS X.
+MacOS Classic is no longer supported.  If you really want it use Vim 6.4.
 
 ----------------------------------------------------------------------------
 1 MacOS X
@@ -57,108 +52,4 @@
  NOTE: You need to first install XFree86 and XDarwin.
        Please visit http://www.XDarwin.org
 
-----------------------------------------------------------------------------
-MacOS 9
-----------------------------------------------------------------------------
-
-Both ':' and '/' supported as path separator.
-
-2.1: Compiling with CodeWarior
-
- 1. Expand the resource file:
-   open ../src/os_mac.rsr.hqx to produce ../src/gui_mac.rsrc:
-   % cd vim62/src
-   % open -a StuffIt\ Expander os_mac.rsr.hqx
-
- 2. Expand the project file:
-   - ../src/os_mac.sit.hqx (to produce ../src/vim.mcp)
-
- 3. Open vim.mcp with CodeWarior
-
-   This is a CodeWarior 9 project file. When using a newer version,
-   you need to convert the file. you may also need to change some
-   access path.
-
-   NOTE: the current project file is old, you need to add a few files:
-	 (ex_cmds2.c, fold.c, mbyte.c, move.c)
-
- 4. Select the target PPC, 68k FAT (with/without debugger)
-
- 5. Compile
-
-2.2: Compiling with MPW.
-
- 0. You will need a recent version of the MPW and the Universal Interfaces.
-    You can get both at:
-	ftp://ftp.apple.com/developer/Tool_Chest/Interfaces-Libraries/
-	ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/
-   For a Carbon version you will need a recent Carbon SDK as well.
-   (When you have an older version already installed you not be able to
-    compile a carbon version. Update "CreateMake" which is available at
-    Apple.
-
- 1. Expand the resource file:
-   open ../src/os_mac.rsr.hqx to produce ../src/gui_mac.rsrc:
-   % cd vim62/src
-   % open -a StuffIt\ Expander os_mac.rsr.hqx
-
- 3. Double click on os_make.make, the MPW will now open in the correct
-    folder and load the CreateVimMake script. Change to the Worksheet
-    window. Type "os_mac.build" and hit Enter (not Return). A dialog box
-    will appear. Select the target you want. (Vim-68k, Vim-ppc, Vim-carbon)
-
- 4. Select "Build" from the menu (or type command-B). Type the program name
-    into the dialog box.
-
 ------------------------------------------------------
-
-OLD FILE: SOME INFO MAY STILL BE USEFUL
-
-NOTE: Users of more recent CodeWarrior version may have to reset the library
-      path, and change the mch_delay in os_mac.c so the finalTick is unsigned.
-
-Compilation instructions:
-
-1. Visit the Vim ftp site (see ftp://ftp.vim.org/pub/vim/MIRRORS)
-   and obtain the following five files:
-
-   unix/vim-X.X-src1.tar.gz
-   unix/vim-X.X-src2.tar.gz
-   unix/vim-X.X-rt1.tar.gz
-   unix/vim-X.X-rt2.tar.gz
-   extra/vim-X.X-extra.tar.gz
-
-   where X.X is the version number.
-
-   NOTE: the language support is not yet supported
-
-2. Expand the archives.
-
-3. Apply patches if they exist.  (Patch files are found in the ftp
-   site in the "patches" directory.)
-
-4. Edit vim-X.X/src/feature.h for your preference.  (You can skip
-   this, then you will get the default behavior as is documented,
-   which should be fine for most people.)
-
-   For example, if you want to add the FEAT_MBYTE feature, turn on
-   #define FEAT_MBYTE
-
-5. Expand the resource file:
-
-   - vim-X.X/src/os_mac.rsr.hqx (to produce vim-X.X/src/gui_mac.rsrc)
-
-6. If using CodeWarrior, expand the project file:
-
-   - vim-X.X/src/os_mac.sit.hqx (to produce vim-X.X/src/vim.mcp)
-
-   The latter file is the CodeWarrior project file to be used.
-
-7. Launch CodeWarrior by double clicking vim.mcp.
-
-8. Check additional files if you include non-standard features.
-
-   For example, if you added the MULTI_BYTE feature, check
-   Extras/mbyte.c in the project window.
-
-9. Compile and you will obtain binaries: vimPPC, Vim 68k, and/or vimFAT.
diff --git a/src/Makefile b/src/Makefile
index 56ab707..8dd1be3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -34,7 +34,7 @@
 #	  X11 Session Management Protocol (XSMP) library (libSM) but do not
 #	  want to use it.
 #	  This can speedup Vim startup but Vim loses the ability to catch the
-#	  user logging out from session-managers like GNOME & KDE and work
+#	  user logging out from session-managers like GNOME and work
 #	  could be lost.
 #	- Uncomment one or more of these lines to include an interface;
 #	  each makes Vim quite a bit bigger:
@@ -338,8 +338,6 @@
 # automatically be used if it is found.  If you have GNOME, but do not want to
 # use it (e.g., want a GTK-only version), then use --enable-gui=gtk.
 #
-# KDE doesn't fully work, unfortunately.  See the todo list.
-#
 # If the selected GUI isn't found, the GUI is disabled automatically
 #CONF_OPT_GUI = --enable-gui=gtk
 #CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest
@@ -348,7 +346,6 @@
 #CONF_OPT_GUI = --enable-gui=gnome
 #CONF_OPT_GUI = --enable-gui=gnome2
 #CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest
-#CONF_OPT_GUI = --enable-gui=kde
 #CONF_OPT_GUI = --enable-gui=motif
 #CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared"
 #CONF_OPT_GUI = --enable-gui=athena
@@ -1087,23 +1084,6 @@
 # Without a GUI install the normal way.
 NONE_INSTALL = install_normal
 
-### KDE GUI interface.
-KDE_SRC		= gui.c pty.c gui_kde.cc gui_kde_x11.cc gui_kde_wid.cc gui_kde_wid_moc.cc kvim_iface_skel.cc
-KDE_OBJ		= objects/gui.o objects/pty.o objects/gui_kde.o objects/gui_kde_x11.o \
-			objects/gui_kde_wid.o objects/gui_kde_wid_moc.o \
-			objects/kvim_iface_skel.o
-KDE_DEFS	= -DFEAT_GUI_KDE $(NARROW_PROTO)
-KDE_IPATH	= $(GUI_INC_LOC)
-KDE_LIBS_DIR	= $(GUI_LIB_LOC)	# Includes the libraries themselves
-KDE_DIR		= $(KDE_PREFIX)
-KDE_LIBS1	=
-KDE_LIBS2	=
-KDE_INSTALL     = install_normal
-KDE_TARGETS	= installglinks installkdeicons
-KDE_MAN_TARGETS = yes
-KDE_TESTTARGET  = gui
-KDE_BUNDLE	=
-
 ### GTK GUI
 GTK_SRC		= gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_gtk_f.c \
 			gui_beval.c
@@ -1230,7 +1210,7 @@
 CARBONGUI_TESTARG = VIMPROG=../$(APPDIR)/Contents/MacOS/$(VIMTARGET)
 
 # All GUI files
-ALL_GUI_SRC  = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c gui_kde.cc gui_kde_wid.cc gui_kde_x11.cc gui_kde_wid_moc.cc
+ALL_GUI_SRC  = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_athena.c gui_gtk_x11.c gui_x11.c gui_at_sb.c gui_at_fs.c pty.c
 ALL_GUI_PRO  = gui.pro gui_gtk.pro gui_motif.pro gui_xmdlg.pro gui_athena.pro gui_gtk_x11.pro gui_x11.pro gui_w16.pro gui_w32.pro gui_photon.pro
 
 # }}}
@@ -1277,7 +1257,7 @@
 SHELL = /bin/sh
 
 .SUFFIXES:
-.SUFFIXES: .cc .c .o .pro
+.SUFFIXES: .c .o .pro
 
 PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS)
 POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(RUBY_CFLAGS) $(EXTRA_DEFS)
@@ -1395,7 +1375,7 @@
 	$(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(RUBY_SRC) \
 	$(SNIFF_SRC) $(WORKSHOP_SRC) $(WSDEBUG_SRC)
 
-TAGS_SRC = *.c *.cpp *.cc if_perl.xs
+TAGS_SRC = *.c *.cpp if_perl.xs
 
 EXTRA_SRC = hangulin.c if_mzsch.c auto/if_perl.c if_perlsfio.c \
 	    if_python.c if_tcl.c if_ruby.c if_sniff.c gui_beval.c \
@@ -1947,23 +1927,6 @@
 	   chmod $(FILEMOD) $(DEST_KMAP)/README.txt $(DEST_KMAP)/*.vim; \
 	fi
 
-# Install the icons for the KDE GUI.  This differs from the KDE icons for
-# other GUIs.
-installkdeicons:
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/applnk/Editors/
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/32x32/apps/
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/48x48/apps/
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/22x22/actions/
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/16x16/actions/
-	mkdir -p $(DESTDIR)$(KDE_DIR)/share/apps/kvim
-
-	cp ../runtime/KVim.desktop $(DESTDIR)$(KDE_DIR)/share/applnk/Editors/ && chmod 644 $(DESTDIR)$(KDE_DIR)/share/applnk/Editors/KVim.desktop
-	cp ../runtime/kvim32x32.png $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/32x32/apps/kvim.png && chmod 644 $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/32x32/apps/kvim.png
-	cp ../runtime/kvim48x48.png $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/48x48/apps/kvim.png && chmod 644 $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/48x48/apps/kvim.png
-	cp ../runtime/hi16-action-make.png $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/16x16/actions/hi16-action-make.png
-	cp ../runtime/hi22-action-make.png $(DESTDIR)$(KDE_DIR)/share/icons/hicolor/22x22/actions/hi22-action-make.png
-	cp ../runtime/kde-tips $(DESTDIR)$(KDE_DIR)/share/apps/kvim/tips && chmod 644 $(DESTDIR)$(KDE_DIR)/share/apps/kvim/tips
-
 # install the icons for KDE, if the directory exists and the icon doesn't.
 ICON48PATH = $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
 ICON32PATH = $(DESTDIR)$(DATADIR)/icons/locolor/32x32/apps
@@ -2145,7 +2108,6 @@
 	-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c
 	-rm -f conftest* *~ auto/link.sed
 	-rm -rf $(APPDIR)
-	-rm -f gui_kde_wid_moc.cc kvim_iface_skel.cc *.kidl
 	if test -d $(PODIR); then \
 		cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
 	fi
@@ -2239,9 +2201,6 @@
 .c.o:
 	$(CCC) $<
 
-.cc.o:
-	$(CCC) $<
-
 auto/if_perl.c: if_perl.xs
 	$(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@
 	$(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
@@ -2512,26 +2471,6 @@
 objects/wsdebug.o: wsdebug.c
 	$(CCC) -o $@ wsdebug.c
 
-objects/gui_kde.o: gui_kde.cc
-	$(CCC) -o $@ gui_kde.cc
-
-objects/gui_kde_x11.o: gui_kde_x11.cc
-	$(CCC) -o $@ gui_kde_x11.cc
-
-objects/gui_kde_wid.o: gui_kde_wid.cc
-	$(MOC) -o gui_kde_wid_moc.cc gui_kde_wid.h
-	$(KDE_DIR)/bin/dcopidl kvim_iface.h > kvim_iface.kidl || ( rm -f kvim_iface.kidl ; /bin/false )
-	$(KDE_DIR)/bin/dcopidl2cpp --c++-suffix cc --no-stub kvim_iface.kidl
-	$(CCC) -o $@ gui_kde_wid.cc
-
-gui_kde_wid_moc.cc: objects/gui_kde_wid.o
-objects/gui_kde_wid_moc.o: gui_kde_wid_moc.cc
-	$(CCC) -o $@ gui_kde_wid_moc.cc
-
-kvim_iface_skel.cc: objects/gui_kde_wid.o
-objects/kvim_iface_skel.o: kvim_iface_skel.cc
-	$(CCC) -o $@ kvim_iface_skel.cc
-
 objects/netbeans.o: netbeans.c
 	$(CCC) -o $@ netbeans.c
 
@@ -2897,36 +2836,6 @@
   keymap.h term.h macros.h structs.h regexp.h gui.h gui_beval.h \
   proto/gui_beval.pro option.h ex_cmds.h proto.h globals.h farsi.h \
   arabic.h if_sniff.h
-objects/gui_kde.o: gui_kde.cc gui_kde_wid.h kvim_iface.h vim.h auto/config.h \
-  feature.h os_unix.h ascii.h keymap.h term.h macros.h structs.h regexp.h \
-  gui.h gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h \
-  globals.h farsi.h arabic.h if_sniff.h ../pixmaps/tb_new.xpm \
-  ../pixmaps/tb_open.xpm ../pixmaps/tb_close.xpm ../pixmaps/tb_save.xpm \
-  ../pixmaps/tb_print.xpm ../pixmaps/tb_cut.xpm ../pixmaps/tb_copy.xpm \
-  ../pixmaps/tb_paste.xpm ../pixmaps/tb_find.xpm \
-  ../pixmaps/tb_find_next.xpm ../pixmaps/tb_find_prev.xpm \
-  ../pixmaps/tb_find_help.xpm ../pixmaps/tb_exit.xpm \
-  ../pixmaps/tb_undo.xpm ../pixmaps/tb_redo.xpm ../pixmaps/tb_help.xpm \
-  ../pixmaps/tb_macro.xpm ../pixmaps/tb_make.xpm \
-  ../pixmaps/tb_save_all.xpm ../pixmaps/tb_jump.xpm \
-  ../pixmaps/tb_ctags.xpm ../pixmaps/tb_load_session.xpm \
-  ../pixmaps/tb_save_session.xpm ../pixmaps/tb_new_session.xpm \
-  ../pixmaps/tb_blank.xpm ../pixmaps/tb_maximize.xpm \
-  ../pixmaps/tb_split.xpm ../pixmaps/tb_minimize.xpm \
-  ../pixmaps/tb_shell.xpm ../pixmaps/tb_replace.xpm \
-  ../pixmaps/tb_vsplit.xpm ../pixmaps/tb_maxwidth.xpm \
-  ../pixmaps/tb_minwidth.xpm
-objects/gui_kde_wid.o: gui_kde_wid.cc gui_kde_wid.h kvim_iface.h vim.h \
-  auto/config.h feature.h os_unix.h ascii.h keymap.h term.h macros.h \
-  structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro option.h \
-  ex_cmds.h proto.h globals.h farsi.h arabic.h if_sniff.h version.h \
-  proto/../../pixmaps/alert.xpm proto/../../pixmaps/error.xpm \
-  proto/../../pixmaps/generic.xpm proto/../../pixmaps/info.xpm \
-  proto/../../pixmaps/quest.xpm
-objects/gui_kde_x11.o: gui_kde_x11.cc gui_kde_wid.h kvim_iface.h vim.h \
-  auto/config.h feature.h os_unix.h ascii.h keymap.h term.h macros.h \
-  structs.h regexp.h gui.h gui_beval.h proto/gui_beval.pro option.h \
-  ex_cmds.h proto.h globals.h farsi.h arabic.h if_sniff.h version.h
 objects/hangulin.o: hangulin.c vim.h auto/config.h feature.h os_unix.h \
   auto/osdef.h ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h \
   gui_beval.h proto/gui_beval.pro option.h ex_cmds.h proto.h globals.h \
diff --git a/src/auto/configure b/src/auto/configure
index c109822..794fd8f 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -309,7 +309,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AWK STRIP CPP_MM OS_EXTRA_SRC OS_EXTRA_OBJ VIMNAME EXNAME VIEWNAME line_break dovimdiff dogvimdiff compiledby vi_cv_path_mzscheme MZSCHEME_SRC MZSCHEME_OBJ MZSCHEME_PRO MZSCHEME_LIBS MZSCHEME_CFLAGS vi_cv_path_perl vi_cv_perllib shrpenv PERL_SRC PERL_OBJ PERL_PRO PERL_CFLAGS PERL_LIBS vi_cv_path_python PYTHON_CONFDIR PYTHON_LIBS PYTHON_GETPATH_CFLAGS PYTHON_CFLAGS PYTHON_SRC PYTHON_OBJ vi_cv_path_tcl TCL_SRC TCL_OBJ TCL_PRO TCL_CFLAGS TCL_LIBS vi_cv_path_ruby RUBY_SRC RUBY_OBJ RUBY_PRO RUBY_CFLAGS RUBY_LIBS WORKSHOP_SRC WORKSHOP_OBJ NETBEANS_SRC NETBEANS_OBJ SNIFF_SRC SNIFF_OBJ xmkmfpath X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS X_LIB MOC KDE_CONFIG KDE_LIBS KDE_INCLUDES KDE_PREFIX CXX CXXFLAGS ac_ct_CXX QT_LIBS QT_INCLUDES ROOTQT GTK_CONFIG GTK12_CONFIG PKG_CONFIG GTK_CFLAGS GTK_LIBS GTK_LIBNAME GNOME_LIBS GNOME_LIBDIR GNOME_INCLUDEDIR GNOME_CONFIG MOTIF_LIBNAME NARROW_PROTO GUI_INC_LOC GUI_LIB_LOC GUITYPE GUI_X_LIBS HANGULIN_SRC HANGULIN_OBJ TAGPRG INSTALL_LANGS INSTALL_TOOL_LANGS MSGFMT MAKEMO DEPEND_CFLAGS_FILTER LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AWK STRIP CPP_MM OS_EXTRA_SRC OS_EXTRA_OBJ VIMNAME EXNAME VIEWNAME line_break dovimdiff dogvimdiff compiledby vi_cv_path_mzscheme MZSCHEME_SRC MZSCHEME_OBJ MZSCHEME_PRO MZSCHEME_LIBS MZSCHEME_CFLAGS vi_cv_path_perl vi_cv_perllib shrpenv PERL_SRC PERL_OBJ PERL_PRO PERL_CFLAGS PERL_LIBS vi_cv_path_python PYTHON_CONFDIR PYTHON_LIBS PYTHON_GETPATH_CFLAGS PYTHON_CFLAGS PYTHON_SRC PYTHON_OBJ vi_cv_path_tcl TCL_SRC TCL_OBJ TCL_PRO TCL_CFLAGS TCL_LIBS vi_cv_path_ruby RUBY_SRC RUBY_OBJ RUBY_PRO RUBY_CFLAGS RUBY_LIBS WORKSHOP_SRC WORKSHOP_OBJ NETBEANS_SRC NETBEANS_OBJ SNIFF_SRC SNIFF_OBJ xmkmfpath X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS X_LIB GTK_CONFIG GTK12_CONFIG PKG_CONFIG GTK_CFLAGS GTK_LIBS GTK_LIBNAME GNOME_LIBS GNOME_LIBDIR GNOME_INCLUDEDIR GNOME_CONFIG MOTIF_LIBNAME NARROW_PROTO GUI_INC_LOC GUI_LIB_LOC GUITYPE GUI_X_LIBS HANGULIN_SRC HANGULIN_OBJ TAGPRG INSTALL_LANGS INSTALL_TOOL_LANGS MSGFMT MAKEMO DEPEND_CFLAGS_FILTER LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -770,14 +770,6 @@
 ac_env_CPP_value=$CPP
 ac_cv_env_CPP_set=${CPP+set}
 ac_cv_env_CPP_value=$CPP
-ac_env_CXX_set=${CXX+set}
-ac_env_CXX_value=$CXX
-ac_cv_env_CXX_set=${CXX+set}
-ac_cv_env_CXX_value=$CXX
-ac_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_env_CXXFLAGS_value=$CXXFLAGS
-ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
-ac_cv_env_CXXFLAGS_value=$CXXFLAGS
 
 #
 # Report the --help message.
@@ -868,8 +860,7 @@
   --enable-hangulinput    Include Hangul input support.
   --enable-xim            Include XIM input support.
   --enable-fontset        Include X fontset output support.
-  --enable-gui=OPTS     X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/kde/motif/athena/neXtaw/photon/carbon
-  --enable-kde-check      If auto-select GUI, check for KDE default=no
+  --enable-gui=OPTS     X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
   --enable-gtk-check      If auto-select GUI, check for GTK default=yes
   --enable-gtk2-check     If GTK GUI, check for GTK+ 2 default=yes
   --enable-gnome-check    If GTK GUI, check for GNOME default=no
@@ -877,9 +868,6 @@
   --enable-athena-check   If auto-select GUI, check for Athena default=yes
   --enable-nextaw-check   If auto-select GUI, check for neXtaw default=yes
   --enable-carbon-check   If auto-select GUI, check for Carbon default=yes
-  --enable-kde-toolbar   if KDE GUI is selected, enable a KDE-look toolbar default=no
-  --disable-rpath      Disable rpath.
-  --disable-kdetest	Do not try to compile and run a test KDE program
   --disable-gtktest       Do not try to compile and run a test GTK program
   --disable-acl           Don't check for ACL support.
   --disable-gpm           Don't use gpm (Linux mouse daemon).
@@ -899,12 +887,6 @@
   --with-python-config-dir=PATH  Python's config directory
   --with-tclsh=PATH       which tclsh to use (default: tclsh8.0)
   --with-x                use the X Window System
-  --with-qt-dir=DIR	Specify prefix of QT files
-  --with-qt-includes=DIR	Specify location of Qt headers
-  --with-qt-libs=DIR	Specify location of Qt libraries
-  --with-kde-prefix=PFX	Prefix where KDE is installed (optional)
-  --with-kde-includes=DIR	Specify location of KDE headers
-  --with-kde-libs=DIR	Specify location of KDE libraries
   --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)
   --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)
   --with-gnome-includes=DIR Specify location of GNOME headers
@@ -921,8 +903,6 @@
   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
               headers in a nonstandard directory <include dir>
   CPP         C preprocessor
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -4516,7 +4496,7 @@
 echo "${ECHO_T}$try/tclConfig.sh" >&6
 	    . $try/tclConfig.sh
 	    	    TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
-	    	    	    TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\ /\\X/' | tr ' ' '\012' | sed -e '/^-[^D]/d' -e '/-D[^_]/d' -e 's/-D_/ -D_/' | tr -d '\012'`
+	    	    	    TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^-[^D]/d' -e '/-D[^_]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
 	    break
 	  fi
 	done
@@ -6916,7 +6896,6 @@
 SKIP_GTK=YES
 SKIP_GTK2=YES
 SKIP_GNOME=YES
-SKIP_KDE=YES
 SKIP_MOTIF=YES
 SKIP_ATHENA=YES
 SKIP_NEXTAW=YES
@@ -6972,9 +6951,6 @@
 		SKIP_ATHENA=
 		SKIP_NEXTAW=
 		SKIP_CARBON=;;
-    kde|Kde|KDE)	echo "$as_me:$LINENO: result: KDE 2.x or 3.x GUI support" >&5
-echo "${ECHO_T}KDE 2.x or 3.x GUI support" >&6
-    		SKIP_KDE=;;
     gtk)	echo "$as_me:$LINENO: result: GTK+ 1.x GUI support" >&5
 echo "${ECHO_T}GTK+ 1.x GUI support" >&6
 		SKIP_GTK=;;
@@ -7006,23 +6982,6 @@
 
 fi
 
-if test "x$SKIP_KDE" != "xYES" -a "$enable_gui_canon" != "kde"; then
-    echo "$as_me:$LINENO: checking whether or not to look for KDE" >&5
-echo $ECHO_N "checking whether or not to look for KDE... $ECHO_C" >&6
-    # Check whether --enable-kde-check or --disable-kde-check was given.
-if test "${enable_kde_check+set}" = set; then
-  enableval="$enable_kde_check"
-
-else
-  enable_kde_check="no"
-fi;
-    echo "$as_me:$LINENO: result: $enable_kde_check" >&5
-echo "${ECHO_T}$enable_kde_check" >&6;
-    if test "x$enable_kde_check" = "xno"; then
-       SKIP_KDE=YES
-    fi
-fi
-
 if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
   echo "$as_me:$LINENO: checking whether or not to look for GTK" >&5
 echo $ECHO_N "checking whether or not to look for GTK... $ECHO_C" >&6
@@ -7146,932 +7105,6 @@
 fi
 
 
-if test -z "$SKIP_KDE"; then
-
-# Check whether --with-qt-dir or --without-qt-dir was given.
-if test "${with_qt_dir+set}" = set; then
-  withval="$with_qt_dir"
-
-						 ROOTQT="$withval"
-						 MOC="$withval"/bin/moc
-						 QT_INCLUDES="$withval"/include
-						 QT_LIBS="$withval"/lib
-
-fi;
-
-if test "x$ROOTQT" = "x"; then
-  if test -z "$QTDIR"; then
-            # Extract the first word of "moc", so it can be a program name with args.
-set dummy moc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_MOC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $MOC in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_MOC="$MOC" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_MOC" && ac_cv_path_MOC="no"
-  ;;
-esac
-fi
-MOC=$ac_cv_path_MOC
-
-if test -n "$MOC"; then
-  echo "$as_me:$LINENO: result: $MOC" >&5
-echo "${ECHO_T}$MOC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    if test "x$MOC" = "xno"; then
-      { { echo "$as_me:$LINENO: error: could not find Qt directory" >&5
-echo "$as_me: error: could not find Qt directory" >&2;}
-   { (exit 1); exit 1; }; }
-    else
-      ROOTQT=`echo $MOC | sed 's+/bin/moc++'`
-    fi
-  else
-    ROOTQT="$QTDIR"
-  fi
-fi
-MOC="$ROOTQT"/bin/moc
-QT_INCLUDES="$ROOTQT"/include
-QT_LIBS="$ROOTQT"/lib
-
-
-# Check whether --with-qt-includes or --without-qt-includes was given.
-if test "${with_qt_includes+set}" = set; then
-  withval="$with_qt_includes"
-  QT_INCLUDES="$withval"
-
-fi;
-
-
-# Check whether --with-qt-libraries or --without-qt-libraries was given.
-if test "${with_qt_libraries+set}" = set; then
-  withval="$with_qt_libraries"
-  QT_LIBS="$withval"
-
-fi;
-
-if test "x$QT_LIBS" = "x" ; then
-	QT_LIBS="$ROOTQT"/lib
-fi
-if test "x$QT_INCLUDES" = "x" ; then
-	QT_INCLUDES="$ROOTQT"/include
-fi
-
-echo "$as_me:$LINENO: checking whether or not to use a KDE Toolbar in KVim" >&5
-echo $ECHO_N "checking whether or not to use a KDE Toolbar in KVim... $ECHO_C" >&6
-# Check whether --enable-kde-toolbar or --disable-kde-toolbar was given.
-if test "${enable_kde_toolbar+set}" = set; then
-  enableval="$enable_kde_toolbar"
-
-else
-  enable_kde_toolbar="no"
-fi;
-if test "x$enable_kde_toolbar" != "xno"; then
-  cat >>confdefs.h <<\_ACEOF
-#define FEAT_KDETOOLBAR 1
-_ACEOF
-
-fi
-echo "$as_me:$LINENO: result: $enable_kde_toolbar" >&5
-echo "${ECHO_T}$enable_kde_toolbar" >&6;
-fi
-
-
-if test -z "$SKIP_KDE"; then
-
-
-
-
-echo "$as_me:$LINENO: checking --disable-rpath argument" >&5
-echo $ECHO_N "checking --disable-rpath argument... $ECHO_C" >&6
-# Check whether --enable-rpath or --disable-rpath was given.
-if test "${enable_rpath+set}" = set; then
-  enableval="$enable_rpath"
-
-else
-  enable_rpath="yes"
-fi;
-if test "$enable_rpath" = "yes"; then
-	echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-else
-	echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-fi
-
-echo "$as_me:$LINENO: checking --with-kde-prefix argument" >&5
-echo $ECHO_N "checking --with-kde-prefix argument... $ECHO_C" >&6
-
-# Check whether --with-kde-prefix or --without-kde-prefix was given.
-if test "${with_kde_prefix+set}" = set; then
-  withval="$with_kde_prefix"
-  kde_config_prefix="$withval";
-echo "$as_me:$LINENO: result: $kde_config_prefix" >&5
-echo "${ECHO_T}$kde_config_prefix" >&6
-else
-  kde_config_prefix="";echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi;
-
-
-# Check whether --with-kde-includes or --without-kde-includes was given.
-if test "${with_kde_includes+set}" = set; then
-  withval="$with_kde_includes"
-  KDE_INCLUDES="$withval"
-
-fi;
-
-
-# Check whether --with-kde-libraries or --without-kde-libraries was given.
-if test "${with_kde_libraries+set}" = set; then
-  withval="$with_kde_libraries"
-  KDE_LIBS="$withval"
-
-fi;
-
-echo "$as_me:$LINENO: checking --disable-kdetest argument" >&5
-echo $ECHO_N "checking --disable-kdetest argument... $ECHO_C" >&6
-# Check whether --enable-kdetest or --disable-kdetest was given.
-if test "${enable_kdetest+set}" = set; then
-  enableval="$enable_kdetest"
-  enable_kdetest=yes
-fi;
-
-if test "x$enable_kdetest" = "xyes" ; then
-	echo "$as_me:$LINENO: result: kde test enabled" >&5
-echo "${ECHO_T}kde test enabled" >&6
-else
-	echo "$as_me:$LINENO: result: kde test disabled" >&5
-echo "${ECHO_T}kde test disabled" >&6
-fi
-
-if test "x$kde_config_prefix" != "x" ; then
-	KDE_CONFIG=$kde_config_prefix/bin/kde-config
-fi
-
-if test "X$KDE_CONFIG" = "X"; then
-	# Extract the first word of "kde-config", so it can be a program name with args.
-set dummy kde-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_KDE_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $KDE_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_KDE_CONFIG="$KDE_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_KDE_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  test -z "$ac_cv_path_KDE_CONFIG" && ac_cv_path_KDE_CONFIG="no"
-  ;;
-esac
-fi
-KDE_CONFIG=$ac_cv_path_KDE_CONFIG
-
-if test -n "$KDE_CONFIG"; then
-  echo "$as_me:$LINENO: result: $KDE_CONFIG" >&5
-echo "${ECHO_T}$KDE_CONFIG" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-else
-	echo "$as_me:$LINENO: result: Using KDE configuration program $KDE_CONFIG" >&5
-echo "${ECHO_T}Using KDE configuration program $KDE_CONFIG" >&6
-fi
-
-if test "X$KDE_CONFIG" != "X" ; then
-
-	if test "X$KDE_CONFIG" != "X"; then
-	  min_kde_version=2.0.0
-	  echo "$as_me:$LINENO: checking for KDE version >= $min_kde_version" >&5
-echo $ECHO_N "checking for KDE version >= $min_kde_version... $ECHO_C" >&6
-	  no_kde=""
-	  if test "$KDE_CONFIG" = "no" ; then
-		no_kde=yes
-	  else
-		KDE_PREFIX=`$KDE_CONFIG --prefix`
-		if test "x$KDE_LIBS" = "x"; then
-		  KDE_LIBS="$KDE_PREFIX/lib"
-		fi
-		if test "x$KDE_INCLUDES" = "x"; then
-		  KDE_INCLUDES="$KDE_PREFIX/include"
-		  if test -d "$KDE_INCLUDES/kde"; then
-		    KDE_INCLUDES="$KDE_INCLUDES/kde"
-		  fi
-		fi
-		kde_major_version=`$KDE_CONFIG --version | grep KDE | \
-sed 's/KDE:\ //' | sed 's/\([0-9]*\).\([0-9]*.*\)/\1/'`
-		kde_minor_version=`$KDE_CONFIG --version | grep KDE | \
-sed 's/KDE:\ //' | sed 's/\([0-9]*\).\([0-9]*.*\)/\2/'`
-
-		qt_major_version=`$KDE_CONFIG --version | grep Qt | sed -e \
-'s/Qt:\ //' | sed 's/\([0-9]*\).\([0-9]*.*\)/\1/'`
-		qt_minor_version=`$KDE_CONFIG --version | grep Qt | sed -e \
-'s/Qt:\ //' | sed 's/\([0-9]*\).\([0-9]*.*\)/\2/'`
-
-								if test "x$enable-kdetest" = "xyes" ; then
-			ac_save_LIBS="$LIBS"
-			LIBS="$LIBS $KDE_LIBS"
-
-						if test "$cross_compiling" = yes; then
-  echo $ac_n "cross compiling KDE ? ? how can i remove that ? :)"
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#include <stdio.h>
-int
-main()
-{ return 0; }
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-no_kde=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-			LIBS="$ac_save_LIBS"
-		fi
-	fi
-	if test "x$no_kde" = x ; then
-	  echo "$as_me:$LINENO: result: found KDE $kde_major_version.$kde_minor_version" >&5
-echo "${ECHO_T}found KDE $kde_major_version.$kde_minor_version" >&6
-	  GUI_LIB_LOC="-L$KDE_LIBS -lkdeui -lkdecore -lDCOP"
-							 GUI_INC_LOC="-I$KDE_INCLUDES"
-							 KDEDIR="$KDE_PREFIX"
-	else
-	  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-	  KDE_LIBS=""
-	  :
-	fi
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  KDE_LIBS=""
-  :
-fi
-
-
-
-
-
-	if test "x$KDE_PREFIX" != "x"; then
-		echo "$as_me:$LINENO: checking for QT version $qt_major_version.x" >&5
-echo $ECHO_N "checking for QT version $qt_major_version.x... $ECHO_C" >&6
-		if test "x$ROOTQT" != "x" ; then
-			GUI_INC_LOC="-I$QT_INCLUDES $GUI_INC_LOC"
-			if test $qt_major_version -lt 2; then
-				{ { echo "$as_me:$LINENO: error: Your QT version is prior to 2.0; KDE 2.x and 3.x require at least QT 2" >&5
-echo "$as_me: error: Your QT version is prior to 2.0; KDE 2.x and 3.x require at least QT 2" >&2;}
-   { (exit 1); exit 1; }; }
-			fi
-						if test "`(uname) 2>/dev/null`" = "FreeBSD"; then
-				CFLAGS="$CFLAGS -D_THREAD_SAFE"
-				CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
-				GUI_LIB_LOC="$GUI_LIB_LOC -pthread"
-				LIBS="$LIBS -pthread"
-			fi
-
-						if test "x$enable_rpath" = "xyes"; then
-				if test $qt_major_version = 2; then
-					GUI_LIB_LOC="-L$KDE_LIBS -lkfile -L$QT_LIBS -lqt $GUI_LIB_LOC \
--Wl,--rpath -Wl,$KDE_LIBS -Wl,--rpath -Wl,$QT_LIBS"
-				else
-					GUI_LIB_LOC="-L$KDE_LIBS -lkio -L$QT_LIBS -lqt-mt $GUI_LIB_LOC \
--Wl,--rpath -Wl,$KDE_LIBS -Wl,--rpath -Wl,$QT_LIBS"
-				fi
-			else
-				if test $qt_major_version = 2; then
-					GUI_LIB_LOC="-L$KDE_LIBS -lkfile -L$QT_LIBS -lqt $GUI_LIB_LOC"
-				else
-					GUI_LIB_LOC="-L$KDE_LIBS -lkio -L$QT_LIBS -lqt-mt $GUI_LIB_LOC"
-				fi
-			fi
-
-						GUI_INC_LOC="`echo $GUI_INC_LOC\ | sed 's%-I/usr/include %%'`"
-
-			echo "$as_me:$LINENO: result: found $qt_major_version.$qt_minor_version in $ROOTQT" >&5
-echo "${ECHO_T}found $qt_major_version.$qt_minor_version in $ROOTQT" >&6
-
-
-  qt_incdir=NO
-  for i in $QT_INCLUDES;
-    do
-      for j in qstyle.h;
-      do
-       echo "configure: 7522: $i/$j" >&5
-       if test -r "$i/$j"; then
-         echo "taking that" >&5
-         qt_incdir=$i
-         break 2
-       fi
-      done
-    done
-
-                       if test "x$qt_incdir" = "xNO"; then
-                               { { echo "$as_me:$LINENO: error: Could not find Qt headers in $QT_INCLUDES" >&5
-echo "$as_me: error: Could not find Qt headers in $QT_INCLUDES" >&2;}
-   { (exit 1); exit 1; }; }
-                       fi
-
-  kde_incdir=NO
-  for i in $KDE_INCLUDES;
-    do
-      for j in kapplication.h;
-      do
-       echo "configure: 7542: $i/$j" >&5
-       if test -r "$i/$j"; then
-         echo "taking that" >&5
-         kde_incdir=$i
-         break 2
-       fi
-      done
-    done
-
-                       if test "x$kde_incdir" = "xNO"; then
-                               { { echo "$as_me:$LINENO: error: Could not find KDE headers in $KDE_INCLUDES" >&5
-echo "$as_me: error: Could not find KDE headers in $KDE_INCLUDES" >&2;}
-   { (exit 1); exit 1; }; }
-                       fi
-
-
-
-                       ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-		       ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ac_ct_CXX" && break
-done
-test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
-
-  CXX=$ac_ct_CXX
-fi
-
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cxx_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cxx_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_prog_cxx_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-                       ac_save_LIBS="$LIBS"
-                       LIBS="$GUI_LIB_LOC"
-                       ac_save_CXXFLAGS="$CXXFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GUI_INC_LOC"
-                       echo "$as_me:$LINENO: checking whether Qt libraries are usable" >&5
-echo $ECHO_N "checking whether Qt libraries are usable... $ECHO_C" >&6
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <qapplication.h>
-int
-main ()
-{
-
-                           int argc;
-                           char** argv;
-                           QApplication app(argc, argv);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;{ { echo "$as_me:$LINENO: error: Qt fails to link a simple application" >&5
-echo "$as_me: error: Qt fails to link a simple application" >&2;}
-   { (exit check your installation and settings); exit check your installation and settings; }; }
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-
-                       echo "$as_me:$LINENO: checking whether KDE libraries are usable" >&5
-echo $ECHO_N "checking whether KDE libraries are usable... $ECHO_C" >&6
-                       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <kapplication.h>
-int
-main ()
-{
-
-                           int argc;
-                           char** argv;
-                           KApplication app(argc, argv);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6;{ { echo "$as_me:$LINENO: error: KDE fails to link a simple application" >&5
-echo "$as_me: error: KDE fails to link a simple application" >&2;}
-   { (exit check your installation and settings); exit check your installation and settings; }; }
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-
-                       LIBS="$ac_save_LIBS"
-                       CXXFLAGS="$ac_save_CXXFLAGS"
-                       ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-			SKIP_GTK=YES
-			SKIP_ATHENA=YES
-			SKIP_MOTIF=YES
-			GUITYPE=KDE
-
-
-
-
-
-			cat >>confdefs.h <<\_ACEOF
-#define FEAT_GUI_KDE 1
-_ACEOF
-
-		else
-			{ { echo "$as_me:$LINENO: error: Detected QT version mismatched" >&5
-echo "$as_me: error: Detected QT version mismatched" >&2;}
-   { (exit 1); exit 1; }; }
-		fi
-	else
-		{ { echo "$as_me:$LINENO: error: Could not find KDE installation prefix" >&5
-echo "$as_me: error: Could not find KDE installation prefix" >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-fi
-fi
-
 if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
   echo "$as_me:$LINENO: checking for Carbon GUI" >&5
 echo $ECHO_N "checking for Carbon GUI... $ECHO_C" >&6
@@ -9957,11 +8990,6 @@
 echo "${ECHO_T}GTK+ 2 GUI selected; fontset has been disabled" >&6
   enable_fontset="no"
 fi
-if test "x$GUITYPE:$enable_fontset" = "xKDE:yes"; then
-  echo "$as_me:$LINENO: result: KDE GUI selected; fontset has been disabled" >&5
-echo "${ECHO_T}KDE GUI selected; fontset has been disabled" >&6
-  enable_fontset="no"
-fi
 
 if test -z "$SKIP_PHOTON"; then
   GUITYPE=PHOTONGUI
@@ -11354,6 +10382,12 @@
 
 done
 
+if test "x$MACOSX" = "xyes"; then
+    cat >>confdefs.h <<\_ACEOF
+#define NO_STRINGS_WITH_STRING_H 1
+_ACEOF
+
+else
 
 echo "$as_me:$LINENO: checking if strings.h can be included after string.h" >&5
 echo $ECHO_N "checking if strings.h can be included after string.h... $ECHO_C" >&6
@@ -11425,6 +10459,7 @@
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 CPPFLAGS=$cppflags_save
+fi
 
 if test $ac_cv_c_compiler_gnu = yes; then
     echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
@@ -16744,17 +15779,6 @@
 s,@X_LIBS@,$X_LIBS,;t t
 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
 s,@X_LIB@,$X_LIB,;t t
-s,@MOC@,$MOC,;t t
-s,@KDE_CONFIG@,$KDE_CONFIG,;t t
-s,@KDE_LIBS@,$KDE_LIBS,;t t
-s,@KDE_INCLUDES@,$KDE_INCLUDES,;t t
-s,@KDE_PREFIX@,$KDE_PREFIX,;t t
-s,@CXX@,$CXX,;t t
-s,@CXXFLAGS@,$CXXFLAGS,;t t
-s,@ac_ct_CXX@,$ac_ct_CXX,;t t
-s,@QT_LIBS@,$QT_LIBS,;t t
-s,@QT_INCLUDES@,$QT_INCLUDES,;t t
-s,@ROOTQT@,$ROOTQT,;t t
 s,@GTK_CONFIG@,$GTK_CONFIG,;t t
 s,@GTK12_CONFIG@,$GTK12_CONFIG,;t t
 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
diff --git a/src/configure.in b/src/configure.in
index 404fbaf..04001de 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -468,7 +468,7 @@
   fi
 
   if test "x$MACOSX" = "xyes"; then
-    dnl Mac OS X 10.2 or 10.3
+    dnl Mac OS X 10.2 or later
     dir=/System/Library/Perl
     darwindir=$dir/darwin
     if test -d $darwindir; then
@@ -749,7 +749,7 @@
 	    TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
 	    dnl Use $TCL_DEFS for -D_THREAD_SAFE et al.  But only use the
 	    dnl "-D_ABC" items.  Watch out for -DFOO=long\ long.
-	    TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\ /\\X/' | tr ' ' '\012' | sed -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr -d '\012'`
+	    TCL_DEFS=`echo $TCL_DEFS | sed -e 's/\\\\ /\\\\X/g' | tr ' ' '\012' | sed -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr '\012' ' ' | sed -e 's/\\\\X/\\\\ /g'`
 	    break
 	  fi
 	done
@@ -1079,7 +1079,7 @@
 
 AC_MSG_CHECKING(--enable-gui argument)
 AC_ARG_ENABLE(gui,
- [  --enable-gui[=OPTS]     X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/kde/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
+ [  --enable-gui[=OPTS]     X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon]], , enable_gui="auto")
 
 dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
 dnl Do not use character classes for portability with old tools.
@@ -1090,7 +1090,6 @@
 SKIP_GTK=YES
 SKIP_GTK2=YES
 SKIP_GNOME=YES
-SKIP_KDE=YES
 SKIP_MOTIF=YES
 SKIP_ATHENA=YES
 SKIP_NEXTAW=YES
@@ -1134,8 +1133,6 @@
 		SKIP_ATHENA=
 		SKIP_NEXTAW=
 		SKIP_CARBON=;;
-    kde|Kde|KDE)	AC_MSG_RESULT(KDE 2.x or 3.x GUI support)
-    		SKIP_KDE=;;
     gtk)	AC_MSG_RESULT(GTK+ 1.x GUI support)
 		SKIP_GTK=;;
     gtk2)	AC_MSG_RESULT(GTK+ 2.x GUI support)
@@ -1159,17 +1156,6 @@
 
 fi
 
-if test "x$SKIP_KDE" != "xYES" -a "$enable_gui_canon" != "kde"; then
-    AC_MSG_CHECKING(whether or not to look for KDE)
-    AC_ARG_ENABLE(kde-check,
-	[  --enable-kde-check      If auto-select GUI, check for KDE [default=no]],
-	,enable_kde_check="no")
-    AC_MSG_RESULT($enable_kde_check);
-    if test "x$enable_kde_check" = "xno"; then
-       SKIP_KDE=YES
-    fi
-fi
-
 if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
   AC_MSG_CHECKING(whether or not to look for GTK)
   AC_ARG_ENABLE(gtk-check,
@@ -1250,308 +1236,6 @@
   fi
 fi
 
-dnl ---------------------------------------------------------------------------
-dnl we use the kde-config script included in KDE since 2.x to check which
-dnl version of KDE, we'll use. We'll use additional args in configure to
-dnl obtain the QT directory (includes and libs) as qt does not give any
-dnl config script ! (shame on the trolls ! ;p)
-dnl ---------------------------------------------------------------------------
-
-if test -z "$SKIP_KDE"; then
-dnl ------------------
-dnl now, take care of QT
-dnl -----------------
-AC_ARG_WITH(qt-dir,
-						[  --with-qt-dir=DIR	Specify prefix of QT files],
-						[
-						 ROOTQT="$withval"
-						 MOC="$withval"/bin/moc
-						 QT_INCLUDES="$withval"/include
-						 QT_LIBS="$withval"/lib
-						 ])
-
-if test "x$ROOTQT" = "x"; then
-  if test -z "$QTDIR"; then
-    dnl Find the Qt directory by looking for the "moc" program.
-    dnl It's better than nothing.
-    AC_PATH_PROG(MOC, moc, no)
-    if test "x$MOC" = "xno"; then
-      AC_MSG_ERROR(could not find Qt directory)
-    else
-      ROOTQT=`echo $MOC | sed 's+/bin/moc++'`
-    fi
-  else
-    ROOTQT="$QTDIR"
-  fi
-fi
-MOC="$ROOTQT"/bin/moc
-QT_INCLUDES="$ROOTQT"/include
-QT_LIBS="$ROOTQT"/lib
-
-AC_ARG_WITH(qt-includes,
-						[  --with-qt-includes=DIR	Specify location of Qt headers],
-						[QT_INCLUDES="$withval"]
-						)
-
-AC_ARG_WITH(qt-libraries,
-						[  --with-qt-libs=DIR	Specify location of Qt libraries],
-						[QT_LIBS="$withval"]
-						)
-
-if test "x$QT_LIBS" = "x" ; then
-	QT_LIBS="$ROOTQT"/lib
-fi
-if test "x$QT_INCLUDES" = "x" ; then
-	QT_INCLUDES="$ROOTQT"/include
-fi
-dnl we should get QT's version from here and compare with what kde-config
-dnl says
-
-AC_MSG_CHECKING(whether or not to use a KDE Toolbar in KVim)
-AC_ARG_ENABLE(kde-toolbar,
-	[  --enable-kde-toolbar   if KDE GUI is selected, enable a KDE-look toolbar [default=no]],
-	, enable_kde_toolbar="no")
-if test "x$enable_kde_toolbar" != "xno"; then
-  AC_DEFINE(FEAT_KDETOOLBAR)
-fi
-AC_MSG_RESULT($enable_kde_toolbar);
-fi
-
-dnl -------------------
-dnl so, first, look up at the kde-config script
-dnl ------------------
-
-if test -z "$SKIP_KDE"; then
-AC_DEFUN([AC_FIND_FILE],
-[
-  $3=NO
-  for i in $2;
-    do
-      for j in $1;
-      do
-       echo "configure: __oline__: $i/$j" >&AC_FD_CC
-       if test -r "$i/$j"; then
-         echo "taking that" >&AC_FD_CC
-         $3=$i
-         break 2
-       fi
-      done
-    done
-])
-
-AC_DEFUN(AM_PATH_KDE,
-[
-	if test "X$KDE_CONFIG" != "X"; then
-	  min_kde_version=ifelse([$1], ,2.0,[$1])
-	  AC_MSG_CHECKING(for KDE version >= $min_kde_version)
-	  no_kde=""
-	  if test "$KDE_CONFIG" = "no" ; then
-		no_kde=yes
-	  else
-		KDE_PREFIX=`$KDE_CONFIG --prefix`
-		if test "x$KDE_LIBS" = "x"; then
-		  KDE_LIBS="$KDE_PREFIX/lib"
-		fi
-		if test "x$KDE_INCLUDES" = "x"; then
-		  KDE_INCLUDES="$KDE_PREFIX/include"
-		  if test -d "$KDE_INCLUDES/kde"; then
-		    KDE_INCLUDES="$KDE_INCLUDES/kde"
-		  fi
-		fi
-		kde_major_version=`$KDE_CONFIG --version | grep KDE | \
-sed 's/KDE:\ //' | sed 's/\([[0-9]]*\).\([[0-9]]*.*\)/\1/'`
-		kde_minor_version=`$KDE_CONFIG --version | grep KDE | \
-sed 's/KDE:\ //' | sed 's/\([[0-9]]*\).\([[0-9]]*.*\)/\2/'`
-
-		qt_major_version=`$KDE_CONFIG --version | grep Qt | sed -e \
-'s/Qt:\ //' | sed 's/\([[0-9]]*\).\([[0-9]]*.*\)/\1/'`
-		qt_minor_version=`$KDE_CONFIG --version | grep Qt | sed -e \
-'s/Qt:\ //' | sed 's/\([[0-9]]*\).\([[0-9]]*.*\)/\2/'`
-
-		dnl maybe in a near future we'll get these ones : QT_PREFIX, QT_LIBS,
-		dnl QT_INCLUDES
-		dnl but for now we need configure options to get them ...
-		if test "x$enable-kdetest" = "xyes" ; then
-			ac_save_LIBS="$LIBS"
-			LIBS="$LIBS $KDE_LIBS"
-
-			dnl fake test
-			AC_TRY_RUN([
-#include <stdio.h>
-int
-main()
-{ return 0; }
-			],, no_kde=yes,[echo $ac_n "cross compiling KDE ? ? how can i remove that ? :)"])
-			LIBS="$ac_save_LIBS"
-		fi
-	fi
-	if test "x$no_kde" = x ; then
-	  AC_MSG_RESULT(found KDE $kde_major_version.$kde_minor_version)
-	  ifelse([$2], , :, [$2])
-	else
-	  AC_MSG_RESULT(no)
-	  KDE_LIBS=""
-	  ifelse([$3], , :, [$3])
-	fi
-else
-  AC_MSG_RESULT(no)
-  KDE_LIBS=""
-  ifelse([$3], , :, [$3])
-fi
-
-AC_SUBST(KDE_LIBS)
-AC_SUBST(KDE_INCLUDES)
-AC_SUBST(KDE_PREFIX)
-])
-
-dnl Check all the KDE stuff
-AC_MSG_CHECKING(--disable-rpath argument)
-AC_ARG_ENABLE(rpath,
-	[  --disable-rpath      Disable rpath.],
-	, enable_rpath="yes")
-if test "$enable_rpath" = "yes"; then
-	AC_MSG_RESULT(no)
-else
-	AC_MSG_RESULT(yes)
-fi
-
-AC_MSG_CHECKING(--with-kde-prefix argument)
-AC_ARG_WITH(kde-prefix,[  --with-kde-prefix=PFX	Prefix where KDE is installed (optional)],kde_config_prefix="$withval";
-AC_MSG_RESULT($kde_config_prefix), kde_config_prefix="";AC_MSG_RESULT(no))
-
-AC_ARG_WITH(kde-includes,
-						[  --with-kde-includes=DIR	Specify location of KDE headers],
-						[KDE_INCLUDES="$withval"]
-						)
-
-AC_ARG_WITH(kde-libraries,
-						[  --with-kde-libs=DIR	Specify location of KDE libraries],
-						[KDE_LIBS="$withval"]
-						)
-
-AC_MSG_CHECKING(--disable-kdetest argument)
-AC_ARG_ENABLE(kdetest,
-							[  --disable-kdetest	Do not try to compile and run a test KDE program],
-							enable_kdetest=yes)
-
-if test "x$enable_kdetest" = "xyes" ; then
-	AC_MSG_RESULT(kde test enabled)
-else
-	AC_MSG_RESULT(kde test disabled)
-fi
-
-if test "x$kde_config_prefix" != "x" ; then
-	KDE_CONFIG=$kde_config_prefix/bin/kde-config
-fi
-
-if test "X$KDE_CONFIG" = "X"; then
-	AC_PATH_PROG(KDE_CONFIG, kde-config, no)
-else
-	AC_MSG_RESULT(Using KDE configuration program $KDE_CONFIG)
-fi
-
-if test "X$KDE_CONFIG" != "X" ; then
-	AM_PATH_KDE(2.0.0,
-							[GUI_LIB_LOC="-L$KDE_LIBS -lkdeui -lkdecore -lDCOP"
-							 GUI_INC_LOC="-I$KDE_INCLUDES"
-							 KDEDIR="$KDE_PREFIX"], )
-	if test "x$KDE_PREFIX" != "x"; then
-		AC_MSG_CHECKING(for QT version $qt_major_version.x)
-		if test "x$ROOTQT" != "x" ; then
-			GUI_INC_LOC="-I$QT_INCLUDES $GUI_INC_LOC"
-			if test $qt_major_version -lt 2; then
-				AC_MSG_ERROR(Your QT version is prior to 2.0; KDE 2.x and 3.x require at least QT 2)
-			fi
-			dnl hack for FreeBSD
-			if test "`(uname) 2>/dev/null`" = "FreeBSD"; then
-				CFLAGS="$CFLAGS -D_THREAD_SAFE"
-				CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
-				GUI_LIB_LOC="$GUI_LIB_LOC -pthread"
-				LIBS="$LIBS -pthread"
-			fi
-
-			dnl check the version
-			if test "x$enable_rpath" = "xyes"; then
-				if test $qt_major_version = 2; then
-					GUI_LIB_LOC="-L$KDE_LIBS -lkfile -L$QT_LIBS -lqt $GUI_LIB_LOC \
--Wl,--rpath -Wl,$KDE_LIBS -Wl,--rpath -Wl,$QT_LIBS"
-				else
-					GUI_LIB_LOC="-L$KDE_LIBS -lkio -L$QT_LIBS -lqt-mt $GUI_LIB_LOC \
--Wl,--rpath -Wl,$KDE_LIBS -Wl,--rpath -Wl,$QT_LIBS"
-				fi
-			else
-				if test $qt_major_version = 2; then
-					GUI_LIB_LOC="-L$KDE_LIBS -lkfile -L$QT_LIBS -lqt $GUI_LIB_LOC"
-				else
-					GUI_LIB_LOC="-L$KDE_LIBS -lkio -L$QT_LIBS -lqt-mt $GUI_LIB_LOC"
-				fi
-			fi
-
-			dnl Remove "-I/usr/include " from GUI_*
-			GUI_INC_LOC="`echo $GUI_INC_LOC\ | sed 's%-I/usr/include %%'`"
-dnl			GUI_LIB_LOC="`echo $GUI_LIB_LOC\ | sed 's% -L/usr/lib%%'`"
-
-			AC_MSG_RESULT(found $qt_major_version.$qt_minor_version in $ROOTQT)
-
-                       dnl now check the results ...
-                       dnl find the Qt's headers ?
-                       AC_FIND_FILE(qstyle.h,$QT_INCLUDES,qt_incdir)
-                       if test "x$qt_incdir" = "xNO"; then
-                               AC_MSG_ERROR(Could not find Qt headers in $QT_INCLUDES)
-                       fi
-                       AC_FIND_FILE(kapplication.h,$KDE_INCLUDES,kde_incdir)
-                       if test "x$kde_incdir" = "xNO"; then
-                               AC_MSG_ERROR(Could not find KDE headers in $KDE_INCLUDES)
-                       fi
-
-                       AC_LANG_SAVE
-                       AC_LANG_CPLUSPLUS
-		       AC_PROG_CXX
-                       ac_save_LIBS="$LIBS"
-                       LIBS="$GUI_LIB_LOC"
-                       ac_save_CXXFLAGS="$CXXFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GUI_INC_LOC"
-                       AC_MSG_CHECKING(whether Qt libraries are usable)
-                       AC_TRY_LINK(
-                           [#include <qapplication.h>],
-                           [
-                           int argc;
-                           char** argv;
-                           QApplication app(argc, argv);]
-                           ,AC_MSG_RESULT(yes),AC_MSG_RESULT(no);AC_MSG_ERROR(Qt fails to link a simple application, check your installation and settings))
-
-                       AC_MSG_CHECKING(whether KDE libraries are usable)
-                       AC_TRY_LINK(
-                           [#include <kapplication.h>],
-                           [
-                           int argc;
-                           char** argv;
-                           KApplication app(argc, argv);]
-                           ,AC_MSG_RESULT(yes),AC_MSG_RESULT(no);AC_MSG_ERROR(KDE fails to link a simple application, check your installation and settings))
-
-                       LIBS="$ac_save_LIBS"
-                       CXXFLAGS="$ac_save_CXXFLAGS"
-                       AC_LANG_RESTORE
-
-
-			SKIP_GTK=YES
-			SKIP_ATHENA=YES
-			SKIP_MOTIF=YES
-			GUITYPE=KDE
-			AC_SUBST(KDE_PREFIX)
-			AC_SUBST(QT_LIBS)
-			AC_SUBST(QT_INCLUDES)
-			AC_SUBST(ROOTQT)
-			AC_SUBST(MOC)
-			AC_DEFINE(FEAT_GUI_KDE)
-		else
-			AC_MSG_ERROR(Detected QT version mismatched)
-		fi
-	else
-		AC_MSG_ERROR(Could not find KDE installation prefix)
-	fi
-fi
-fi
 
 if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
   AC_MSG_CHECKING(for Carbon GUI)
@@ -2156,10 +1840,6 @@
   AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
   enable_fontset="no"
 fi
-if test "x$GUITYPE:$enable_fontset" = "xKDE:yes"; then
-  AC_MSG_RESULT(KDE GUI selected; fontset has been disabled)
-  enable_fontset="no"
-fi
 
 if test -z "$SKIP_PHOTON"; then
   GUITYPE=PHOTONGUI
@@ -2261,6 +1941,10 @@
 	      AC_MSG_RESULT(no))
 
 AC_CHECK_HEADERS(strings.h)
+if test "x$MACOSX" = "xyes"; then
+  dnl The strings.h file on OS/X contains a warning and nothing useful.
+  AC_DEFINE(NO_STRINGS_WITH_STRING_H)
+else
 
 dnl Check if strings.h and string.h can both be included when defined.
 AC_MSG_CHECKING([if strings.h can be included after string.h])
@@ -2285,6 +1969,7 @@
 		AC_DEFINE(NO_STRINGS_WITH_STRING_H)
 		AC_MSG_RESULT(no))
 CPPFLAGS=$cppflags_save
+fi
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_PROG_GCC_TRADITIONAL
diff --git a/src/edit.c b/src/edit.c
index b1b7b4c..0a770a7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -222,10 +222,6 @@
 static int	revins_scol;		/* start column of revins session */
 #endif
 
-#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
-static short	previous_script = smRoman;
-#endif
-
 static int	ins_need_undo;		/* call u_save() before inserting a
 					   char.  Set when edit() is called.
 					   after that arrow_used is used. */
@@ -398,10 +394,6 @@
     im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
 #endif
 
-#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
-    KeyScript(previous_script);
-#endif
-
 #ifdef FEAT_MOUSE
     setmouse();
 #endif
@@ -2089,6 +2081,8 @@
     return count;
 }
 
+/* "compl_match_array" points the currently displayed list of entries in the
+ * popup menu.  It is NULL when there is no popup menu. */
 static char_u **compl_match_array = NULL;
 static int compl_match_arraysize;
 
@@ -6533,10 +6527,6 @@
 	composing_hangul = 0;
     }
 #endif
-#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
-    previous_script = GetScriptManagerVariable(smKeyScript);
-    KeyScript(smKeyRoman); /* or smKeySysScript */
-#endif
 
     temp = curwin->w_cursor.col;
     if (disabled_redraw)
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 449b66c..0926e9b 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -520,10 +520,6 @@
 	}
 	else
 	    bp->dbg_name = p;
-#ifdef MACOS_CLASSIC
-	if (bp->dbg_name != NULL)
-	    slash_n_colon_adjust(bp->dbg_name);
-#endif
     }
 
     if (bp->dbg_name == NULL)
@@ -2754,9 +2750,6 @@
     vim_free(p);
     if (fname_exp == NULL)
 	return retval;
-#ifdef MACOS_CLASSIC
-    slash_n_colon_adjust(fname_exp);
-#endif
     if (mch_isdir(fname_exp))
     {
 	smsg((char_u *)_("Cannot source a directory: \"%s\""), fname);
diff --git a/src/ex_getln.c b/src/ex_getln.c
index b355257..7c9ea14 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -2206,8 +2206,7 @@
 }
 #endif
 
-#if (defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))) \
-							     || defined(PROTO)
+#if (defined(FEAT_XIM) && (defined(FEAT_GUI_GTK))) || defined(PROTO)
 /*
  * Return the virtual column number at the current cursor position.
  * This is used by the IM code to obtain the start of the preedit string.
diff --git a/src/feature.h b/src/feature.h
index e69fcd9..6abc0ed 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -660,8 +660,7 @@
  * +xfontset		X fontset support.  For outputting wide characters.
  */
 #ifndef FEAT_XFONTSET
-# if defined(FEAT_MBYTE) && defined(HAVE_X11) \
-		&& !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
+# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(HAVE_GTK2)
 #  define FEAT_XFONTSET
 # else
 /* #  define FEAT_XFONTSET */
@@ -708,8 +707,7 @@
  *			always has it).  But only if menus are enabled.
  */
 #if defined(FEAT_NORMAL) && defined(FEAT_MENU) \
-	&& (defined(FEAT_GUI_KDE) \
-		|| defined(FEAT_GUI_GTK) \
+	&& (defined(FEAT_GUI_GTK) \
 		|| defined(FEAT_GUI_MSWIN) \
 		|| ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
 			&& defined(HAVE_XPM)) \
@@ -725,7 +723,7 @@
 /*
  * +browse		":browse" command.
  */
-#if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_KDE) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
+#if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
 # define FEAT_BROWSE
 #endif
 
@@ -740,8 +738,7 @@
 	|| defined(FEAT_GUI_GTK) \
 	|| defined(FEAT_GUI_PHOTON) \
 	|| defined(FEAT_GUI_MSWIN) \
-	|| defined(FEAT_GUI_MAC) \
-	|| defined(FEAT_GUI_KDE)
+	|| defined(FEAT_GUI_MAC)
 #  define FEAT_CON_DIALOG
 #  define FEAT_GUI_DIALOG
 # else
@@ -749,13 +746,13 @@
 # endif
 #endif
 #if !defined(FEAT_GUI_DIALOG) && (defined(FEAT_GUI_MOTIF) \
-	|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
+	|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK))
 /* need a dialog to show error messages when starting from the desktop */
 # define FEAT_GUI_DIALOG
 #endif
 #if defined(FEAT_GUI_DIALOG) && \
 	(defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
-	 || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)|| defined(FEAT_GUI_MSWIN) \
+	 || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN) \
 	 || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
 # define FEAT_GUI_TEXTDIALOG
 #endif
@@ -1043,7 +1040,7 @@
 #endif
 
 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
-	|| defined(MSWIN_FIND_REPLACE) || defined(FEAT_GUI_KDE)
+	|| defined(MSWIN_FIND_REPLACE)
 # define FIND_REPLACE_DIALOG 1
 #endif
 
@@ -1074,7 +1071,7 @@
 #  define MCH_CURSOR_SHAPE
 # endif
 # if defined(FEAT_GUI_W32) || defined(FEAT_GUI_W16) || defined(FEAT_GUI_MOTIF) \
-	|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)\
+	|| defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \
 	|| defined(FEAT_GUI_PHOTON)
 #  define FEAT_MOUSESHAPE
 # endif
@@ -1089,7 +1086,7 @@
 
 #if defined(FEAT_MZSCHEME) && (defined(FEAT_GUI_W32) || defined(FEAT_GUI_GTK)    \
 	|| defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)	\
-	|| defined(FEAT_GUI_MAC) || defined(FEAT_GUI_KDE))
+	|| defined(FEAT_GUI_MAC))
 # define MZSCHEME_GUI_THREADS
 #endif
 
@@ -1172,7 +1169,7 @@
 	    || defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL))
 # define FEAT_BEVAL
 # if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
-	&& !defined(FEAT_GUI_KDE) && !defined(FEAT_GUI_W32)
+	&& !defined(FEAT_GUI_W32)
 #  define FEAT_XFONTSET
 # endif
 #endif
diff --git a/src/fileio.c b/src/fileio.c
index eaa2bd1..8ad3443 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -42,9 +42,7 @@
 #endif
 
 /* Is there any system that doesn't have access()? */
-#ifndef MACOS_CLASSIC /* Not available on MacOS 9 */
-# define USE_MCH_ACCESS
-#endif
+#define USE_MCH_ACCESS
 
 #ifdef FEAT_MBYTE
 static char_u *next_fenc __ARGS((char_u **pp));
@@ -6758,6 +6756,7 @@
     {"QuickFixCmdPost",	EVENT_QUICKFIXCMDPOST},
     {"QuickFixCmdPre",	EVENT_QUICKFIXCMDPRE},
     {"RemoteReply",	EVENT_REMOTEREPLY},
+    {"SessionLoadPost",	EVENT_SESSIONLOADPOST},
     {"StdinReadPost",	EVENT_STDINREADPOST},
     {"StdinReadPre",	EVENT_STDINREADPRE},
     {"Syntax",		EVENT_SYNTAX},
diff --git a/src/globals.h b/src/globals.h
index 3731f06..b589131 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -745,11 +745,6 @@
 #endif /* FEAT_MBYTE */
 
 #ifdef FEAT_XIM
-# ifdef FEAT_GUI_KDE
-EXTERN colnr_T		preedit_start_col INIT(= MAXCOL);
-EXTERN colnr_T		preedit_end_col INIT(= MAXCOL);
-EXTERN char		*draw_feedback INIT(= NULL);
-# endif
 # ifdef FEAT_GUI_GTK
 #  ifdef HAVE_GTK2
 EXTERN GtkIMContext	*xic INIT(= NULL);
@@ -1164,10 +1159,6 @@
 EXTERN int	echo_wid_arg INIT(= FALSE);	/* --echo-wid argument */
 #endif
 
-#ifdef FEAT_GUI_KDE
-EXTERN int	echo_wid_arg INIT(= FALSE);
-# endif
-
 #ifdef FEAT_CLIENTSERVER
 EXTERN char_u	*serverName INIT(= NULL);	/* name of the server */
 EXTERN int	received_from_client INIT(= FALSE);	/* received text from
diff --git a/src/gui.c b/src/gui.c
index 9561195..32416cb 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -99,7 +99,7 @@
 
     vim_free(old_term);
 
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
     if (gui.in_use)
 	/* Display error messages in a dialog now. */
 	display_errors();
@@ -540,7 +540,7 @@
 	/* Our GUI can't do bidi. */
 	p_tbidi = FALSE;
 #endif
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_GTK)
 	/* Give GTK+ a chance to put all widget's into place. */
 	gui_mch_update();
 	/* Now make sure the shell fits on the screen. */
@@ -616,7 +616,7 @@
     gui_mch_exit(rc);
 }
 
-#if defined(FEAT_GUI_KDE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
 	|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(PROTO)
 /*
  * Called when the GUI shell is closed by the user.  If there are no changed
@@ -1100,7 +1100,7 @@
     void
 gui_position_menu()
 {
-# if !defined(FEAT_GUI_KDE) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
+# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
     if (gui.menu_is_active && gui.in_use)
 	gui_mch_set_menu_pos(0, 0, gui.menu_width, gui.menu_height);
 # endif
@@ -1212,7 +1212,6 @@
     if (gui.menu_is_active)
 	base_height += gui.menu_height;
 # endif
-#ifndef FEAT_GUI_KDE
 # ifdef FEAT_TOOLBAR
     if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
 #  if defined(FEAT_GUI_MSWIN) && defined(FEAT_TOOLBAR)
@@ -1221,7 +1220,6 @@
 	base_height += gui.toolbar_height;
 #  endif
 # endif
-#endif
 # ifdef FEAT_FOOTER
     if (vim_strchr(p_go, GO_FOOTER) != NULL)
 	base_height += gui.footer_height;
@@ -1724,7 +1722,7 @@
      * We need to make sure this is cleared since Athena doesn't tell us when
      * he is done dragging.  Do the same for GTK.
      */
-#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK)
     gui.dragged_sb = SBAR_NONE;
 #endif
 
@@ -1956,7 +1954,7 @@
     guicolor_T	fg_color;
     guicolor_T	bg_color;
     guicolor_T	sp_color;
-#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
+#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
     GuiFont	font = NOFONT;
 # ifdef FEAT_XFONTSET
     GuiFontset	fontset = NOFONTSET;
@@ -2010,7 +2008,7 @@
 	highlight_mask = gui.highlight_mask;
     hl_mask_todo = highlight_mask;
 
-#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2) && !defined(FEAT_GUI_KDE)
+#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
     /* Set the font */
     if (aep != NULL && aep->ae_u.gui.font != NOFONT)
 	font = aep->ae_u.gui.font;
@@ -2124,7 +2122,7 @@
     if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)))
 	return FAIL;
 
-#if defined(RISCOS) || defined(HAVE_GTK2) || defined(FEAT_GUI_KDE)
+#if defined(RISCOS) || defined(HAVE_GTK2)
     /* If there's no italic font, then fake it.
      * For GTK2, we don't need a different font for italic style. */
     if (hl_mask_todo & HL_ITALIC)
@@ -2197,7 +2195,7 @@
 	    /* print the string so far if it's the last character or there is
 	     * a composing character. */
 	    if (i + cl >= len || (comping && i > start) || dowide
-#  if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#  if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
 		    || (cn > 1
 #   ifdef FEAT_XFONTSET
 			/* No fontset: At least draw char after wide char at
@@ -2222,18 +2220,14 @@
 		cells = 0;
 		if (dowide)
 		{
-#ifndef FEAT_GUI_KDE
 		    gui_mch_set_font(gui.wide_font);
-#endif
 		    gui_mch_draw_string(gui.row, scol - cn,
 						   s + start, cl, draw_flags);
-#ifndef FEAT_GUI_KDE
 		    gui_mch_set_font(font);
-#endif
 		    start += cl;
 		}
 
-#  if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#  if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
 		/* No fontset: draw a space to fill the gap after a wide char
 		 * */
 		if (cn > 1 && (draw_flags & DRAW_TRANSP) == 0
@@ -4116,7 +4110,7 @@
     t = gui_mch_get_color(name);
 
     if (t == INVALCOLOR
-#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
 	    && gui.in_use
 #endif
 	    )
@@ -4359,7 +4353,7 @@
 }
 
 #if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32) \
-	|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_KDE)) && defined(FEAT_TOOLBAR)) || defined(PROTO)
+	|| defined(FEAT_GUI_PHOTON)) && defined(FEAT_TOOLBAR)) || defined(PROTO)
 /*
  * This is shared between Athena, Motif and GTK.
  */
@@ -4423,7 +4417,7 @@
 # endif
 #endif
 
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE) || defined(FEAT_GUI_X11) || defined(PROTO)
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(PROTO)
     void
 display_errors()
 {
diff --git a/src/gui.h b/src/gui.h
index ce21a7e..2f5275c 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -22,23 +22,6 @@
 # include "gui_beval.h"
 #endif
 
-#ifdef FEAT_GUI_KDE
-# include <X11/Intrinsic.h>
-
-/* used only as pointer to, so casting to int is ok */
-# ifdef __cplusplus
-class QScrollBar;
-class QPopupMenu;
-class QFont;
-class VimWidget;
-# else
-#  define QScrollBar int
-#  define QPopupMenu int
-#  define QFont int
-#  define VimWidget  int
-# endif
-#endif
-
 #ifdef FEAT_GUI_GTK
 # include <X11/Intrinsic.h>
 # include <gtk/gtk.h>
@@ -90,7 +73,7 @@
  * GUIs that support dropping files on a running Vim.
  */
 #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) \
-	|| defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+	|| defined(FEAT_GUI_GTK)
 # define HAVE_DROP_FILE
 #endif
 
@@ -158,7 +141,7 @@
 #define DRAW_BOLD		0x02	/* draw bold text */
 #define DRAW_UNDERL		0x04	/* draw underline text */
 #define DRAW_UNDERC		0x08	/* draw undercurl text */
-#if defined(RISCOS) || defined(HAVE_GTK2) || defined (FEAT_GUI_KDE)
+#if defined(RISCOS) || defined(HAVE_GTK2)
 # define DRAW_ITALIC		0x10	/* draw italic text */
 #endif
 #define DRAW_CURSOR		0x20	/* drawing block cursor (win32) */
@@ -177,7 +160,7 @@
 #endif
 #define TOOLBAR_BORDER_HEIGHT	12  /* room above+below buttons for MSWindows */
 
-#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE) || defined(FEAT_GUI_X11)
+#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
 # define NO_CONSOLE_INPUT	/* use no_console_input() to check if there
 				   is no console input possible */
 #endif
@@ -201,9 +184,6 @@
     int		width;		/* Current width of scroll bar in cols */
 #endif
     int		status_height;	/* Height of status line */
-#ifdef FEAT_GUI_KDE
-    QScrollBar *w;
-#endif
 #ifdef FEAT_GUI_X11
     Widget	id;		/* Id of real scroll bar */
 #endif
@@ -237,12 +217,6 @@
 				   displays there is a tiny chance this is an
 				   actual color */
 
-#ifdef FEAT_GUI_KDE
-  typedef QFont		*GuiFont;
-  typedef QFont		*GuiFontset;
-# define NOFONT		(GuiFont)NULL
-# define NOFONTSET	(GuiFontset)NULL
-#endif
 #ifdef FEAT_GUI_GTK
 # ifdef HAVE_GTK2
   typedef PangoFontDescription	*GuiFont;       /* handle for a GUI font */
@@ -266,12 +240,10 @@
 #   define NOFONT	(GuiFont)0
 #   define NOFONTSET	(GuiFontset)0
 #  else
-#   if !defined(FEAT_GUI_KDE)
   typedef long_u	GuiFont;	/* handle for a GUI font */
   typedef long_u	GuiFontset;	/* handle for a GUI fontset */
 #   define NOFONT	(GuiFont)0
 #   define NOFONTSET	(GuiFontset)0
-#   endif
 #  endif
 # endif
 #endif
@@ -390,13 +362,6 @@
     Bool	color_approx;	    /* Some color was approximated */
 #endif
 
-#ifdef FEAT_GUI_KDE
-    VimWidget   *w;                 /* Vim widget */
-    Display     *dpy;               /* X display */
-    QFont	*current_font;
-    char_u	*fontname;	    /* font name from font selection dialog */
-#endif
-
 #ifdef FEAT_GUI_GTK
     int		visibility;	    /* Is shell partially/fully obscured? */
     GdkCursor	*blank_pointer;	    /* Blank pointer */
diff --git a/src/mbyte.c b/src/mbyte.c
index d057266..9a10bd0 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -753,11 +753,6 @@
     apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf);
 #endif
 
-#ifdef FEAT_GUI_KDE
-    if (gui.in_use)
-	gui_mch_update_codec();
-#endif
-
 #ifdef FEAT_SYN_HL
     /* Need to reload spell dictionaries */
     spell_reload();
@@ -4181,7 +4176,7 @@
 # endif
 #endif
 
-#if defined(FEAT_GUI_GTK) || defined(PROTO) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
 static int	preedit_buf_len = 0;
 static int	xim_can_preediting INIT(= FALSE);	/* XIM in showmode() */
 static int	xim_input_style;
@@ -4317,7 +4312,7 @@
     /* If 'imdisable' is set, XIM is never active. */
     if (p_imdisable)
 	active = FALSE;
-#if !defined (FEAT_GUI_GTK) && !defined (FEAT_GUI_KDE)
+#if !defined (FEAT_GUI_GTK)
     else if (input_style & XIMPreeditPosition)
 	/* There is a problem in switching XIM off when preediting is used,
 	 * and it is not clear how this can be solved.  For now, keep XIM on
@@ -4489,7 +4484,6 @@
     }
 }
 
-#ifndef FEAT_GUI_KDE
 /*ARGSUSED*/
     void
 im_set_position(row, col)
@@ -4498,7 +4492,6 @@
 {
     xim_set_preedit();
 }
-#endif
 
 /*
  * Set the XIM to the current cursor position.
@@ -4593,8 +4586,6 @@
 	    gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask);
     }
 #else /* FEAT_GUI_GTK */
-# ifdef FEAT_GUI_KDE
-# else
     {
 	XVaNestedList attr_list;
 	XRectangle spot_area;
@@ -4641,7 +4632,6 @@
 	    XFree(attr_list);
 	}
     }
-# endif /* FEAT_GUI_KDE */
 #endif /* FEAT_GUI_GTK */
 }
 
@@ -4695,8 +4685,6 @@
     }
 # endif
 #else
-# ifdef FEAT_GUI_KDE
-# else
     {
 	XVaNestedList preedit_list = 0, status_list = 0, list = 0;
 	XRectangle pre_area, status_area;
@@ -4788,11 +4776,10 @@
 	if (preedit_list)
 	    XFree(preedit_list);
     }
-# endif /* FEAT_GUI_KDE */
 #endif
 }
 
-#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
 static char e_xim[] = N_("E285: Failed to create input context");
 #endif
 
@@ -5576,12 +5563,8 @@
     if (xim_input_style & (int)GDK_IM_STATUS_AREA)
 	return gui.char_height;
 #else
-# if defined FEAT_GUI_KDE
-    /* always return zero? */
-# else
     if (status_area_enabled)
 	return gui.char_height;
-# endif
 #endif
     return 0;
 }
@@ -5599,10 +5582,6 @@
     if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
 	return xim_can_preediting;
 #  endif
-#  ifdef FEAT_GUI_KDE
-    if (preedit_start_col != MAXCOL)
-	return TRUE;
-#  endif
     return xim_has_focus;
 }
 
diff --git a/src/misc2.c b/src/misc2.c
index e691aa9..e8845e2 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2945,7 +2945,7 @@
 }
 
 #if defined(FEAT_SESSION) || defined(MSWIN) || defined(FEAT_GUI_MAC) \
-	|| ((defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)) \
+	|| ((defined(FEAT_GUI_GTK)) \
 			&& ( defined(FEAT_WINDOWS) || defined(FEAT_DND)) ) \
 	|| defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
 	|| defined(PROTO)
diff --git a/src/option.c b/src/option.c
index 1b724dc..14d40c9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1075,14 +1075,14 @@
 #endif
 				    },
     {"guiheadroom", "ghr",  P_NUM|P_VI_DEF,
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
 			    (char_u *)&p_ghr, PV_NONE,
 #else
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)50L, (char_u *)0L}},
     {"guioptions",  "go",   P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST,
-#if defined(FEAT_GUI) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI)
 			    (char_u *)&p_go, PV_NONE,
 # if defined(UNIX) && !defined(MACOS)
 			    {(char_u *)"agimrLtT", (char_u *)0L}
@@ -1168,7 +1168,7 @@
 			    (char_u *)&p_ic, PV_NONE,
 			    {(char_u *)FALSE, (char_u *)0L}},
     {"imactivatekey","imak",P_STRING|P_VI_DEF,
-#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
 			    (char_u *)&p_imak, PV_NONE,
 #else
 			    (char_u *)NULL, PV_NONE,
@@ -5305,7 +5305,7 @@
     }
 #endif
 
-#if defined(FEAT_XIM) && ( defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE) )
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
     else if (varp == &p_imak)
     {
 	if (gui.in_use && !im_xim_isvalid_imactivate())
@@ -5574,7 +5574,7 @@
 	if (gui.in_use)
 	{
 	    p = p_guifont;
-# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+# if defined(FEAT_GUI_GTK)
 	    /*
 	     * Put up a font dialog and let the user select a new value.
 	     * If this is cancelled go back to the old value but don't
diff --git a/src/option.h b/src/option.h
index 173919e..9421d16 100644
--- a/src/option.h
+++ b/src/option.h
@@ -499,7 +499,7 @@
 # endif
 EXTERN int	p_guipty;	/* 'guipty' */
 #endif
-#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
 EXTERN long	p_ghr;		/* 'guiheadroom' */
 #endif
 #ifdef CURSOR_SHAPE
@@ -545,7 +545,7 @@
 EXTERN char_u	*p_iconstring;	/* 'iconstring' */
 #endif
 EXTERN int	p_ic;		/* 'ignorecase' */
-#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
+#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK))
 EXTERN char_u	*p_imak;	/* 'imactivatekey' */
 #endif
 #ifdef USE_IM_CONTROL
@@ -822,7 +822,7 @@
 #endif
 EXTERN long	p_window;	/* 'window' */
 #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
-	|| defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_KDE)
+	|| defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
 #define FEAT_WAK
 EXTERN char_u	*p_wak;		/* 'winaltkeys' */
 #endif
diff --git a/src/os_macosx.c b/src/os_macosx.c
index 8e9d55d..48023e3 100644
--- a/src/os_macosx.c
+++ b/src/os_macosx.c
@@ -8,8 +8,7 @@
  */
 
 /*
- * os_macosx.c -- election of os_mac.c or os_unix.c
- *
+ * os_macosx.c -- Mac specific things for Mac OS/X.
  */
 
 #ifdef MACOS_X_UNIX
@@ -19,8 +18,7 @@
 #  include "os_unix.c"	    /* Using Project Builder */
 # endif
 #else
-# include "os_mac.c"
-# include <TextEncodingConverter.h>
+    Error: MACOS 9 is no longer supported in Vim 7
 #endif
 
 #ifdef _DEBUG
diff --git a/src/os_unix.c b/src/os_unix.c
index f951f18..c72cd83 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1319,12 +1319,6 @@
     XErrorEvent	*error_event;
 {
     XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
-#if defined(FEAT_GUI_KDE)
-    /* KDE sometimes produces X error that we want to ignore */
-    STRCAT(IObuff, _("\nVim: Got X error but we continue...\n"));
-    mch_errmsg((char *)IObuff);
-    return 0;
-#else
     STRCAT(IObuff, _("\nVim: Got X error\n"));
 
     /* We cannot print a message and continue, because no X calls are allowed
@@ -1333,7 +1327,6 @@
     preserve_exit();		    /* preserve files and exit */
 
     return 0;		/* NOTREACHED */
-#endif
 }
 
 /*
@@ -1474,7 +1467,7 @@
 	did_set_error_handler = TRUE;
     }
 
-#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE)
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
     if (gui.in_use)
     {
 	/*
@@ -1896,11 +1889,6 @@
      * Note: if "t_TS" is set, title is set with escape sequence rather
      *	     than x11 calls, because the x11 calls don't always work
      */
-#ifdef FEAT_GUI_KDE
-    /* dont know why but KDE needs this one as we don't go through the next
-     * function... */
-    gui_mch_settitle(title, icon);
-#endif
     if ((type || *T_TS != NUL) && title != NULL)
     {
 	if (oldtitle == NULL
diff --git a/src/screen.c b/src/screen.c
index ccc7cec..09821bd 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -174,7 +174,7 @@
 static int fillchar_vsep __ARGS((int *attr));
 #endif
 #ifdef FEAT_STL_OPT
-static void win_redr_custom __ARGS((win_T *wp, int Ruler));
+static void win_redr_custom __ARGS((win_T *wp, int draw_ruler));
 #endif
 #ifdef FEAT_CMDL_INFO
 static void win_redr_ruler __ARGS((win_T *wp, int always));
@@ -2577,7 +2577,7 @@
 #endif
 #define WL_LINE		WL_SBR + 1	/* text in the line */
     int		draw_state = WL_START;	/* what to draw next */
-#if defined(FEAT_XIM) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE))
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
     int		feedback_col = 0;
     int		feedback_old_attr = -1;
 #endif
@@ -5524,9 +5524,9 @@
  * Redraw the status line or ruler of window wp.
  */
     static void
-win_redr_custom(wp, Ruler)
+win_redr_custom(wp, draw_ruler)
     win_T	*wp;
-    int		Ruler;
+    int		draw_ruler;	/* TRUE or FALSE */
 {
     int		attr;
     int		curattr;
@@ -5549,7 +5549,7 @@
 	p = wp->w_p_stl;
     else
 	p = p_stl;
-    if (Ruler)
+    if (draw_ruler)
     {
 	p = p_ruf;
 	/* advance past any leading group spec - implicit in ru_col */
@@ -8476,6 +8476,14 @@
 {
     if (!always && !redrawing())
 	return;
+#ifdef FEAT_INS_EXPAND
+    if (pum_visible())
+    {
+	/* Don't redraw right now, do it later. */
+	curwin->w_redr_status = TRUE;
+	return;
+    }
+#endif
 #if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
     if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
 	win_redr_custom(curwin, FALSE);
diff --git a/src/structs.h b/src/structs.h
index 94b9ddb..293b59f 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1991,9 +1991,6 @@
     Widget	id;		    /* Manage this to enable item */
     Widget	submenu_id;	    /* If this is submenu, add children here */
 #endif
-#ifdef FEAT_GUI_KDE
-    QPopupMenu *widget;
-#endif
 #ifdef FEAT_GUI_GTK
     GtkWidget	*id;		    /* Manage this to enable item */
     GtkWidget	*submenu_id;	    /* If this is submenu, add children here */
diff --git a/src/version.c b/src/version.c
index 8112664..69a47ff 100644
--- a/src/version.c
+++ b/src/version.c
@@ -871,10 +871,6 @@
 #	 else
 #	  if defined (MACOS)
     MSG_PUTS(_("with (classic) GUI."));
-#	   else
-#	    ifdef FEAT_GUI_KDE
-    MSG_PUTS(_("with KDE GUI."));
-#          endif
 #	  endif
 #	 endif
 #	endif
diff --git a/src/version.h b/src/version.h
index d1c888b..8e3ec02 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 1)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 1, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 6)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 6, compiled "