updated for version 7.0153
diff --git a/src/Make_bc3.mak b/src/Make_bc3.mak
index 207b861..20a9b1f 100644
--- a/src/Make_bc3.mak
+++ b/src/Make_bc3.mak
@@ -80,6 +80,7 @@
 	normal.obj \
 	ops.obj \
 	option.obj \
+	popupmenu.obj \
 	quickfix.obj \
 	regexp.obj \
 	screen.obj \
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index 880f292..5879f1d 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: 2005 Jul 23
+# Last updated by Dan Sharp.  Last Change: 2005 Oct 01
 #
 # Also read INSTALLpc.txt!
 #
@@ -421,6 +421,7 @@
 	$(OUTDIR)/os_win32.o \
 	$(OUTDIR)/os_mswin.o \
 	$(OUTDIR)/pathdef.o \
+	$(OUTDIR)/popupmenu.o \
 	$(OUTDIR)/quickfix.o \
 	$(OUTDIR)/regexp.o \
 	$(OUTDIR)/screen.o \
diff --git a/src/Make_dice.mak b/src/Make_dice.mak
index fe74f52..b4e1709 100644
--- a/src/Make_dice.mak
+++ b/src/Make_dice.mak
@@ -56,6 +56,7 @@
 	ops.c \
 	option.c \
 	os_amiga.c \
+	popupmenu.c \
 	quickfix.c \
 	regexp.c \
 	screen.c \
@@ -99,6 +100,7 @@
 	o/ops.o \
 	o/option.o \
 	o/os_amiga.o \
+	o/popupmenu.o \
 	o/quickfix.o \
 	o/regexp.o \
 	o/screen.o \
@@ -196,6 +198,8 @@
 
 o/os_amiga.o:	os_amiga.c  $(SYMS) os_amiga.h
 
+o/popupmenu.o:	popupmenu.c  $(SYMS)
+
 o/quickfix.o:	quickfix.c  $(SYMS)
 
 o/regexp.o:	regexp.c  $(SYMS) regexp.h
diff --git a/src/Make_manx.mak b/src/Make_manx.mak
index 52b9e48..46c0015 100644
--- a/src/Make_manx.mak
+++ b/src/Make_manx.mak
@@ -64,6 +64,7 @@
 	ops.c \
 	option.c \
 	os_amiga.c \
+	popupmenu.c \
 	quickfix.c \
 	regexp.c \
 	screen.c \
@@ -109,6 +110,7 @@
 	obj/ops.o \
 	obj/option.o \
 	obj/os_amiga.o \
+	obj/popupmenu.o \
 	obj/quickfix.o \
 	obj/regexp.o \
 	obj/screen.o \
@@ -152,6 +154,7 @@
 	proto/ops.pro \
 	proto/option.pro \
 	proto/os_amiga.pro \
+	proto/popupmenu.pro \
 	proto/quickfix.pro \
 	proto/regexp.pro \
 	proto/screen.pro \
@@ -303,6 +306,9 @@
 obj/os_amiga.o:	os_amiga.c
 	$(CCSYM) $@ os_amiga.c
 
+obj/popupmenu.o:	popupmenu.c
+	$(CCSYM) $@ popupmenu.c
+
 obj/quickfix.o:	quickfix.c
 	$(CCSYM) $@ quickfix.c
 
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index 9d78da5..7b601cc 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -389,6 +389,7 @@
 	$(OUTDIR)/os_win32.o \
 	$(OUTDIR)/os_mswin.o \
 	$(OUTDIR)/pathdef.o \
+	$(OUTDIR)/popupmenu.o \
 	$(OUTDIR)/quickfix.o \
 	$(OUTDIR)/regexp.o \
 	$(OUTDIR)/screen.o \
diff --git a/src/Make_mpw.mak b/src/Make_mpw.mak
index 5be703a..5955a60 100644
--- a/src/Make_mpw.mak
+++ b/src/Make_mpw.mak
@@ -52,6 +52,7 @@
 				  :src:option.c ¶
 				  :src:os_mac.c ¶
 				  :src:pty.c ¶
+				  :src:popupmenu.c ¶
 				  :src:quickfix.c ¶
 				  :src:regexp.c ¶
 				  :src:screen.c ¶
@@ -105,6 +106,7 @@
 				  "{ObjDir}option.c.x" ¶
 				  "{ObjDir}os_mac.c.x" ¶
 				  "{ObjDir}pty.c.x" ¶
+				  "{ObjDir}popupmenu.c.x" ¶
 				  "{ObjDir}quickfix.c.x" ¶
 				  "{ObjDir}regexp.c.x" ¶
 				  "{ObjDir}screen.c.x" ¶
@@ -189,6 +191,7 @@
 "{ObjDir}option.c.x"  Ä  :src:option.c
 "{ObjDir}os_mac.c.x"  Ä  :src:os_mac.c
 "{ObjDir}pty.c.x"  Ä  :src:pty.c
+"{ObjDir}popupmenu.c.x"  Ä  :src:popupmenu.c
 "{ObjDir}quickfix.c.x"  Ä  :src:quickfix.c
 "{ObjDir}regexp.c.x"  Ä  :src:regexp.c
 "{ObjDir}screen.c.x"  Ä  :src:screen.c
@@ -276,6 +279,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -359,6 +363,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -442,6 +447,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -525,6 +531,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -608,6 +615,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -692,6 +700,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -775,6 +784,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -858,6 +868,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -941,6 +952,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1024,6 +1036,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1107,6 +1120,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1190,6 +1204,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1273,6 +1288,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1354,6 +1370,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1437,6 +1454,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1520,6 +1538,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1603,6 +1622,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1686,6 +1706,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1795,6 +1816,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1879,6 +1901,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -1962,6 +1985,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2045,6 +2069,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2128,6 +2153,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2211,6 +2237,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2294,6 +2321,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2378,6 +2406,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2461,6 +2490,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2544,6 +2574,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2627,6 +2658,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2710,6 +2742,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2793,6 +2826,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2876,6 +2910,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -2959,6 +2994,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3042,6 +3078,91 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
+	:src:proto:quickfix.pro ¶
+	:src:proto:regexp.pro ¶
+	:src:proto:screen.pro ¶
+	:src:proto:search.pro ¶
+	:src:proto:spell.pro ¶
+	:src:proto:syntax.pro ¶
+	:src:proto:tag.pro ¶
+	:src:proto:term.pro ¶
+	:src:proto:termlib.pro ¶
+	:src:proto:ui.pro ¶
+	:src:proto:undo.pro ¶
+	:src:proto:version.pro ¶
+	:src:proto:window.pro ¶
+	:src:proto:if_python.pro ¶
+	:src:proto:if_tcl.pro ¶
+	:src:proto:if_ruby.pro ¶
+	:src:proto:gui.pro ¶
+	:src:proto:pty.pro ¶
+	:src:proto:gui_gtk.pro ¶
+	:src:proto:gui_gtk_x11.pro ¶
+	:src:proto:gui_motif.pro ¶
+	:src:proto:gui_athena.pro ¶
+	:src:proto:gui_mac.pro ¶
+	:src:proto:gui_x11.pro ¶
+	:src:proto:workshop.pro ¶
+	:src:proto:if_perl.pro ¶
+	:src:proto:if_perlsfio.pro
+
+:obj:popupmenu.c.x	Ä  ¶
+	:src:popupmenu.c ¶
+	:src:vim.h ¶
+	:src:auto:config.h ¶
+	:src:feature.h ¶
+	:src:os_unix.h ¶
+	:src:os_mac.h ¶
+	:src:workshop.h ¶
+	:src:ascii.h ¶
+	:src:keymap.h ¶
+	:src:term.h ¶
+	:src:macros.h ¶
+	:src:structs.h ¶
+	:src:globals.h ¶
+	:src:option.h ¶
+	:src:ex_cmds.h ¶
+	:src:proto.h ¶
+	:src:integration.h ¶
+	:src:wsdebug.h ¶
+	:src:regexp.h ¶
+	:src:gui.h ¶
+	:src:farsi.h ¶
+	:src:proto:os_unix.pro ¶
+	:src:proto:os_mac.pro ¶
+	:src:proto:buffer.pro ¶
+	:src:proto:charset.pro ¶
+	:src:proto:if_cscope.pro ¶
+	:src:proto:diff.pro ¶
+	:src:proto:digraph.pro ¶
+	:src:proto:edit.pro ¶
+	:src:proto:eval.pro ¶
+	:src:proto:ex_cmds.pro ¶
+	:src:proto:ex_cmds2.pro ¶
+	:src:proto:ex_docmd.pro ¶
+	:src:proto:ex_eval.pro ¶
+	:src:proto:ex_getln.pro ¶
+	:src:proto:fileio.pro ¶
+	:src:proto:fold.pro ¶
+	:src:proto:getchar.pro ¶
+	:src:proto:hardcopy.pro ¶
+	:src:proto:hashtable.pro ¶
+	:src:proto:hangulin.pro ¶
+	:src:proto:main.pro ¶
+	:src:proto:mark.pro ¶
+	:src:proto:memfile.pro ¶
+	:src:proto:memline.pro ¶
+	:src:proto:menu.pro ¶
+	:src:proto:message.pro ¶
+	:src:proto:misc1.pro ¶
+	:src:proto:misc2.pro ¶
+	:src:proto:move.pro ¶
+	:src:proto:multibyte.pro ¶
+	:src:proto:normal.pro ¶
+	:src:proto:ops.pro ¶
+	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3125,6 +3246,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3208,6 +3330,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3291,6 +3414,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3374,6 +3498,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3457,6 +3582,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3540,6 +3666,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3623,6 +3750,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3706,6 +3834,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3790,6 +3919,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3872,6 +4002,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -3955,6 +4086,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -4039,6 +4171,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -4122,6 +4255,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
@@ -4205,6 +4339,7 @@
 	:src:proto:normal.pro ¶
 	:src:proto:ops.pro ¶
 	:src:proto:option.pro ¶
+	:src:proto:popupmenu.pro ¶
 	:src:proto:quickfix.pro ¶
 	:src:proto:regexp.pro ¶
 	:src:proto:screen.pro ¶
diff --git a/src/Make_os2.mak b/src/Make_os2.mak
index 2c4cdaf..1a64c11 100644
--- a/src/Make_os2.mak
+++ b/src/Make_os2.mak
@@ -68,6 +68,7 @@
 	normal.o \
 	ops.o \
 	option.o \
+	popupmenu.o \
 	quickfix.o \
 	regexp.o \
 	screen.o \
@@ -140,6 +141,7 @@
 normal.o:	normal.c  $(INCL)
 ops.o:		ops.c  $(INCL)
 option.o:	option.c  $(INCL)
+popupmenu.o:	popupmenu.c  $(INCL)
 quickfix.o:	quickfix.c  $(INCL)
 regexp.o:	regexp.c  $(INCL)
 screen.o:	screen.c  $(INCL)
diff --git a/src/Make_ro.mak b/src/Make_ro.mak
index 38e6324..1577409 100644
--- a/src/Make_ro.mak
+++ b/src/Make_ro.mak
@@ -15,7 +15,8 @@
 	o.ex_docmd o.ex_eval o.ex_getln o.fileio o.fold o.getchar \
 	o.hardcopy o.hashtable o.main o.mark o.mbyte  \
 	o.memfile o.memline o.menu o.message o.misc1 o.misc2 o.move     \
-	o.normal o.ops o.option o.quickfix o.regexp o.screen o.search   \
+	o.normal o.ops o.option o.popupmenu o.quickfix o.regexp o.screen \
+	o.search   \
 	o.spell o.syntax o.tag o.term o.termlib o.ui o.undo o.version	\
 	o.window o.os_riscos o.swis o.gui o.gui_riscos
 
@@ -104,6 +105,8 @@
 
 o.pty:		c.pty
 
+o.popupmenu:	c.popupmenu
+
 o.quickfix:	c.quickfix
 
 o.regexp:	c.regexp
diff --git a/src/Make_sas.mak b/src/Make_sas.mak
index 484f562..9caadd0 100644
--- a/src/Make_sas.mak
+++ b/src/Make_sas.mak
@@ -119,6 +119,7 @@
 	ops.c \
 	option.c \
 	os_amiga.c \
+	popupmenu.c \
 	quickfix.c \
 	regexp.c \
 	screen.c \
@@ -163,6 +164,7 @@
 	ops.o \
 	option.o \
 	os_amiga.o \
+	popupmenu.o \
 	quickfix.o \
 	regexp.o \
 	screen.o \
@@ -207,6 +209,7 @@
 	proto/ops.pro \
 	proto/option.pro \
 	proto/os_amiga.pro \
+	proto/popupmenu.pro \
 	proto/quickfix.pro \
 	proto/regexp.pro \
 	proto/screen.pro \
@@ -335,6 +338,8 @@
 proto/option.pro:	option.c
 os_amiga.o:		os_amiga.c
 proto/os_amiga.pro:	os_amiga.c
+popupmenu.o:		popupmenu.c
+proto/popupmenu.pro:	popupmenu.c
 quickfix.o:		quickfix.c
 proto/quickfix.pro:	quickfix.c
 regexp.o:		regexp.c
diff --git a/src/Make_w16.mak b/src/Make_w16.mak
index 42d1547..598d72e 100644
--- a/src/Make_w16.mak
+++ b/src/Make_w16.mak
@@ -107,6 +107,7 @@
    $(INTDIR)\os_win16.obj\
    $(INTDIR)\os_msdos.obj\
    $(INTDIR)\os_mswin.obj\
+   $(INTDIR)\popupmenu.obj\
    $(INTDIR)\quickfix.obj\
    $(INTDIR)\regexp.obj\
    $(INTDIR)\screen.obj\
diff --git a/src/Makefile b/src/Makefile
index 0340f79..92ccafb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1371,6 +1371,7 @@
 	option.c \
 	os_unix.c \
 	auto/pathdef.c \
+	popupmenu.c \
 	quickfix.c \
 	regexp.c \
 	screen.c \
@@ -1441,6 +1442,7 @@
 	objects/option.o \
 	objects/os_unix.o \
 	objects/pathdef.o \
+	objects/popupmenu.o \
 	objects/quickfix.o \
 	objects/regexp.o \
 	objects/screen.o \
@@ -1500,6 +1502,7 @@
 	ops.pro \
 	option.pro \
 	os_unix.pro \
+	popupmenu.pro \
 	quickfix.pro \
 	regexp.pro \
 	screen.pro \
@@ -1611,14 +1614,19 @@
 # Generate the converted .mo files separately, it's no problem if this fails.
 languages:
 	@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
+		$(MAKE) language-check; \
 		cd $(PODIR); \
-		CC="$(CC)" $(MAKE) check; \
 		CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
 	fi
 	-@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
 		cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
 	fi
 
+# Separate target to check the po files for valitidy, because it depends on
+# ./vim.
+language-check: $(VIMTARGET)
+	cd $(PODIR); $(MAKE) check VIM=../$(VIMTARGET)
+
 # Update the *.po files for changes in the sources.  Only run manually.
 update-po:
 	cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) update-po
@@ -2457,6 +2465,9 @@
 objects/pty.o: pty.c
 	$(CCC) -o $@ pty.c
 
+objects/popupmenu.o: popupmenu.c
+	$(CCC) -o $@ popupmenu.c
+
 objects/quickfix.o: quickfix.c
 	$(CCC) -o $@ quickfix.c
 
diff --git a/src/edit.c b/src/edit.c
index e4370fc..140c17f 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -109,10 +109,14 @@
 static int  has_compl_option __ARGS((int dict_opt));
 static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches, int dir));
 static int  ins_compl_make_cyclic __ARGS((void));
+static void ins_compl_upd_pum __ARGS((void));
+static void ins_compl_del_pum __ARGS((void));
+static int pum_wanted __ARGS((void));
+static void ins_compl_show_pum __ARGS((void));
 static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
 static void ins_compl_free __ARGS((void));
 static void ins_compl_clear __ARGS((void));
-static void ins_compl_prep __ARGS((int c));
+static int  ins_compl_prep __ARGS((int c));
 static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag));
 static int  ins_compl_get_exp __ARGS((pos_T *ini, int dir));
 static void ins_compl_delete __ARGS((void));
@@ -659,10 +663,19 @@
 #endif
 
 #ifdef FEAT_INS_EXPAND
+	/* When the popup menu is visible cursor keys change the selection. */
+	if (c == K_UP && pum_visible())
+	    c = Ctrl_P;
+	if (c == K_DOWN && pum_visible())
+	    c = Ctrl_N;
+
 	/* Prepare for or stop CTRL-X mode.  This doesn't do completion, but
 	 * it does fix up the text when finishing completion. */
 	if (c != K_IGNORE)
-	    ins_compl_prep(c);
+	{
+	    if (ins_compl_prep(c))
+		continue;
+	}
 #endif
 
 	/* CTRL-\ CTRL-N goes to Normal mode,
@@ -1968,6 +1981,9 @@
 	} while (match != NULL && match != compl_first_match);
     }
 
+    /* Remove any popup menu before changing the list of matches. */
+    ins_compl_del_pum();
+
     /*
      * Allocate a new match structure.
      * Copy the values to the new match structure.
@@ -2073,6 +2089,157 @@
     return count;
 }
 
+static char_u **compl_match_array = NULL;
+static int compl_match_arraysize;
+
+/*
+ * Update the screen and when there is any scrolling remove the popup menu.
+ */
+    static void
+ins_compl_upd_pum()
+{
+    int		h;
+
+    if (compl_match_array != NULL)
+    {
+	h = curwin->w_cline_height;
+	update_screen(0);
+	if (h != curwin->w_cline_height)
+	    ins_compl_del_pum();
+    }
+}
+
+/*
+ * Remove any popup menu.
+ */
+    static void
+ins_compl_del_pum()
+{
+    if (compl_match_array != NULL)
+    {
+	pum_undisplay();
+	vim_free(compl_match_array);
+	compl_match_array = NULL;
+    }
+}
+
+/*
+ * Return TRUE if the popup menu should be displayed.
+ */
+    static int
+pum_wanted()
+{
+    compl_T     *compl;
+    int		i;
+
+    /* 'completeopt' must contain "menu" */
+    if (*p_cot == NUL)
+	return FALSE;
+
+    /* The display looks bad on a B&W display. */
+    if (t_colors < 8
+#ifdef FEAT_GUI
+	    && !gui.in_use
+#endif
+	    )
+	return FALSE;
+
+    /* Don't display the popup menu if there are no matches or there is only
+     * one (ignoring the original text). */
+    compl = compl_first_match;
+    i = 0;
+    do
+    {
+	if (compl == NULL
+		      || ((compl->cp_flags & ORIGINAL_TEXT) == 0 && ++i == 2))
+	    break;
+	compl = compl->cp_next;
+    } while (compl != compl_first_match);
+
+    return (i >= 2);
+}
+
+/*
+ * Show the popup menu for the list of matches.
+ */
+    static void
+ins_compl_show_pum()
+{
+    compl_T     *compl;
+    int		i;
+    int		cur = -1;
+    colnr_T	col;
+
+    if (!pum_wanted())
+	return;
+
+    /* Update the screen before drawing the popup menu over it. */
+    update_screen(0);
+
+    if (compl_match_array == NULL)
+    {
+	/* Need to build the popup menu list. */
+	compl_match_arraysize = 0;
+	compl = compl_first_match;
+	do
+	{
+	    if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+		++compl_match_arraysize;
+	    compl = compl->cp_next;
+	} while (compl != NULL && compl != compl_first_match);
+	compl_match_array = (char_u **)alloc((unsigned)(sizeof(char_u **)
+						    * compl_match_arraysize));
+	if (compl_match_array != NULL)
+	{
+	    i = 0;
+	    compl = compl_first_match;
+	    do
+	    {
+		if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+		{
+		    if (compl == compl_shown_match)
+			cur = i;
+		    compl_match_array[i++] = compl->cp_str;
+		}
+		compl = compl->cp_next;
+	    } while (compl != NULL && compl != compl_first_match);
+	}
+    }
+    else
+    {
+	/* popup menu already exists, only need to find the current item.*/
+	i = 0;
+	compl = compl_first_match;
+	do
+	{
+	    if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+	    {
+		if (compl == compl_shown_match)
+		{
+		    cur = i;
+		    break;
+		}
+		++i;
+	    }
+	    compl = compl->cp_next;
+	} while (compl != NULL && compl != compl_first_match);
+    }
+
+    if (compl_match_array != NULL)
+    {
+	/* Compute the screen column of the start of the completed text.
+	 * Use the cursor to get all wrapping and other settings right. */
+	col = curwin->w_cursor.col;
+	curwin->w_cursor.col = compl_col;
+	validate_cursor_col();
+	pum_display(compl_match_array, compl_match_arraysize, cur,
+		  curwin->w_cline_row + W_WINROW(curwin),
+		  curwin->w_cline_height,
+		  curwin->w_wcol + W_WINCOL(curwin));
+	curwin->w_cursor.col = col;
+    }
+}
+
 #define DICT_FIRST	(1)	/* use just first element in "dict" */
 #define DICT_EXACT	(2)	/* "dict" is the exact name of a file */
 /*
@@ -2277,6 +2444,10 @@
 
     if (compl_first_match == NULL)
 	return;
+
+    ins_compl_del_pum();
+    pum_clear();
+
     compl_curr_match = compl_first_match;
     do
     {
@@ -2306,14 +2477,16 @@
 /*
  * Prepare for Insert mode completion, or stop it.
  * Called just after typing a character in Insert mode.
+ * Returns TRUE when the character is not to be inserted;
  */
-    static void
+    static int
 ins_compl_prep(c)
     int	    c;
 {
     char_u	*ptr;
     int		temp;
     int		want_cindent;
+    int		retval = FALSE;
 
     /* Forget any previous 'special' messages if this is actually
      * a ^X mode key - bar ^R, in which case we wait to see what it gives us.
@@ -2323,7 +2496,7 @@
 
     /* Ignore end of Select mode mapping */
     if (c == K_SELECT)
-	return;
+	return retval;
 
     if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
     {
@@ -2504,6 +2677,11 @@
 
 	    auto_format(FALSE, TRUE);
 
+	    /* if the popup menu is displayed hitting Enter means accepting
+	     * the selection without inserting anything. */
+	    if ((c == CAR || c == K_KENTER || c == NL) && pum_visible())
+		retval = TRUE;
+
 	    ins_compl_free();
 	    compl_started = FALSE;
 	    compl_matches = 0;
@@ -2534,6 +2712,8 @@
 	compl_cont_status = 0;
 	compl_cont_mode = 0;
     }
+
+    return retval;
 }
 
 /*
@@ -2890,8 +3070,8 @@
 	    {
 		int	flags = 0;
 
-		/* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that has
-		 * added a word that was at the beginning of the line */
+		/* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that
+		 * has added a word that was at the beginning of the line */
 		if (	ctrl_x_mode == CTRL_X_WHOLE_LINE
 			|| (compl_cont_status & CONT_SOL))
 		    found_new_match = search_for_exact_line(ins_buf, pos,
@@ -2999,7 +3179,7 @@
 		    }
 		}
 		if (ins_compl_add_infercase(ptr, len,
-			    ins_buf == curbuf ?  NULL : ins_buf->b_sfname,
+				 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
 						       dir, flags) != NOTDONE)
 		{
 		    found_new_match = OK;
@@ -3009,22 +3189,35 @@
 	    p_scs = save_p_scs;
 	    p_ws = save_p_ws;
 	}
+
 	/* check if compl_curr_match has changed, (e.g. other type of
 	 * expansion added somenthing) */
-	if (compl_curr_match != old_match)
+	if (type != 0 && compl_curr_match != old_match)
 	    found_new_match = OK;
 
 	/* break the loop for specialized modes (use 'complete' just for the
 	 * generic ctrl_x_mode == 0) or when we've found a new match */
 	if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
 						   || found_new_match != FAIL)
-	    break;
+	{
+	    if (got_int)
+		break;
+	    if (pum_wanted() && type != -1)
+		/* Fill the popup menu as soon as possible. */
+		ins_compl_check_keys(0);
+	    if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
+							 || compl_interrupted)
+		break;
+	    compl_started = TRUE;
+	}
+	else
+	{
+	    /* Mark a buffer scanned when it has been scanned completely */
+	    if (type == 0 || type == CTRL_X_PATH_PATTERNS)
+		ins_buf->b_scanned = TRUE;
 
-	/* Mark a buffer scanned when it has been scanned completely */
-	if (type == 0 || type == CTRL_X_PATH_PATTERNS)
-	    ins_buf->b_scanned = TRUE;
-
-	compl_started = FALSE;
+	    compl_started = FALSE;
+	}
     }
     compl_started = TRUE;
 
@@ -3106,8 +3299,7 @@
 	compl_pending = TRUE;
 	if (allow_get_expansion)
 	{
-	    num_matches = ins_compl_get_exp(&compl_startpos,
-							  compl_direction);
+	    num_matches = ins_compl_get_exp(&compl_startpos, compl_direction);
 	    if (compl_pending)
 	    {
 		if (compl_direction == compl_shows_dir)
@@ -3123,9 +3315,15 @@
 
     if (!allow_get_expansion)
     {
+	/* may undisplay the popup menu first */
+	ins_compl_upd_pum();
+
 	/* Display the current match. */
 	update_screen(0);
 
+	/* display the updated popup menu */
+	ins_compl_show_pum();
+
 	/* Delete old text to be replaced, since we're still searching and
 	 * don't want to match ourselves!  */
 	ins_compl_delete();
@@ -3593,6 +3791,9 @@
      */
     n = ins_compl_next(TRUE);
 
+    /* may undisplay the popup menu */
+    ins_compl_upd_pum();
+
     if (n > 1)		/* all matches have been found */
 	compl_matches = n;
     compl_curr_match = compl_shown_match;
@@ -3671,8 +3872,8 @@
 		    if (match != NULL)
 			/* go up and assign all numbers which are not assigned
 			 * yet */
-			for (match = match->cp_next; match
-				&& match->cp_number == -1;
+			for (match = match->cp_next;
+				match != NULL && match->cp_number == -1;
 						       match = match->cp_next)
 			    match->cp_number = ++number;
 		}
@@ -3699,8 +3900,8 @@
 		}
 	    }
 
-	    /* The match should always have a sequnce number now, this is just
-	     * a safety check. */
+	    /* The match should always have a sequence number now, this is
+	     * just a safety check. */
 	    if (compl_curr_match->cp_number != -1)
 	    {
 		/* Space for 10 text chars. + 2x10-digit no.s */
@@ -3733,6 +3934,8 @@
     else
 	msg_clr_cmdline();	/* necessary for "noshowmode" */
 
+    ins_compl_show_pum();
+
     return OK;
 }
 
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 2748915..f92140a 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -1289,7 +1289,7 @@
 		goto cmdline_not_changed;
 
 	case K_VER_SCROLLBAR:
-		if (!msg_scrolled)
+		if (msg_scrolled == 0)
 		{
 		    gui_do_scroll();
 		    redrawcmd();
@@ -1297,7 +1297,7 @@
 		goto cmdline_not_changed;
 
 	case K_HOR_SCROLLBAR:
-		if (!msg_scrolled)
+		if (msg_scrolled == 0)
 		{
 		    gui_do_horiz_scroll();
 		    redrawcmd();
@@ -2897,7 +2897,7 @@
     void
 compute_cmdrow()
 {
-    if (exmode_active || msg_scrolled)
+    if (exmode_active || msg_scrolled != 0)
 	cmdline_row = Rows - 1;
     else
 	cmdline_row = W_WINROW(lastwin) + lastwin->w_height
diff --git a/src/fileio.c b/src/fileio.c
index e743061..f00e1ea 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2193,7 +2193,7 @@
 #endif
 		p = msg_trunc_attr(IObuff, FALSE, 0);
 	    if (read_stdin || read_buffer || restart_edit != 0
-		    || (msg_scrolled && !need_wait_return))
+		    || (msg_scrolled != 0 && !need_wait_return))
 	    {
 		/* Need to repeat the message after redrawing when:
 		 * - When reading from stdin (the screen will be cleared next).
diff --git a/src/gui.c b/src/gui.c
index 9135992..9561195 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -3492,7 +3492,7 @@
 	    ins_horscroll();
 	else if (State & CMDLINE)
 	{
-	    if (!msg_scrolled)
+	    if (msg_scrolled == 0)
 	    {
 		gui_do_horiz_scroll();
 		redrawcmdline();
diff --git a/src/option.c b/src/option.c
index b3c80d6..4d7a95b 100644
--- a/src/option.c
+++ b/src/option.c
@@ -659,6 +659,15 @@
 			    {(char_u *)0L, (char_u *)0L}
 #endif
 			    },
+    {"completeopt",   "cot",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_INS_EXPAND
+			    (char_u *)&p_cot, PV_NONE,
+			    {(char_u *)"menu", (char_u *)0L}
+#else
+			    (char_u *)NULL, PV_NONE,
+			    {(char_u *)0L, (char_u *)0L}
+#endif
+			    },
     {"confirm",     "cf",   P_BOOL|P_VI_DEF,
 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
 			    (char_u *)&p_confirm, PV_NONE,
@@ -1119,7 +1128,7 @@
 			    {(char_u *)FALSE, (char_u *)0L}},
     {"highlight",   "hl",   P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
 			    (char_u *)&p_hl, PV_NONE,
-			    {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal",
+			    {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb",
 				(char_u *)0L}},
     {"history",	    "hi",   P_NUM|P_VIM,
 			    (char_u *)&p_hi, PV_NONE,
@@ -2608,12 +2617,15 @@
 static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
 #ifdef FEAT_FOLDING
 static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
-#ifdef FEAT_DIFF
+# ifdef FEAT_DIFF
 				"diff",
-#endif
+# endif
 				NULL};
 static char *(p_fcl_values[]) = {"all", NULL};
 #endif
+#ifdef FEAT_INS_EXPAND
+static char *(p_cot_values[]) = {"menu", NULL};
+#endif
 
 static void set_option_default __ARGS((int, int opt_flags, int compatible));
 static void set_options_default __ARGS((int opt_flags));
@@ -5930,6 +5942,13 @@
 	    }
 	}
     }
+
+    /* 'completeopt' */
+    else if (varp == &p_cot)
+    {
+	if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK)
+	    errmsg = e_invarg;
+    }
 #endif /* FEAT_INS_EXPAND */
 
 
diff --git a/src/option.h b/src/option.h
index 3cfdd4f..173919e 100644
--- a/src/option.h
+++ b/src/option.h
@@ -384,6 +384,9 @@
 EXTERN int	p_confirm;	/* 'confirm' */
 #endif
 EXTERN int	p_cp;		/* 'compatible' */
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u	*p_cot;		/* 'completeopt' */
+#endif
 EXTERN char_u	*p_cpo;		/* 'cpoptions' */
 #ifdef FEAT_CSCOPE
 EXTERN char_u	*p_csprg;	/* 'cscopeprg' */
diff --git a/src/screen.c b/src/screen.c
index fa13904..1a2161f 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -5296,7 +5296,13 @@
 	/* no status line, can only be last window */
 	redraw_cmdline = TRUE;
     }
-    else if (!redrawing())
+    else if (!redrawing()
+#ifdef FEAT_INS_EXPAND
+	    /* don't update status line when popup menu is visible and may be
+	     * drawn over it */
+	    || pum_visible()
+#endif
+	    )
     {
 	/* Don't redraw right now, do it later. */
 	wp->w_redr_status = TRUE;
@@ -8534,6 +8540,9 @@
 # endif
 	if (edit_submode != NULL)
 	    return;
+    /* Don't draw the ruler when the popup menu is visible, it may overlap. */
+    if (pum_visible())
+	return;
 #endif
 
 #ifdef FEAT_STL_OPT
diff --git a/src/syntax.c b/src/syntax.c
index a04b81b..ce2ff88 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6065,6 +6065,8 @@
 	"VertSplit term=reverse cterm=reverse gui=reverse",
 	"VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold",
 	"DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
+	"PmenuThumb cterm=reverse gui=reverse",
+	"PmenuSbar ctermbg=Grey guibg=Grey",
 	NULL
     };
 
@@ -6080,6 +6082,8 @@
 	"SpellCap term=reverse ctermbg=LightBlue guisp=Blue gui=undercurl",
 	"SpellRare term=reverse ctermbg=LightMagenta guisp=Magenta gui=undercurl",
 	"SpellLocal term=underline ctermbg=Cyan guisp=DarkCyan gui=undercurl",
+	"Pmenu ctermbg=LightMagenta guibg=LightMagenta",
+	"PmenuSel ctermbg=LightGrey guibg=Grey",
 	"SpecialKey term=bold ctermfg=DarkBlue guifg=Blue",
 	"Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta",
 	"WarningMsg term=standout ctermfg=DarkRed guifg=Red",
@@ -6107,6 +6111,8 @@
 	"SpellCap term=reverse ctermbg=Blue guisp=Blue gui=undercurl",
 	"SpellRare term=reverse ctermbg=Magenta guisp=Magenta gui=undercurl",
 	"SpellLocal term=underline ctermbg=Cyan guisp=Cyan gui=undercurl",
+	"Pmenu ctermbg=Magenta guibg=Magenta",
+	"PmenuSel ctermbg=Grey guibg=Grey",
 	"Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta",
 	"WarningMsg term=standout ctermfg=LightRed guifg=Red",
 	"WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
diff --git a/src/testdir/test32.in b/src/testdir/test32.in
index 0d54051..85d76ae 100644
--- a/src/testdir/test32.in
+++ b/src/testdir/test32.in
@@ -23,10 +23,12 @@
 STARTTEST
 :so small.vim
 :se nocp viminfo+=nviminfo cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
+:se cot=
 nO#include "Xtestfile"
 ru
 O
 
+
 
 :se cpt=.,w,i
 kOM
diff --git a/src/version.h b/src/version.h
index 85bf690..3571032 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 Sep 30)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 30, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Oct 3)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Oct 3, compiled "