diff -crN ../vim-5.6/Makefile ./Makefile *** ../vim-5.6/Makefile Tue Aug 31 22:03:09 1999 --- ./Makefile Sat Mar 18 18:23:32 2000 *************** *** 1,9 **** ! # This is just a stub for the Unix Makefile, to provide support for doing # "make install" in the top Vim directory. # ! # NOTE: If this doesn't work properly, do "cd src" first, and then type ! # "make". Noticed on AIX systems: Trying to run "cproto" or something else ! # after Vim has been compiled. Don't know why... all install uninstall tools config configure proto depend lint tags types test testclean clean distclean: cd src && $(MAKE) $@ --- 1,12 ---- ! # This is a stub for the Unix Makefile, to provide support for doing # "make install" in the top Vim directory. # ! # NOTE: If this doesn't work properly, first change directory to "src" and use ! # the Makefile there: ! # cd src ! # make [arguments] ! # Noticed on AIX systems when using this Makefile: Trying to run "cproto" or ! # something else after Vim has been compiled. Don't know why... all install uninstall tools config configure proto depend lint tags types test testclean clean distclean: cd src && $(MAKE) $@ diff -crN ../vim-5.6/README_src.txt ./README_src.txt *** ../vim-5.6/README_src.txt Sun Jan 16 14:12:31 2000 --- ./README_src.txt Sat Jun 24 11:09:44 2000 *************** *** 1,9 **** ! README_src.txt for version 5.6 of Vim: Vi IMproved. ! This is the source archive for Vim. It is packed for Unix systems. It is ! also used for other systems in combination with the extra archive ! (vim-5.5-extra.tar.gz, in the "extra" directory of ftp.vim.org). For more information, see the README.txt file that comes with the runtime ! archive (vim-5.5-rt.tar.gz). To be able to run Vim you MUST get the runtime archive too! --- 1,10 ---- ! README_src.txt for version 5.7 of Vim: Vi IMproved. ! The source archive contains the files needed to compile Vim on Unix systems. ! It is packed for Unix systems (NL line separator). It is also used for other ! systems in combination with the extra archive (vim-5.7-extra.tar.gz, in the ! "extra" directory of ftp.vim.org). For more information, see the README.txt file that comes with the runtime ! archive (vim-5.7-rt.tar.gz). To be able to run Vim you MUST get the runtime archive too! diff -crN ../vim-5.6/src/INSTALL ./src/INSTALL *** ../vim-5.6/src/INSTALL Mon Jul 19 22:51:03 1999 --- ./src/INSTALL Wed Jun 14 10:46:57 2000 *************** *** 12,19 **** 6. Atari MiNT For BeBox see doc/os_bebox.txt. ! For Amiga see INSTALL.amiga ! For PC (MS-DOS, Windows NT, Windows 95) see INSTALL.pc 1. Generic --- 12,20 ---- 6. Atari MiNT For BeBox see doc/os_bebox.txt. ! For Amiga see INSTALL_ami.txt ! For PC (MS-DOS, Windows NT, Windows 95) see INSTALL_pc.txt ! For Macintosh see INSTALL_mac.txt 1. Generic diff -crN ../vim-5.6/src/Makefile ./src/Makefile *** ../vim-5.6/src/Makefile Sun Jan 16 15:03:04 2000 --- ./src/Makefile Sat Jun 24 11:28:59 2000 *************** *** 25,31 **** # Athena but don't want to make gvim (the GUI version of Vim with nice # menus and scrollbars, but makes Vim bigger and startup slower). # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but ! # want to disable using X11 libraries. This speeds up starting Vim, # but the window title will not be set and the X11 selection can not # used. # - Uncomment the line with --enable-perlinterp to enable Perl. Makes --- 25,31 ---- # Athena but don't want to make gvim (the GUI version of Vim with nice # menus and scrollbars, but makes Vim bigger and startup slower). # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but ! # want to disable using X11 libraries. This speeds up starting Vim, # but the window title will not be set and the X11 selection can not # used. # - Uncomment the line with --enable-perlinterp to enable Perl. Makes *************** *** 122,128 **** # 6. Use Vim until a new version comes out. # # 7. "make uninstall_runtime" ! # Will remove the runtime files for the current version. This is safe # to use while another version is being used, only version-specific # files will be deleted. # To remove the runtime files of another version: --- 122,128 ---- # 6. Use Vim until a new version comes out. # # 7. "make uninstall_runtime" ! # Will remove the runtime files for the current version. This is safe # to use while another version is being used, only version-specific # files will be deleted. # To remove the runtime files of another version: *************** *** 150,160 **** #AIX 4.2 gcc 2.7.2.1 +X11 +GUI_Motif 5.2 D. Rothkamp #AIX 4.2.1 cc 5.2k (C) Will Fiveash #AIX 4.3 cc +X11 +GUI_Athena 5.3 Glauber Ribeiro #A/UX 3.1.1 gcc +X11 4.0 (6) Jim Jagielski #BeOS PR mwcc DR3 5.0n (T) Olaf Seibert #BSDI 2.1 (x86) shlicc2 gcc-2.6.3 -X11 X11R6 4.5 (1) Jos Backus #BSD/OS 3.0 (x86) gcc gcc-2.7.2.1 -X11 X11R6 4.6c (1) Jos Backus ! #CYGWIN32_NT 19.3 egcs-2.90.27 -X11 -GUI 5.2 D. Rothkamp #CX/UX 6.2 cc +X11 +GUI_Mofif 5.4 (V) Kipp E. Howard #DG/UX 5.4* gcc 2.5.8 GUI 5.0e (H) Jonas Schlein #DG/UX 5.4R4.20 gcc 2.7.2 GUI 5.0s (H) Rocky Olive --- 150,161 ---- #AIX 4.2 gcc 2.7.2.1 +X11 +GUI_Motif 5.2 D. Rothkamp #AIX 4.2.1 cc 5.2k (C) Will Fiveash #AIX 4.3 cc +X11 +GUI_Athena 5.3 Glauber Ribeiro + #AIX 4.3.3.12 xic 3.6.6 5.6 (5) David R. Favor #A/UX 3.1.1 gcc +X11 4.0 (6) Jim Jagielski #BeOS PR mwcc DR3 5.0n (T) Olaf Seibert #BSDI 2.1 (x86) shlicc2 gcc-2.6.3 -X11 X11R6 4.5 (1) Jos Backus #BSD/OS 3.0 (x86) gcc gcc-2.7.2.1 -X11 X11R6 4.6c (1) Jos Backus ! #Cygwin 1.0 Win-NT 2.9-cygwin-990830 -X11 -GUI 5.6 Bram Moolenaar #CX/UX 6.2 cc +X11 +GUI_Mofif 5.4 (V) Kipp E. Howard #DG/UX 5.4* gcc 2.5.8 GUI 5.0e (H) Jonas Schlein #DG/UX 5.4R4.20 gcc 2.7.2 GUI 5.0s (H) Rocky Olive *************** *** 174,182 **** #FreeBSD 2.1.6 gcc-2.6.3 +X11 -GUI Athena 5.0c Bram Moolenaar #FreeBSD 2.2.5 gcc-2.7.2.1 X11R6 Moo-Tiff 5.4d Bram Moolenaar #FreeBSD 2.2.5 gcc-2.7.2.1 +X11 -GUI Athena 5.4d Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 GTK 1.2.5 5.6a Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 Athena 5.6a Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 Lesstif0.89.4 5.6a Bram Moolenaar #Linux 2.0 gcc-2.7.2 Infomagic Motif 4.3 (3) Ronald Rietman #Linux 2.0.31 gcc +X11 +GUI Athena 5.0w (U) Darren Hiebert #Linux 2.0.33 gcc-2.7.2.1 X11R6, Lesstif 5.0s Tony Nugent --- 175,183 ---- #FreeBSD 2.1.6 gcc-2.6.3 +X11 -GUI Athena 5.0c Bram Moolenaar #FreeBSD 2.2.5 gcc-2.7.2.1 X11R6 Moo-Tiff 5.4d Bram Moolenaar #FreeBSD 2.2.5 gcc-2.7.2.1 +X11 -GUI Athena 5.4d Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 GTK 1.2.5 5.7 Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 Athena 5.7 Bram Moolenaar ! #FreeBSD 3.3 gcc-2.7.2.1 +X11 Lesstif0.89.4 5.7 Bram Moolenaar #Linux 2.0 gcc-2.7.2 Infomagic Motif 4.3 (3) Ronald Rietman #Linux 2.0.31 gcc +X11 +GUI Athena 5.0w (U) Darren Hiebert #Linux 2.0.33 gcc-2.7.2.1 X11R6, Lesstif 5.0s Tony Nugent *************** *** 207,213 **** #Solaris 2.6 (sun4u) gcc 2.7.2.3 +X11 +GUI_Motif 5.2 D. Rothkamp #Solaris 2.6 (sun4u) cc (SC4.2) +X11R6 +GUI (CDE) 5.0v Andrew Large #Solaris 2.6 gcc 2.8.1 ncursus 5.3 (G) Larry W. Virden ! #Solaris with -lthread 5.5 (W) K. Nagano #SunOS_5.5.1 gcc 2.7.2 +X11 +Motif 5.0s Karsten Sievert #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar #SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert --- 208,214 ---- #Solaris 2.6 (sun4u) gcc 2.7.2.3 +X11 +GUI_Motif 5.2 D. Rothkamp #Solaris 2.6 (sun4u) cc (SC4.2) +X11R6 +GUI (CDE) 5.0v Andrew Large #Solaris 2.6 gcc 2.8.1 ncursus 5.3 (G) Larry W. Virden ! #Solaris with -lthread 5.5 (W) K. Nagano #SunOS_5.5.1 gcc 2.7.2 +X11 +Motif 5.0s Karsten Sievert #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar #SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert *************** *** 222,228 **** # And add "-lXpm" to MOTIF_LIBS2. # (4) For cc the optimizer must be disabled (use CFLAGS= after running # configure) (symptom: ":set termcap" output looks weird). ! # (5) Compiler may need -qmaxmem argument, see below. # (6) See below for a few lines to uncomment # (7) See below for lines which enable the use of clcc # (8) Needs some EXTRA_LIBS, search for Unisys below --- 223,229 ---- # And add "-lXpm" to MOTIF_LIBS2. # (4) For cc the optimizer must be disabled (use CFLAGS= after running # configure) (symptom: ":set termcap" output looks weird). ! # (5) Compiler may need extra argument, see below. # (6) See below for a few lines to uncomment # (7) See below for lines which enable the use of clcc # (8) Needs some EXTRA_LIBS, search for Unisys below *************** *** 329,335 **** # PERL - For creating Vim with Perl interface # Uncomment this when you want to include the Perl interface. # The Perl option sometimes causes problems, because it adds extra flags ! # to the command line. If you see strange flags during compilation, check in # config.mk where they come from. If it's PERL_CFLAGS, try commenting the # next line. # When you get an error for a missing "perl.exp" file, try creating an emtpy --- 330,336 ---- # PERL - For creating Vim with Perl interface # Uncomment this when you want to include the Perl interface. # The Perl option sometimes causes problems, because it adds extra flags ! # to the command line. If you see strange flags during compilation, check in # config.mk where they come from. If it's PERL_CFLAGS, try commenting the # next line. # When you get an error for a missing "perl.exp" file, try creating an emtpy *************** *** 479,485 **** #EXTRA_DEFS = -DHPUX_DIGRAPHS ### (2) For HP-UX: 9.04 cpp default macro definition table of 128000 bytes ! ### is too small to compile many routines. It produces too much defining ### and no space errors. ### Uncomment the following to specify a larger macro definition table. #CFLAGS = -Wp,-H256000 --- 480,486 ---- #EXTRA_DEFS = -DHPUX_DIGRAPHS ### (2) For HP-UX: 9.04 cpp default macro definition table of 128000 bytes ! ### is too small to compile many routines. It produces too much defining ### and no space errors. ### Uncomment the following to specify a larger macro definition table. #CFLAGS = -Wp,-H256000 *************** *** 493,499 **** #GUI_LIB_LOC = /usr/lib/Motif1.2_R6 ### (5) AIX 4.1.4 with cc ! #CFLAGS = -O -qmaxmem=8092 ### (W) Solaris with multi-threaded libraries (-lthread): ### If suspending doesn't work properly, try using this line: --- 494,508 ---- #GUI_LIB_LOC = /usr/lib/Motif1.2_R6 ### (5) AIX 4.1.4 with cc ! #CFLAGS = -O -qmaxmem=8192 ! ! ### AIX with c89 (Walter Briscoe) ! #CC = c89 ! #CPPFLAGS = -D_ALL_SOURCE ! ! ### AIX 4.3.3.12 with xic 3.6.6 (David R. Favor) ! # needed to avoid a problem where strings.h gets included ! #CFLAGS = -qsrcmsg -O2 -qmaxmem=8192 -D__STR31__ ### (W) Solaris with multi-threaded libraries (-lthread): ### If suspending doesn't work properly, try using this line: *************** *** 585,591 **** #EXTRA_DEFS = -D_XPG_IV ### (I) Reliant-Unix (aka SINIX) 5.44 with standard cc ! # Use both "-F O3" lines for optimization or the "-g" line for debugging #EXTRA_LIBS = -lgen -lsocket -lnsl -lSM -lICE #CFLAGS = -F O3 -DSINIXN #LDFLAGS = -F O3 --- 594,600 ---- #EXTRA_DEFS = -D_XPG_IV ### (I) Reliant-Unix (aka SINIX) 5.44 with standard cc ! # Use both "-F O3" lines for optimization or the "-g" line for debugging #EXTRA_LIBS = -lgen -lsocket -lnsl -lSM -lICE #CFLAGS = -F O3 -DSINIXN #LDFLAGS = -F O3 *************** *** 634,641 **** #LDFLAGS= -OPT:Olimit=3500 -O -n32 -mips3 -IPA:aggr_cprop=ON -INLINE:dfe=ON:list=ON:must=screen_char,out_char,ui_write,out_flush ### (K) for SGI Irix machines with 64 bit pointers ("uname -s" says IRIX64) ! ### suggested by Jon Wright ! ### tested on R8000 IRIX6.1 Power Indigo2 # either (for 64 bit pointers) uncomment the following line #GUI_LIB_LOC = /usr/lib64 # then --- 643,651 ---- #LDFLAGS= -OPT:Olimit=3500 -O -n32 -mips3 -IPA:aggr_cprop=ON -INLINE:dfe=ON:list=ON:must=screen_char,out_char,ui_write,out_flush ### (K) for SGI Irix machines with 64 bit pointers ("uname -s" says IRIX64) ! ### Suggested by Jon Wright . ! ### Tested on R8000 IRIX6.1 Power Indigo2. ! ### Check /etc/compiler.defaults for your compiler settings. # either (for 64 bit pointers) uncomment the following line #GUI_LIB_LOC = /usr/lib64 # then *************** *** 673,680 **** ### (O) For LynxOS 2.5.0, tested on PC. #EXTRA_LIBS = -lXext -lSM -lICE -lbsd ! ### (V) For CX/UX 6.2 (on Harris/Concurrent NightHawk 4800, 5800). Remove ### -Qtarget if only in a 5800 environment. (Kipp E. Howard) #CFLAGS = -O -Qtarget=m88110compat #EXTRA_LIBS = -lgen --- 683,695 ---- ### (O) For LynxOS 2.5.0, tested on PC. #EXTRA_LIBS = -lXext -lSM -lICE -lbsd + ### For LynxOS 3.0.1, tested on PPC + #EXTRA_LIBS= -lXext -lSM -lICE -lnetinet -lXmu -liberty + ### For LynxOS 3.0.1, tested on PC + #EXTRA_LIBS= -lXext -lSM -lICE -lnetinet -lXmu + ! ### (V) For CX/UX 6.2 (on Harris/Concurrent NightHawk 4800, 5800). Remove ### -Qtarget if only in a 5800 environment. (Kipp E. Howard) #CFLAGS = -O -Qtarget=m88110compat #EXTRA_LIBS = -lgen *************** *** 736,742 **** ### Location of Vim files (should not need to be changed, and some things ### might not work when they are changed!) VIMDIR = /vim ! VIMRTDIR = /vim56 HELPSUBDIR = /doc SYNSUBDIR = /syntax MACROSUBDIR = /macros --- 751,757 ---- ### Location of Vim files (should not need to be changed, and some things ### might not work when they are changed!) VIMDIR = /vim ! VIMRTDIR = /vim57 HELPSUBDIR = /doc SYNSUBDIR = /syntax MACROSUBDIR = /macros *************** *** 805,811 **** # Program to install the program in the target directory. Could also be "mv". INSTALL_PROG = cp ! # Program to install the data in the target directory. Cannot be "mv"! INSTALL_DATA = cp INSTALL_DATA_R = cp -r --- 820,826 ---- # Program to install the program in the target directory. Could also be "mv". INSTALL_PROG = cp ! # Program to install the data in the target directory. Cannot be "mv"! INSTALL_DATA = cp INSTALL_DATA_R = cp -r *************** *** 1020,1026 **** .SUFFIXES: .SUFFIXES: .cc .c .o .pro ! PRE_DEFS = -Iproto $(DEFS) $(SNIFF_DEFS) $(GUI_DEFS) $(GUI_IPATH) POST_DEFS = $(X_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS) ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(POST_DEFS) --- 1035,1041 ---- .SUFFIXES: .SUFFIXES: .cc .c .o .pro ! PRE_DEFS = -Iproto $(DEFS) $(SNIFF_DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) POST_DEFS = $(X_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS) ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(POST_DEFS) *************** *** 1193,1199 **** $(TCL_PRO) \ $(PERL_PRO) ! PRO_MANUAL = os_amiga.pro os_msdos.pro os_win32.pro os_beos.pro os_vms.pro # Default target is making the executable and tools all: $(VIMTARGET) $(TOOLS) --- 1208,1215 ---- $(TCL_PRO) \ $(PERL_PRO) ! PRO_MANUAL = os_amiga.pro os_msdos.pro os_win32.pro os_beos.pro os_vms.pro \ ! os_riscos.pro # Default target is making the executable and tools all: $(VIMTARGET) $(TOOLS) *************** *** 1211,1222 **** # config config.mk: configure GUI_INC_LOC="$(GUI_INC_LOC)" GUI_LIB_LOC="$(GUI_LIB_LOC)" \ ! CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ ! $(CONF_SHELL) ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) \ ! $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) $(CONF_OPT_TCL) \ ! $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ ! $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) \ ! $(CONF_OPT_MAX) $(CONF_OPT_MIN) $(CONF_TERM_LIB) $(CONF_ARGS) # When configure.in has changed, run autoconf to produce configure # If you don't have autoconf, use the configure that's there --- 1227,1239 ---- # config config.mk: configure GUI_INC_LOC="$(GUI_INC_LOC)" GUI_LIB_LOC="$(GUI_LIB_LOC)" \ ! CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ ! LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) \ ! ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) \ ! $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) $(CONF_OPT_TCL) \ ! $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ ! $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) \ ! $(CONF_OPT_MAX) $(CONF_OPT_MIN) $(CONF_TERM_LIB) $(CONF_ARGS) # When configure.in has changed, run autoconf to produce configure # If you don't have autoconf, use the configure that's there *************** *** 1243,1258 **** ctags/config.h ctags/ctags.h ctags/ctags$(SUFFIX): ctags/Makefile $(CTAGSFILES) ! cd ctags; CC="$(CC)" CFLAGS="$(CFLAGS)" \ $(MAKE) -f Makefile SUFFIX="$(SUFFIX)" ctags/Makefile ctags/config.h: ctags/Makefile.in ! cd ctags; SUFFIX="$(SUFFIX)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ ! LDFLAGS="$(LDFLAGS)" \ ./configure --mandir="$(MANDIR)" --exec_prefix="$(exec_prefix)" xxd/xxd$(SUFFIX): xxd/xxd.c ! cd xxd; CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) -f Makefile.unix # Generate function prototypes. This is not needed to compile vim, but if # you want to use it, cproto is out there on the net somewhere -- Webb --- 1260,1276 ---- ctags/config.h ctags/ctags.h ctags/ctags$(SUFFIX): ctags/Makefile $(CTAGSFILES) ! cd ctags; CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ $(MAKE) -f Makefile SUFFIX="$(SUFFIX)" ctags/Makefile ctags/config.h: ctags/Makefile.in ! cd ctags; SUFFIX="$(SUFFIX)" CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" \ ! CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ ./configure --mandir="$(MANDIR)" --exec_prefix="$(exec_prefix)" xxd/xxd$(SUFFIX): xxd/xxd.c ! cd xxd; CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ ! $(MAKE) -f Makefile.unix # Generate function prototypes. This is not needed to compile vim, but if # you want to use it, cproto is out there on the net somewhere -- Webb *************** *** 1302,1308 **** ctags tags TAGS: notags $(TAGPRG) $(TAGS_SRC) $(TAGS_INCL) ! # Make a highlight file for types. Requires Exhuberant ctags and awk types: types.vim types.vim: $(TAGS_SRC) $(TAGS_INCL) ctags -i=gstuS -o- $(TAGS_SRC) $(TAGS_INCL) |\ --- 1320,1326 ---- ctags tags TAGS: notags $(TAGPRG) $(TAGS_SRC) $(TAGS_INCL) ! # Make a highlight file for types. Requires Exuberant ctags and awk types: types.vim types.vim: $(TAGS_SRC) $(TAGS_INCL) ctags -i=gstuS -o- $(TAGS_SRC) $(TAGS_INCL) |\ *************** *** 1616,1624 **** # $(CC) -c -I$(srcdir) $(ALL_CFLAGS) $(*F).c -o $@ if_perl.c: if_perl.xs ! $(PERL) -MConfig -e 'unless (exists $$Config{apiversion} && \ ! $$Config{apiversion} >= 5.005) { for (qw(na defgv errgv)) { \ ! print "#define PL_$$_ $$_\n" }} ' > $@ $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \ $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@ --- 1634,1641 ---- # $(CC) -c -I$(srcdir) $(ALL_CFLAGS) $(*F).c -o $@ 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 \ $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@ diff -crN ../vim-5.6/src/buffer.c ./src/buffer.c *** ../vim-5.6/src/buffer.c Wed Dec 15 13:54:07 1999 --- ./src/buffer.c Wed Jun 7 19:11:48 2000 *************** *** 30,37 **** static char_u *buflist_match __ARGS((vim_regexp *prog, BUF *buf)); static char_u *buflist_match_try __ARGS((vim_regexp *prog, char_u *name)); static void buflist_setfpos __ARGS((BUF *, linenr_t, colnr_t)); - static FPOS *buflist_findfpos __ARGS((BUF *buf)); #ifdef UNIX static int otherfile_buf __ARGS((BUF *buf, char_u *ffname, struct stat *stp)); static void buf_setino __ARGS((BUF *buf)); static int buf_same_ino __ARGS((BUF *buf, struct stat *stp)); --- 30,37 ---- static char_u *buflist_match __ARGS((vim_regexp *prog, BUF *buf)); static char_u *buflist_match_try __ARGS((vim_regexp *prog, char_u *name)); static void buflist_setfpos __ARGS((BUF *, linenr_t, colnr_t)); #ifdef UNIX + static BUF *buflist_findname_stat __ARGS((char_u *ffname, struct stat *st)); static int otherfile_buf __ARGS((BUF *buf, char_u *ffname, struct stat *stp)); static void buf_setino __ARGS((BUF *buf)); static int buf_same_ino __ARGS((BUF *buf, struct stat *stp)); *************** *** 66,82 **** && (curbuf->b_flags & BF_NEVERLOADED)) curbuf->b_p_ro = TRUE; - #ifdef VMS - if (curbuf->b_ffname != NULL) - { - char *ptr; - - ptr = strrchr((char *)curbuf->b_ffname, ';'); - if (ptr != NULL) - *ptr = '\0'; - } - #endif - if (ml_open() == FAIL) { /* --- 66,71 ---- *************** *** 803,815 **** int use_curbuf; { BUF *buf; fname_expand(&ffname, &sfname); /* will allocate ffname */ /* * If file name already exists in the list, update the entry. */ ! if (ffname != NULL && (buf = buflist_findname(ffname)) != NULL) { vim_free(ffname); if (lnum != 0) --- 792,818 ---- int use_curbuf; { BUF *buf; + #ifdef UNIX + struct stat st; + #endif fname_expand(&ffname, &sfname); /* will allocate ffname */ + #ifdef UNIX + if (sfname == NULL || mch_stat((char *)sfname, &st) < 0) + st.st_dev = (unsigned)-1; + #endif + /* * If file name already exists in the list, update the entry. */ ! if (ffname != NULL && (buf = ! #ifdef UNIX ! buflist_findname_stat(ffname, &st) ! #else ! buflist_findname(ffname) ! #endif ! ) != NULL) { vim_free(ffname); if (lnum != 0) *************** *** 918,924 **** buf->b_fname = buf->b_sfname; #ifdef UNIX ! buf_setino(buf); #endif buf->b_u_synced = TRUE; buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED; --- 921,933 ---- buf->b_fname = buf->b_sfname; #ifdef UNIX ! if (st.st_dev == (unsigned)-1) ! buf->b_dev = -1; ! else ! { ! buf->b_dev = st.st_dev; ! buf->b_ino = st.st_ino; ! } #endif buf->b_u_synced = TRUE; buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED; *************** *** 1094,1111 **** buflist_findname(ffname) char_u *ffname; { - BUF *buf; #ifdef UNIX struct stat st; if (mch_stat((char *)ffname, &st) < 0) st.st_dev = (unsigned)-1; #endif for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (!otherfile_buf(buf, ffname #ifdef UNIX ! , &st #endif )) return buf; --- 1103,1132 ---- buflist_findname(ffname) char_u *ffname; { #ifdef UNIX struct stat st; if (mch_stat((char *)ffname, &st) < 0) st.st_dev = (unsigned)-1; + return buflist_findname_stat(ffname, &st); + } + + /* + * Same as buflist_findname(), but pass the stat structure to avoid getting it + * twice for the same file. + */ + static BUF * + buflist_findname_stat(ffname, stp) + char_u *ffname; + struct stat *stp; + { #endif + BUF *buf; for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (!otherfile_buf(buf, ffname #ifdef UNIX ! , stp #endif )) return buf; *************** *** 1423,1429 **** * find the position (lnum and col) for the buffer 'buf' for the current window * returns a pointer to no_position if no position is found */ ! static FPOS * buflist_findfpos(buf) BUF *buf; { --- 1444,1450 ---- * find the position (lnum and col) for the buffer 'buf' for the current window * returns a pointer to no_position if no position is found */ ! FPOS * buflist_findfpos(buf) BUF *buf; { *************** *** 1461,1466 **** --- 1482,1488 ---- { BUF *buf; int len; + int i; for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) { *************** *** 1483,1495 **** len = STRLEN(IObuff); IObuff[len++] = '"'; ! /* ! * try to put the "line" strings in column 40 ! */ do { IObuff[len++] = ' '; ! } while (len < 40 && len < IOSIZE - 18); sprintf((char *)IObuff + len, "line %ld", buf == curbuf ? curwin->w_cursor.lnum : (long)buflist_findlnum(buf)); --- 1505,1518 ---- len = STRLEN(IObuff); IObuff[len++] = '"'; ! ! /* put "line 999" in column 40 or after the file name */ ! IObuff[len] = NUL; ! i = 40 - vim_strsize(IObuff); do { IObuff[len++] = ' '; ! } while (--i > 0 && len < IOSIZE - 18); sprintf((char *)IObuff + len, "line %ld", buf == curbuf ? curwin->w_cursor.lnum : (long)buflist_findlnum(buf)); *************** *** 1535,1541 **** char_u *ffname, *sfname; int message; { ! BUF *buf; if (ffname == NULL || *ffname == NUL) { --- 1558,1567 ---- char_u *ffname, *sfname; int message; { ! BUF *buf; ! #ifdef UNIX ! struct stat st; ! #endif if (ffname == NULL || *ffname == NUL) { *************** *** 1543,1548 **** --- 1569,1577 ---- vim_free(curbuf->b_sfname); curbuf->b_ffname = NULL; curbuf->b_sfname = NULL; + #ifdef UNIX + st.st_dev = (unsigned)-1; + #endif } else { *************** *** 1561,1567 **** --- 1590,1602 ---- * - if the buffer is loaded, fail * - if the buffer is not loaded, delete it from the list */ + #ifdef UNIX + if (mch_stat((char *)ffname, &st) < 0) + st.st_dev = (unsigned)-1; + buf = buflist_findname_stat(ffname, &st); + #else buf = buflist_findname(ffname); + #endif if (buf != NULL && buf != curbuf) { if (buf->b_ml.ml_mfp != NULL) /* it's loaded, fail */ *************** *** 1587,1593 **** } curbuf->b_fname = curbuf->b_sfname; #ifdef UNIX ! buf_setino(curbuf); #endif #ifndef SHORT_FNAME --- 1622,1634 ---- } curbuf->b_fname = curbuf->b_sfname; #ifdef UNIX ! if (st.st_dev == (unsigned)-1) ! curbuf->b_dev = -1; ! else ! { ! curbuf->b_dev = st.st_dev; ! curbuf->b_ino = st.st_ino; ! } #endif #ifndef SHORT_FNAME *************** *** 2606,2630 **** colnr_t col; BUF *buf; char_u *sfname; /* don't read in if there are files on the command-line or if writing: */ ! if (!writing && arg_file_count == 0 && find_viminfo_parameter('%') != NULL) { ! tab = vim_strchr(line + 1, '\t'); lnum = 0; col = 0; if (tab != NULL) { *tab++ = '\0'; ! lnum = atol((char *)tab); ! tab = vim_strchr(tab, '\t'); if (tab != NULL) ! col = atoi((char *)tab + 1); } /* Expand "~/" in the file name at "line + 1" to a full path. * Then try shortening it by comparing with the current directory */ ! expand_env(line + 1, NameBuff, MAXPATHL); mch_dirname(IObuff, IOSIZE); sfname = shorten_fname(NameBuff, IObuff); if (sfname == NULL) --- 2647,2681 ---- colnr_t col; BUF *buf; char_u *sfname; + char_u *xline; + + /* Handle long line and escaped characters. */ + xline = viminfo_readstring(line + 1, fp); /* don't read in if there are files on the command-line or if writing: */ ! if (xline != NULL && !writing && arg_file_count == 0 ! && find_viminfo_parameter('%') != NULL) { ! /* Format is: Tab Tab . ! * Watch out for a Tab in the file name, work from the end. */ lnum = 0; col = 0; + tab = vim_strrchr(xline, '\t'); if (tab != NULL) { *tab++ = '\0'; ! col = atoi((char *)tab); ! tab = vim_strrchr(xline, '\t'); if (tab != NULL) ! { ! *tab++ = '\0'; ! lnum = atol((char *)tab); ! } } /* Expand "~/" in the file name at "line + 1" to a full path. * Then try shortening it by comparing with the current directory */ ! expand_env(xline, NameBuff, MAXPATHL); mch_dirname(IObuff, IOSIZE); sfname = shorten_fname(NameBuff, IObuff); if (sfname == NULL) *************** *** 2638,2643 **** --- 2689,2695 ---- buflist_setfpos(buf, lnum, col); } } + vim_free(xline); return vim_fgets(line, LSIZE, fp); } *************** *** 2648,2657 **** --- 2700,2715 ---- { BUF *buf; WIN *win; + char_u *line; if (find_viminfo_parameter('%') == NULL) return; + /* Allocate room for the file name, lnum and col. */ + line = alloc(MAXPATHL + 30); + if (line == NULL) + return; + for (win = firstwin; win != NULL; win = win->w_next) set_last_cursor(win); *************** *** 2661,2671 **** if (buf->b_fname == NULL || buf->b_help || removable(buf->b_ffname)) continue; ! home_replace(NULL, buf->b_ffname, NameBuff, MAXPATHL, TRUE); ! ! fprintf(fp, "%%%s\t%ld\t%d\n", NameBuff, (long)buf->b_last_cursor.lnum, buf->b_last_cursor.col); } } #endif --- 2719,2731 ---- if (buf->b_fname == NULL || buf->b_help || removable(buf->b_ffname)) continue; ! putc('%', fp); ! home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE); ! sprintf((char *)line + STRLEN(line), "\t%ld\t%d", (long)buf->b_last_cursor.lnum, buf->b_last_cursor.col); + viminfo_writestring(fp, line); } + vim_free(line); } #endif diff -crN ../vim-5.6/src/config.mk.in ./src/config.mk.in *** ../vim-5.6/src/config.mk.in Mon Aug 9 11:22:49 1999 --- ./src/config.mk.in Fri Mar 31 13:44:41 2000 *************** *** 15,20 **** --- 15,21 ---- CC = @CC@ DEFS = @DEFS@ CFLAGS = @CFLAGS@ + CPPFLAGS = @CPPFLAGS@ srcdir = @srcdir@ VPATH = @srcdir@ LDFLAGS = @LDFLAGS@ diff -crN ../vim-5.6/src/configure ./src/configure *** ../vim-5.6/src/configure Sat Jan 15 13:16:29 2000 --- ./src/configure Wed Jun 7 14:05:11 2000 *************** *** 5078,5085 **** LDFLAGS=$ldflags_save fi echo $ac_n "checking how to create tags""... $ac_c" 1>&6 ! echo "configure:5083: checking how to create tags" >&5 test -f tags && mv tags tags.save (eval etags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags" (eval etags -c /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags -c" --- 5078,5126 ---- LDFLAGS=$ldflags_save fi + echo $ac_n "checking for _xpg4_setrunelocale in -lxpg4""... $ac_c" 1>&6 + echo "configure:5083: checking for _xpg4_setrunelocale in -lxpg4" >&5 + ac_lib_var=`echo xpg4'_'_xpg4_setrunelocale | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lxpg4 $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lxpg4" + else + echo "$ac_t""no" 1>&6 + fi + + echo $ac_n "checking how to create tags""... $ac_c" 1>&6 ! echo "configure:5124: checking how to create tags" >&5 test -f tags && mv tags tags.save (eval etags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags" (eval etags -c /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags -c" *************** *** 5092,5098 **** echo "$ac_t""$TAGPRG" 1>&6 echo $ac_n "checking how to run man with a section nr""... $ac_c" 1>&6 ! echo "configure:5096: checking how to run man with a section nr" >&5 MANDEF="man" (eval man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s" echo "$ac_t""$MANDEF" 1>&6 --- 5133,5139 ---- echo "$ac_t""$TAGPRG" 1>&6 echo $ac_n "checking how to run man with a section nr""... $ac_c" 1>&6 ! echo "configure:5137: checking how to run man with a section nr" >&5 MANDEF="man" (eval man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s" echo "$ac_t""$MANDEF" 1>&6 diff -crN ../vim-5.6/src/configure.in ./src/configure.in *** ../vim-5.6/src/configure.in Sat Jan 15 13:15:24 2000 --- ./src/configure.in Wed Jun 7 13:55:32 2000 *************** *** 1313,1318 **** --- 1313,1321 ---- LDFLAGS=$ldflags_save fi + dnl Link with xpg4, it is said to make Korean locale working + AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,) + dnl Check how we can run ctags dnl -t for typedefs (many ctags have this) dnl -s for static functions (Elvis ctags only?) diff -crN ../vim-5.6/src/ctags/FAQ ./src/ctags/FAQ *** ../vim-5.6/src/ctags/FAQ Sat Sep 11 22:13:16 1999 --- ./src/ctags/FAQ Mon Apr 10 07:12:44 2000 *************** *** 5,20 **** * 2. Why doesn't my editor work with these tag files? * 3. What are these strange bits of text beginning with ;"? * 4. Why doesn't XEmacs' Speedbar module work with Exuberant Ctags? ! * 5. Why doesn't NEdit locate the tag in the source file? ! * 6. Why can't I jump to "class::member"? ! * 7. How can I avoid having to specify my favorite option every time? ! * 8. Why do I end up on the wrong line when I jump to a tag? ! * 9. How do I jump to the tag I want instead of the wrong one by the ! same name? ! * 10. What is "Vim"? ! * 11. How can I locate all references to a specific function or variable? ! * 12. Why does appending tags to a tag file tag so long? ! * 13. How should I set up tag files for a multi-level directory hierarchy? ---------------------------------------------------------------------- 1. Why do you call it "Exuberant Ctags"? --- 5,21 ---- * 2. Why doesn't my editor work with these tag files? * 3. What are these strange bits of text beginning with ;"? * 4. Why doesn't XEmacs' Speedbar module work with Exuberant Ctags? ! * 5. Why doesn't Xemacs correctly locate the tag in the source file? ! * 6. Why doesn't NEdit correctly locate the tag in the source file? ! * 7. Why can't I jump to "class::member"? ! * 8. How can I avoid having to specify my favorite option every time? ! * 9. Why do I end up on the wrong line when I jump to a tag? ! * 10. How do I jump to the tag I want instead of the wrong one by the ! same name? ! * 11. What is "Vim"? ! * 12. How can I locate all references to a specific function or variable? ! * 13. Why does appending tags to a tag file tag so long? ! * 14. How should I set up tag files for a multi-level directory hierarchy? ---------------------------------------------------------------------- 1. Why do you call it "Exuberant Ctags"? *************** *** 66,79 **** speedbar-fetch-etags-arguments '("-f" "-")) ---------------------------------------------------------------------- ! 5. Why doesn't NEdit locate the tag in the source file? ! Because NEdit does not yet support the extended tag file format generated by ! Exuberant Ctags by default. To generate tag files which work correctly with ! NEdit, specify the option "--format=1". ---------------------------------------------------------------------- ! 6. Why can't I jump to "class::member"? Because, by default, ctags only generates tags for the separate identifiers found in the source files. If you specify the --c-types=+C option, then ctags --- 67,89 ---- speedbar-fetch-etags-arguments '("-f" "-")) ---------------------------------------------------------------------- ! 5. Why doesn't Xemacs correctly locate the tag in the source file? ! This has been observed with version 20.3. It seems that when Xemacs searches ! for a tag, it searches using the tag name instead of the search string located ! in the TAGS file. This is a bug in Xemacs and does not occur in the GNU ! version of Emacs. ---------------------------------------------------------------------- ! 6. Why doesn't NEdit correctly locate the tag in the source file? ! ! Versions of NEdit prior to 5.1 did not support the extended tag file format ! generated by Exuberant Ctags by default. Either upgrade to version 5.1 or ! specify the option "--format=1" when running ctags to output the old tag file ! format. ! ! ---------------------------------------------------------------------- ! 7. Why can't I jump to "class::member"? Because, by default, ctags only generates tags for the separate identifiers found in the source files. If you specify the --c-types=+C option, then ctags *************** *** 83,94 **** adding the 'C' flag to either --eiffel-types or --java-types. ---------------------------------------------------------------------- ! 7. How can I avoid having to specify my favorite option every time? By setting the environment variable CTAGS to your custom options. ---------------------------------------------------------------------- ! 8. Why do I end up on the wrong line when I jump to a tag? By default, ctags encodes the line number in the file where macro (#define) tags are found. This was done to remain compatible with the original UNIX --- 93,104 ---- adding the 'C' flag to either --eiffel-types or --java-types. ---------------------------------------------------------------------- ! 8. How can I avoid having to specify my favorite option every time? By setting the environment variable CTAGS to your custom options. ---------------------------------------------------------------------- ! 9. Why do I end up on the wrong line when I jump to a tag? By default, ctags encodes the line number in the file where macro (#define) tags are found. This was done to remain compatible with the original UNIX *************** *** 103,110 **** behaviour of Exuberant Ctags to behave differently. ---------------------------------------------------------------------- ! 9. How do I jump to the tag I want instead of the wrong one by the ! same name? A tag file is simple a list of tag names and where to find them. If there are duplicate entries, you often end up going to the wrong one because the --- 113,120 ---- behaviour of Exuberant Ctags to behave differently. ---------------------------------------------------------------------- ! 10. How do I jump to the tag I want instead of the wrong one by the ! same name? A tag file is simple a list of tag names and where to find them. If there are duplicate entries, you often end up going to the wrong one because the *************** *** 116,122 **** commands which allow for selection of the desired matching tag. ---------------------------------------------------------------------- ! 10. What is "Vim"? Vim is a vi-compatible editor available as source and compilable for any platform. Yeah, I know the first reaction is to shy away from this. But you --- 126,132 ---- commands which allow for selection of the desired matching tag. ---------------------------------------------------------------------- ! 11. What is "Vim"? Vim is a vi-compatible editor available as source and compilable for any platform. Yeah, I know the first reaction is to shy away from this. But you *************** *** 129,135 **** Vim comes bundled with Exuberant Ctags! ---------------------------------------------------------------------- ! 11. How can I locate all references to a specific function or variable? There are several packages already available which provide this capability. Namely, these are: the GNU id-utils package, cscope (a commercial package), --- 139,145 ---- Vim comes bundled with Exuberant Ctags! ---------------------------------------------------------------------- ! 12. How can I locate all references to a specific function or variable? There are several packages already available which provide this capability. Namely, these are: the GNU id-utils package, cscope (a commercial package), *************** *** 141,147 **** cs: ftp://cantor.informatik.rwth-aachen.de/pub/unix/cs-0.5.tar.gz ---------------------------------------------------------------------- ! 12. Why does appending tags to a tag file tag so long? Sometimes, in an attempt to build a global tag file for all source files in a large source tree of many directories, someone will make an attempt to run --- 151,157 ---- cs: ftp://cantor.informatik.rwth-aachen.de/pub/unix/cs-0.5.tar.gz ---------------------------------------------------------------------- ! 13. Why does appending tags to a tag file tag so long? Sometimes, in an attempt to build a global tag file for all source files in a large source tree of many directories, someone will make an attempt to run *************** *** 162,168 **** final tag file, or let the final invocation of ctags sort the file. ---------------------------------------------------------------------- ! 13. How should I set up tag files for a multi-level directory hierarchy? There are a few ways of approaching this: --- 172,178 ---- final tag file, or let the final invocation of ctags sort the file. ---------------------------------------------------------------------- ! 14. How should I set up tag files for a multi-level directory hierarchy? There are a few ways of approaching this: diff -crN ../vim-5.6/src/ctags/INSTALL ./src/ctags/INSTALL *** ../vim-5.6/src/ctags/INSTALL Fri Sep 24 06:55:26 1999 --- ./src/ctags/INSTALL Fri Apr 14 06:12:03 2000 *************** *** 26,32 **** uses the sort utility of the operating system by default because it is more memory efficient. ! --enable-custom-config Defines a custom option configuration file to establish site-wide defaults. Ctags will read the following files at startup for options: /etc/ctags.conf, /usr/local/etc/ctags.conf, --- 26,32 ---- uses the sort utility of the operating system by default because it is more memory efficient. ! --enable-custom-config=FILE Defines a custom option configuration file to establish site-wide defaults. Ctags will read the following files at startup for options: /etc/ctags.conf, /usr/local/etc/ctags.conf, *************** *** 44,49 **** --- 44,56 ---- --enable-maintainer-mode Creates a special GNU-specific version of the makefile which is used to maintain Exuberant Ctags. + + --enable-tmpdir=DIR When the library function mkstemp() is + available, this option allows specifying the + default directory to use for temporary files + generated by ctags. This default can be + changed at run time by setting the environment + variable TMPDIR. If you wish to change the name of the installed files, edit the makefile produced by the configure script ("Makefile") before performing the "make diff -crN ../vim-5.6/src/ctags/INSTALL.DOS ./src/ctags/INSTALL.DOS *** ../vim-5.6/src/ctags/INSTALL.DOS Thu Mar 4 05:16:35 1999 --- ./src/ctags/INSTALL.DOS Tue Apr 11 06:25:34 2000 *************** *** 1,11 **** Simple makefiles are provided for a few environments. ! Makefile.amiga For Amiga with Manx C ! Makefile.bcc For Borland C/C++ on MSDOS ! Makefile.djg For the Gnu GCC (DJGPP) compiler on MSDOS ! Makefile.os2 For OS/2 ! Makefile.w32 For Win32 with Visual C++ or Borland C++ Make sure that your makefile defines the appropriate label for the host for ! which you are compiling (i.e. AMIGA, MSDOS, OS2, or WIN32) --- 1,14 ---- Simple makefiles are provided for a few environments. ! Makefile.amiga For Amiga using Manx C ! Makefile.bc3 For MSDOS using Borland C/C++ 3.x ! Makefile.bc5 For Win32 using Borland C++ 5.5 ! Makefile.djg For MSDOS using Gnu GCC (DJGPP) compiler ! Makefile.ming For Win32 using Mingw32 compiler ! Makefile.mvc For Win32 using Microsoft Visual C++ ! Makefile.os2 For OS/2 using GCC (EMX) compiler ! Makefile.qdos For QDOS using C68 compiler Make sure that your makefile defines the appropriate label for the host for ! which you are compiling (i.e. AMIGA, MSDOS, OS2, QDOS, or WIN32) diff -crN ../vim-5.6/src/ctags/Makefile.maint ./src/ctags/Makefile.maint *** ../vim-5.6/src/ctags/Makefile.maint Fri Dec 17 04:07:58 1999 --- ./src/ctags/Makefile.maint Sat Apr 15 04:58:04 2000 *************** *** 1,5 **** #***************************************************************************** ! # $Id: Makefile.maint,v 8.15 1999/12/17 03:07:58 darren Exp $ # # Development makefile for Exuberant Ctags, used to build releases. # --- 1,5 ---- #***************************************************************************** ! # $Id: Makefile.maint,v 8.19 2000/04/15 02:58:04 darren Exp $ # # Development makefile for Exuberant Ctags, used to build releases. # *************** *** 13,28 **** keyword.h main.h options.h parse.h read.h sort.h \ strlist.h vstring.h ! VERSION_FILES= ctags.h ctags.1 ctags.lsm configure.in NEWS DIST_FILES = COPYING FAQ INSTALL INSTALL.DOS QUOTES README configure.in \ acconfig.h mkinstalldirs Makefile.in Makefile.amiga \ ! Makefile.bcc Makefile.djg Makefile.maint Makefile.os2 \ ! Makefile.qdos Makefile.w32 Makefile.ming descrip.mms \ $(DSOURCES) qdos.c strstr.c $(HEADERS) ctags.1 ctags.lsm NEWS ! DOS_FILES = COPYING FAQ INSTALL.DOS QUOTES README Makefile.bcc \ ! Makefile.djg Makefile.os2 Makefile.w32 Makefile.ming \ $(DSOURCES) $(HEADERS) CVS_FILES = $(DIST_FILES) ctags.spec --- 13,32 ---- keyword.h main.h options.h parse.h read.h sort.h \ strlist.h vstring.h ! DOS_VER_FILES= ctags.h ctags.1 ctags.lsm NEWS ! ! VERSION_FILES= $(DOS_VER_FILES) configure.in DIST_FILES = COPYING FAQ INSTALL INSTALL.DOS QUOTES README configure.in \ acconfig.h mkinstalldirs Makefile.in Makefile.amiga \ ! Makefile.bc3 Makefile.bc5 Makefile.djg Makefile.maint \ ! Makefile.mvc Makefile.os2 Makefile.qdos Makefile.ming \ ! descrip.mms \ $(DSOURCES) qdos.c strstr.c $(HEADERS) ctags.1 ctags.lsm NEWS ! DOS_FILES = COPYING FAQ INSTALL.DOS QUOTES README \ ! Makefile.bc3 Makefile.bc5 Makefile.djg Makefile.os2 \ ! Makefile.ming Makefile.mvc \ $(DSOURCES) $(HEADERS) CVS_FILES = $(DIST_FILES) ctags.spec *************** *** 214,220 **** cd $(CTAGS_DOSDIR); mv makefile makefile.bak; \ sed -e 's/^\(VERSION =\) [0-9]\+/\1 $*/' makefile.bak > makefile ! dos2-%: $(VERSION_FILES) ctags.man for file in $^ ;do \ rm -f $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'`/$${file} ;\ sed -e "s/@@VERSION@@/$*/" \ --- 218,224 ---- cd $(CTAGS_DOSDIR); mv makefile makefile.bak; \ sed -e 's/^\(VERSION =\) [0-9]\+/\1 $*/' makefile.bak > makefile ! dos2-%: $(DOS_VER_FILES) ctags.man for file in $^ ;do \ rm -f $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'`/$${file} ;\ sed -e "s/@@VERSION@@/$*/" \ diff -crN ../vim-5.6/src/ctags/NEWS ./src/ctags/NEWS *** ../vim-5.6/src/ctags/NEWS Fri Jan 14 05:28:51 2000 --- ./src/ctags/NEWS Sun Apr 23 19:51:09 2000 *************** *** 1,4 **** ! Current Version: 3.4 ctags-3.4 (Thu Jan 13 2000) * Fixed sorting problems when LC_ALL environment variable was set to foreign --- 1,30 ---- ! Current Version: 3.5.1 ! ! ctags-3.5.1 (Sun Apr 23 2000) ! * Fixed infinite loop in writing Emacs-style TAGS file on platforms using ! tmpnam() instead of mkstemp() [Win32]. ! * Fixed minor problems in Borland makefiles [Win32]. ! * Fixed compiler warning [DJGPP]. ! ! ctags-3.5 (Fri Apr 14 2000) ! * Fixed core dump when including access field in tag file [Java]. ! * Fixed failure to identify end of statement for block statements [Java]. ! * Fixed bug with lone "end" in feature adaptation part of inheritance clause ! [Eiffel]. ! * Fixed problem preventing const functions from being recognized as pure ! virtual [C/C++]. ! * Fixed problem with no tags found after certain macro calls [C/C++]. ! * Fixed bug in descrip.mms build file [VMS]. ! * Changed to use mkstemp() (when available) to create temporary files for ! security reasons and allow configuring default temporary directory, and to ! override this directory at run-time by setting TMPDIR environment variable. ! * Added support for extracting inheritance information into new "inherits" ! extension flag [C++, Java]. ! * Added Makefile.bc5 for Borland C++ version 5.5 compiler (free version). ! * Added new question to FAQ regarding Xemacs. ! * Updated FAQ regarding new release of NEdit. ! * Renamed Borland 3.1 makefile from Makefile.bcc to Makefile.bc3. ! * Renamed Microsoft Visual C++ makefile from Makefile.w32 to Makefile.mvc. ctags-3.4 (Thu Jan 13 2000) * Fixed sorting problems when LC_ALL environment variable was set to foreign diff -crN ../vim-5.6/src/ctags/acconfig.h ./src/ctags/acconfig.h *** ../vim-5.6/src/ctags/acconfig.h Sat Sep 11 19:54:22 1999 --- ./src/ctags/acconfig.h Fri Apr 14 06:34:42 2000 *************** *** 1,4 **** ! /* $Id: acconfig.h,v 8.2 1999/09/11 17:54:22 darren Exp $ */ /* Package name. */ --- 1,4 ---- ! /* $Id: acconfig.h,v 8.4 2000/04/14 04:34:42 darren Exp $ */ /* Package name. */ *************** *** 60,70 **** # undef EXTERNAL_SORT #endif ! /* If you are using the system sort utility (i.e. external sort), define ! * this label to be the name of your awk program, which is used to report ! * duplicate tags when the -W option is specified. */ ! #define AWK "awk" /* This corrects the problem of missing prototypes for certain functions * in some GNU installations (e.g. SunOS 4.1.x). --- 60,69 ---- # undef EXTERNAL_SORT #endif ! /* If you wish to change the directory in which temporary files are stored, ! * define this label to the directory desired. */ ! #undef TMPDIR /* This corrects the problem of missing prototypes for certain functions * in some GNU installations (e.g. SunOS 4.1.x). diff -crN ../vim-5.6/src/ctags/args.c ./src/ctags/args.c *** ../vim-5.6/src/ctags/args.c Tue Dec 14 06:28:12 1999 --- ./src/ctags/args.c Sat Mar 18 05:27:40 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: args.c,v 8.14 1999/12/14 05:28:12 darren Exp $ * * Copyright (c) 1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: args.c,v 8.15 2000/03/18 04:27:40 darren Exp $ * * Copyright (c) 1999, Darren Hiebert * *************** *** 88,94 **** const char* start; Assert(*next != NULL); ! for (start = *next ; isspace(*start) ; ++start) ; if (*start == '\0') *next = start; --- 88,94 ---- const char* start; Assert(*next != NULL); ! for (start = *next ; isspace((int)*start) ; ++start) ; if (*start == '\0') *next = start; *************** *** 97,103 **** size_t length; const char* end; ! for (end = start ; *end != '\0' && ! isspace(*end) ; ++end) ; length = end - start; Assert(length > 0); --- 97,103 ---- size_t length; const char* end; ! for (end = start ; *end != '\0' && ! isspace((int)*end) ; ++end) ; length = end - start; Assert(length > 0); diff -crN ../vim-5.6/src/ctags/config.h.in ./src/ctags/config.h.in *** ../vim-5.6/src/ctags/config.h.in Fri Jan 14 05:28:56 2000 --- ./src/ctags/config.h.in Sun Apr 23 19:51:09 2000 *************** *** 1,5 **** /* config.h.in. Generated automatically from configure.in by autoheader. */ ! /* $Id: acconfig.h,v 8.2 1999/09/11 17:54:22 darren Exp $ */ /* Package name. */ --- 1,5 ---- /* config.h.in. Generated automatically from configure.in by autoheader. */ ! /* $Id: acconfig.h,v 8.4 2000/04/14 04:34:42 darren Exp $ */ /* Package name. */ *************** *** 61,71 **** # undef EXTERNAL_SORT #endif ! /* If you are using the system sort utility (i.e. external sort), define ! * this label to be the name of your awk program, which is used to report ! * duplicate tags when the -W option is specified. */ ! #define AWK "awk" /* This corrects the problem of missing prototypes for certain functions * in some GNU installations (e.g. SunOS 4.1.x). --- 61,70 ---- # undef EXTERNAL_SORT #endif ! /* If you wish to change the directory in which temporary files are stored, ! * define this label to the directory desired. */ ! #undef TMPDIR /* This corrects the problem of missing prototypes for certain functions * in some GNU installations (e.g. SunOS 4.1.x). *************** *** 119,124 **** --- 118,126 ---- /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE + + /* Define if you have the mkstemp function. */ + #undef HAVE_MKSTEMP /* Define if you have the opendir function. */ #undef HAVE_OPENDIR diff -crN ../vim-5.6/src/ctags/configure ./src/ctags/configure *** ../vim-5.6/src/ctags/configure Fri Jan 14 05:28:58 2000 --- ./src/ctags/configure Sun Apr 23 19:51:09 2000 *************** *** 14,19 **** --- 14,23 ---- ac_help="$ac_help --disable-etags disable the installation of links for etags" ac_help="$ac_help + --disable-extended-format + disable extension flags; use original ctag file + format only" + ac_help="$ac_help --disable-external-sort use internal sort algorithm instead of sort program" ac_help="$ac_help --enable-custom-config=FILE *************** *** 22,33 **** --enable-macro-patterns use patterns as default method to locate macros instead of line numbers" ac_help="$ac_help - --disable-extended-format - disable extension flags; use original ctag file - format only" - ac_help="$ac_help --enable-maintainer-mode use maintainer makefile" # Initialize some variables set by options. # The variables have the same names as the options, with --- 26,35 ---- --enable-macro-patterns use patterns as default method to locate macros instead of line numbers" ac_help="$ac_help --enable-maintainer-mode use maintainer makefile" + ac_help="$ac_help + --enable-tmpdir=DIR default directory for temporary files [ARG=/tmp]" # Initialize some variables set by options. # The variables have the same names as the options, with *************** *** 540,546 **** ! echo 'Exuberant Ctags, version 3.4' uname -mrsv 2>/dev/null --- 542,548 ---- ! echo 'Exuberant Ctags, version 3.5.1' uname -mrsv 2>/dev/null *************** *** 555,560 **** --- 557,577 ---- fi + # Check whether --enable-extended-format or --disable-extended-format was given. + if test "${enable_extended_format+set}" = set; then + enableval="$enable_extended_format" + cat >> confdefs.h <<\EOF + #define DEFAULT_FILE_FORMAT 1 + EOF + + else + cat >> confdefs.h <<\EOF + #define DEFAULT_FILE_FORMAT 2 + EOF + + fi + + # Check whether --enable-external-sort or --disable-external-sort was given. if test "${enable_external_sort+set}" = set; then enableval="$enable_external_sort" *************** *** 578,598 **** fi - # Check whether --enable-extended-format or --disable-extended-format was given. - if test "${enable_extended_format+set}" = set; then - enableval="$enable_extended_format" - cat >> confdefs.h <<\EOF - #define DEFAULT_FILE_FORMAT 1 - EOF - - else - cat >> confdefs.h <<\EOF - #define DEFAULT_FILE_FORMAT 2 - EOF - - fi - - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 595,600 ---- *************** *** 600,617 **** fi if test "$enable_maintainer_mode" = yes ; then echo "$ac_t""enabling maintainer mode" 1>&6 fi if test "$enable_etags" = yes ; then install_targets="install-ctags install-etags" ! echo "$ac_t""links for etags will be installed" 1>&6 else install_targets="install-ctags" ! echo "$ac_t""do not install links for etags" 1>&6 fi --- 602,628 ---- fi + # Check whether --enable-tmpdir or --disable-tmpdir was given. + if test "${enable_tmpdir+set}" = set; then + enableval="$enable_tmpdir" + tmpdir_specified=yes + fi + + if test "$enable_maintainer_mode" = yes ; then echo "$ac_t""enabling maintainer mode" 1>&6 fi + echo $ac_n "checking whether to install link to etags""... $ac_c" 1>&6 + echo "configure:620: checking whether to install link to etags" >&5 if test "$enable_etags" = yes ; then install_targets="install-ctags install-etags" ! echo "$ac_t""yes" 1>&6 else install_targets="install-ctags" ! echo "$ac_t""no" 1>&6 fi *************** *** 633,644 **** echo "$ac_t""tag file will use patterns for macros by default" 1>&6 fi ! if test "$enable_external_sort" = yes ; then enable_external_sort=no # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:642: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_sort_found'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 644,660 ---- echo "$ac_t""tag file will use patterns for macros by default" 1>&6 fi ! echo $ac_n "checking selected sort method""... $ac_c" 1>&6 ! echo "configure:649: checking selected sort method" >&5 ! if test "$enable_external_sort" != yes ; then ! echo "$ac_t""simple internal algorithm" 1>&6 ! else ! echo "$ac_t""external sort utility" 1>&6 enable_external_sort=no # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:658: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_sort_found'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 666,741 **** fi if test "$sort_found" = yes ; then ! echo $ac_n "checking whether sort accepts our command line""... $ac_c" 1>&6 ! echo "configure:671: checking whether sort accepts our command line" >&5 touch /tmp/sort.test sort -u -o /tmp/sort.test /tmp/sort.test 1>/dev/null 2>&1 if test $? -ne 0 ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 ! for ac_prog in mawk gawk nawk awk ! 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:683: checking for $ac_word" >&5 ! if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then ! echo $ac_n "(cached) $ac_c" 1>&6 ! else ! if test -n "$AWK"; then ! ac_cv_prog_AWK="$AWK" # Let the user override the test. ! else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do ! test -z "$ac_dir" && ac_dir=. ! if test -f $ac_dir/$ac_word; then ! ac_cv_prog_AWK="$ac_prog" ! break ! fi ! done ! IFS="$ac_save_ifs" ! fi ! fi ! AWK="$ac_cv_prog_AWK" ! if test -n "$AWK"; then ! echo "$ac_t""$AWK" 1>&6 ! else ! echo "$ac_t""no" 1>&6 ! fi ! ! test -n "$AWK" && break ! done ! ! if test -z "$AWK" ; then ! echo "$ac_t""no awk found" 1>&6 ! else ! cat >> confdefs.h <> confdefs.h <<\EOF #define EXTERNAL_SORT 1 EOF ! echo "$ac_t""using external sort utility" 1>&6 ! enable_external_sort=yes ! fi fi rm -f /tmp/sort.test fi fi if test "$enable_external_sort" != yes ; then ! echo "$ac_t""using internal sort algorithm" 1>&6 fi - # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:739: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 682,713 ---- fi if test "$sort_found" = yes ; then ! echo $ac_n "checking if sort accepts our command line""... $ac_c" 1>&6 ! echo "configure:687: checking if sort accepts our command line" >&5 touch /tmp/sort.test sort -u -o /tmp/sort.test /tmp/sort.test 1>/dev/null 2>&1 if test $? -ne 0 ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 ! cat >> confdefs.h <<\EOF #define EXTERNAL_SORT 1 EOF ! enable_external_sort=yes fi rm -f /tmp/sort.test fi fi if test "$enable_external_sort" != yes ; then ! echo "$ac_t""using internal sort algorithm as fallback" 1>&6 fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:711: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 765,771 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:769: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 737,743 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:741: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 816,822 **** # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:820: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 788,794 ---- # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:792: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 848,854 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 820,826 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:824: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 859,870 **** cat > conftest.$ac_ext << EOF ! #line 863 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 831,842 ---- cat > conftest.$ac_ext << EOF ! #line 835 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 890,901 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:894: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:899: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 862,873 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:866: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:871: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 904,910 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 876,882 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 923,929 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:927: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 895,901 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:899: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 955,961 **** fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:959: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 927,933 ---- fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:931: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 978,984 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:982: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 950,956 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:954: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1009,1015 **** echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1013: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 981,987 ---- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:985: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 1024,1036 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 996,1008 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** *** 1041,1053 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 1013,1025 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** *** 1058,1070 **** rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 1030,1042 ---- rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** *** 1092,1108 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1096: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 1064,1080 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1068: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1132,1148 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1136: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 1104,1120 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1108: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1173,1181 **** echo $ac_n "checking "if L_tmpnam is defined in stdio.h"""... $ac_c" 1>&6 ! echo "configure:1177: checking "if L_tmpnam is defined in stdio.h"" >&5 cat > conftest.$ac_ext < #ifdef L_tmpnam --- 1145,1153 ---- echo $ac_n "checking "if L_tmpnam is defined in stdio.h"""... $ac_c" 1>&6 ! echo "configure:1149: checking "if L_tmpnam is defined in stdio.h"" >&5 cat > conftest.$ac_ext < #ifdef L_tmpnam *************** *** 1205,1213 **** echo $ac_n "checking "if INT_MAX is defined in limits.h"""... $ac_c" 1>&6 ! echo "configure:1209: checking "if INT_MAX is defined in limits.h"" >&5 cat > conftest.$ac_ext < #ifdef INT_MAX --- 1177,1185 ---- echo $ac_n "checking "if INT_MAX is defined in limits.h"""... $ac_c" 1>&6 ! echo "configure:1181: checking "if INT_MAX is defined in limits.h"" >&5 cat > conftest.$ac_ext < #ifdef INT_MAX *************** *** 1228,1236 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking "if MAXINT is defined in limits.h"""... $ac_c" 1>&6 ! echo "configure:1232: checking "if MAXINT is defined in limits.h"" >&5 cat > conftest.$ac_ext < #ifdef MAXINT --- 1200,1208 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking "if MAXINT is defined in limits.h"""... $ac_c" 1>&6 ! echo "configure:1204: checking "if MAXINT is defined in limits.h"" >&5 cat > conftest.$ac_ext < #ifdef MAXINT *************** *** 1268,1279 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1272: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 1240,1251 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1244: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 1281,1287 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 1253,1259 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1298,1304 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1270,1276 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1316,1322 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1288,1294 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1337,1343 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 1309,1315 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 1348,1354 **** exit (0); } EOF ! if { (eval echo configure:1352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else --- 1320,1326 ---- exit (0); } EOF ! if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else *************** *** 1372,1383 **** fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:1376: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 1344,1355 ---- fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:1348: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 1405,1416 **** fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:1409: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 1377,1388 ---- fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:1381: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 1439,1447 **** echo $ac_n "checking "for fpos_t"""... $ac_c" 1>&6 ! echo "configure:1443: checking "for fpos_t"" >&5 cat > conftest.$ac_ext < EOF --- 1411,1419 ---- echo $ac_n "checking "for fpos_t"""... $ac_c" 1>&6 ! echo "configure:1415: checking "for fpos_t"" >&5 cat > conftest.$ac_ext < EOF *************** *** 1463,1471 **** echo $ac_n "checking "for clock_t"""... $ac_c" 1>&6 ! echo "configure:1467: checking "for clock_t"" >&5 cat > conftest.$ac_ext < EOF --- 1435,1443 ---- echo $ac_n "checking "for clock_t"""... $ac_c" 1>&6 ! echo "configure:1439: checking "for clock_t"" >&5 cat > conftest.$ac_ext < EOF *************** *** 1489,1500 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:1493: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1465: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else --- 1515,1521 ---- ; return 0; } EOF ! if { (eval echo configure:1519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else *************** *** 1569,1580 **** for ac_func in strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1573: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1545: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1569,1575 ---- ; return 0; } EOF ! if { (eval echo configure:1573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1627,1638 **** for ac_func in fgetpos do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1631: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1603: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1627,1633 ---- ; return 0; } EOF ! if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1683,1691 **** if test "$have_fgetpos" != yes ; then echo $ac_n "checking "if SEEK_SET is defined in stdio.h"""... $ac_c" 1>&6 ! echo "configure:1687: checking "if SEEK_SET is defined in stdio.h"" >&5 cat > conftest.$ac_ext < #ifdef SEEK_SET --- 1655,1663 ---- if test "$have_fgetpos" != yes ; then echo $ac_n "checking "if SEEK_SET is defined in stdio.h"""... $ac_c" 1>&6 ! echo "configure:1659: checking "if SEEK_SET is defined in stdio.h"" >&5 cat > conftest.$ac_ext < #ifdef SEEK_SET *************** *** 1706,1714 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking "if SEEK_SET is defined in unistd.h"""... $ac_c" 1>&6 ! echo "configure:1710: checking "if SEEK_SET is defined in unistd.h"" >&5 cat > conftest.$ac_ext < #ifdef SEEK_SET --- 1678,1686 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking "if SEEK_SET is defined in unistd.h"""... $ac_c" 1>&6 ! echo "configure:1682: checking "if SEEK_SET is defined in unistd.h"" >&5 cat > conftest.$ac_ext < #ifdef SEEK_SET *************** *** 1741,1755 **** fi for ac_func in strerror opendir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1748: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 + echo "configure:1720: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func(); + + int main() { + + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:1748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + if test "$have_mkstemp" != yes ; then + if test "$tmpdir_specified" = yes ; then + echo "$ac_t""use of tmpnam overrides temporary directory selection" 1>&6 + fi + else + echo $ac_n "checking directory to use for temporary files""... $ac_c" 1>&6 + echo "configure:1778: checking directory to use for temporary files" >&5 + if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ; + then tmpdir=/tmp + else tmpdir="$enable_tmpdir" + fi + if test -d $tmpdir ; then + echo "$ac_t""$tmpdir" 1>&6 + cat >> confdefs.h <&2 + fi + fi + for ac_func in strerror opendir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1797: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1821,1827 ---- ; return 0; } EOF ! if { (eval echo configure:1825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1799,1810 **** for ac_func in clock times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1803: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1852: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1876,1882 ---- ; return 0; } EOF ! if { (eval echo configure:1880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1854,1865 **** for ac_func in remove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1858: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1907: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1931,1937 ---- ; return 0; } EOF ! if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1904,1912 **** else echo "$ac_t""no" 1>&6 echo $ac_n "checking "if remove is defined in unistd.h"""... $ac_c" 1>&6 ! echo "configure:1908: checking "if remove is defined in unistd.h"" >&5 cat > conftest.$ac_ext < #ifdef remove --- 1953,1961 ---- else echo "$ac_t""no" 1>&6 echo $ac_n "checking "if remove is defined in unistd.h"""... $ac_c" 1>&6 ! echo "configure:1957: checking "if remove is defined in unistd.h"" >&5 cat > conftest.$ac_ext < #ifdef remove *************** *** 1940,1951 **** for ac_func in truncate do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1944: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1993: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2017,2023 ---- ; return 0; } EOF ! if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1996,2007 **** for ac_func in ftruncate do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2000: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2049: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2073,2079 ---- ; return 0; } EOF ! if { (eval echo configure:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 2052,2063 **** for ac_func in chsize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2056: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2105: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2129,2135 ---- ; return 0; } EOF ! if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 2110,2121 **** for ac_func in setenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2114: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2163: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2187,2193 ---- ; return 0; } EOF ! if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 2166,2177 **** for ac_func in putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2170: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2219: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2243,2249 ---- ; return 0; } EOF ! if { (eval echo configure:2247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 2220,2226 **** if test "$have_putenv" = yes ; then cat > conftest.$ac_ext < EOF --- 2269,2275 ---- if test "$have_putenv" = yes ; then cat > conftest.$ac_ext < EOF *************** *** 2233,2241 **** if test "$have_putenv_prototype" = yes ; then echo $ac_n "checking "putenv prototype"""... $ac_c" 1>&6 ! echo "configure:2237: checking "putenv prototype"" >&5 cat > conftest.$ac_ext < EOF --- 2282,2290 ---- if test "$have_putenv_prototype" = yes ; then echo $ac_n "checking "putenv prototype"""... $ac_c" 1>&6 ! echo "configure:2286: checking "putenv prototype"" >&5 cat > conftest.$ac_ext < EOF *************** *** 2261,2273 **** echo "checking "for missing prototypes"" 1>&6 ! echo "configure:2265: checking "for missing prototypes"" >&5 if test "$have_remove" = yes ; then cat > conftest.$ac_ext < EOF --- 2310,2322 ---- echo "checking "for missing prototypes"" 1>&6 ! echo "configure:2314: checking "for missing prototypes"" >&5 if test "$have_remove" = yes ; then cat > conftest.$ac_ext < EOF *************** *** 2285,2291 **** else cat > conftest.$ac_ext < EOF --- 2334,2340 ---- else cat > conftest.$ac_ext < EOF *************** *** 2303,2309 **** fi cat > conftest.$ac_ext < EOF --- 2352,2358 ---- fi cat > conftest.$ac_ext < EOF *************** *** 2320,2326 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 2369,2375 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** *** 2337,2343 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 2386,2392 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** *** 2354,2360 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 2403,2409 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** *** 2371,2377 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 2420,2426 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** *** 2389,2395 **** if test "$have_fgetpos" = yes ; then cat > conftest.$ac_ext < EOF --- 2438,2444 ---- if test "$have_fgetpos" = yes ; then cat > conftest.$ac_ext < EOF *************** *** 2408,2414 **** fi if test "$have_truncate" = yes ; then cat > conftest.$ac_ext < EOF --- 2457,2463 ---- fi if test "$have_truncate" = yes ; then cat > conftest.$ac_ext < EOF *************** *** 2427,2433 **** fi if test "$have_ftruncate" = yes ; then cat > conftest.$ac_ext < EOF --- 2476,2482 ---- fi if test "$have_ftruncate" = yes ; then cat > conftest.$ac_ext < EOF *************** *** 2590,2596 **** s%@mandir@%$mandir%g s%@install_targets@%$install_targets%g s%@sort_found@%$sort_found%g - s%@AWK@%$AWK%g s%@CC@%$CC%g s%@LN_S@%$LN_S%g s%@STRIP@%$STRIP%g --- 2639,2644 ---- diff -crN ../vim-5.6/src/ctags/configure.in ./src/ctags/configure.in *** ../vim-5.6/src/ctags/configure.in Fri Jan 14 05:28:51 2000 --- ./src/ctags/configure.in Sun Apr 23 19:51:09 2000 *************** *** 1,4 **** ! dnl $Id: configure.in,v 8.6 2000/01/11 03:55:10 darren Exp $ dnl Copyright (c) 1996-1999, Darren Hiebert dnl --- 1,4 ---- ! dnl $Id: configure.in,v 8.10 2000/04/14 04:34:42 darren Exp $ dnl Copyright (c) 1996-1999, Darren Hiebert dnl *************** *** 13,19 **** dnl Report system info dnl ------------------ ! echo 'Exuberant Ctags, version 3.4' uname -mrsv 2>/dev/null dnl Define convenience macros --- 13,19 ---- dnl Report system info dnl ------------------ ! echo 'Exuberant Ctags, version 3.5.1' uname -mrsv 2>/dev/null dnl Define convenience macros *************** *** 42,47 **** --- 42,53 ---- [ --disable-etags disable the installation of links for etags],, enable_etags=yes) + AC_ARG_ENABLE(extended-format, + [ --disable-extended-format + disable extension flags; use original ctag file + format only], + AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 2)) + AC_ARG_ENABLE(external-sort, [ --disable-external-sort use internal sort algorithm instead of sort program],, enable_external_sort=yes) *************** *** 54,69 **** [ --enable-macro-patterns use patterns as default method to locate macros instead of line numbers]) - AC_ARG_ENABLE(extended-format, - [ --disable-extended-format - disable extension flags; use original ctag file - format only], - AC_DEFINE(DEFAULT_FILE_FORMAT, 1), AC_DEFINE(DEFAULT_FILE_FORMAT, 2)) - AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode use maintainer makefile]) dnl Process configuration options dnl ----------------------------- --- 60,73 ---- [ --enable-macro-patterns use patterns as default method to locate macros instead of line numbers]) AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode use maintainer makefile]) + AC_ARG_ENABLE(tmpdir, + [ --enable-tmpdir=DIR default directory for temporary files [ARG=/tmp]], + tmpdir_specified=yes) + dnl Process configuration options dnl ----------------------------- *************** *** 72,83 **** AC_MSG_RESULT(enabling maintainer mode) fi if test "$enable_etags" = yes ; then install_targets="install-ctags install-etags" ! AC_MSG_RESULT(links for etags will be installed) else install_targets="install-ctags" ! AC_MSG_RESULT(do not install links for etags) fi AC_SUBST(install_targets) --- 76,88 ---- AC_MSG_RESULT(enabling maintainer mode) fi + AC_MSG_CHECKING(whether to install link to etags) if test "$enable_etags" = yes ; then install_targets="install-ctags install-etags" ! AC_MSG_RESULT(yes) else install_targets="install-ctags" ! AC_MSG_RESULT(no) fi AC_SUBST(install_targets) *************** *** 93,127 **** AC_MSG_RESULT(tag file will use patterns for macros by default) fi ! if test "$enable_external_sort" = yes ; then enable_external_sort=no AC_CHECK_PROG(sort_found, sort, yes, no) if test "$sort_found" = yes ; then ! AC_MSG_CHECKING(whether sort accepts our command line) touch /tmp/sort.test sort -u -o /tmp/sort.test /tmp/sort.test 1>/dev/null 2>&1 if test $? -ne 0 ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) ! AC_PROG_AWK ! if test -z "$AWK" ; then ! AC_MSG_RESULT(no awk found) ! else ! AC_DEFINE_UNQUOTED(AWK, "$AWK") ! AC_DEFINE(EXTERNAL_SORT) ! AC_MSG_RESULT(using external sort utility) ! enable_external_sort=yes ! fi fi rm -f /tmp/sort.test fi fi if test "$enable_external_sort" != yes ; then ! AC_MSG_RESULT(using internal sort algorithm) fi - dnl Checks for programs dnl ------------------- --- 98,128 ---- AC_MSG_RESULT(tag file will use patterns for macros by default) fi ! AC_MSG_CHECKING(selected sort method) ! if test "$enable_external_sort" != yes ; then ! AC_MSG_RESULT(simple internal algorithm) ! else ! AC_MSG_RESULT(external sort utility) enable_external_sort=no AC_CHECK_PROG(sort_found, sort, yes, no) if test "$sort_found" = yes ; then ! AC_MSG_CHECKING(if sort accepts our command line) touch /tmp/sort.test sort -u -o /tmp/sort.test /tmp/sort.test 1>/dev/null 2>&1 if test $? -ne 0 ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) ! AC_DEFINE(EXTERNAL_SORT) ! enable_external_sort=yes fi rm -f /tmp/sort.test fi fi if test "$enable_external_sort" != yes ; then ! AC_MSG_RESULT(using internal sort algorithm as fallback) fi dnl Checks for programs dnl ------------------- *************** *** 186,191 **** --- 187,211 ---- CHECK_HEADER_DEFINE(SEEK_SET, stdio.h,, CHECK_HEADER_DEFINE(SEEK_SET, unistd.h,, AC_DEFINE(SEEK_SET, 0))) + fi + + AC_CHECK_FUNCS(mkstemp, have_mkstemp=yes) + if test "$have_mkstemp" != yes ; then + if test "$tmpdir_specified" = yes ; then + AC_MSG_RESULT(use of tmpnam overrides temporary directory selection) + fi + else + AC_MSG_CHECKING(directory to use for temporary files) + if test -z "$enable_tmpdir" -o "$enable_tmpdir" = no -o "$enable_tmpdir" = yes ; + then tmpdir=/tmp + else tmpdir="$enable_tmpdir" + fi + if test -d $tmpdir ; then + AC_MSG_RESULT($tmpdir) + AC_DEFINE_UNQUOTED(TMPDIR, "$tmpdir") + else + AC_MSG_WARN($tmpdir does not exist) + fi fi AC_CHECK_FUNCS(strerror opendir) diff -crN ../vim-5.6/src/ctags/ctags.1 ./src/ctags/ctags.1 *** ../vim-5.6/src/ctags/ctags.1 Fri Jan 14 05:28:51 2000 --- ./src/ctags/ctags.1 Sun Apr 23 19:51:09 2000 *************** *** 1,4 **** ! .TH CTAGS 1 "Version 3.4" "Darren Hiebert" .SH NAME --- 1,4 ---- ! .TH CTAGS 1 "Version 3.5.1" "Darren Hiebert" .SH NAME *************** *** 303,318 **** .PP .RS 5 ! In the above example, the macro "ARGDECL2" would be mistakenly interpreted to be the name of the function instead of the correct name of "foo". Specifying ! \fB-I\fP \fIARGDECL2\fP results in the correct behavior. .RE .PP .RS 8 /* creates an RCS version string in module */ .br ! MODULE_VERSION("$Revision: 8.22 $") .RE .PP --- 303,318 ---- .PP .RS 5 ! In the above example, the macro "ARGDECL4" would be mistakenly interpreted to be the name of the function instead of the correct name of "foo". Specifying ! \fB-I\fP \fIARGDECL4\fP results in the correct behavior. .RE .PP .RS 8 /* creates an RCS version string in module */ .br ! MODULE_VERSION("$Revision: 8.25 $") .RE .PP *************** *** 1040,1045 **** --- 1040,1050 ---- ("virtual" or "pure virtual" for C++; "abstract" for Java). .TP 12 + .I inherits + When present, \fIvalue\fP. is a comma-separated list of classes from which + this class is derived (i.e. inherits from). + + .TP 12 .I interface Indicates that this tag is a member of the interface whose name is given by \fIvalue\fP. *************** *** 1076,1081 **** --- 1081,1100 ---- Similar to the \fBCTAGS\fP variable above, this variable, if found, will be read when \fBetags\fP starts. If this variable is not found, \fBetags\fP will try to use \fBCTAGS\fP instead. + + .TP 8 + .B TMPDIR + On Unix-like hosts where mkstemp() is available, the value of this variable + specifies the directory in which to place temporary files. This can be useful + if the size of a temporary file becomes too large to fit on the partition + holding the default temporary directory defined at compilation time. + \fBctags\fP creates temporary files only if either (1) an emacs-style tag file + is being generated, (2) the tag file is being sent to standard output, or (3) + the program was compiled to use an internal sort algorithm to sort the tag + files instead of the the sort utility of the operating system. If the sort + utility of the operating system is being used, it will generally observe this + variable also. Note that if \fBctags\fP is setuid, the value of TMPDIR will be + ignored. .SH "HOW TO USE WITH VI" Vi will, by default, expect a tag file by the name "tags" in the current diff -crN ../vim-5.6/src/ctags/ctags.h ./src/ctags/ctags.h *** ../vim-5.6/src/ctags/ctags.h Fri Jan 14 05:28:50 2000 --- ./src/ctags/ctags.h Sun Apr 23 19:51:09 2000 *************** *** 22,28 **** = General defines ============================================================================*/ #ifndef PROGRAM_VERSION ! # define PROGRAM_VERSION "3.4" #endif #define PROGRAM_NAME "Exuberant Ctags" #define PROGRAM_URL "http://darren.hiebert.com/ctags/" --- 22,28 ---- = General defines ============================================================================*/ #ifndef PROGRAM_VERSION ! # define PROGRAM_VERSION "3.5.1" #endif #define PROGRAM_NAME "Exuberant Ctags" #define PROGRAM_URL "http://darren.hiebert.com/ctags/" diff -crN ../vim-5.6/src/ctags/ctags.lsm ./src/ctags/ctags.lsm *** ../vim-5.6/src/ctags/ctags.lsm Fri Jan 14 05:28:51 2000 --- ./src/ctags/ctags.lsm Sun Apr 23 19:51:09 2000 *************** *** 1,7 **** Begin3 Title: Exuberant Ctags ! Version: 3.4 ! Entered-date: 13JAN00 Description: A better ctags with support for C, C++, Eiffel, Fortran and Java. It is capable of generating tags for all of the following language constructs: --- 1,7 ---- Begin3 Title: Exuberant Ctags ! Version: 3.5.1 ! Entered-date: 23APR00 Description: A better ctags with support for C, C++, Eiffel, Fortran and Java. It is capable of generating tags for all of the following language constructs: *************** *** 18,34 **** subroutines; derived types Java: classes; fields; interfaces; methods ! It is far less easily fooled by C code containing #if ! preprocessor conditional constructs. It can also be used to ! print out a list of selected objects found in source files. ! It can also produce Emacs-style TAGS files. Keywords: ctags etags ftags tag tags Exuberant C C++ Eiffel Fortran Java tool utility source index Author: darren@hiebert.com (Darren Hiebert) Primary-site: sunsite.unc.edu /pub/Linux/devel/lang/c ! 137kB ctags-3.4.tar.gz Original-site: http://darren.hiebert.com/ctags ! 137kB archives/ctags-3.4.tar.gz Platforms: UNIX, MSDOS, Windows 95/NT, OS/2, QNX, Amiga, QDOS, VMS, Cray Copying-policy: GNU General Public License End --- 18,33 ---- subroutines; derived types Java: classes; fields; interfaces; methods ! Ctags can also produce Emacs-style TAGS files. It can also be ! used to print out a list of selected objects found in source ! files. Keywords: ctags etags ftags tag tags Exuberant C C++ Eiffel Fortran Java tool utility source index Author: darren@hiebert.com (Darren Hiebert) Primary-site: sunsite.unc.edu /pub/Linux/devel/lang/c ! 139kB ctags-3.5.1.tar.gz Original-site: http://darren.hiebert.com/ctags ! 139kB archives/ctags-3.5.1.tar.gz Platforms: UNIX, MSDOS, Windows 95/NT, OS/2, QNX, Amiga, QDOS, VMS, Cray Copying-policy: GNU General Public License End diff -crN ../vim-5.6/src/ctags/eiffel.c ./src/ctags/eiffel.c *** ../vim-5.6/src/ctags/eiffel.c Sun Oct 31 15:33:13 1999 --- ./src/ctags/eiffel.c Mon Mar 27 07:03:23 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: eiffel.c,v 8.7 1999/10/31 14:33:13 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: eiffel.c,v 8.8 2000/03/27 05:03:23 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * *************** *** 959,964 **** --- 959,968 ---- case KEYWORD_redefine: case KEYWORD_select: locateKeyword(token, KEYWORD_end); + break; + + case KEYWORD_end: + readToken(token); break; default: break; diff -crN ../vim-5.6/src/ctags/entry.c ./src/ctags/entry.c *** ../vim-5.6/src/ctags/entry.c Wed Sep 29 04:20:25 1999 --- ./src/ctags/entry.c Sun Apr 23 19:35:51 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: entry.c,v 8.16 1999/09/29 02:20:25 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: entry.c,v 8.19 2000/04/23 17:35:51 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * *************** *** 73,79 **** NULL, /* file pointer */ { 0, 0 }, /* numTags */ { 0, 0, 0 }, /* max */ ! { "", NULL, 0 }, /* etags */ NULL /* vLine */ }; --- 73,79 ---- NULL, /* file pointer */ { 0, 0 }, /* numTags */ { 0, 0, 0 }, /* max */ ! { NULL, NULL, 0 }, /* etags */ NULL /* vLine */ }; *************** *** 91,97 **** #endif static void writePseudoTag __ARGS((const char *const tagName, const char *const fileName, const char *const pattern)); ! static void updateSortedFlag __ARGS((const char *const line, FILE *const fp, const fpos_t *const pStartOfLine)); static void addPseudoTags __ARGS((void)); static long unsigned int updatePseudoTags __ARGS((FILE *const fp)); static boolean isValidTagAddress __ARGS((const char *const tag)); --- 91,97 ---- #endif static void writePseudoTag __ARGS((const char *const tagName, const char *const fileName, const char *const pattern)); ! static void updateSortedFlag __ARGS((const char *const line, FILE *const fp, fpos_t startOfLine)); static void addPseudoTags __ARGS((void)); static long unsigned int updatePseudoTags __ARGS((FILE *const fp)); static boolean isValidTagAddress __ARGS((const char *const tag)); *************** *** 170,179 **** } } ! static void updateSortedFlag( line, fp, pStartOfLine ) const char *const line; FILE *const fp; ! const fpos_t *const pStartOfLine; { const char *const tab = strchr(line, '\t'); --- 170,179 ---- } } ! static void updateSortedFlag( line, fp, startOfLine ) const char *const line; FILE *const fp; ! fpos_t startOfLine; { const char *const tab = strchr(line, '\t'); *************** *** 185,191 **** { fpos_t nextLine; ! if (fgetpos(fp, &nextLine) == -1 || fsetpos(fp, pStartOfLine) == -1) error(WARNING, "Failed to update 'sorted' pseudo-tag"); else { --- 185,191 ---- { fpos_t nextLine; ! if (fgetpos(fp, &nextLine) == -1 || fsetpos(fp, &startOfLine) == -1) error(WARNING, "Failed to update 'sorted' pseudo-tag"); else { *************** *** 239,245 **** tab == '\t') { if (strcmp(classType, "_SORTED") == 0) ! updateSortedFlag(line, fp, &startOfLine); } fgetpos(fp, &startOfLine); } --- 239,245 ---- tab == '\t') { if (strcmp(classType, "_SORTED") == 0) ! updateSortedFlag(line, fp, startOfLine); } fgetpos(fp, &startOfLine); } *************** *** 396,403 **** extern void openTagFile() { - static char tempName[L_tmpnam]; - setDefaultTagFileName(); TagsToStdout = isDestinationStdout(); --- 396,401 ---- *************** *** 407,426 **** /* Open the tags file. */ if (TagsToStdout) ! { ! TagFile.name = tmpnam(tempName); ! TagFile.fp = fopen(TagFile.name, "w"); ! } else { ! const char* fname; boolean fileExists; setDefaultTagFileName(); ! fname = Option.tagFileName; ! fileExists = doesFileExist(fname); ! TagFile.name = fname; if (fileExists && ! isTagFile(fname)) error(FATAL, "\"%s\" doesn't look like a tag file; I refuse to overwrite it.", --- 405,421 ---- /* Open the tags file. */ if (TagsToStdout) ! TagFile.fp = tempFile("w", &TagFile.name); else { ! char* fname; boolean fileExists; setDefaultTagFileName(); ! fname = (char*)eMalloc(strlen(Option.tagFileName) + 1); ! strcpy(fname, Option.tagFileName); TagFile.name = fname; + fileExists = doesFileExist(fname); if (fileExists && ! isTagFile(fname)) error(FATAL, "\"%s\" doesn't look like a tag file; I refuse to overwrite it.", *************** *** 470,483 **** const char *const name; const long size; { ! char tempName[L_tmpnam]; - if (tmpnam(tempName) != NULL) - { - copyFile(name, tempName, size); - copyFile(tempName, name, WHOLE_FILE); - remove(tempName); - } return 0; } --- 465,478 ---- const char *const name; const long size; { ! char *tempName = NULL; ! FILE *fp = tempFile("w", &tempName); ! fclose(fp); ! copyFile(name, tempName, size); ! copyFile(tempName, name, WHOLE_FILE); ! remove(tempName); ! eFree(tempName); return 0; } *************** *** 485,491 **** static void sortTagFile() { ! if (TagFile.numTags.added + TagFile.numTags.prev > 0L) { if (Option.sorted) { --- 480,486 ---- static void sortTagFile() { ! if (TagFile.numTags.added > 0L) { if (Option.sorted) { *************** *** 551,573 **** extern void closeTagFile( resize ) const boolean resize; { ! long size; if (Option.etags) writeEtagsIncludes(TagFile.fp); size = ftell(TagFile.fp); fclose(TagFile.fp); ! if (resize) ! resizeTagFile(size); ! sortTagFile(); } extern void beginEtagsFile() { ! tmpnam(TagFile.etags.name); ! TagFile.etags.fp = fopen(TagFile.etags.name, "w+b"); ! if (TagFile.etags.fp == NULL) ! error(FATAL | PERROR, "cannot open \"%s\"", TagFile.etags.name); TagFile.etags.byteCount = 0; } --- 546,575 ---- extern void closeTagFile( resize ) const boolean resize; { ! long desiredSize, size; if (Option.etags) writeEtagsIncludes(TagFile.fp); + desiredSize = ftell(TagFile.fp); + fseek(TagFile.fp, 0L, SEEK_END); size = ftell(TagFile.fp); fclose(TagFile.fp); ! if (resize && desiredSize < size) ! { ! DebugStatement( ! debugPrintf(DEBUG_STATUS, "shrinking %s from %ld to %ld bytes\n", ! TagFile.name, size, desiredSize); ) ! resizeTagFile(desiredSize); ! } ! if (! Option.etags) ! sortTagFile(); ! eFree(TagFile.name); ! TagFile.name = NULL; } extern void beginEtagsFile() { ! TagFile.etags.fp = tempFile("w+b", &TagFile.etags.name); TagFile.etags.byteCount = 0; } *************** *** 584,591 **** fputs(line, TagFile.fp); fclose(TagFile.etags.fp); remove(TagFile.etags.name); } - TagFile.etags.name[0] = '\0'; } /*---------------------------------------------------------------------------- --- 586,595 ---- fputs(line, TagFile.fp); fclose(TagFile.etags.fp); remove(TagFile.etags.name); + eFree(TagFile.etags.name); + TagFile.etags.fp = NULL; + TagFile.etags.name = NULL; } } /*---------------------------------------------------------------------------- *************** *** 680,687 **** static int writeXrefEntry( tag ) const tagEntryInfo *const tag; { ! const char *const line = readSourceLine(TagFile.vLine, &tag->filePosition, ! NULL); int length = fprintf(TagFile.fp, "%-20s %-10s %4lu %-14s ", tag->name, tag->kindName, tag->lineNumber, tag->sourceFileName); --- 684,691 ---- static int writeXrefEntry( tag ) const tagEntryInfo *const tag; { ! const char *const line = ! readSourceLine(TagFile.vLine, tag->filePosition, NULL); int length = fprintf(TagFile.fp, "%-20s %-10s %4lu %-14s ", tag->name, tag->kindName, tag->lineNumber, tag->sourceFileName); *************** *** 722,729 **** else { long seekValue; ! char *const line = readSourceLine(TagFile.vLine, &tag->filePosition, ! &seekValue); if (tag->truncateLine) truncateTagLine(line, tag->name, TRUE); --- 726,733 ---- else { long seekValue; ! char *const line = ! readSourceLine(TagFile.vLine, tag->filePosition, &seekValue); if (tag->truncateLine) truncateTagLine(line, tag->name, TRUE); *************** *** 784,790 **** static int writePatternEntry( tag ) const tagEntryInfo *const tag; { ! char *const line = readSourceLine(TagFile.vLine, &tag->filePosition, NULL); const int searchChar = Option.backward ? '?' : '/'; boolean newlineTerminated; int length = 0; --- 788,794 ---- static int writePatternEntry( tag ) const tagEntryInfo *const tag; { ! char *const line = readSourceLine(TagFile.vLine, tag->filePosition, NULL); const int searchChar = Option.backward ? '?' : '/'; boolean newlineTerminated; int length = 0; diff -crN ../vim-5.6/src/ctags/entry.h ./src/ctags/entry.h *** ../vim-5.6/src/ctags/entry.h Tue Sep 14 05:43:26 1999 --- ./src/ctags/entry.h Thu Apr 13 07:38:19 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: entry.h,v 8.7 1999/09/14 03:43:26 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: entry.h,v 8.8 2000/04/13 05:38:19 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * *************** *** 33,44 **** /* Maintains the state of the tag file. */ typedef struct eTagFile { ! const char *name; FILE *fp; struct sNumTags { unsigned long added, prev; } numTags; struct sMax { size_t line, tag, file; } max; struct sEtags { ! char name[L_tmpnam]; FILE *fp; size_t byteCount; } etags; --- 33,44 ---- /* Maintains the state of the tag file. */ typedef struct eTagFile { ! char *name; FILE *fp; struct sNumTags { unsigned long added, prev; } numTags; struct sMax { size_t line, tag, file; } max; struct sEtags { ! char *name; FILE *fp; size_t byteCount; } etags; diff -crN ../vim-5.6/src/ctags/main.c ./src/ctags/main.c *** ../vim-5.6/src/ctags/main.c Tue Dec 14 06:28:12 1999 --- ./src/ctags/main.c Sun Apr 23 19:23:00 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: main.c,v 8.24 1999/12/14 05:28:12 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: main.c,v 8.30 2000/04/23 17:23:00 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * *************** *** 28,38 **** #include #include ! #ifndef HAVE_FGETPOS ! # include /* to declare SEEK_SET (hopefully) */ ! # if defined(HAVE_UNISTD_H) ! # include /* to declare SEEK_SET on SunOS 4.1.x */ ! # endif #endif #ifdef AMIGA --- 28,36 ---- #include #include ! #include /* to declare SEEK_SET (hopefully) */ ! #if defined(HAVE_UNISTD_H) ! # include /* to declare mkstemp(), and SEEK_SET on SunOS 4.1.x */ #endif #ifdef AMIGA *************** *** 170,175 **** --- 168,178 ---- static const char PathDelimiters[] = ":]>"; #endif + #ifndef TMPDIR + # define TMPDIR "/tmp" + #endif + + static const char *ExecutableProgram = NULL; static const char *ExecutableName = NULL; static struct { long files, lines, bytes; } Totals = { 0, 0, 0 }; *************** *** 332,337 **** --- 335,362 ---- return isNormal; } + #ifdef HAVE_MKSTEMP + + static boolean isSetUID __ARGS((const char *const name)); + + static boolean isSetUID( name ) + const char *const name; + { + #if defined(__vms) || defined(MSDOS) || defined(WIN32) || defined(__EMX__) || defined(AMIGA) + return FALSE; + #else + struct stat fileStatus; + boolean result = FALSE; + + if (stat(name, &fileStatus) == 0) + result = (boolean)((fileStatus.st_mode & S_ISUID) != 0); + + return result; + #endif + } + + #endif + static boolean isDirectory( name ) const char *const name; { *************** *** 424,429 **** --- 449,489 ---- return toStdout; } + extern FILE *tempFile( mode, pName ) + const char *const mode; + char **const pName; + { + char *name; + FILE *fp; + #ifdef HAVE_MKSTEMP + int fd; + const char *const template = "tags.XXXXXX"; + const char *tmpdir = NULL; + if (! isSetUID(ExecutableProgram)) + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) + tmpdir = TMPDIR; + name = (char*)eMalloc(strlen(tmpdir) + 1 + strlen(template) + 1); + sprintf(name, "%s%c%s", tmpdir, PATH_SEPARATOR, template); + fd = mkstemp(name); + if (fd == -1) + error(FATAL | PERROR, "cannot open temporary file"); + fp = fdopen(fd, mode); + #else + name = (char*)eMalloc((size_t)L_tmpnam); + if (tmpnam(name) != name) + error(FATAL | PERROR, "cannot assign temporary file name"); + fp = fopen(name, mode); + #endif + if (fp == NULL) + error(FATAL | PERROR, "cannot open temporary file"); + DebugStatement( + debugPrintf(DEBUG_STATUS, "opened temporary file %s\n", name); ) + Assert(*pName == NULL); + *pName = name; + return fp; + } + /*---------------------------------------------------------------------------- * Pathname manipulation (O/S dependent!!!) *--------------------------------------------------------------------------*/ *************** *** 463,469 **** (isalpha(path[0]) && path[1] == ':')); #else # ifdef __vms ! return (boolean)strchr(path, ':'); # else return (boolean)(path[0] == PATH_SEPARATOR); # endif --- 523,529 ---- (isalpha(path[0]) && path[1] == ':')); #else # ifdef __vms ! return (boolean)(strchr(path, ':') != NULL); # else return (boolean)(path[0] == PATH_SEPARATOR); # endif *************** *** 1023,1028 **** --- 1083,1089 ---- static void setExecutableName( path ) const char *const path; { + ExecutableProgram = path; ExecutableName = baseFilename(path); } diff -crN ../vim-5.6/src/ctags/main.h ./src/ctags/main.h *** ../vim-5.6/src/ctags/main.h Wed Sep 29 04:20:25 1999 --- ./src/ctags/main.h Thu Apr 13 07:38:19 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: main.h,v 8.4 1999/09/29 02:20:25 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: main.h,v 8.5 2000/04/13 05:38:19 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * *************** *** 16,21 **** --- 16,22 ---- ============================================================================*/ #include "general.h" #include "vstring.h" + #include /*============================================================================ = Data declarations *************** *** 33,38 **** --- 34,40 ---- #endif extern void error __ARGS((const errorSelection selection, const char *const format, ...)); + extern FILE *tempFile __ARGS((const char *const mode, char **const pName)); extern boolean strequiv __ARGS((const char *const s1, const char *const s2)); extern void *eMalloc __ARGS((const size_t size)); extern void *eRealloc __ARGS((void *const ptr, const size_t size)); diff -crN ../vim-5.6/src/ctags/options.c ./src/ctags/options.c *** ../vim-5.6/src/ctags/options.c Tue Dec 14 06:28:12 1999 --- ./src/ctags/options.c Sun Apr 23 18:12:17 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: options.c,v 8.26 1999/12/14 05:28:12 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: options.c,v 8.27 2000/04/23 16:12:17 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * *************** *** 714,722 **** "auto", "C", "C++", "Eiffel", "Fortran", "Java" }; ! DebugStatement( if (sizeof(names)/sizeof(names[0]) != LANG_COUNT) ! error(FATAL, "LangNames array not consistent with LANG enumeration"); ) ! return names[(int)language]; } --- 714,720 ---- "auto", "C", "C++", "Eiffel", "Fortran", "Java" }; ! Assert(sizeof(names)/sizeof(names[0]) == LANG_COUNT); return names[(int)language]; } diff -crN ../vim-5.6/src/ctags/parse.c ./src/ctags/parse.c *** ../vim-5.6/src/ctags/parse.c Fri Jan 14 05:20:23 2000 --- ./src/ctags/parse.c Sat Apr 15 04:50:32 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: parse.c,v 8.19 2000/01/14 04:20:23 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: parse.c,v 8.24 2000/04/15 02:50:32 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * *************** *** 31,37 **** /*============================================================================ = Macros ============================================================================*/ ! #define MaxFields 2 #define stringValue(a) #a #define activeToken(st) ((st)->token[(int)(st)->tokenIndex]) --- 31,37 ---- /*============================================================================ = Macros ============================================================================*/ ! #define MaxFields 6 #define stringValue(a) #a #define activeToken(st) ((st)->token[(int)(st)->tokenIndex]) *************** *** 156,162 **** typedef struct sTokenInfo { tokenType type; keywordId keyword; ! vString * name; /* the name of the token */ unsigned long lineNumber; /* line number of tag */ fpos_t filePosition; /* file position of line containing name */ } tokenInfo; --- 156,162 ---- typedef struct sTokenInfo { tokenType type; keywordId keyword; ! vString* name; /* the name of the token */ unsigned long lineNumber; /* line number of tag */ fpos_t filePosition; /* file position of line containing name */ } tokenInfo; *************** *** 185,190 **** --- 185,191 ---- tokenInfo* context; /* accumulated scope of current statement */ tokenInfo* blockName; /* name of current block */ memberInfo member; /* information regarding parent class/struct */ + vString* parentClasses; /* parent classes */ struct sStatementInfo *parent; /* statement we are nested within */ } statementInfo; *************** *** 300,314 **** static boolean isContextualKeyword __ARGS((const tokenInfo *const token)); static boolean isContextualStatement __ARGS((const statementInfo *const st)); static boolean isMember __ARGS((const statementInfo *const st)); - static void reinitStatement __ARGS((statementInfo *const st, const boolean comma)); static void initMemberInfo __ARGS((statementInfo *const st)); static void initStatement __ARGS((statementInfo *const st, statementInfo *const parent)); static const char *tagName __ARGS((const tagType type)); static int tagLetter __ARGS((const tagType type)); static boolean includeTag __ARGS((const tagType type, const boolean isFileScope)); static tagType declToTagType __ARGS((const declType declaration)); static const char* accessField __ARGS((const statementInfo *const st)); ! static int addOtherFields __ARGS((const tagType type, const statementInfo *const st, vString *const scope, const char *(*otherFields)[2])); static void addContextSeparator __ARGS((vString *const scope)); static void findScopeHierarchy __ARGS((vString *const string, const statementInfo *const st)); static void makeExtraTagEntry __ARGS((tagEntryInfo *const e, vString *const scope)); --- 301,315 ---- static boolean isContextualKeyword __ARGS((const tokenInfo *const token)); static boolean isContextualStatement __ARGS((const statementInfo *const st)); static boolean isMember __ARGS((const statementInfo *const st)); static void initMemberInfo __ARGS((statementInfo *const st)); + static void reinitStatement __ARGS((statementInfo *const st, const boolean comma)); static void initStatement __ARGS((statementInfo *const st, statementInfo *const parent)); static const char *tagName __ARGS((const tagType type)); static int tagLetter __ARGS((const tagType type)); static boolean includeTag __ARGS((const tagType type, const boolean isFileScope)); static tagType declToTagType __ARGS((const declType declaration)); static const char* accessField __ARGS((const statementInfo *const st)); ! static int addOtherFields __ARGS((const tagType type, const statementInfo *const st, vString *const scope, const char *(*otherFields)[MaxFields])); static void addContextSeparator __ARGS((vString *const scope)); static void findScopeHierarchy __ARGS((vString *const string, const statementInfo *const st)); static void makeExtraTagEntry __ARGS((tagEntryInfo *const e, vString *const scope)); *************** *** 320,326 **** static void qualifyCompoundTag __ARGS((const statementInfo *const st, const tokenInfo *const nameToken)); static void qualifyBlockTag __ARGS((statementInfo *const st, const tokenInfo *const nameToken)); static void qualifyVariableTag __ARGS((const statementInfo *const st, const tokenInfo *const nameToken)); - static int skipToCharacter __ARGS((const int target)); static int skipToNonWhite __ARGS((void)); static void skipToFormattedBraceMatch __ARGS((void)); static void skipToMatch __ARGS((const char *const pair)); --- 321,326 ---- *************** *** 334,339 **** --- 334,341 ---- static void copyToken __ARGS((tokenInfo *const dest, const tokenInfo *const src)); static void setAccess __ARGS((statementInfo *const st, const accessType access)); static void discardTypeList __ARGS((tokenInfo *const token)); + static void addParentClass __ARGS((statementInfo *const st, tokenInfo *const token)); + static void readParents __ARGS((statementInfo *const st, const int qualifier)); static void readPackage __ARGS((tokenInfo *const token)); static void processName __ARGS((statementInfo *const st)); static void processToken __ARGS((tokenInfo *const token, statementInfo *const st)); *************** *** 637,642 **** --- 639,675 ---- return result; } + static void initMemberInfo( st ) + statementInfo *const st; + { + accessType accessDefault = ACCESS_UNDEFINED; + + if (st->parent != NULL) switch (st->parent->declaration) + { + case DECL_ENUM: + case DECL_NAMESPACE: + case DECL_UNION: + accessDefault = ACCESS_UNDEFINED; + break; + + case DECL_CLASS: + if (isLanguage(LANG_JAVA)) + accessDefault = ACCESS_DEFAULT; + else + accessDefault = ACCESS_PRIVATE; + break; + + case DECL_INTERFACE: + case DECL_STRUCT: + accessDefault = ACCESS_PUBLIC; + break; + + default: break; + } + st->member.accessDefault = accessDefault; + st->member.access = accessDefault; + } + static void reinitStatement( st, partial ) statementInfo *const st; const boolean partial; *************** *** 664,669 **** --- 697,703 ---- initToken(st->context); initToken(st->blockName); + vStringClear(st->parentClasses); /* Init member info. */ *************** *** 671,707 **** st->member.access = st->member.accessDefault; } - static void initMemberInfo( st ) - statementInfo *const st; - { - accessType accessDefault = ACCESS_UNDEFINED; - - if (st->parent != NULL) switch (st->parent->declaration) - { - case DECL_ENUM: - case DECL_NAMESPACE: - case DECL_UNION: - accessDefault = ACCESS_UNDEFINED; - break; - - case DECL_CLASS: - if (isLanguage(LANG_JAVA)) - accessDefault = ACCESS_DEFAULT; - else - accessDefault = ACCESS_PRIVATE; - break; - - case DECL_INTERFACE: - case DECL_STRUCT: - accessDefault = ACCESS_PUBLIC; - break; - - default: break; - } - st->member.accessDefault = accessDefault; - st->member.access = accessDefault; - } - static void initStatement( st, parent ) statementInfo *const st; statementInfo *const parent; --- 705,710 ---- *************** *** 853,858 **** --- 856,862 ---- if (isMember(st) && ! (type == TAG_ENUMERATOR && vStringLength(scope) == 0)) { + Assert(numFields < MaxFields); if (isType(st->context, TOKEN_NAME)) otherFields[0][numFields] = tagName(TAG_CLASS); else *************** *** 864,872 **** --- 868,885 ---- otherFields[1][numFields] = vStringValue(scope); ++numFields; } + if ((type == TAG_CLASS || type == TAG_STRUCT) && + vStringLength(st->parentClasses) > 0) + { + Assert(numFields < MaxFields); + otherFields[0][numFields] = "inherits"; + otherFields[1][numFields] = vStringValue(st->parentClasses); + ++numFields; + } if (st->implementation != IMP_DEFAULT && (isLanguage(LANG_CPP) || isLanguage(LANG_JAVA))) { + Assert(numFields < MaxFields); otherFields[0][numFields] = "implementation"; otherFields[1][numFields] = implementationString(st->implementation); ++numFields; *************** *** 877,892 **** { if (accessField(st) != NULL) { otherFields[0][numFields] = "access"; otherFields[1][numFields] = accessField(st); ++numFields; } } break; - - case TAG_VARIABLE: - Assert("Shouldn't happen" == NULL); - break; } return numFields; } --- 890,902 ---- { if (accessField(st) != NULL) { + Assert(numFields < MaxFields); otherFields[0][numFields] = "access"; otherFields[1][numFields] = accessField(st); ++numFields; } } break; } return numFields; } *************** *** 1090,1100 **** case DECL_UNION: qualifyCompoundTag(st, nameToken); break; - - case DECL_FUNCTION: - qualifyFunctionTag(st, nameToken); - break; - default: break; } } --- 1100,1105 ---- *************** *** 1143,1162 **** /* Skip to the next non-white character. */ - static int skipToCharacter( target ) - const int target; - { - int c; - - do - c = cppGetc(); - while (c != target && c != EOF); - - return c; - } - - /* Skip to the next non-white character. - */ static int skipToNonWhite() { int c; --- 1148,1153 ---- *************** *** 1441,1449 **** tokenInfo *const token; { int c = skipToNonWhite(); - - /* Read and discard interface or class type-list (ident[, ident]). - */ while (isident1(c)) { readIdentifier(token, c); --- 1432,1437 ---- *************** *** 1454,1466 **** cppUngetc(c); } ! static void readPackage( token ) tokenInfo *const token; { ! const int c = skipToNonWhite(); Assert(isType(token, TOKEN_KEYWORD)); ! readPackageName(token, c); token->type = TOKEN_PACKAGE; } --- 1442,1491 ---- cppUngetc(c); } ! static void addParentClass( st, token ) ! statementInfo *const st; tokenInfo *const token; { ! if (vStringLength(st->parentClasses) > 0) ! vStringPut(st->parentClasses, ','); ! vStringCat(st->parentClasses, token->name); ! } ! ! static void readParents ( st, qualifier ) ! statementInfo *const st; ! const int qualifier; ! { ! tokenInfo *const token = newToken(); ! tokenInfo *const parent = newToken(); ! int c; ! ! do ! { ! c = skipToNonWhite(); ! if (isident1(c)) ! { ! readIdentifier(token, c); ! if (isType(token, TOKEN_NAME)) ! vStringCat(parent->name, token->name); ! } ! else if (c == qualifier) ! vStringPut(parent->name, c); ! else if (isType(token, TOKEN_NAME)) ! { ! addParentClass(st, parent); ! initToken(parent); ! } ! } while (c != '{'); ! cppUngetc(c); ! deleteToken(parent); ! deleteToken(token); ! } + static void readPackage( token ) + tokenInfo *const token; + { Assert(isType(token, TOKEN_KEYWORD)); ! readPackageName(token, skipToNonWhite()); token->type = TOKEN_PACKAGE; } *************** *** 1491,1500 **** case KEYWORD_CONST: st->declaration = DECL_BASE; break; case KEYWORD_DOUBLE: st->declaration = DECL_BASE; break; case KEYWORD_ENUM: st->declaration = DECL_ENUM; break; ! case KEYWORD_EXTENDS: discardTypeList(token); break; case KEYWORD_FLOAT: st->declaration = DECL_BASE; break; case KEYWORD_FRIEND: st->scope = SCOPE_FRIEND; break; ! case KEYWORD_IMPLEMENTS:discardTypeList(token); break; case KEYWORD_IMPORT: st->declaration = DECL_IGNORE; break; case KEYWORD_INT: st->declaration = DECL_BASE; break; case KEYWORD_INTERFACE: st->declaration = DECL_INTERFACE; break; --- 1516,1527 ---- case KEYWORD_CONST: st->declaration = DECL_BASE; break; case KEYWORD_DOUBLE: st->declaration = DECL_BASE; break; case KEYWORD_ENUM: st->declaration = DECL_ENUM; break; ! case KEYWORD_EXTENDS: readParents(st, '.'); ! setToken(st, TOKEN_NONE); break; case KEYWORD_FLOAT: st->declaration = DECL_BASE; break; case KEYWORD_FRIEND: st->scope = SCOPE_FRIEND; break; ! case KEYWORD_IMPLEMENTS:readParents(st, '.'); ! setToken(st, TOKEN_NONE); break; case KEYWORD_IMPORT: st->declaration = DECL_IGNORE; break; case KEYWORD_INT: st->declaration = DECL_BASE; break; case KEYWORD_INTERFACE: st->declaration = DECL_INTERFACE; break; *************** *** 1629,1634 **** --- 1656,1662 ---- case ')': break; case ':': skipMemIntializerList(token); break; /* ctor-initializer */ case '[': skipToMatch("[]"); break; + case '=': cppUngetc(c); end = TRUE; break; case '{': cppUngetc(c); end = TRUE; break; case '}': cppUngetc(c); end = TRUE; break; *************** *** 1991,1998 **** if (isLanguage(LANG_CPP) && ( st->declaration == DECL_CLASS || st->declaration == DECL_STRUCT)) { ! const int d = skipToCharacter('{'); ! cppUngetc(d); } } } --- 2019,2025 ---- if (isLanguage(LANG_CPP) && ( st->declaration == DECL_CLASS || st->declaration == DECL_STRUCT)) { ! readParents(st, ':'); } } } *************** *** 2094,2110 **** st->declaration = DECL_NOMANGLE; st->scope = SCOPE_GLOBAL; } - if (isLanguage(LANG_JAVA) && - (st->declaration == DECL_CLASS || st->declaration == DECL_INTERFACE)) - { - if (prev->keyword == KEYWORD_CLASS || - prev->keyword == KEYWORD_INTERFACE) - { - if (isType(activeToken(st), TOKEN_NAME)) - copyToken(st->blockName, activeToken(st)); - qualifyBlockTag(st, activeToken(st)); - } - } } /* Reads characters from the pre-processor and assembles tokens, setting --- 2121,2126 ---- *************** *** 2154,2159 **** --- 2170,2176 ---- st->context = newToken(); st->blockName = newToken(); + st->parentClasses = vStringNew(); initStatement(st, parent); CurrentStatement = st; *************** *** 2168,2177 **** unsigned int i; for (i = 0 ; i < (unsigned int)NumTokens ; ++i) ! deleteToken(st->token[i]); ! ! deleteToken(st->blockName); ! deleteToken(st->context); eFree(st); CurrentStatement = parent; } --- 2185,2196 ---- unsigned int i; for (i = 0 ; i < (unsigned int)NumTokens ; ++i) ! { ! deleteToken(st->token[i]); st->token[i] = NULL; ! } ! deleteToken(st->blockName); st->blockName = NULL; ! deleteToken(st->context); st->context = NULL; ! vStringDelete(st->parentClasses); st->parentClasses = NULL; eFree(st); CurrentStatement = parent; } *************** *** 2190,2200 **** if (isType(token, TOKEN_SEMICOLON)) isEnd = TRUE; ! else if (isType(token, TOKEN_BRACE_CLOSE) && ! (st->declaration == DECL_FUNCTION || ! st->declaration == DECL_NAMESPACE || ! st->declaration == DECL_NOMANGLE)) ! isEnd = TRUE; else isEnd = FALSE; --- 2209,2216 ---- if (isType(token, TOKEN_SEMICOLON)) isEnd = TRUE; ! else if (isType(token, TOKEN_BRACE_CLOSE)) ! isEnd = (boolean)(! isContextualStatement(st)); else isEnd = FALSE; *************** *** 2272,2281 **** st->declaration = DECL_FUNCTION; if (isType (prev, TOKEN_NAME)) copyToken(st->blockName, prev2); ! qualifyBlockTag(st, prev2); } } ! else if (! isLanguage(LANG_JAVA) && isContextualStatement(st)) { if (isType (prev, TOKEN_NAME)) copyToken(st->blockName, prev); --- 2288,2297 ---- st->declaration = DECL_FUNCTION; if (isType (prev, TOKEN_NAME)) copyToken(st->blockName, prev2); ! qualifyFunctionTag(st, prev2); } } ! else if (isContextualStatement(st)) { if (isType (prev, TOKEN_NAME)) copyToken(st->blockName, prev); diff -crN ../vim-5.6/src/ctags/read.c ./src/ctags/read.c *** ../vim-5.6/src/ctags/read.c Fri Aug 20 06:37:07 1999 --- ./src/ctags/read.c Mon Mar 27 07:23:14 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: read.c,v 8.1 1999/03/04 04:16:38 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: read.c,v 8.2 2000/03/27 05:23:14 darren Exp $ * * Copyright (c) 1996-1999, Darren Hiebert * *************** *** 311,326 **** /* Places into the line buffer the contents of the line referenced by * "location". */ ! extern char *readSourceLine( vLine, pLocation, pSeekValue ) vString *const vLine; ! const fpos_t *const pLocation; long *const pSeekValue; { fpos_t orignalPosition; char *line; fgetpos(File.fp, &orignalPosition); ! fsetpos(File.fp, pLocation); if (pSeekValue != NULL) *pSeekValue = ftell(File.fp); line = readLine(vLine, File.fp); --- 311,326 ---- /* Places into the line buffer the contents of the line referenced by * "location". */ ! extern char *readSourceLine( vLine, location, pSeekValue ) vString *const vLine; ! fpos_t location; long *const pSeekValue; { fpos_t orignalPosition; char *line; fgetpos(File.fp, &orignalPosition); ! fsetpos(File.fp, &location); if (pSeekValue != NULL) *pSeekValue = ftell(File.fp); line = readLine(vLine, File.fp); diff -crN ../vim-5.6/src/ctags/read.h ./src/ctags/read.h *** ../vim-5.6/src/ctags/read.h Mon Apr 12 07:55:25 1999 --- ./src/ctags/read.h Mon Mar 27 07:23:14 2000 *************** *** 1,5 **** /***************************************************************************** ! * $Id: read.h,v 8.2 1999/04/12 05:55:05 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * --- 1,5 ---- /***************************************************************************** ! * $Id: read.h,v 8.3 2000/03/27 05:23:14 darren Exp $ * * Copyright (c) 1998-1999, Darren Hiebert * *************** *** 85,91 **** extern void fileClose __ARGS((void)); extern int fileGetc __ARGS((void)); extern void fileUngetc __ARGS((int c)); ! extern char *readSourceLine __ARGS((vString *const vLine, const fpos_t *const pLocation, long *const pSeekValue)); #endif /* _READ_H */ --- 85,91 ---- extern void fileClose __ARGS((void)); extern int fileGetc __ARGS((void)); extern void fileUngetc __ARGS((int c)); ! extern char *readSourceLine __ARGS((vString *const vLine, fpos_t location, long *const pSeekValue)); #endif /* _READ_H */ diff -crN ../vim-5.6/src/digraph.c ./src/digraph.c *** ../vim-5.6/src/digraph.c Tue May 18 16:55:33 1999 --- ./src/digraph.c Tue Apr 18 09:58:23 2000 *************** *** 91,105 **** #else /* !MSDOS && !WIN32 */ # ifdef __MINT__ char_u digraphdefault[][3] = /* standard ATARI digraphs */ ! {{'C', ',', 128}, /* ~@ */ {'u', '"', 129}, /* */ {'e', '\'', 130}, /* ‚ */ {'a', '^', 131}, /* ƒ */ {'a', '"', 132}, /* „ */ {'a', '`', 133}, /* … */ {'a', '@', 134}, /* † */ ! {'c', ',', 135}, /* ~G */ ! {'e', '^', 136}, /* ~H */ {'e', '"', 137}, /* ‰ */ {'e', '`', 138}, /* Š */ {'i', '"', 139}, /* ‹ */ --- 91,105 ---- #else /* !MSDOS && !WIN32 */ # ifdef __MINT__ char_u digraphdefault[][3] = /* standard ATARI digraphs */ ! {{'C', ',', 128}, /* ~@ XX */ {'u', '"', 129}, /* */ {'e', '\'', 130}, /* ‚ */ {'a', '^', 131}, /* ƒ */ {'a', '"', 132}, /* „ */ {'a', '`', 133}, /* … */ {'a', '@', 134}, /* † */ ! {'c', ',', 135}, /* ~G XX */ ! {'e', '^', 136}, /* ~H XX */ {'e', '"', 137}, /* ‰ */ {'e', '`', 138}, /* Š */ {'i', '"', 139}, /* ‹ */ *************** *** 120,126 **** {'U', '"', 154}, /* š */ {'c', '|', 155}, /* › */ {'$', '$', 156}, /* œ */ ! {'Y', '-', 157}, /* ~] */ {'s', 's', 158}, /* ž */ {'f', 'f', 159}, /* Ÿ */ {'a', '\'', 160}, /*   */ --- 120,126 ---- {'U', '"', 154}, /* š */ {'c', '|', 155}, /* › */ {'$', '$', 156}, /* œ */ ! {'Y', '-', 157}, /* ~] XX */ {'s', 's', 158}, /* ž */ {'f', 'f', 159}, /* Ÿ */ {'a', '\'', 160}, /*   */ *************** *** 254,259 **** --- 254,387 ---- }; # else /* !HPUX_DIGRAPHS */ + # ifdef macintosh + + char_u digraphdefault[][3] = /* different Macintosh digraphs */ + {{'a', 't', 64}, /* @ */ + {'A', '"', 128}, /* ~@ XX */ + {'A', 'o', 129}, /* Å */ + {'C', ',', 130}, /* Ç */ + {'E', '\'', 131}, /* É */ + {'N', '~', 132}, /* Ñ */ + {'O', '"', 133}, /* Ö */ + {'U', '"', 134}, /* Ü */ + {'a', '\'', 135}, /* ~G XX */ + {'a', '`', 136}, /* ~H XX */ + {'a', '^', 137}, /* â */ + {'a', '"', 138}, /* ä */ + {'a', '~', 139}, /* ã */ + {'a', 'o', 140}, /* å */ + {'c', ',', 141}, /* ç */ + {'e', '\'', 142}, /* é */ + {'e', '`', 143}, /* è */ + {'e', '^', 144}, /* ê */ + {'e', '"', 145}, /* ë */ + {'i', '\'', 146}, /* í */ + {'i', '`', 147}, /* ì */ + {'i', '^', 148}, /* î */ + {'i', '"', 149}, /* ï */ + {'n', '~', 150}, /* ñ */ + {'o', '\'', 151}, /* ó */ + {'o', '`', 152}, /* ò */ + {'o', '^', 153}, /* ô */ + {'o', '"', 154}, /* ö */ + {'o', '~', 155}, /* o */ + {'u', '\'', 156}, /* ú */ + {'u', '`', 157}, /* ~] XX */ + {'u', '^', 158}, /* û */ + {'u', '"', 159}, /* ü */ + {'+', '_', 160}, /* Ý */ + {'~', 'o', 161}, /* ° */ + {'c', '|', 162}, /* ¢ */ + {'$', '$', 163}, /* £ */ + {'p', 'a', 164}, /* § */ + {'.', '.', 165}, /* * */ + {'P', 'P', 166}, /* ¶ */ + {'s', 's', 167}, /* ß */ + {'r', 'O', 168}, /* ® */ + {'c', 'O', 169}, /* © */ + {'T', 'M', 170}, /* */ + {'=', '/', 173}, /* ‚ */ + {'A', 'E', 174}, /* Æ */ + {'O', '/', 175}, /* Ø */ + {'0', '0', 176}, /* ƒ */ + {'+', '-', 177}, /* ± */ + {'<', '=', 178}, /* ¾ */ + {'>', '=', 179}, /* „ */ + {'Y', '-', 180}, /* ¥ */ + {'j', 'u', 181}, /* µ */ + {'m', 'u', 181}, /* µ */ + {'d', 'd', 182}, /* */ + {'S', 'S', 183}, /* … */ + {'S', 'I', 183}, /* … */ + {'P', 'I', 184}, /* ½ */ + {'p', 'i', 185}, /* ¼ */ + {'I', 'I', 186}, /* † */ + {'a', '-', 187}, /* » */ + {'o', '-', 188}, /* º */ + {'O', 'M', 189}, /* ½ */ + {'a', 'e', 190}, /* æ */ + {'o', '/', 191}, /* ø */ + {'~', '?', 192}, /* ¿ */ + {'~', '!', 193}, /* ¡ */ + {'-', ',', 194}, /* ¬ */ + {'v', '-', 195}, /* ~H XX */ + {'f', '-', 196}, /* Ÿ */ + {'~', '~', 197}, /* ‰ */ + {'D', 'E', 198}, /* */ + {'<', '<', 199}, /* « */ + {'>', '>', 200}, /* » */ + {'.', ':', 201}, /* Š */ + {'A', '`', 203}, /* À */ + {'A', '~', 204}, /* à */ + {'O', '~', 205}, /* Õ */ + {'O', 'E', 206}, /* ‘ */ + {'o', 'e', 207}, /* ¦ */ + {'-', '.', 208}, /* - */ + {'-', '-', 209}, /* - */ + {'`', '`', 210}, /* " */ + {'\'', '\'', 211}, /* " */ + {'`', ' ', 212}, /* ' */ + {'\'', ' ', 213}, /* ' */ + {'-', ':', 214}, /* ÷ */ + {'D', 'I', 215}, /* × */ + {'y', ':', 216}, /* ÿ */ + {'Y', ':', 217}, /* */ + {'/', '/', 218}, /* Ž */ + {'E', '=', 219}, /* ¤ Euro System >=8.5 */ + {'o', 'x', 219}, /* ¤ Currency System <=8.1*/ + {'<', ' ', 220}, /* Ð */ + {'>', ' ', 221}, /* ð */ + {'f', 'i', 222}, /* Þ */ + {'f', 'l', 223}, /* þ */ + {'+', '+', 224}, /* ý */ + {'~', '.', 225}, /* · */ + {',', ' ', 226}, /* ’ */ + {',', ',', 227}, /* “ */ + {'%', '.', 228}, /* ” */ + {'%', '0', 228}, /* ” */ + {'A', '^', 229}, /*  */ + {'E', '^', 230}, /* Ê */ + {'A', '\'', 231}, /* Á */ + {'E', '"', 232}, /* Ë */ + {'E', '`', 233}, /* È */ + {'I', '\'', 234}, /* Í */ + {'I', '^', 235}, /* Î */ + {'I', '"', 236}, /* Ï */ + {'I', '`', 237}, /* Ì */ + {'O', '\'', 238}, /* Ó */ + {'O', '^', 239}, /* Ô */ + {'A', 'P', 240}, /* • */ + {'O', '`', 241}, /* Ò */ + {'U', '\'', 242}, /* Ú */ + {'U', '^', 243}, /* Û */ + {'U', '`', 244}, /* Ù */ + {'i', '.', 245}, /* ž */ + {NUL, NUL, NUL} + }; + + # else /* !macintosh */ + char_u digraphdefault[][3] = /* standard ISO digraphs */ {{'~', '!', 161}, /* ¡ */ *************** *** 358,364 **** {'y', '"', 255}, /* x XX */ {NUL, NUL, NUL} }; ! # endif /* !HPUX_DIGRAPHS */ # endif /* !__MINT__ */ #endif /* !MSDOS && !WIN32 */ --- 486,492 ---- {'y', '"', 255}, /* x XX */ {NUL, NUL, NUL} }; ! # endif /* Macintosh */ # endif /* !HPUX_DIGRAPHS */ # endif /* !__MINT__ */ #endif /* !MSDOS && !WIN32 */ diff -crN ../vim-5.6/src/edit.c ./src/edit.c *** ../vim-5.6/src/edit.c Sun Dec 19 12:26:07 1999 --- ./src/edit.c Sat Jun 17 21:32:18 2000 *************** *** 172,177 **** --- 172,181 ---- int revins_scol; /* start column of revins session */ #endif + #if defined(MULTI_BYTE) && defined(macintosh) + static short previous_script = smRoman; + #endif + /* * edit(): Start inserting text. * *************** *** 287,292 **** --- 291,299 ---- #if defined(USE_GUI_WIN32) && defined(MULTI_BYTE_IME) ImeSetOriginMode(); #endif + #if defined(MULTI_BYTE) && defined(macintosh) + KeyScript(previous_script); + #endif /* * Need to recompute the cursor position, it might move when the cursor is *************** *** 344,352 **** update_curswant(); if ( ((o_eol && curwin->w_cursor.lnum == o_lnum) || curwin->w_curswant > curwin->w_virtcol) ! && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL ! && *(ptr + 1) == NUL) ! ++curwin->w_cursor.col; } else { --- 351,366 ---- update_curswant(); if ( ((o_eol && curwin->w_cursor.lnum == o_lnum) || curwin->w_curswant > curwin->w_virtcol) ! && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL) ! { ! if (ptr[1] == NUL) ! ++curwin->w_cursor.col; ! #ifdef MULTI_BYTE ! else if (is_dbcs && ptr[2] == NUL && IsLeadByte(ptr[0]) ! && IsTrailByte(ptr - curwin->w_cursor.col, ptr + 1)) ! curwin->w_cursor.col += 2; ! #endif ! } } else { *************** *** 662,667 **** --- 676,682 ---- switch (c) { case K_INS: /* toggle insert/replace mode */ + case K_KINS: #ifdef FKMAP if (p_fkmap && p_ri) { *************** *** 809,814 **** --- 824,830 ---- /* delete character under the cursor */ case K_DEL: + case K_KDEL: ins_del(); need_redraw = TRUE; break; *************** *** 3083,3089 **** { if (!vim_isdigit(nc) && !isxdigit(nc)) break; ! nc = tolower(nc); if (nc >= 'a') nc = 10 + nc - 'a'; else --- 3099,3105 ---- { if (!vim_isdigit(nc) && !isxdigit(nc)) break; ! nc = TO_LOWER(nc); if (nc >= 'a') nc = 10 + nc - 'a'; else *************** *** 3803,3815 **** #ifdef MULTI_BYTE if (is_dbcs) { ! /* if the character on the current cursor is a multi-byte character, ! move two characters right */ ! char_u *base; ! ! base = ml_get(curwin->w_cursor.lnum); ! if (*(ptr+1) != NUL && IsTrailByte(base, ptr)) ++curwin->w_cursor.col; } #endif curwin->w_set_curswant = TRUE; --- 3819,3832 ---- #ifdef MULTI_BYTE if (is_dbcs) { ! /* If the character under the cursor is a multi-byte character, move ! * two bytes right. */ ! if (IsTrailByte(ml_get(curwin->w_cursor.lnum), ptr)) ! { ! if (*(ptr + 1) == NUL) ! return FAIL; ++curwin->w_cursor.col; + } } #endif curwin->w_set_curswant = TRUE; *************** *** 3983,3989 **** echeck_abbr(c) int c; { ! if (p_paste || no_abbr) /* no abbreviations or in paste mode */ return FALSE; return check_abbr(c, ml_get_curline(), curwin->w_cursor.col, --- 4000,4008 ---- echeck_abbr(c) int c; { ! /* Don't check for abbreviation in paste mode, when disabled and just ! * after moving around with cursor keys. */ ! if (p_paste || no_abbr || arrow_used) return FALSE; return check_abbr(c, ml_get_curline(), curwin->w_cursor.col, *************** *** 4391,4397 **** (char_u)AIN /*y*/, (char_u)ZADI /*z*/}; if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z') ! return (int)(map[tolower(c) - 'a'] - 1 + p_aleph);/* '-1'='sofit' */ else if (c == 'x') return 'X'; else if (c == 'q') --- 4410,4416 ---- (char_u)AIN /*y*/, (char_u)ZADI /*z*/}; if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z') ! return (int)(map[TO_LOWER(c) - 'a'] - 1 + p_aleph);/* '-1'='sofit' */ else if (c == 'x') return 'X'; else if (c == 'q') *************** *** 4548,4553 **** --- 4567,4576 ---- composing_hangul = 0; } #endif + #if defined(MULTI_BYTE) && defined(macintosh) + previous_script = GetScriptManagerVariable(smKeyScript); + KeyScript(smKeyRoman); /* or smKeySysScript */ + #endif temp = curwin->w_cursor.col; if (disabled_redraw) *************** *** 4606,4612 **** */ if ( curwin->w_cursor.col != 0 && (!restart_edit ! || gchar_cursor() == NUL) #ifdef RIGHTLEFT && !revins_on #endif --- 4629,4635 ---- */ if ( curwin->w_cursor.col != 0 && (!restart_edit ! || (gchar_cursor() == NUL && !VIsual_active)) #ifdef RIGHTLEFT && !revins_on #endif *************** *** 5793,5798 **** --- 5816,5825 ---- old_indent = get_indent(); set_indent(0, TRUE); } + + /* Adjust ai_col, the char at this position can be deleted. */ + if (ai_col > curwin->w_cursor.col) + ai_col = curwin->w_cursor.col; } #endif diff -crN ../vim-5.6/src/eval.c ./src/eval.c *** ../vim-5.6/src/eval.c Wed Jan 12 21:14:54 2000 --- ./src/eval.c Tue Jun 6 12:55:14 2000 *************** *** 143,148 **** --- 143,149 ---- static int get_env_var __ARGS((char_u **arg, VAR retvar, int evaluate)); static int find_internal_func __ARGS((char_u *name)); static int get_func_var __ARGS((char_u *name, int len, VAR retvar, char_u **arg, linenr_t firstline, linenr_t lastline, int *doesrange, int evaluate)); + static linenr_t get_arg_lnum __ARGS((VAR argvars, VAR retvar)); static void f_append __ARGS((VAR argvars, VAR retvar)); static void f_argc __ARGS((VAR argvars, VAR retvar)); static void f_argv __ARGS((VAR argvars, VAR retvar)); *************** *** 2133,2147 **** return ret; } - /********************************************* - * Implementation of the built-in functions - */ - /* ! * "append(lnum, string)" function */ ! static void ! f_append(argvars, retvar) VAR argvars; VAR retvar; { --- 2134,2144 ---- return ret; } /* ! * Get the lnum from the first argument. Also accepts ".", "$", etc. */ ! static linenr_t ! get_arg_lnum(argvars, retvar) VAR argvars; VAR retvar; { *************** *** 2154,2159 **** --- 2151,2174 ---- lnum = retvar->var_val.var_number; clear_var(retvar); } + return lnum; + } + + /********************************************* + * Implementation of the built-in functions + */ + + /* + * "append(lnum, string)" function + */ + static void + f_append(argvars, retvar) + VAR argvars; + VAR retvar; + { + long lnum; + + lnum = get_arg_lnum(argvars, retvar); retvar->var_val.var_number = 1; /* Default: Failed */ if (lnum >= 0 && lnum <= curbuf->b_ml.ml_line_count *************** *** 2747,2760 **** linenr_t lnum; char_u *p; ! lnum = get_var_number(&argvars[0]); ! if (lnum == 0) /* no valid number, try using line() */ ! { ! f_line(argvars, retvar); ! lnum = retvar->var_val.var_number; ! clear_var(retvar); ! } ! if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) p = ml_get(lnum); else --- 2762,2768 ---- linenr_t lnum; char_u *p; ! lnum = get_arg_lnum(argvars, retvar); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) p = ml_get(lnum); else *************** *** 2991,2997 **** #ifdef USE_MOUSE "mouse", #endif ! #ifdef UNIX # ifdef DEC_MOUSE "mouse_dec", # endif --- 2999,3005 ---- #ifdef USE_MOUSE "mouse", #endif ! #if defined(UNIX) || defined(VMS) # ifdef DEC_MOUSE "mouse_dec", # endif *************** *** 3390,3396 **** #else linenr_t lnum; ! lnum = get_var_number(&argvars[0]); if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) retvar->var_val.var_number = -1; else --- 3398,3404 ---- #else linenr_t lnum; ! lnum = get_arg_lnum(argvars, retvar); if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) retvar->var_val.var_number = -1; else *************** *** 3598,3604 **** linenr_t lnum; char_u *line; ! lnum = get_var_number(&argvars[0]); line = get_var_string(&argvars[1]); retvar->var_val.var_number = 1; /* FAIL is default */ --- 3606,3612 ---- linenr_t lnum; char_u *line; ! lnum = get_arg_lnum(argvars, retvar); line = get_var_string(&argvars[1]); retvar->var_val.var_number = 1; /* FAIL is default */ *************** *** 3722,3728 **** long col; int trans; ! line = get_var_number(&argvars[0]); col = get_var_number(&argvars[1]) - 1; trans = get_var_number(&argvars[2]); --- 3730,3736 ---- long col; int trans; ! line = get_arg_lnum(argvars, retvar); col = get_var_number(&argvars[1]) - 1; trans = get_var_number(&argvars[2]); *************** *** 4655,4661 **** msg_putchar_attr(*p, echo_attr); } else ! (void)msg_outtrans_len_attr(p, 1, echo_attr); } clear_var(&retvar); arg = skipwhite(arg); --- 4663,4680 ---- msg_putchar_attr(*p, echo_attr); } else ! { ! #ifdef MULTI_BYTE ! /* check multibyte */ ! if (is_dbcs && p[1] != NUL && IsLeadByte(*p)) ! { ! (void)msg_outtrans_len_attr(p, 2, echo_attr); ! ++p; ! } ! else ! #endif ! (void)msg_outtrans_len_attr(p, 1, echo_attr); ! } } clear_var(&retvar); arg = skipwhite(arg); *************** *** 4951,4956 **** --- 4970,4976 ---- goto erret; } + /* Check for "endfunction" (should be more strict...). */ for (p = theline; vim_iswhite(*p) || *p == ':'; ++p) ; if (STRNCMP(p, "endf", 4) == 0 && nesting-- == 0) *************** *** 4958,4967 **** --- 4978,4990 ---- vim_free(theline); break; } + + /* Increase indent inside "if" and "while", decrease at "end" */ if (indent > 2 && STRNCMP(p, "end", 3) == 0) indent -= 2; else if (STRNCMP(p, "if", 2) == 0 || STRNCMP(p, "wh", 2) == 0) indent += 2; + /* Check for defining a function inside this function. */ if (STRNCMP(p, "fu", 2) == 0) { *************** *** 5546,5556 **** { valid |= VALID_PATH; *usedlen += 2; ! *fnamep = FullName_save(*fnamep, FALSE); ! vim_free(*bufp); /* free any allocated file name */ ! *bufp = *fnamep; ! if (*fnamep == NULL) ! return -1; } /* ":." - path relative to the current directory */ --- 5569,5583 ---- { valid |= VALID_PATH; *usedlen += 2; ! /* FullName_save() is slow, don't use it when not needed. */ ! if (!mch_isFullName(*fnamep)) ! { ! *fnamep = FullName_save(*fnamep, FALSE); ! vim_free(*bufp); /* free any allocated file name */ ! *bufp = *fnamep; ! if (*fnamep == NULL) ! return -1; ! } } /* ":." - path relative to the current directory */ *************** *** 5610,5615 **** --- 5637,5646 ---- while (tail > s && vim_ispathsep(tail[-1])) --tail; *fnamelen = tail - *fnamep; + #ifdef VMS + if (*fnamelen > 0) + *fnamelen += 1; /* the path separator is part of the path */ + #endif while (tail > s && !vim_ispathsep(tail[-1])) --tail; } *************** *** 5644,5649 **** --- 5675,5689 ---- { *fnamelen += *fnamep - (s + 1); *fnamep = s + 1; + #ifdef VMS + /* cut version from the extension */ + s = *fnamep + *fnamelen - 1; + for ( ; s > *fnamep; --s) + if (s[0] == ';') + break; + if (s > *fnamep) + *fnamelen = s - *fnamep; + #endif } else if (*fnamep <= tail) *fnamelen = 0; diff -crN ../vim-5.6/src/ex_cmds.c ./src/ex_cmds.c *** ../vim-5.6/src/ex_cmds.c Fri Dec 24 12:15:29 1999 --- ./src/ex_cmds.c Tue Jun 20 15:55:51 2000 *************** *** 723,729 **** int save_nwr; #endif #ifdef MSWIN ! int winstart; #endif #ifdef RISCOS int silent = FALSE; --- 723,729 ---- int save_nwr; #endif #ifdef MSWIN ! int winstart = FALSE; #endif #ifdef RISCOS int silent = FALSE; *************** *** 858,869 **** # else # ifdef RISCOS if (cmd == NULL || silent) ! { if (!silent) must_redraw = CLEAR; # else if (cmd == NULL) ! { must_redraw = CLEAR; # endif # endif --- 858,869 ---- # else # ifdef RISCOS if (cmd == NULL || silent) ! { /* } */ if (!silent) must_redraw = CLEAR; # else if (cmd == NULL) ! { /* } */ must_redraw = CLEAR; # endif # endif *************** *** 1295,1303 **** char_u *tempname = NULL; /* name of temp viminfo file */ struct stat st_new; /* mch_stat() of potential new file */ char_u *wp; #ifdef UNIX int shortname = FALSE; /* use 8.3 file name */ - mode_t umask_save; struct stat st_old; /* mch_stat() of existing viminfo file */ #endif --- 1295,1305 ---- char_u *tempname = NULL; /* name of temp viminfo file */ struct stat st_new; /* mch_stat() of potential new file */ char_u *wp; + #if defined(UNIX) || defined(VMS) + mode_t umask_save; + #endif #ifdef UNIX int shortname = FALSE; /* use 8.3 file name */ struct stat st_old; /* mch_stat() of existing viminfo file */ #endif *************** *** 1315,1321 **** /* if it does exist, but we can't read it, don't try writing */ if (mch_stat((char *)file, &st_new) == 0) goto end; ! #ifdef UNIX /* * For Unix we create the .viminfo non-accessible for others, * because it may contain text from non-accessible documents. --- 1317,1323 ---- /* if it does exist, but we can't read it, don't try writing */ if (mch_stat((char *)file, &st_new) == 0) goto end; ! #if defined(UNIX) || defined(VMS) /* * For Unix we create the .viminfo non-accessible for others, * because it may contain text from non-accessible documents. *************** *** 1323,1329 **** umask_save = umask(077); #endif fp_out = mch_fopen((char *)file, WRITEBIN); ! #ifdef UNIX (void)umask(umask_save); #endif } --- 1325,1331 ---- umask_save = umask(077); #endif fp_out = mch_fopen((char *)file, WRITEBIN); ! #if defined(UNIX) || defined(VMS) (void)umask(umask_save); #endif } *************** *** 1525,1531 **** --- 1527,1537 ---- { #ifdef VIMINFO_FILE2 /* don't use $HOME when not defined (turned into "c:/"!). */ + # ifdef VMS + if (mch_getenv((char_u *)"SYS$LOGIN") == NULL) + # else if (mch_getenv((char_u *)"HOME") == NULL) + # endif { /* don't use $VIM when not available. */ expand_env((char_u *)"$VIM", NameBuff, MAXPATHL); *************** *** 1791,1797 **** p = find_termcode((char_u *)"kb"); add_termcode((char_u *)"kD", p != NULL && *p == 0x7f ? ! (char_u *)"\010" : (char_u *)"\177"); } void --- 1797,1803 ---- p = find_termcode((char_u *)"kb"); add_termcode((char_u *)"kD", p != NULL && *p == 0x7f ? ! (char_u *)"\010" : (char_u *)"\177", FALSE); } void *************** *** 2294,2299 **** --- 2300,2307 ---- linenr_t lnum; linenr_t topline = 0; int newcol = -1; + int solcol = -1; + FPOS *pos; if (fnum != 0) { *************** *** 2417,2423 **** /* May jump to last used line number for a loaded buffer or when asked * for explicitly */ if ((oldbuf && newlnum == ECMD_LASTL) || newlnum == ECMD_LAST) ! newlnum = buflist_findlnum(buf); /* * Make the (new) buffer the one used by the current window. --- 2425,2435 ---- /* May jump to last used line number for a loaded buffer or when asked * for explicitly */ if ((oldbuf && newlnum == ECMD_LASTL) || newlnum == ECMD_LAST) ! { ! pos = buflist_findfpos(buf); ! newlnum = pos->lnum; ! solcol = pos->col; ! } /* * Make the (new) buffer the one used by the current window. *************** *** 2514,2520 **** --- 2526,2535 ---- { set_last_cursor(curwin); /* may set b_last_cursor */ if (newlnum == ECMD_LAST || newlnum == ECMD_LASTL) + { newlnum = curwin->w_cursor.lnum; + solcol = curwin->w_cursor.col; + } #ifdef AUTOCMD buf = curbuf; if (buf->b_fname != NULL) *************** *** 2651,2657 **** { curwin->w_cursor.lnum = newlnum; check_cursor_lnum(); ! beginline(BL_SOL | BL_FIX); } else /* no line number, go to last line in Ex mode */ { --- 2666,2679 ---- { curwin->w_cursor.lnum = newlnum; check_cursor_lnum(); ! if (solcol >= 0 && !p_sol) ! { ! /* 'sol' is off: Use last known column. */ ! curwin->w_cursor.col = solcol; ! check_cursor_col(); ! } ! else ! beginline(BL_SOL | BL_FIX); } else /* no line number, go to last line in Ex mode */ { *************** *** 3055,3061 **** --- 3077,3088 ---- break; } if (cmd[0] == '\\' && cmd[1] != 0) /* skip escaped characters */ + { + /* Change "\^M" to "^V^M" to avoid a line split below */ + if (cmd[1] == CR) + cmd[0] = Ctrl('V'); ++cmd; + } ++cmd; } *************** *** 3180,3192 **** unsigned len, needed_len; unsigned new_start_len = 0; ! /* make a copy of the line, so it won't be taken away when updating ! the screen */ if ((old_line = vim_strsave(ptr)) == NULL) continue; ! vim_regexec(prog, old_line, TRUE); /* match again on this line to ! * update the pointers. TODO: ! * remove extra vim_regexec() */ if (!got_match) { setpcmark(); --- 3207,3219 ---- unsigned len, needed_len; unsigned new_start_len = 0; ! /* Make a copy of the line, so it won't be taken away when ! * updating the screen. */ if ((old_line = vim_strsave(ptr)) == NULL) continue; ! /* Adjust the pointers in "prog" for the copied string. */ ! vim_regnewptr(prog, ptr, old_line); ! if (!got_match) { setpcmark(); *************** *** 3362,3370 **** /* * Now the trick is to replace CTRL-Ms with a real line break. * This would make it impossible to insert CTRL-Ms in the text. ! * That is the way vi works. In Vim the line break can be ! * avoided by preceding the CTRL-M with a CTRL-V. Now you can't ! * precede a line break with a CTRL-V, big deal. */ while ((p1 = vim_strchr(new_end, CR)) != NULL) { --- 3389,3398 ---- /* * Now the trick is to replace CTRL-Ms with a real line break. * This would make it impossible to insert CTRL-Ms in the text. ! * The line break can be avoided by preceding the CTRL-M with ! * a CTRL-V. Now you can't precede a line break with a CTRL-V. ! * Above "\^M" is replaced with "^V^M", so that a backslash ! * can also be used to escape the CTRL-M (Vi compatible). */ while ((p1 = vim_strchr(new_end, CR)) != NULL) { *************** *** 3483,3489 **** else if (got_match) /* did find something but nothing substituted */ MSG(""); else if (do_error) /* nothing found */ ! emsg2(e_patnotf2, pat); } vim_free(prog); --- 3511,3517 ---- else if (got_match) /* did find something but nothing substituted */ MSG(""); else if (do_error) /* nothing found */ ! emsg2(e_patnotf2, get_search_pat()); } vim_free(prog); *************** *** 4009,4014 **** --- 4037,4046 ---- } else { + /* replace "[:...:]" with "\[:...:]" */ + if (arg[0] == '[' && arg[1] == ':') + *d++ = '\\'; + for (s = arg; *s; ++s) { /* diff -crN ../vim-5.6/src/ex_docmd.c ./src/ex_docmd.c *** ../vim-5.6/src/ex_docmd.c Sat Jan 8 13:45:47 2000 --- ./src/ex_docmd.c Tue Jun 20 11:18:24 2000 *************** *** 121,127 **** static void do_sleep __ARGS((EXARG *eap)); static void do_exmap __ARGS((EXARG *eap, int isabbrev)); static void do_winsize __ARGS((char_u *arg)); ! #if defined(USE_GUI) || defined(UNIX) static void do_winpos __ARGS((char_u *arg)); #endif static void do_exops __ARGS((EXARG *eap)); --- 121,127 ---- static void do_sleep __ARGS((EXARG *eap)); static void do_exmap __ARGS((EXARG *eap, int isabbrev)); static void do_winsize __ARGS((char_u *arg)); ! #if defined(USE_GUI) || defined(UNIX) || defined(VMS) static void do_winpos __ARGS((char_u *arg)); #endif static void do_exops __ARGS((EXARG *eap)); *************** *** 1962,1968 **** do_winsize(ea.arg); break; ! #if defined(USE_GUI) || defined(UNIX) case CMD_winpos: do_winpos(ea.arg); break; --- 1962,1968 ---- do_winsize(ea.arg); break; ! #if defined(USE_GUI) || defined(UNIX) || defined(VMS) case CMD_winpos: do_winpos(ea.arg); break; *************** *** 3622,3627 **** --- 3622,3631 ---- break; } } + #ifdef MULTI_BYTE + else if (is_dbcs && p[1] && IsLeadByte(*p)) + ++p; /* skip second byte of double-byte char */ + #endif } if (!(eap->argt & NOTRLCOM)) /* remove trailing spaces */ del_trailing_spaces(eap->arg); *************** *** 4033,4038 **** --- 4037,4045 ---- } #ifdef QUICKFIX + /* + * Used for ":make" and ":grep". + */ static void do_make(arg, errorformat) char_u *arg; *************** *** 5844,5851 **** { int other; char_u *p; - char_u *ffname; - BUF *buf; if (argn < 0 || argn >= arg_file_count) { --- 5851,5856 ---- *************** *** 5890,5912 **** if (argn == arg_file_count - 1) arg_had_last = TRUE; ! /* ! * If no line number given, use the last known line number. ! */ ! if (eap->do_ecmd_lnum == 0) ! { ! ffname = fix_fname(arg_files[curwin->w_arg_idx]); ! if (ffname != NULL) ! { ! buf = buflist_findname(ffname); ! if (buf != NULL) ! eap->do_ecmd_lnum = buflist_findlnum(buf); ! vim_free(ffname); ! } ! } ! (void)do_ecmd(0, arg_files[curwin->w_arg_idx], ! NULL, eap->do_ecmd_cmd, eap->do_ecmd_lnum, (p_hid ? ECMD_HIDE : 0) + (eap->forceit ? ECMD_FORCEIT : 0)); } --- 5895,5903 ---- if (argn == arg_file_count - 1) arg_had_last = TRUE; ! /* Edit the file; always use the last known line number. */ (void)do_ecmd(0, arg_files[curwin->w_arg_idx], ! NULL, eap->do_ecmd_cmd, ECMD_LAST, (p_hid ? ECMD_HIDE : 0) + (eap->forceit ? ECMD_FORCEIT : 0)); } *************** *** 6430,6436 **** char_u *tofree; new_dir = eap->arg; ! #ifndef UNIX /* for non-UNIX ":cd" means: print current directory */ if (*new_dir == NUL) do_pwd(); --- 6421,6427 ---- char_u *tofree; new_dir = eap->arg; ! #if !defined(UNIX) && !defined(VMS) /* for non-UNIX ":cd" means: print current directory */ if (*new_dir == NUL) do_pwd(); *************** *** 6455,6466 **** else prev_dir = NULL; ! #ifdef UNIX /* for UNIX ":cd" means: go to home directory */ if (*new_dir == NUL) { /* use NameBuff for home directory name */ expand_env((char_u *)"$HOME", NameBuff, MAXPATHL); new_dir = NameBuff; } #endif --- 6446,6467 ---- else prev_dir = NULL; ! #if defined(UNIX) || defined(VMS) /* for UNIX ":cd" means: go to home directory */ if (*new_dir == NUL) { /* use NameBuff for home directory name */ + # ifdef VMS + char_u *p; + + p = mch_getenv((char_u *)"SYS$LOGIN"); + if (p == NULL || *p == NUL) /* empty is the same as not set */ + NameBuff[0] = NUL; + else + STRNCPY(NameBuff, p, MAXPATHL); + # else expand_env((char_u *)"$HOME", NameBuff, MAXPATHL); + # endif new_dir = NameBuff; } #endif *************** *** 6554,6560 **** set_winsize(w, h, TRUE); } ! #if defined(USE_GUI) || defined(UNIX) /* * ":winpos" command. */ --- 6555,6561 ---- set_winsize(w, h, TRUE); } ! #if defined(USE_GUI) || defined(UNIX) || defined(VMS) /* * ":winpos" command. */ *************** *** 6796,6802 **** { if (islower(*eap->arg)) /* make register empty */ write_reg_contents(*eap->arg, (char_u *)""); ! redir_reg = toupper(*eap->arg); } else EMSG(e_invarg); --- 6797,6803 ---- { if (islower(*eap->arg)) /* make register empty */ write_reg_contents(*eap->arg, (char_u *)""); ! redir_reg = TO_UPPER(*eap->arg); } else EMSG(e_invarg); *************** *** 7530,7536 **** return NULL; } if (lnump != NULL) ! *lnump = buflist_findlnum(buf); if (buf->b_fname == NULL) { result = (char_u *)""; --- 7531,7537 ---- return NULL; } if (lnump != NULL) ! *lnump = ECMD_LAST; if (buf->b_fname == NULL) { result = (char_u *)""; *************** *** 7648,7654 **** char_u *repl; int srclen; char_u *p; - linenr_t dummy; result = vim_strsave(arg); if (result == NULL) --- 7649,7654 ---- *************** *** 7661,7667 **** else { /* replace "" with the sourced file name, and do ":" stuff */ ! repl = eval_vars(p, &srclen, &dummy, &errormsg, result); if (errormsg != NULL) { if (*errormsg) --- 7661,7667 ---- else { /* replace "" with the sourced file name, and do ":" stuff */ ! repl = eval_vars(p, &srclen, NULL, &errormsg, result); if (errormsg != NULL) { if (*errormsg) diff -crN ../vim-5.6/src/ex_getln.c ./src/ex_getln.c *** ../vim-5.6/src/ex_getln.c Wed Dec 29 10:47:03 1999 --- ./src/ex_getln.c Mon Jun 5 12:35:31 2000 *************** *** 629,639 **** --- 629,643 ---- case K_BS: case Ctrl('H'): case K_DEL: + case K_KDEL: case Ctrl('W'): #ifdef FKMAP if (cmd_fkmap && c == K_BS) c = K_DEL; #endif + if (c == K_KDEL) + c = K_DEL; + /* * delete current character is the same as backspace on next * character, except at end of line *************** *** 689,694 **** --- 693,699 ---- goto cmdline_changed; case K_INS: + case K_KINS: #ifdef FKMAP /* if Farsi mode set, we are in reverse insert mode - Do not change the mode */ *************** *** 721,727 **** #endif putcmdline('"'); ++no_mapping; ! c = safe_vgetc(); --no_mapping; #ifdef WANT_EVAL /* --- 726,734 ---- #endif putcmdline('"'); ++no_mapping; ! i = c = safe_vgetc(); /* CTRL-R */ ! if (c == Ctrl('R')) ! c = safe_vgetc(); /* CTRL-R CTRL-R */ --no_mapping; #ifdef WANT_EVAL /* *************** *** 749,755 **** } #endif if (c != ESC) /* use ESC to cancel inserting register */ ! cmdline_paste(c); redrawcmd(); goto cmdline_changed; --- 756,762 ---- } #endif if (c != ESC) /* use ESC to cancel inserting register */ ! cmdline_paste(c, i == Ctrl('R')); redrawcmd(); goto cmdline_changed; *************** *** 821,830 **** goto cmdline_not_changed; /* Ignore mouse */ # ifdef USE_GUI if (gui.in_use) ! cmdline_paste('*'); else # endif ! cmdline_paste(0); redrawcmd(); goto cmdline_changed; --- 828,837 ---- goto cmdline_not_changed; /* Ignore mouse */ # ifdef USE_GUI if (gui.in_use) ! cmdline_paste('*', TRUE); else # endif ! cmdline_paste(0, TRUE); redrawcmd(); goto cmdline_changed; *************** *** 1345,1350 **** --- 1352,1363 ---- else #endif c = charsize(ccline.cmdbuff[i]); + #ifdef MULTI_BYTE + /* multibyte wrap */ + if (is_dbcs && IsLeadByte(ccline.cmdbuff[i]) + && (ccline.cmdspos % Columns + c == Columns)) + ccline.cmdspos++; + #endif /* If the cmdline doesn't fit, put cursor on last visible char. */ if ((ccline.cmdspos += c) >= m) { *************** *** 1474,1480 **** if (c1 == '\r') c1 = '\n'; ! if (c1 == BS || c1 == K_BS || c1 == DEL || c1 == K_DEL) { if (line_ga.ga_len > 0) { --- 1487,1494 ---- if (c1 == '\r') c1 = '\n'; ! if (c1 == BS || c1 == K_BS ! || c1 == DEL || c1 == K_DEL || c1 == K_KDEL) { if (line_ga.ga_len > 0) { *************** *** 1679,1684 **** --- 1693,1699 ---- int retval; int i; int m; + int c; if (len < 0) len = STRLEN(str); *************** *** 1727,1745 **** m = Columns * Rows; else m = MAXCOL; ! while (len--) { #ifdef CRYPTV if (cmdline_crypt) ! i = 1; else #endif ! i = charsize(str[len]); /* Stop cursor at the end of the screen */ ! if (ccline.cmdspos + i >= m) break; ++ccline.cmdpos; ! ccline.cmdspos += i; } } } --- 1742,1766 ---- m = Columns * Rows; else m = MAXCOL; ! for (i = 0; i < len; ++i) { #ifdef CRYPTV if (cmdline_crypt) ! c = 1; else #endif ! c = charsize(str[i]); ! #ifdef MULTI_BYTE ! /* multibyte wrap */ ! if (is_dbcs && IsLeadByte(str[i]) ! && ccline.cmdspos % Columns + c == Columns) ! ccline.cmdspos++; ! #endif /* Stop cursor at the end of the screen */ ! if (ccline.cmdspos + c >= m) break; ++ccline.cmdpos; ! ccline.cmdspos += c; } } } *************** *** 2129,2143 **** if (options & WILD_HOME_REPLACE) tilde_replace(str, cmd_numfiles, cmd_files); ! /* ! * Insert backslashes into a file name before a space, \, %, # and ! * wildmatch characters, except '~'. ! */ ! if ((options & WILD_ESCAPE) ! && (expand_context == EXPAND_FILES ! || expand_context == EXPAND_BUFFERS ! || expand_context == EXPAND_DIRECTORIES)) { for (i = 0; i < cmd_numfiles; ++i) { /* for ":set path=" we need to escape spaces twice */ --- 2150,2165 ---- if (options & WILD_HOME_REPLACE) tilde_replace(str, cmd_numfiles, cmd_files); ! if (options & WILD_ESCAPE) { + if (expand_context == EXPAND_FILES + || expand_context == EXPAND_BUFFERS + || expand_context == EXPAND_DIRECTORIES) + { + /* + * Insert a backslash into a file name before a space, \, %, # + * and wildmatch characters, except '~'. + */ for (i = 0; i < cmd_numfiles; ++i) { /* for ":set path=" we need to escape spaces twice */ *************** *** 2175,2182 **** --- 2197,2236 ---- vim_free(cmd_files[i]); cmd_files[i] = p; } + + /* If 'str' starts with "\~", replace "~" at start of + * cmd_files[i] with "\~". */ + if (str[0] == '\\' && str[1] == '~' + && cmd_files[i][0] == '~') + { + p = alloc((unsigned)(STRLEN(cmd_files[i]) + 2)); + if (p != NULL) + { + p[0] = '\\'; + STRCPY(p + 1, cmd_files[i]); + vim_free(cmd_files[i]); + cmd_files[i] = p; + } + } } expand_set_path = FALSE; + } + else if (expand_context == EXPAND_TAGS) + { + /* + * Insert a backslash before characters in a tag name that + * would terminate the ":tag" command. + */ + for (i = 0; i < cmd_numfiles; ++i) + { + p = vim_strsave_escaped(cmd_files[i], (char_u *)"\\|\""); + if (p != NULL) + { + vim_free(cmd_files[i]); + cmd_files[i] = p; + } + } + } } /* *************** *** 3084,3089 **** --- 3138,3145 ---- return -1; } + static int last_maptick = -1; /* last seen maptick */ + /* * Add the given string to the given history. If the string is already in the * history then it is moved to the front. "histype" may be HIST_CMD, *************** *** 3095,3101 **** char_u *new_entry; int in_map; /* consider maptick when inside a mapping */ { - static int last_maptick = -1; /* last seen maptick */ struct hist_entry *hisptr; if (hislen == 0) /* no history */ --- 3151,3156 ---- *************** *** 3301,3309 **** i = calc_hist_idx(histype, idx); if (i < 0) return FALSE; - idx = hisidx[histype]; vim_free(history[histype][i].hisstr); while (i != idx) { j = (i + 1) % hislen; --- 3356,3370 ---- i = calc_hist_idx(histype, idx); if (i < 0) return FALSE; idx = hisidx[histype]; vim_free(history[histype][i].hisstr); + + /* When deleting the last added search string in a mapping, reset + * last_maptick, so that the last added search string isn't deleted again. + */ + if (histype == HIST_SEARCH && maptick == last_maptick && i == idx) + last_maptick = -1; + while (i != idx) { j = (i + 1) % hislen; diff -crN ../vim-5.6/src/feature.h ./src/feature.h *** ../vim-5.6/src/feature.h Sun Jan 9 19:59:08 2000 --- ./src/feature.h Wed Mar 29 16:10:34 2000 *************** *** 38,50 **** * default A selection of features enabled. * * These executables are made available with MAX_FEAT defined, because they ! * are supposed to have enough RAM: Win32 (console & GUI), dos32 and OS/2. * The dos16 version has very little RAM available, use MIN_FEAT. */ #if !defined(MIN_FEAT) && !defined(MAX_FEAT) /* #define MIN_FEAT */ /* #define MAX_FEAT */ ! # if defined(MSWIN) || defined(DJGPP) || defined(OS2) # define MAX_FEAT # else # ifdef MSDOS --- 38,50 ---- * default A selection of features enabled. * * These executables are made available with MAX_FEAT defined, because they ! * are supposed to have enough RAM: Win32 (console & GUI), dos32, OS/2 and VMS. * The dos16 version has very little RAM available, use MIN_FEAT. */ #if !defined(MIN_FEAT) && !defined(MAX_FEAT) /* #define MIN_FEAT */ /* #define MAX_FEAT */ ! # if defined(MSWIN) || defined(DJGPP) || defined(OS2) || defined(VMS) # define MAX_FEAT # else # ifdef MSDOS *************** *** 436,442 **** * chinese and Japanese. * +hangul_input Internal Hangul input method. Must be included * through configure: "--enable-hangulin" ! * Both are for Unix only. */ #ifndef USE_XIM /* #define USE_XIM */ --- 436,442 ---- * chinese and Japanese. * +hangul_input Internal Hangul input method. Must be included * through configure: "--enable-hangulin" ! * Both are for Unix only. Works for VMS too. */ #ifndef USE_XIM /* #define USE_XIM */ *************** *** 539,546 **** * is strongly discouraged: You can loose all your * changes when the computer crashes while writing the * file. */ ! #ifndef VMS /* doesn't work on VMS */ # define WRITEBACKUP #endif --- 539,549 ---- * is strongly discouraged: You can loose all your * changes when the computer crashes while writing the * file. + * VMS note: It does work on VMS as well, but because of + * version handling it does not have any purpose. + * Overwrite will write to the new version. */ ! #ifndef VMS # define WRITEBACKUP #endif diff -crN ../vim-5.6/src/fileio.c ./src/fileio.c *** ../vim-5.6/src/fileio.c Wed Dec 15 13:28:21 1999 --- ./src/fileio.c Tue Jun 6 19:27:58 2000 *************** *** 40,45 **** --- 40,49 ---- # define CRYPT_MAGIC_LEN 12 #endif + #if defined(UNIX) || defined(DJGPP) || defined(__EMX__) || defined(VMS) || defined(RISCOS) + # define USE_MCH_ACCESS + #endif + #ifdef AUTOCMD struct aco_save { *************** *** 95,100 **** --- 99,106 ---- msg_scroll_save = msg_scroll; if (shortmess(SHM_OVERALL)) msg_scroll = FALSE; + if (!msg_scroll) /* wait a bit when overwriting an error msg */ + check_for_delay(FALSE); msg_start(); msg_scroll = msg_scroll_save; /* may truncate the message to avoid a hit-return prompt */ *************** *** 287,292 **** --- 293,304 ---- (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)((st.st_mode & 0777) | 0600)); #endif + #ifdef macintosh + /* Get the FSSpec on MacOS + * TODO: Update it properly when the buffer name changes + */ + (void) GetFSSpecFromPath(curbuf->b_ffname, &curbuf->b_FSSpec); + #endif } else { *************** *** 309,315 **** fd = 0; else { ! #if defined(UNIX) || defined(DJGPP) || defined(__EMX__) || defined(VMS) || defined(RISCOS) if ( # ifdef UNIX !(perm & 0222) || --- 321,327 ---- fd = 0; else { ! #ifdef USE_MCH_ACCESS if ( # ifdef UNIX !(perm & 0222) || *************** *** 465,482 **** * still be running, don't move the cursor to the last line, unless * always using the GUI. */ - #ifndef ALWAYS_USE_GUI if (read_stdin) { mch_msg("Vim: Reading from stdin...\n"); ! # ifdef USE_GUI /* Also write a message in the GUI window, if there is one. */ if (gui.in_use) gui_write((char_u *)"Reading from stdin...", 21); ! # endif } else - #endif filemess(curbuf, sfname, (char_u *)"", 0); } --- 477,494 ---- * still be running, don't move the cursor to the last line, unless * always using the GUI. */ if (read_stdin) { + #ifndef ALWAYS_USE_GUI mch_msg("Vim: Reading from stdin...\n"); ! #endif ! #ifdef USE_GUI /* Also write a message in the GUI window, if there is one. */ if (gui.in_use) gui_write((char_u *)"Reading from stdin...", 21); ! #endif } else filemess(curbuf, sfname, (char_u *)"", 0); } *************** *** 945,951 **** c = TRUE; msg_add_lines(c, (long)linecnt, filesize); ! keep_msg = msg_trunc_attr(IObuff, FALSE, 0); keep_msg_attr = 0; if (read_stdin) { --- 957,970 ---- c = TRUE; msg_add_lines(c, (long)linecnt, filesize); ! #ifdef ALWAYS_USE_GUI ! /* Don't show the message when reading stdin, it would end up in a ! * message box (which might be shown when exiting!) */ ! if (read_stdin) ! keep_msg = msg_may_trunc(FALSE, IObuff); ! else ! #endif ! keep_msg = msg_trunc_attr(IObuff, FALSE, 0); keep_msg_attr = 0; if (read_stdin) { *************** *** 1128,1134 **** int made_writable = FALSE; /* 'w' bit has been set */ #endif #ifdef VMS ! char_u *cp, nfname[MAXPATHL]; #endif /* writing everything */ int whole = (start == 1 && end == buf->b_ml.ml_line_count); --- 1147,1153 ---- int made_writable = FALSE; /* 'w' bit has been set */ #endif #ifdef VMS ! char_u nfname[MAXPATHL]; #endif /* writing everything */ int whole = (start == 1 && end == buf->b_ml.ml_line_count); *************** *** 1597,1602 **** --- 1616,1633 ---- errmsg = (char_u *)"is a directory"; goto fail; } + else if (!forceit && ( + # ifdef USE_MCH_ACCESS + mch_access((char *)fname, W_OK) + # else + (fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0 + ? TRUE : (close(fd), FALSE) + # endif + )) + { + errmsg = (char_u *)"is read-only (use ! to override)"; + goto fail; + } else if (overwriting) { struct stat st; *************** *** 1731,1750 **** */ #ifdef VMS STRCPY(nfname, fname); ! if ((cp = vim_strchr(nfname, ';')) != NULL) /* remove version */ ! *cp = '\0'; ! vms_fixfilename(nfname); #endif ! while ((fd = open((char *) ! #ifdef VMS ! nfname, ! #else ! fname, ! #endif ! O_WRONLY | O_EXTRA | (append ? ! (forceit ? (O_APPEND | O_CREAT) : O_APPEND) : ! (O_CREAT | O_TRUNC)) #ifndef macintosh , 0666 #endif --- 1762,1774 ---- */ #ifdef VMS STRCPY(nfname, fname); ! vms_remove_version(nfname); /* remove version */ ! fname = nfname; #endif ! while ((fd = open((char *)fname, O_WRONLY | O_EXTRA | (append ! ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND) ! : (O_CREAT | O_TRUNC)) #ifndef macintosh , 0666 #endif *************** *** 2021,2027 **** --- 2045,2057 ---- --no_wait_return; /* may wait for return now */ #ifndef UNIX + # ifdef VMS + STRCPY(nfname, sfname); + vms_remove_version(nfname); /* remove version */ + fname = nfname; + # else fname = sfname; /* use shortname now, for the messages */ + # endif #endif if (!filtering) { *************** *** 2207,2213 **** curbuf = curwin->w_buffer; } #endif ! return retval; } --- 2237,2246 ---- curbuf = curwin->w_buffer; } #endif ! #ifdef macintosh ! /* Update machine specific information. */ ! mch_post_buffer_write(buf); ! #endif return retval; } *************** *** 2402,2409 **** --- 2435,2444 ---- { if (vim_ispathsep(*p)) ++p; + #ifndef VMS /* the path separator is always part of the path */ else p = NULL; + #endif } } #if defined(MSDOS) || defined(MSWIN) || defined(OS2) *************** *** 2532,2540 **** return NULL; STRCPY(retval, fname); #ifdef VMS ! ptr = (char_u *)strrchr((char *)retval, ';'); ! if (ptr != NULL) ! *ptr = '\0'; #endif } --- 2567,2574 ---- return NULL; STRCPY(retval, fname); #ifdef VMS ! vms_remove_version(retval); /* we do not need versions here */ ! fnamelen = STRLEN(retval); /* it can be shorter*/ #endif } *************** *** 4320,4325 **** --- 4354,4366 ---- if (*p == '\\') *p = '/'; } + #endif + + #ifdef VMS + /* remove version for correct match */ + if (sfname != NULL) + vms_remove_version(sfname); + vms_remove_version(fname); #endif /* diff -crN ../vim-5.6/src/getchar.c ./src/getchar.c *** ../vim-5.6/src/getchar.c Mon Sep 13 13:32:42 1999 --- ./src/getchar.c Sun Apr 16 11:28:20 2000 *************** *** 881,886 **** --- 881,890 ---- } } may_sync_undo(); + + /* Since characters have been typed, consider the following to be in + * another mapping. Search string will be kept in history. */ + ++maptick; } /* *************** *** 1110,1115 **** --- 1114,1125 ---- continue; } #endif + #ifdef USE_GUI + /* Translate K_CSI to CSI. The special key is only used to avoid + * it being recognized as the start of a special key. */ + if (c == K_CSI) + c = CSI; + #endif } #ifdef MSDOS /* *************** *** 1452,1457 **** --- 1462,1479 ---- { keylen = check_termcode(max_mlen + 1, NULL, 0); + #ifdef MULTI_BYTE + /* + * When a CSI appears in a multi-byte character, + * don't wait for another character. + */ + if (keylen < 0 && is_dbcs && typeoff > 0) + { + if (IsLeadByte(*(typebuf + typeoff - 1)) + && *(typebuf + typeoff) == CSI) + keylen = 0; + } + #endif /* * When getting a partial match, but the last * characters were not typed, don't wait for a *************** *** 1500,1506 **** else { KeyTyped = TRUE; - ++maptick; /* write char to script file(s) */ gotchars(typebuf + typeoff, 1); } --- 1522,1527 ---- diff -crN ../vim-5.6/src/globals.h ./src/globals.h *** ../vim-5.6/src/globals.h Mon Dec 27 12:58:44 1999 --- ./src/globals.h Tue Jun 20 21:28:04 2000 *************** *** 139,145 **** EXTERN int quit_more INIT(= FALSE); /* 'q' hit at "--more--" msg */ EXTERN int more_back INIT(= 0); /* 'b' or 'u' at "--more--" msg */ EXTERN int more_back_used INIT(= FALSE); /* using more_back */ ! #if defined(UNIX) || defined(__EMX__) EXTERN int newline_on_exit INIT(= FALSE); /* did msg in altern. screen */ EXTERN int intr_char INIT(= 0); /* extra interrupt character */ #endif --- 139,145 ---- EXTERN int quit_more INIT(= FALSE); /* 'q' hit at "--more--" msg */ EXTERN int more_back INIT(= 0); /* 'b' or 'u' at "--more--" msg */ EXTERN int more_back_used INIT(= FALSE); /* using more_back */ ! #if defined(UNIX) || defined(__EMX__) || defined(VMS) EXTERN int newline_on_exit INIT(= FALSE); /* did msg in altern. screen */ EXTERN int intr_char INIT(= 0); /* extra interrupt character */ #endif *************** *** 623,629 **** --- 623,633 ---- /* these are in version.c */ extern char *Version; extern char *mediumVersion; + #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC) + extern char longVersion[]; + #else extern char *longVersion; + #endif /* * Some file names for Unix are stored in pathdef.c, to make their value *************** *** 635,640 **** --- 639,647 ---- extern char_u *default_vimruntime_dir; extern char_u *all_cflags; extern char_u *all_lflags; + # ifdef VMS + extern char_u *compiler_version; + # endif extern char_u *compiled_user; extern char_u *compiled_sys; #endif diff -crN ../vim-5.6/src/gui.c ./src/gui.c *** ../vim-5.6/src/gui.c Sun Jan 16 12:30:34 2000 --- ./src/gui.c Sun Jun 18 13:56:27 2000 *************** *** 125,141 **** else /* parent */ { int gui_in_use; (void)close(pfd[1]); /* parent closes its write end */ ! if (read(pfd[0], &gui_in_use, sizeof(int)) <= 0 || !gui_in_use) { ! EMSG("child process failed to start gui"); ! (void)close(pfd[0]); ! /* terminate the child process, in case it's still around */ ! (void)kill(pid, SIGTERM); } ! else exit(0); /* child was successful, parent can exit */ } } else --- 125,155 ---- else /* parent */ { int gui_in_use; + int i; (void)close(pfd[1]); /* parent closes its write end */ ! ! /* ! * Repeat the read() when interrupted by a signal. Could be a ! * harmless SIGWINCH. ! */ ! for (;;) { ! i = read(pfd[0], &gui_in_use, sizeof(int)); ! if (i != sizeof(int)) ! gui_in_use = 0; ! #ifdef EINTR ! if (i >= 0 || errno != EINTR) ! #endif ! break; } ! if (gui_in_use) exit(0); /* child was successful, parent can exit */ + + EMSG("child process failed to start gui"); + (void)close(pfd[0]); + /* terminate the child process, in case it's still around */ + (void)kill(pid, SIGTERM); } } else *************** *** 683,688 **** --- 697,706 ---- gui_undraw_cursor(); if (gui.row <0) return; + #ifdef MULTI_BYTE_IME + if (gui.row != gui.cursor_row || gui.col != gui.cursor_col) + ImeSetCompositionWindow(); + #endif gui.cursor_row = gui.row; gui.cursor_col = gui.col; gui.cursor_is_valid = TRUE; *************** *** 1278,1284 **** gui_stop_highlight(arg1); break; case 'f': /* flash the window (visual bell) */ ! gui_mch_flash(); break; default: p = s + 1; /* Skip the ESC */ --- 1296,1302 ---- gui_stop_highlight(arg1); break; case 'f': /* flash the window (visual bell) */ ! gui_mch_flash(arg1 == 0 ? 20 : arg1); break; default: p = s + 1; /* Skip the ESC */ *************** *** 1435,1444 **** --- 1453,1465 ---- gui_mch_set_font(font); #endif + draw_flags = 0; + /* Set the color */ bg_color = gui.back_pixel; if ((flags & GUI_MON_IS_CURSOR) && gui.in_focus) { + draw_flags |= DRAW_CURSOR; fg_color = fg; bg_color = bg; } *************** *** 1481,1493 **** if (!(flags & GUI_MON_NOCLEAR)) clip_may_clear_selection(gui.row, gui.row); - draw_flags = 0; /* If there's no bold font, then fake it */ if ((highlight_mask & (HL_BOLD | HL_STANDOUT)) && (gui.bold_font == 0 || (aep != NULL && aep->ae_u.gui.font != 0))) - { draw_flags |= DRAW_BOLD; s -= back; len += back; col -= back; --- 1502,1520 ---- if (!(flags & GUI_MON_NOCLEAR)) clip_may_clear_selection(gui.row, gui.row); /* If there's no bold font, then fake it */ if ((highlight_mask & (HL_BOLD | HL_STANDOUT)) && (gui.bold_font == 0 || (aep != NULL && aep->ae_u.gui.font != 0))) draw_flags |= DRAW_BOLD; + + /* + * When drawing bold or italic characters the spill-over from the left + * neighbor may be destroyed. Backup to start redrawing just after a + * blank. + */ + if ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)) + { s -= back; len += back; col -= back; diff -crN ../vim-5.6/src/gui.h ./src/gui.h *** ../vim-5.6/src/gui.h Tue Jul 20 11:17:36 1999 --- ./src/gui.h Wed Apr 5 15:31:53 2000 *************** *** 139,144 **** --- 139,145 ---- #ifdef RISCOS # define DRAW_ITALIC 0x08 /* draw italic text */ #endif + #define DRAW_CURSOR 0x10 /* drawing block cursor (win32) */ /* For our own tearoff menu item */ #define TEAR_STRING "-->Detach" *************** *** 314,319 **** --- 315,323 ---- #endif #ifdef USE_GUI_MAC WindowPtr VimWindow; + MenuHandle MacOSHelpMenu; /* Help menu provided by the MacOS */ + int MacOSHelpItems; /* Nr of help-items supplied by MacOS */ + int MacOSHaveCntxMenu; /* Contextual menu available */ GuiColor menu_fg_pixel; /* Color of menu and dialog foregound */ GuiColor menu_bg_pixel; /* Color of menu and dialog backgound */ GuiColor scroll_fg_pixel; /* Color of scrollbar foregrnd */ diff -crN ../vim-5.6/src/gui_athena.c ./src/gui_athena.c *** ../vim-5.6/src/gui_athena.c Tue Jul 27 18:17:39 1999 --- ./src/gui_athena.c Thu Mar 30 13:43:14 2000 *************** *** 922,930 **** Widget dialog; Widget dialogshell; Widget dialogmessage; ! #define MAXBUT 10 ! Widget dialogButton[MAXBUT]; int butcount; if (title == NULL) title = (char_u *)"Vim dialog"; --- 922,931 ---- Widget dialog; Widget dialogshell; Widget dialogmessage; ! Widget dialogButton; ! Widget prev_dialogButton = NULL; int butcount; + int vertical; if (title == NULL) title = (char_u *)"Vim dialog"; *************** *** 933,938 **** --- 934,942 ---- /* if our pointer is currently hidden, then we should show it. */ gui_mch_mousehide(FALSE); + /* Check 'v' flag in 'guioptions': vertical button placement. */ + vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL); + /* The shell is created each time, to make sure it is resized properly */ dialogshell = XtVaCreatePopupShell("dialogShell", transientShellWidgetClass, vimShell, *************** *** 942,948 **** goto error; dialog = XtVaCreateManagedWidget("dialog", formWidgetClass, dialogshell, ! XtNdefaultDistance, 30, XtNforeground, gui.menu_fg_pixel, XtNbackground, gui.menu_bg_pixel, NULL); --- 946,952 ---- goto error; dialog = XtVaCreateManagedWidget("dialog", formWidgetClass, dialogshell, ! XtNdefaultDistance, 20, XtNforeground, gui.menu_fg_pixel, XtNbackground, gui.menu_bg_pixel, NULL); *************** *** 967,973 **** return -1; p = buts; ! for (butcount = 0; butcount < MAXBUT; ++butcount) { for (next = p; *next; ++next) { --- 971,977 ---- return -1; p = buts; ! for (butcount = 0; *p; ++butcount) { for (next = p; *next; ++next) { *************** *** 979,985 **** break; } } ! dialogButton[butcount] = XtVaCreateManagedWidget("button", commandWidgetClass, dialog, XtNlabel, p, XtNtop, XtChainBottom, --- 983,989 ---- break; } } ! dialogButton = XtVaCreateManagedWidget("button", commandWidgetClass, dialog, XtNlabel, p, XtNtop, XtChainBottom, *************** *** 987,1008 **** XtNleft, XtChainLeft, XtNright, XtChainLeft, XtNfromVert, dialogmessage, XtNforeground, gui.menu_fg_pixel, XtNbackground, gui.menu_bg_pixel, XtNresizable, False, NULL); if (butcount > 0) ! XtVaSetValues(dialogButton[butcount], ! XtNfromHoriz, dialogButton[butcount - 1], NULL); ! XtAddCallback(dialogButton[butcount], XtNcallback, ! butproc, (XtPointer)butcount); ! if (*next == NUL) ! break; p = next; } - ++butcount; vim_free(buts); XtRealizeWidget(dialogshell); --- 991,1010 ---- XtNleft, XtChainLeft, XtNright, XtChainLeft, XtNfromVert, dialogmessage, + XtNvertDistance, vertical ? 4 : 20, XtNforeground, gui.menu_fg_pixel, XtNbackground, gui.menu_bg_pixel, XtNresizable, False, NULL); if (butcount > 0) ! XtVaSetValues(dialogButton, ! vertical ? XtNfromVert : XtNfromHoriz, prev_dialogButton, NULL); ! XtAddCallback(dialogButton, XtNcallback, butproc, (XtPointer)butcount); p = next; + prev_dialogButton = dialogButton; } vim_free(buts); XtRealizeWidget(dialogshell); *************** *** 1019,1024 **** --- 1021,1030 ---- (Position)((wv - wd) / 2), (Position)((hv - hd) / 2), &x, &y); + if (x < 0) + x = 0; + if (y < 0) + y = 0; XtVaSetValues(dialogshell, XtNx, x, XtNy, y, NULL); app = XtWidgetToApplicationContext(dialogshell); diff -crN ../vim-5.6/src/gui_gtk.c ./src/gui_gtk.c *** ../vim-5.6/src/gui_gtk.c Sat Jan 8 21:11:02 2000 --- ./src/gui_gtk.c Fri May 19 21:16:50 2000 *************** *** 532,539 **** STRCAT(full_pathname, name); STRCAT(full_pathname, ".xpm"); if (mch_access((const char *)full_pathname, F_OK) == 0) ! *pixmap = gdk_pixmap_create_from_xpm( ! gui.mainwin->window, mask, &gui.mainwin->style->bg[GTK_STATE_NORMAL], (const char *)full_pathname); --- 532,540 ---- STRCAT(full_pathname, name); STRCAT(full_pathname, ".xpm"); if (mch_access((const char *)full_pathname, F_OK) == 0) ! *pixmap = gdk_pixmap_colormap_create_from_xpm( ! NULL, ! gtk_widget_get_colormap(gui.mainwin), mask, &gui.mainwin->style->bg[GTK_STATE_NORMAL], (const char *)full_pathname); *************** *** 944,972 **** char_u * buttons, /* names of buttons */ int def_but) /* default button */ { ! char_u *names; ! char_u *p; ! int butcount; ! int dialog_status = -1; ! ! GtkWidget *dialog; ! GtkWidget *frame; ! GtkWidget *vbox; ! GtkWidget *table; ! GtkWidget *pixmap; ! GtkWidget *dialogmessage; ! GtkWidget *action_area; ! GtkWidget *sub_area; ! GtkWidget *separator; ! ! GdkPixmap *icon = NULL; ! GdkBitmap *mask = NULL; ! char **icon_data = NULL; ! ! #define MAXBUT 10 ! GtkWidget *button[MAXBUT]; ! ButtonData data[MAXBUT]; ! CancelData cancel_data; if (title == NULL) title = (char_u *) "Vim dialog..."; --- 945,975 ---- char_u * buttons, /* names of buttons */ int def_but) /* default button */ { ! char_u *names; ! char_u *p; ! int i; ! int butcount; ! int dialog_status = -1; ! int vertical; ! ! GtkWidget *dialog; ! GtkWidget *frame; ! GtkWidget *vbox; ! GtkWidget *table; ! GtkWidget *pixmap; ! GtkWidget *dialogmessage; ! GtkWidget *action_area; ! GtkWidget *sub_area; ! GtkWidget *separator; ! GtkAccelGroup *accel_group; ! ! GdkPixmap *icon = NULL; ! GdkBitmap *mask = NULL; ! char **icon_data = NULL; ! ! GtkWidget **button; ! ButtonData *data; ! CancelData cancel_data; if (title == NULL) title = (char_u *) "Vim dialog..."; *************** *** 974,979 **** --- 977,985 ---- if ((type < 0) || (type > VIM_LAST_TYPE)) type = VIM_GENERIC; + /* Check 'v' flag in 'guioptions': vertical button placement. */ + vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL); + /* if our pointer is currently hidden, then we should show it. */ gui_mch_mousehide(FALSE); *************** *** 1051,1085 **** gtk_box_pack_end(GTK_BOX(vbox), action_area, FALSE, TRUE, 0); gtk_widget_show(action_area); ! sub_area = gtk_hbox_new(TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(sub_area), 0); ! gtk_box_pack_start(GTK_BOX(action_area), sub_area, FALSE, TRUE, 0); gtk_widget_show(sub_area); - /* make a copy, so that we can insert NULs */ - names = vim_strsave(buttons); - if (names == NULL) - return -1; - /* * Create the buttons. */ p = names; ! for (butcount = 0; butcount < MAXBUT; ++butcount) { ! char_u *next; for (next = p; *next; ++next) { - if (*next == DLG_HOTKEY_CHAR) - mch_memmove(next, next + 1, STRLEN(next)); if (*next == DLG_BUTTON_SEP) { *next++ = NUL; break; } } ! button[butcount] = gtk_button_new_with_label((const gchar *)p); GTK_WIDGET_SET_FLAGS(button[butcount], GTK_CAN_DEFAULT); ! gtk_widget_show(button[butcount]); data[butcount].status = &dialog_status; data[butcount].index = butcount; --- 1057,1157 ---- gtk_box_pack_end(GTK_BOX(vbox), action_area, FALSE, TRUE, 0); gtk_widget_show(action_area); ! /* Add a [vh]box in the hbox to center the buttons in the dialog. */ ! if (vertical) ! sub_area = gtk_vbox_new(FALSE, 0); ! else ! sub_area = gtk_hbox_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(sub_area), 0); ! gtk_box_pack_start(GTK_BOX(action_area), sub_area, TRUE, FALSE, 0); gtk_widget_show(sub_area); /* * Create the buttons. */ + + /* + * Translate the Vim accelerator character into an underscore for GTK+. + * Double underscores to keep them in the label. + */ + /* count the number of underscores */ + i = 1; + for (p = buttons; *p; ++p) + if (*p == '_') + ++i; + + /* make a copy of "buttons" with the translated characters */ + names = alloc(STRLEN(buttons) + i); + if (names == NULL) + return -1; + + p = names; + for (i = 0; buttons[i]; ++i) + { + if (buttons[i] == DLG_HOTKEY_CHAR) + *p++ = '_'; + else + { + if (buttons[i] == '_') + *p++ = '_'; + *p++ = buttons[i]; + } + } + *p = NUL; + + /* Count the number of buttons and allocate button[] and data[]. */ + butcount = 1; + for (p = names; *p; ++p) + if (*p == DLG_BUTTON_SEP) + ++butcount; + button = (GtkWidget **)alloc((unsigned)(butcount * sizeof(GtkWidget *))); + data = (ButtonData *)alloc((unsigned)(butcount * sizeof(ButtonData))); + if (button == NULL || data == NULL) + { + vim_free(names); + vim_free(button); + vim_free(data); + return -1; + } + + /* Attach the new accelerator group to the window. */ + accel_group = gtk_accel_group_new(); + gtk_accel_group_attach(accel_group, GTK_OBJECT(dialog)); + p = names; ! for (butcount = 0; *p; ++butcount) { ! char_u *next; ! GtkWidget *label; ! guint accel_key; + /* Chunk out this single button. */ for (next = p; *next; ++next) { if (*next == DLG_BUTTON_SEP) { *next++ = NUL; break; } } ! button[butcount] = gtk_button_new(); GTK_WIDGET_SET_FLAGS(button[butcount], GTK_CAN_DEFAULT); ! ! label = gtk_accel_label_new(""); ! gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(label), dialog); ! ! accel_key = gtk_label_parse_uline(GTK_LABEL(label), (const gchar *)p); ! # ifdef GTK_USE_ACCEL ! /* Don't add accelator if 'winaltkeys' is "no". */ ! if (accel_key != GDK_VoidSymbol) { ! gtk_widget_add_accelerator(button[butcount], ! "clicked", ! accel_group, ! accel_key, 0, ! 0); ! } ! # endif ! ! gtk_container_add(GTK_CONTAINER(button[butcount]), label); ! gtk_widget_show_all(button[butcount]); data[butcount].status = &dialog_status; data[butcount].index = butcount; *************** *** 1089,1106 **** GTK_SIGNAL_FUNC(dlg_button_clicked), (gpointer) &data[butcount]); ! if (*next == NUL) { ! gtk_box_pack_end(GTK_BOX(action_area), button[butcount], ! FALSE, TRUE, 0); ! break; ! } else { ! gtk_box_pack_start(GTK_BOX(sub_area), button[butcount], ! TRUE, TRUE, 0); ! } p = next; } vim_free(names); --def_but; /* 1 is first button */ if (def_but < 0) def_but = 0; --- 1161,1174 ---- GTK_SIGNAL_FUNC(dlg_button_clicked), (gpointer) &data[butcount]); ! gtk_box_pack_start(GTK_BOX(sub_area), button[butcount], ! TRUE, FALSE, 0); p = next; } + vim_free(names); + --butcount; --def_but; /* 1 is first button */ if (def_but < 0) def_but = 0; *************** *** 1123,1128 **** --- 1191,1203 ---- if (dialog_status < 0) dialog_status = 0; + + /* let the garbage collector know that we don't need it anylonger */ + gtk_accel_group_unref(accel_group); + + vim_free(button); + vim_free(data); + return dialog_status; } diff -crN ../vim-5.6/src/gui_gtk_x11.c ./src/gui_gtk_x11.c *** ../vim-5.6/src/gui_gtk_x11.c Sun Jan 16 14:08:56 2000 --- ./src/gui_gtk_x11.c Tue Jun 20 15:08:20 2000 *************** *** 43,48 **** --- 43,50 ---- enum { SELECTION_TYPE_NONE, SELECTION_STRING, + SELECTION_TEXT, + SELECTION_COMPOUND_TEXT, SELECTION_CLIPBOARD }; *************** *** 58,63 **** --- 60,66 ---- }; static GtkTargetEntry target_table[] = { + { "text/uri-list", 0, TARGET_STRING }, { "STRING", 0, TARGET_STRING }, { "text/plain", 0, TARGET_STRING } }; *************** *** 339,344 **** --- 342,351 ---- static gint expose_event(GtkWidget * widget, GdkEventExpose * event) { + /* Skip this when the GUI isn't set up yet, will redraw later. */ + if (gui.starting) + return FALSE; + out_flush(); /* make sure all output has been processed */ gui_redraw(event->area.x, event->area.y, event->area.width, event->area.height); *************** *** 472,478 **** gtk_widget_grab_focus(gui.drawarea); #ifdef USE_XIM ! xim_set_focus(!(State & NORMAL)); #endif return TRUE; --- 479,485 ---- gtk_widget_grab_focus(gui.drawarea); #ifdef USE_XIM ! xim_set_focus(TRUE); #endif return TRUE; *************** *** 509,521 **** int i; int modifiers; int key; key_sym = event->keyval; len = event->length; g_assert(len <= sizeof(string)); #ifdef HANGUL_INPUT ! if (event->keyval == GDK_space && (event->state & GDK_SHIFT_MASK)) { hangul_input_state_toggle(); return TRUE; --- 516,530 ---- int i; int modifiers; int key; + guint state; key_sym = event->keyval; len = event->length; + state = event->state; g_assert(len <= sizeof(string)); #ifdef HANGUL_INPUT ! if (event->keyval == GDK_space && (state & GDK_SHIFT_MASK)) { hangul_input_state_toggle(); return TRUE; *************** *** 529,536 **** if (key_sym == GDK_ISO_Left_Tab) key_sym = GDK_Tab; ! if ((key_sym == GDK_2 || key_sym == GDK_at) ! && (event->state & GDK_CONTROL_MASK)) { string[0] = NUL; /* CTRL-2 and CTRL-@ is NUL */ len = 1; --- 538,544 ---- if (key_sym == GDK_ISO_Left_Tab) key_sym = GDK_Tab; ! if ((key_sym == GDK_2 || key_sym == GDK_at) && (state & GDK_CONTROL_MASK)) { string[0] = NUL; /* CTRL-2 and CTRL-@ is NUL */ len = 1; *************** *** 546,552 **** #ifdef WANT_MENU /* If there is a menu and 'wak' is "yes", or 'wak' is "menu" and the key * is a menu shortcut, we ignore everything with the ALT modifier. */ ! if ((event->state & GDK_MOD1_MASK) && gui.menu_is_active && (*p_wak == 'y' || (*p_wak == 'm' --- 554,560 ---- #ifdef WANT_MENU /* If there is a menu and 'wak' is "yes", or 'wak' is "menu" and the key * is a menu shortcut, we ignore everything with the ALT modifier. */ ! if ((state & GDK_MOD1_MASK) && gui.menu_is_active && (*p_wak == 'y' || (*p_wak == 'm' *************** *** 556,566 **** #endif /* Check for Alt/Meta key (Mod1Mask) */ ! if (len == 1 && (event->state & GDK_MOD1_MASK) && !(key_sym == GDK_BackSpace || key_sym == GDK_Delete)) { /* Don't do this for , that should become K_S_TAB with ALT. */ ! if (!(key_sym == GDK_Tab && (event->state & GDK_SHIFT_MASK))) string[0] |= 0x80; } /* Check for special keys, making sure BS and DEL are recognised. */ --- 564,577 ---- #endif /* Check for Alt/Meta key (Mod1Mask) */ ! if (len == 1 && (state & GDK_MOD1_MASK) && !(key_sym == GDK_BackSpace || key_sym == GDK_Delete)) { /* Don't do this for , that should become K_S_TAB with ALT. */ ! if (!(key_sym == GDK_Tab && (state & GDK_SHIFT_MASK))) ! { string[0] |= 0x80; + state &= ~GDK_MOD1_MASK; /* don't use it again */ + } } /* Check for special keys, making sure BS and DEL are recognised. */ *************** *** 584,594 **** key_sym == GDK_Return || key_sym == GDK_Linefeed || key_sym == GDK_Escape) { modifiers = 0; ! if (event->state & GDK_SHIFT_MASK) modifiers |= MOD_MASK_SHIFT; ! if (event->state & GDK_CONTROL_MASK) modifiers |= MOD_MASK_CTRL; ! if (event->state & GDK_MOD1_MASK) modifiers |= MOD_MASK_ALT; #if defined(USE_XIM) && defined(MULTI_BYTE) /* It seems GDK returns GDK_VoidSymbol if the len is 3 and it --- 595,605 ---- key_sym == GDK_Return || key_sym == GDK_Linefeed || key_sym == GDK_Escape) { modifiers = 0; ! if (state & GDK_SHIFT_MASK) modifiers |= MOD_MASK_SHIFT; ! if (state & GDK_CONTROL_MASK) modifiers |= MOD_MASK_CTRL; ! if (state & GDK_MOD1_MASK) modifiers |= MOD_MASK_ALT; #if defined(USE_XIM) && defined(MULTI_BYTE) /* It seems GDK returns GDK_VoidSymbol if the len is 3 and it *************** *** 631,636 **** --- 642,656 ---- trash_input_buf(); got_int = TRUE; } + + if (len == 1 && string[0] == CSI) + { + /* Turn CSI into K_CSI. */ + string[1] = KS_EXTRA; + string[2] = KE_CSI; + len = 3; + } + add_to_input_buf(string, len); /* blank out the pointer if necessary */ *************** *** 670,678 **** static void selection_received_event(GtkWidget * widget, GtkSelectionData * data) { ! int motion_type; ! long_u len; ! char_u *p; if ((!data->data) || (data->length <= 0)) { received_selection = RS_FAIL; --- 690,699 ---- static void selection_received_event(GtkWidget * widget, GtkSelectionData * data) { ! int motion_type; ! long_u len; ! char_u *p; ! int free_p = FALSE; if ((!data->data) || (data->length <= 0)) { received_selection = RS_FAIL; *************** *** 684,691 **** } motion_type = MCHAR; ! p = (char_u *) data->data; ! len = data->length; if (data->type == clipboard.atom) { motion_type = *p++; --- 705,734 ---- } motion_type = MCHAR; ! if (data->type == gdk_atom_intern("COMPOUND_TEXT", FALSE) ! || data->type == gdk_atom_intern("TEXT", FALSE)) ! { ! int count, i; ! char **list; ! GString *str = g_string_new(NULL); ! ! count = gdk_text_property_to_text_list(data->type, data->format, ! data->data, data->length, &list); ! len = 0; ! for (i = 0; i < count; i++) ! g_string_append(str, list[i]); ! ! p = (char_u *)str->str; ! len = str->len; ! g_string_free(str, FALSE); ! gdk_free_text_list(list); ! free_p = TRUE; ! } ! else ! { ! p = (char_u *)data->data; ! len = data->length; ! } if (data->type == clipboard.atom) { motion_type = *p++; *************** *** 695,700 **** --- 738,746 ---- received_selection = RS_OK; if (gtk_main_level() > 0) gtk_main_quit(); + + if (free_p) + g_free(p); } #ifdef GTK_HAVE_FEATURES_1_1_4 *************** *** 719,725 **** if (!clipboard.owned) return; /* Shouldn't ever happen */ ! if (info != SELECTION_STRING && info != SELECTION_CLIPBOARD) return; clip_get_selection(); --- 765,772 ---- if (!clipboard.owned) return; /* Shouldn't ever happen */ ! if (info != SELECTION_STRING && info != SELECTION_CLIPBOARD ! && info != SELECTION_COMPOUND_TEXT && info != SELECTION_TEXT) return; clip_get_selection(); *************** *** 746,751 **** --- 793,816 ---- mch_memmove(result + 1, string, (size_t)(length - 1)); type = clipboard.atom; } + else if (info == SELECTION_COMPOUND_TEXT || info == SELECTION_TEXT) + { + char *str; + gint format, new_len; + + vim_free(result); + str = g_new(char, length + 1); + mch_memmove(str, string, (size_t) length); + vim_free(string); + str[length] = '\0'; + gdk_string_to_compound_text(str, &type, &format, &result, &new_len); + g_free(str); + selection_data->type = type; + selection_data->format = format; + gtk_selection_data_set(selection_data, type, format, result, new_len); + gdk_free_compound_text(result); + return; + } else { mch_memmove(result, string, (size_t)length); *************** *** 1156,1162 **** gdk_window_get_pointer(NULL, NULL, NULL, ¤t_modifiers); /* guard against trash */ ! if (((data->length <= 0) && (data->format != 8)) || (((char *)data->data)[data->length] != '\0')) { gtk_drag_finish(context, FALSE, FALSE, time); --- 1221,1228 ---- gdk_window_get_pointer(NULL, NULL, NULL, ¤t_modifiers); /* guard against trash */ ! if ((data->length <= 0) ! || (data->format != 8) || (((char *)data->data)[data->length] != '\0')) { gtk_drag_finish(context, FALSE, FALSE, time); *************** *** 1255,1260 **** --- 1321,1368 ---- } #endif /* GTK_DND */ + #if 0 + /* Not used yet, because I don't know how to catch the WM_SAVE_YOURSELF event. + */ + /* + * Setup the WM_PROTOCOLS to indicate we want the WM_SAVE_YOURSELF event. + * This is an ugly use of X functions. GTK doesn't offer an alternative. + */ + static void + setup_save_yourself(void) + { + Atom *existing; + Atom *new; + int count; + int i; + + /* first get the existing value */ + if (XGetWMProtocols(GDK_DISPLAY(), + GDK_WINDOW_XWINDOW(gui.mainwin->window), &existing, &count)) + { + /* check if WM_SAVE_YOURSELF isn't there yet */ + for (i = 0; i < count; ++i) + if (existing[i] == save_yourself_atom) + break; + if (i == count) + { + /* allocate an Atoms array which is one item longer */ + new = (Atom *)alloc((count + 1) * sizeof(Atom)); + if (new != NULL) + { + for (i = 0; i < count; ++i) + new[i] = existing[i]; + new[count] = save_yourself_atom; + XSetWMProtocols(GDK_DISPLAY(), + GDK_WINDOW_XWINDOW(gui.mainwin->window), new, count + 1); + vim_free(new); + } + } + XFree(existing); + } + } + #endif + /* * Setup the window icon after the main window has bee realized. */ *************** *** 1272,1277 **** --- 1380,1391 ---- icon = gdk_pixmap_create_from_xpm_d(gui.mainwin->window, &icon_mask, NULL, magick); gdk_window_set_icon(gui.mainwin->window, NULL, icon, icon_mask); + #if 0 + + /* Setup to indicate to the window manager that we want to catch the + * WM_SAVE_YOURSELF event. */ + setup_save_yourself(); + #endif } /* *************** *** 1327,1332 **** --- 1441,1454 ---- return TRUE; } + #define VIM_ATOM_NAME "_VIM_TEXT" + static const GtkTargetEntry primary_targets[] = { + {VIM_ATOM_NAME, 0, SELECTION_CLIPBOARD}, + {"STRING", 0, SELECTION_STRING}, + {"TEXT", 0, SELECTION_TEXT}, + {"COMPOUND_TEXT", 0, SELECTION_COMPOUND_TEXT} + }; + /* * Initialise the X GUI. Create all the windows, set up all the call-backs etc. * Returns OK for success, FAIL when the GUI can't be started. *************** *** 1443,1449 **** gui.def_back_pixel = gui.back_pixel; } gui.visibility = GDK_VISIBILITY_UNOBSCURED; ! clipboard.atom = gdk_atom_intern("_VIM_TEXT", FALSE); save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE); reread_rcfiles_atom = gdk_atom_intern("_GTK_READ_RCFILES", FALSE); --- 1565,1571 ---- gui.def_back_pixel = gui.back_pixel; } gui.visibility = GDK_VISIBILITY_UNOBSCURED; ! clipboard.atom = gdk_atom_intern(VIM_ATOM_NAME, FALSE); save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE); reread_rcfiles_atom = gdk_atom_intern("_GTK_READ_RCFILES", FALSE); *************** *** 1492,1501 **** /* gtk_selection_add_target() is not in GTK 1.1.2 */ #ifdef GTK_HAVE_FEATURES_1_1_4 ! gtk_selection_add_target(gui.drawarea, GDK_SELECTION_PRIMARY, ! GDK_TARGET_STRING, SELECTION_STRING); ! gtk_selection_add_target(gui.drawarea, GDK_SELECTION_PRIMARY, ! clipboard.atom, SELECTION_CLIPBOARD); gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get", GTK_SIGNAL_FUNC(selection_get_event), NULL); #else --- 1614,1622 ---- /* gtk_selection_add_target() is not in GTK 1.1.2 */ #ifdef GTK_HAVE_FEATURES_1_1_4 ! gtk_selection_add_targets(gui.drawarea, GDK_SELECTION_PRIMARY, ! primary_targets, ! sizeof(primary_targets)/sizeof(primary_targets[0])); gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get", GTK_SIGNAL_FUNC(selection_get_event), NULL); #else *************** *** 1540,1560 **** #ifdef USE_GEOMETRY_FOR_HINTS GdkGeometry geometry; GdkWindowHints geometry_mask; /* This also needs to be done when the main window isn't there yet, * otherwise the hints don't work. */ width = gui_get_base_width(); height = gui_get_base_height(); ! geometry_mask = GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC|GDK_HINT_MIN_SIZE; ! geometry.width_inc = gui.char_width; ! geometry.height_inc = gui.char_height; ! geometry.base_width = width; ! geometry.base_height = height; ! geometry.min_width = width + MIN_COLUMNS * gui.char_width; ! geometry.min_height = height + MIN_LINES * gui.char_height; ! gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin, ! &geometry, geometry_mask); #else XSizeHints size_hints; --- 1661,1697 ---- #ifdef USE_GEOMETRY_FOR_HINTS GdkGeometry geometry; GdkWindowHints geometry_mask; + static int old_width = 0; + static int old_height = 0; + static int old_char_width = 0; + static int old_char_height = 0; /* This also needs to be done when the main window isn't there yet, * otherwise the hints don't work. */ width = gui_get_base_width(); height = gui_get_base_height(); ! /* Avoid an expose event when the size didn't change. */ ! if (width != old_width ! || height != old_height ! || gui.char_width != old_char_width ! || gui.char_height != old_char_height) ! { ! geometry_mask = ! GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC|GDK_HINT_MIN_SIZE; ! geometry.width_inc = gui.char_width; ! geometry.height_inc = gui.char_height; ! geometry.base_width = width; ! geometry.base_height = height; ! geometry.min_width = width + MIN_COLUMNS * gui.char_width; ! geometry.min_height = height + MIN_LINES * gui.char_height; ! gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin, ! &geometry, geometry_mask); ! old_width = width; ! old_height = height; ! old_char_width = gui.char_width; ! old_char_height = gui.char_height; ! } #else XSizeHints size_hints; *************** *** 1622,1628 **** static gint client_event_cb(GtkWidget *widget, GdkEventClient *event) { ! if (event->message_type == save_yourself_atom ) { out_flush(); ml_sync_all(FALSE, FALSE); /* preserve all swap files */ return TRUE; --- 1759,1766 ---- static gint client_event_cb(GtkWidget *widget, GdkEventClient *event) { ! if (event->message_type == save_yourself_atom) { ! /* NOTE: this is never reached! */ out_flush(); ml_sync_all(FALSE, FALSE); /* preserve all swap files */ return TRUE; *************** *** 1710,1715 **** --- 1848,1854 ---- */ gtk_signal_connect_after(GTK_OBJECT(gui.mainwin), "client_event", GTK_SIGNAL_FUNC(client_event_cb), NULL); + #ifdef HANGUL_INPUT hangul_keyboard_set(); #endif *************** *** 2097,2103 **** if ((sdup = g_strdup((const char *)font_name)) == NULL) return FAIL; ! /* slipt up the whole */ i = 0; for (tmp = sdup; *tmp != '\0'; ++tmp) if (*tmp == '-') --- 2236,2242 ---- if ((sdup = g_strdup((const char *)font_name)) == NULL) return FAIL; ! /* split up the whole */ i = 0; for (tmp = sdup; *tmp != '\0'; ++tmp) if (*tmp == '-') *************** *** 2107,2114 **** ++i; } - g_free(sdup); - if (i == 14) { char *bold_name = NULL; --- 2246,2251 ---- *************** *** 2125,2130 **** --- 2262,2268 ---- vim_free(bold_name); vim_free(ital_name); vim_free(italbold_name); + g_free(sdup); return FAIL; } *************** *** 2182,2187 **** --- 2320,2327 ---- vim_free(ital_name); vim_free(italbold_name); } + + g_free(sdup); } /* Synchronize the fonts used in user input dialogs, since otherwise *************** *** 2483,2489 **** } void ! gui_mch_flash() { GdkGCValues values; GdkGC *invert_gc; --- 2623,2629 ---- } void ! gui_mch_flash(int msec) { GdkGCValues values; GdkGC *invert_gc; *************** *** 2519,2525 **** FILL_Y((int) Rows) + gui.border_offset); gdk_flush(); ! ui_delay(20L, TRUE); /* wait 1/50 of a second */ gdk_draw_rectangle(gui.drawarea->window, invert_gc, TRUE, 0, 0, --- 2659,2665 ---- FILL_Y((int) Rows) + gui.border_offset); gdk_flush(); ! ui_delay((long)msec, TRUE); /* wait so many msec */ gdk_draw_rectangle(gui.drawarea->window, invert_gc, TRUE, 0, 0, diff -crN ../vim-5.6/src/gui_motif.c ./src/gui_motif.c *** ../vim-5.6/src/gui_motif.c Mon Nov 29 20:06:45 1999 --- ./src/gui_motif.c Thu Mar 30 13:44:50 2000 *************** *** 861,871 **** dflt = (char_u *)""; if (initdir == NULL || *initdir == NUL) { - #ifdef VMS - mch_dirname_vms(dirbuf, MAXPATHL); - #else mch_dirname(dirbuf, MAXPATHL); - #endif initdir = dirbuf; } --- 861,867 ---- *************** *** 1000,1007 **** int butcount; static Widget dialogbb = NULL; static Widget dialogmessage = NULL; ! #define MAXBUT 10 ! Widget dialogButton[MAXBUT]; if (title == NULL) title = (char_u *)"Vim dialog"; --- 996,1003 ---- int butcount; static Widget dialogbb = NULL; static Widget dialogmessage = NULL; ! Widget *dialogButton; ! int vertical; if (title == NULL) title = (char_u *)"Vim dialog"; *************** *** 1032,1037 **** --- 1028,1036 ---- NULL); XmStringFree(label); + /* Check 'v' flag in 'guioptions': vertical button placement. */ + vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL); + /* Set the title of the Dialog window */ label = XmStringCreateSimple((char *)title); if (label == NULL) *************** *** 1039,1045 **** XtVaSetValues(dialogbb, XmNdialogTitle, label, XmNhorizontalSpacing, 20, ! XmNverticalSpacing, 20, NULL); XmStringFree(label); --- 1038,1044 ---- XtVaSetValues(dialogbb, XmNdialogTitle, label, XmNhorizontalSpacing, 20, ! XmNverticalSpacing, vertical ? 0 : 20, NULL); XmStringFree(label); *************** *** 1048,1058 **** if (buts == NULL) return -1; /* * Create the buttons. */ p = buts; ! for (butcount = 0; butcount < MAXBUT; ++butcount) { for (next = p; *next; ++next) { --- 1047,1069 ---- if (buts == NULL) return -1; + /* Count the number of buttons and allocate dialogButton[]. */ + butcount = 1; + for (p = buts; *p; ++p) + if (*p == DLG_BUTTON_SEP) + ++butcount; + dialogButton = (Widget *)alloc((unsigned)(butcount * sizeof(Widget))); + if (dialogButton == NULL) + { + vim_free(buts); + return -1; + } + /* * Create the buttons. */ p = buts; ! for (butcount = 0; *p; ++butcount) { for (next = p; *next; ++next) { *************** *** 1075,1104 **** XmNtopWidget, dialogmessage, NULL); XmStringFree(label); ! if (butcount == 0) ! XtVaSetValues(dialogButton[butcount], ! XmNleftAttachment, XmATTACH_FORM, ! NULL); ! else ! XtVaSetValues(dialogButton[butcount], ! XmNleftAttachment, XmATTACH_WIDGET, ! XmNleftWidget, dialogButton[butcount - 1], ! NULL); XtAddCallback(dialogButton[butcount], XmNactivateCallback, butproc, (XtPointer)butcount); - if (*next == NUL) - break; p = next; } - ++butcount; vim_free(buts); if (dfltbutton < 1) dfltbutton = 1; if (dfltbutton > butcount) dfltbutton = butcount; ! XtVaSetValues(dialogbb, XmNdefaultButton, dialogButton[dfltbutton - 1], NULL); XtManageChild(dialogbb); app = XtWidgetToApplicationContext(dialogbb); --- 1086,1116 ---- XmNtopWidget, dialogmessage, NULL); XmStringFree(label); ! if (butcount) ! { ! if (vertical) ! XtVaSetValues(dialogButton[butcount], ! XmNtopWidget, dialogButton[butcount - 1], ! NULL); ! else ! XtVaSetValues(dialogButton[butcount], ! XmNleftAttachment, XmATTACH_WIDGET, ! XmNleftWidget, dialogButton[butcount - 1], ! NULL); ! } XtAddCallback(dialogButton[butcount], XmNactivateCallback, butproc, (XtPointer)butcount); p = next; } vim_free(buts); if (dfltbutton < 1) dfltbutton = 1; if (dfltbutton > butcount) dfltbutton = butcount; ! XtVaSetValues(dialogbb, ! XmNdefaultButton, dialogButton[dfltbutton - 1], NULL); XtManageChild(dialogbb); app = XtWidgetToApplicationContext(dialogbb); *************** *** 1121,1126 **** --- 1133,1140 ---- XtUnmanageChild(dialogButton[butcount]); XtDestroyWidget(dialogButton[butcount]); } + + vim_free(dialogButton); return dialogStatus; } diff -crN ../vim-5.6/src/gui_x11.c ./src/gui_x11.c *** ../vim-5.6/src/gui_x11.c Sun Jan 16 16:26:41 2000 --- ./src/gui_x11.c Fri Jun 23 10:04:24 2000 *************** *** 719,731 **** } if (len == 1 && (string[0] == Ctrl('C') #ifdef UNIX ! || string[0] == intr_char #endif )) { trash_input_buf(); got_int = TRUE; } add_to_input_buf(string, len); #ifdef USE_XIM --- 719,740 ---- } if (len == 1 && (string[0] == Ctrl('C') #ifdef UNIX ! || (intr_char != 0 && string[0] == intr_char) #endif )) { trash_input_buf(); got_int = TRUE; } + + if (len == 1 && string[0] == CSI) + { + /* Turn CSI into K_CSI. */ + string[1] = KS_EXTRA; + string[2] = KE_CSI; + len = 3; + } + add_to_input_buf(string, len); #ifdef USE_XIM *************** *** 1889,1902 **** } void ! gui_mch_flash() { /* Do a visual beep by reversing the foreground and background colors */ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0, FILL_X((int)Columns) + gui.border_offset, FILL_Y((int)Rows) + gui.border_offset); XSync(gui.dpy, False); ! ui_delay(20L, TRUE); /* wait 1/50 of a second */ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0, FILL_X((int)Columns) + gui.border_offset, FILL_Y((int)Rows) + gui.border_offset); --- 1898,1912 ---- } void ! gui_mch_flash(msec) ! int msec; { /* Do a visual beep by reversing the foreground and background colors */ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0, FILL_X((int)Columns) + gui.border_offset, FILL_Y((int)Rows) + gui.border_offset); XSync(gui.dpy, False); ! ui_delay((long)msec, TRUE); /* wait for a few msec */ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0, FILL_X((int)Columns) + gui.border_offset, FILL_Y((int)Rows) + gui.border_offset); *************** *** 2353,2359 **** return; /* ! * SAVE_YOURSELF can arrive at any moment (not only when crashing!). * Just sync our swap files. */ if (((XClientMessageEvent *)event)->data.l[0] == --- 2363,2370 ---- return; /* ! * The WM_SAVE_YOURSELF event arrives when the window manager wants to ! * exit. That can be cancelled though, thus Vim shouldn't exit here. * Just sync our swap files. */ if (((XClientMessageEvent *)event)->data.l[0] == *************** *** 2361,2366 **** --- 2372,2382 ---- { out_flush(); ml_sync_all(FALSE, FALSE); /* preserve all swap files */ + + /* Set the window's WM_COMMAND property, to let the window manager + * know we are done saving ourselves. We don't want to be restarted, + * thus set argv to NULL. */ + XSetCommand(gui.dpy, XtWindow(vimShell), NULL, 0); return; } diff -crN ../vim-5.6/src/if_perl.xs ./src/if_perl.xs *** ../vim-5.6/src/if_perl.xs Wed Mar 10 21:09:06 1999 --- ./src/if_perl.xs Thu May 11 10:04:21 2000 *************** *** 34,39 **** --- 34,40 ---- #ifdef MIN # undef MIN #endif + #include #include #include *************** *** 472,478 **** else { char_u *pat; ! int len; pat = (char_u *)SvPV(sv, len); ++emsg_off; --- 473,479 ---- else { char_u *pat; ! STRLEN len; pat = (char_u *)SvPV(sv, len); ++emsg_off; diff -crN ../vim-5.6/src/if_tcl.c ./src/if_tcl.c *** ../vim-5.6/src/if_tcl.c Sun Sep 5 20:17:21 1999 --- ./src/if_tcl.c Wed Jun 7 15:04:50 2000 *************** *** 8,14 **** /* * Tcl extensions by Ingo Wilken ! * Last modification: Fri Mar 27 22:41:25 CET 1998 * Requires Tcl 8.0 or higher. * * Variables: --- 8,14 ---- /* * Tcl extensions by Ingo Wilken ! * Last modification: Wed May 10 21:28:44 CEST 2000 * Requires Tcl 8.0 or higher. * * Variables: *************** *** 70,84 **** #include #include ! static struct ! { Tcl_Interp *interp; ! unsigned int refcount; ! unsigned do_exit:1; ! unsigned valid:1; ! int range_start, range_end, lbase; char *curbuf, *curwin; ! } tcl = {(Tcl_Interp *)NULL, 0, 0, 0}; #define VAR_RANGE1 "::vim::range(start)" #define VAR_RANGE2 "::vim::range(begin)" --- 70,83 ---- #include #include ! typedef struct { Tcl_Interp *interp; ! int range_start, range_end; ! int lbase; char *curbuf, *curwin; ! } tcl_info; ! ! static tcl_info tclinfo = { NULL, 0, 0, 0, NULL, NULL }; #define VAR_RANGE1 "::vim::range(start)" #define VAR_RANGE2 "::vim::range(begin)" *************** *** 90,99 **** #define VAR_CURLNUM "lnum" #define VARNAME_SIZE 64 ! #define row2tcl(x) ((x) - (tcl.lbase==0)) ! #define row2vim(x) ((x) + (tcl.lbase==0)) ! #define col2tcl(x) ((x) + (tcl.lbase!=0)) ! #define col2vim(x) ((x) - (tcl.lbase!=0)) #define VIMOUT ((ClientData)1) --- 89,98 ---- #define VAR_CURLNUM "lnum" #define VARNAME_SIZE 64 ! #define row2tcl(x) ((x) - (tclinfo.lbase==0)) ! #define row2vim(x) ((x) + (tclinfo.lbase==0)) ! #define col2tcl(x) ((x) + (tclinfo.lbase!=0)) ! #define col2vim(x) ((x) - (tclinfo.lbase!=0)) #define VIMOUT ((ClientData)1) *************** *** 122,127 **** --- 121,127 ---- static int tcldoexcommand _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn)); static int tclsetoption _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn)); static int tclvimexpr _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn)); + static void tcldelthisinterp _ANSI_ARGS_ ((void)); static int vimerror _ANSI_ARGS_((Tcl_Interp *interp)); static void tclmsg _ANSI_ARGS_((char *text)); *************** *** 135,144 **** ****************************************************************************/ /* ! * "exit" - replaces Tcl's standard "exit" command. ! * Unfortunately, this is one of Tcl's design flaws - "exit" should have ! * been implemented as returning TCL_EXIT to the application. */ /* ARGSUSED */ static int exitcmd(dummy, interp, objc, objv) --- 135,150 ---- ****************************************************************************/ /* ! * Replace standard "exit" and "catch" commands. ! * ! * This is a design flaw in Tcl - the standard "exit" command just calls ! * exit() and kills the application. It should return TCL_EXIT to the ! * app, which then decides if it wants to terminate or not. In our case, ! * we just delete the Tcl interpreter (and create a new one with the next ! * :tcl command). */ + #define TCL_EXIT 5 + /* ARGSUSED */ static int exitcmd(dummy, interp, objc, objv) *************** *** 148,171 **** Tcl_Obj *CONST objv[]; { int value = 0; - char buf[32]; switch (objc) { case 2: if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) break; case 1: ! sprintf(buf, "exit code %d", value); ! Tcl_SetResult(interp, buf, TCL_VOLATILE); ! tcl.do_exit = 1; ! break; default: Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?"); } return TCL_ERROR; } /* * "::vim::beep" - what Vi[m] does best :-) */ --- 154,213 ---- Tcl_Obj *CONST objv[]; { int value = 0; switch (objc) { case 2: if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) break; + /* FALLTHROUGH */ case 1: ! Tcl_SetObjResult(interp, Tcl_NewIntObj(value)); ! return TCL_EXIT; default: Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?"); } return TCL_ERROR; } + /* ARGSUSED */ + static int + catchcmd(dummy, interp, objc, objv) + ClientData dummy; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; + { + char *varname = NULL; + int result; + + switch (objc) + { + case 3: + varname = Tcl_GetStringFromObj(objv[2], NULL); + /* fallthrough */ + case 2: + Tcl_ResetResult(interp); + Tcl_AllowExceptions(interp); + result = Tcl_EvalObj(interp, objv[1]); + if (result == TCL_EXIT) + return result; + if (varname) + { + if (Tcl_SetVar(interp, varname, Tcl_GetStringResult(interp), 0) == NULL) + { + Tcl_SetResult(interp, "couldn't save command result in variable", TCL_STATIC); + return TCL_ERROR; + } + } + Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); + return TCL_OK; + default: + Tcl_WrongNumArgs(interp, 1, objv, "command ?varName?"); + } + return TCL_ERROR; + } + /* * "::vim::beep" - what Vi[m] does best :-) */ *************** *** 1069,1075 **** Tcl_Obj *CONST objv[]; int objn; { ! int save1, save2, save3; int err, flag, nobjs; char *arg; --- 1111,1117 ---- Tcl_Obj *CONST objv[]; int objn; { ! tcl_info saveinfo; int err, flag, nobjs; char *arg; *************** *** 1095,1103 **** ++objn; } ! save1 = tcl.range_start; ! save2 = tcl.range_end; ! save3 = tcl.lbase; arg = Tcl_GetStringFromObj(objv[objn], NULL); if (flag) --- 1137,1146 ---- ++objn; } ! memcpy(&saveinfo, &tclinfo, sizeof(tcl_info)); ! tclinfo.interp = NULL; ! tclinfo.curwin = NULL; ! tclinfo.curbuf = NULL; arg = Tcl_GetStringFromObj(objv[objn], NULL); if (flag) *************** *** 1107,1115 **** --emsg_off; err = vimerror(interp); ! tcl.range_start = save1; ! tcl.range_end = save2; ! tcl.lbase = save3; tclupdatevars(); return err; --- 1150,1159 ---- --emsg_off; err = vimerror(interp); ! /* If the ex command created a new Tcl interpreter, remove it */ ! if (tclinfo.interp) ! tcldelthisinterp(); ! memcpy(&tclinfo, &saveinfo, sizeof(tcl_info)); tclupdatevars(); return err; *************** *** 1319,1326 **** return NULL; } #endif } ! sprintf(name, "::vim::%s_%lx", prefix, (long)vimobj); cmd = Tcl_CreateObjCommand(interp, name, proc, (ClientData)ref, (Tcl_CmdDeleteProc *)delref); if (!cmd) --- 1363,1375 ---- return NULL; } #endif + ref->interp = NULL; + ref->next = (struct ref *)(*refstartP); + (*refstartP) = (void *)ref; } ! ! /* This might break on some exotic systems... */ ! sprintf(name, "::vim::%s_%lx", prefix, (unsigned long)vimobj); cmd = Tcl_CreateObjCommand(interp, name, proc, (ClientData)ref, (Tcl_CmdDeleteProc *)delref); if (!cmd) *************** *** 1330,1337 **** ref->cmd = cmd; ref->delcmd = NULL; ref->vimobj = vimobj; - ref->next = (struct ref *)(*refstartP); - (*refstartP) = (void *)ref; } return name; } --- 1379,1384 ---- *************** *** 1378,1384 **** reflist = reflist->next; } /* This should never happen. Famous last word? */ ! Tcl_SetResult(interp, "TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org", TCL_STATIC); return TCL_ERROR; } --- 1425,1432 ---- reflist = reflist->next; } /* This should never happen. Famous last word? */ ! EMSG("TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"); ! Tcl_SetResult(interp, "cannot register callback command: buffer/window reference not found", TCL_STATIC); return TCL_ERROR; } *************** *** 1508,1628 **** char *name; strcpy(varname, VAR_RANGE1); ! Tcl_UpdateLinkedVar(tcl.interp, varname); strcpy(varname, VAR_RANGE2); ! Tcl_UpdateLinkedVar(tcl.interp, varname); strcpy(varname, VAR_RANGE3); ! Tcl_UpdateLinkedVar(tcl.interp, varname); strcpy(varname, VAR_LBASE); ! Tcl_UpdateLinkedVar(tcl.interp, varname); ! name = tclgetbuffer(tcl.interp, curbuf); ! strcpy(tcl.curbuf, name); strcpy(varname, VAR_CURBUF); ! Tcl_UpdateLinkedVar(tcl.interp, varname); ! name = tclgetwindow(tcl.interp, curwin); ! strcpy(tcl.curwin, name); strcpy(varname, VAR_CURWIN); ! Tcl_UpdateLinkedVar(tcl.interp, varname); } ! static void tclinit(eap) EXARG *eap; { ! char varname[VARNAME_SIZE]; /* must be writeable memory */ char *name; ! if (!tcl.valid) { ! static Tcl_ChannelType ct1, ct2; ! Tcl_Channel ch1, ch2; ! tcl.interp = Tcl_CreateInterp(); ! if (Tcl_Init(tcl.interp) == TCL_ERROR) ! return; ! tcl.do_exit = 0; #if 0 /* VIM sure is interactive */ ! Tcl_SetVar(tcl.interp, "tcl_interactive", "1", TCL_GLOBAL_ONLY); #endif ! /* replace stdout and stderr */ ! ct1 = channel_type; ! ch1 = Tcl_CreateChannel(&ct1, "vimout", VIMOUT, TCL_WRITABLE); ! Tcl_RegisterChannel(tcl.interp, ch1); ! Tcl_SetStdChannel(ch1, TCL_STDOUT); ! Tcl_SetChannelOption(tcl.interp, ch1, "-buffering", "line"); ! ct2 = channel_type; ! ch2 = Tcl_CreateChannel(&ct2, "vimerr", VIMERR, TCL_WRITABLE); ! Tcl_RegisterChannel(tcl.interp, ch2); ! Tcl_SetStdChannel(ch2, TCL_STDERR); ! Tcl_SetChannelOption(tcl.interp, ch2, "-buffering", "line"); /* replace some standard Tcl commands */ ! Tcl_DeleteCommand(tcl.interp, "exit"); ! Tcl_CreateObjCommand(tcl.interp, "exit", exitcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); /* new commands, in ::vim namespace */ ! Tcl_CreateObjCommand(tcl.interp, "::vim::buffer", buffercmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(tcl.interp, "::vim::window", windowcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(tcl.interp, "::vim::command", commandcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(tcl.interp, "::vim::beep", beepcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(tcl.interp, "::vim::option", optioncmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(tcl.interp, "::vim::expr", exprcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); /* "lbase" variable */ ! tcl.lbase = 1; strcpy(varname, VAR_LBASE); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.lbase, TCL_LINK_INT); /* "range" variable */ ! tcl.range_start = eap->line1; strcpy(varname, VAR_RANGE1); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY); strcpy(varname, VAR_RANGE2); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY); ! tcl.range_end = eap->line2; strcpy(varname, VAR_RANGE3); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.range_end, TCL_LINK_INT|TCL_LINK_READ_ONLY); /* "current" variable */ ! tcl.curbuf = Tcl_Alloc(VARNAME_SIZE); ! tcl.curwin = Tcl_Alloc(VARNAME_SIZE); ! name = tclgetbuffer(tcl.interp, curbuf); ! strcpy(tcl.curbuf, name); strcpy(varname, VAR_CURBUF); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.curbuf, TCL_LINK_STRING|TCL_LINK_READ_ONLY); ! name = tclgetwindow(tcl.interp, curwin); ! strcpy(tcl.curwin, name); strcpy(varname, VAR_CURWIN); ! Tcl_LinkVar(tcl.interp, varname, (char *)&tcl.curwin, TCL_LINK_STRING|TCL_LINK_READ_ONLY); ! tcl.valid = 1; } else { /* Interpreter already exists, just update variables */ ! tcl.range_start = row2tcl(eap->line1); ! tcl.range_end = row2tcl(eap->line2); tclupdatevars(); } ! ! Tcl_Preserve(tcl.interp); /* protect interpreter from deletion */ ! ++tcl.refcount; } ! static void tclerrmsg(text) char *text; { --- 1556,1678 ---- char *name; strcpy(varname, VAR_RANGE1); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); strcpy(varname, VAR_RANGE2); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); strcpy(varname, VAR_RANGE3); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); strcpy(varname, VAR_LBASE); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); ! name = tclgetbuffer(tclinfo.interp, curbuf); ! strcpy(tclinfo.curbuf, name); strcpy(varname, VAR_CURBUF); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); ! name = tclgetwindow(tclinfo.interp, curwin); ! strcpy(tclinfo.curwin, name); strcpy(varname, VAR_CURWIN); ! Tcl_UpdateLinkedVar(tclinfo.interp, varname); } ! static int tclinit(eap) EXARG *eap; { ! char varname[VARNAME_SIZE]; /* Tcl_LinkVar requires writeable varname */ char *name; ! if (!tclinfo.interp) { ! Tcl_Interp *interp; ! static Tcl_Channel ch1, ch2; ! ! /* replace stdout and stderr */ ! ch1 = Tcl_CreateChannel(&channel_type, "vimout", VIMOUT, TCL_WRITABLE); ! ch2 = Tcl_CreateChannel(&channel_type, "vimerr", VIMERR, TCL_WRITABLE); ! Tcl_SetStdChannel(ch1, TCL_STDOUT); ! Tcl_SetStdChannel(ch2, TCL_STDERR); ! interp = Tcl_CreateInterp(); ! Tcl_Preserve(interp); ! if (Tcl_Init(interp) == TCL_ERROR) ! { ! Tcl_Release(interp); ! Tcl_DeleteInterp(interp); ! return FAIL; ! } #if 0 /* VIM sure is interactive */ ! Tcl_SetVar(interp, "tcl_interactive", "1", TCL_GLOBAL_ONLY); #endif ! Tcl_SetChannelOption(interp, ch1, "-buffering", "line"); ! Tcl_SetChannelOption(interp, ch2, "-buffering", "line"); /* replace some standard Tcl commands */ ! Tcl_DeleteCommand(interp, "exit"); ! Tcl_CreateObjCommand(interp, "exit", exitcmd, ! (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_DeleteCommand(interp, "catch"); ! Tcl_CreateObjCommand(interp, "catch", catchcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); /* new commands, in ::vim namespace */ ! Tcl_CreateObjCommand(interp, "::vim::buffer", buffercmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(interp, "::vim::window", windowcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(interp, "::vim::command", commandcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(interp, "::vim::beep", beepcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(interp, "::vim::option", optioncmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); ! Tcl_CreateObjCommand(interp, "::vim::expr", exprcmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); /* "lbase" variable */ ! tclinfo.lbase = 1; strcpy(varname, VAR_LBASE); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.lbase, TCL_LINK_INT); /* "range" variable */ ! tclinfo.range_start = eap->line1; strcpy(varname, VAR_RANGE1); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY); strcpy(varname, VAR_RANGE2); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY); ! tclinfo.range_end = eap->line2; strcpy(varname, VAR_RANGE3); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_end, TCL_LINK_INT|TCL_LINK_READ_ONLY); /* "current" variable */ ! tclinfo.curbuf = Tcl_Alloc(VARNAME_SIZE); ! tclinfo.curwin = Tcl_Alloc(VARNAME_SIZE); ! name = tclgetbuffer(interp, curbuf); ! strcpy(tclinfo.curbuf, name); strcpy(varname, VAR_CURBUF); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.curbuf, TCL_LINK_STRING|TCL_LINK_READ_ONLY); ! name = tclgetwindow(interp, curwin); ! strcpy(tclinfo.curwin, name); strcpy(varname, VAR_CURWIN); ! Tcl_LinkVar(interp, varname, (char *)&tclinfo.curwin, TCL_LINK_STRING|TCL_LINK_READ_ONLY); ! tclinfo.interp = interp; } else { /* Interpreter already exists, just update variables */ ! tclinfo.range_start = row2tcl(eap->line1); ! tclinfo.range_end = row2tcl(eap->line2); tclupdatevars(); } ! return OK; } ! static void tclerrmsg(text) char *text; { *************** *** 1654,1687 **** MSG(text); } static int tclexit(error) int error; { ! int newerr; ! char *result; ! result = Tcl_GetStringResult(tcl.interp); ! if (error == TCL_OK) { ! tclmsg(result); ! newerr = OK; } else { ! tclerrmsg(result); ! newerr = FAIL; ! } ! if (--tcl.refcount == 0 && tcl.do_exit) ! { ! if (!Tcl_InterpDeleted(tcl.interp)) ! Tcl_DeleteInterp(tcl.interp); ! Tcl_Free(tcl.curbuf); ! Tcl_Free(tcl.curwin); ! tcl.valid = 0; ! /* TODO: should call Tcl_UnlinkVar */ } - Tcl_Release(tcl.interp); return newerr; } --- 1704,1781 ---- MSG(text); } + + static void + tcldelthisinterp() + { + if (!Tcl_InterpDeleted(tclinfo.interp)) + Tcl_DeleteInterp(tclinfo.interp); + Tcl_Release(tclinfo.interp); + /* The interpreter is now gets deleted. All registered commands (esp. + * window and buffer commands) are deleted, triggering their deletion + * callback, which deletes all refs pointing to this interpreter. + * We could garbage-collect the unused ref structs in all windows and + * buffers, but unless the user creates hundreds of sub-interpreters + * all refering to lots of windows and buffers, this is hardly worth + * the effort. Unused refs are recycled by other interpreters, and + * all refs are free'd when the window/buffer gets closed by vim. + */ + + tclinfo.interp = NULL; + Tcl_Free(tclinfo.curbuf); + Tcl_Free(tclinfo.curwin); + tclinfo.curbuf = tclinfo.curwin = NULL; + } + static int tclexit(error) int error; { ! int newerr = OK; ! if (error == TCL_EXIT ) { ! int retval; ! char buf[32]; ! Tcl_Obj *robj; ! ! robj = Tcl_GetObjResult(tclinfo.interp); ! if( Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK ) ! { ! EMSG("TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"); ! newerr = FAIL; ! } ! else ! { ! sprintf(buf, "exit code %d", retval); ! tclerrmsg(buf); ! if (retval == 0 ) ! { ! did_emsg = 0; ! newerr = OK; ! } ! else ! newerr = FAIL; ! } ! ! tcldelthisinterp(); } else { ! char *result; ! ! result = Tcl_GetStringResult(tclinfo.interp); ! if (error == TCL_OK) ! { ! tclmsg(result); ! newerr = OK; ! } ! else ! { ! tclerrmsg(result); ! newerr = FAIL; ! } } return newerr; } *************** *** 1693,1701 **** char *script = (char *)eap->arg; int err; ! tclinit(eap); ! err = Tcl_Eval(tcl.interp, script); ! return tclexit(err); } int --- 1787,1800 ---- char *script = (char *)eap->arg; int err; ! err = tclinit(eap); ! if (err == OK) ! { ! Tcl_AllowExceptions(tclinfo.interp); ! err = Tcl_Eval(tclinfo.interp, script); ! err = tclexit(err); ! } ! return err; } int *************** *** 1705,1713 **** char *file = (char *)eap->arg; int err; ! tclinit(eap); ! err = Tcl_EvalFile(tcl.interp, file); ! return tclexit(err); } int --- 1804,1817 ---- char *file = (char *)eap->arg; int err; ! err = tclinit(eap); ! if (err == OK) ! { ! Tcl_AllowExceptions(tclinfo.interp); ! err = Tcl_EvalFile(tclinfo.interp, file); ! err = tclexit(err); ! } ! return err; } int *************** *** 1725,1738 **** strcpy(var_lnum, VAR_CURLNUM); strcpy(var_line, VAR_CURLINE); ! tclinit(eap); lnum = row2tcl(rs); ! Tcl_LinkVar(tcl.interp, var_lnum, (char *)&lnum, TCL_LINK_INT|TCL_LINK_READ_ONLY); err = TCL_OK; if (u_save((linenr_t)(rs-1), (linenr_t)(re+1)) != OK) { ! Tcl_SetResult(tcl.interp, "cannot save undo information", TCL_STATIC); err = TCL_ERROR; } while (err == TCL_OK && rs <= re) --- 1829,1844 ---- strcpy(var_lnum, VAR_CURLNUM); strcpy(var_line, VAR_CURLINE); ! err = tclinit(eap); ! if (err != OK) ! return err; lnum = row2tcl(rs); ! Tcl_LinkVar(tclinfo.interp, var_lnum, (char *)&lnum, TCL_LINK_INT|TCL_LINK_READ_ONLY); err = TCL_OK; if (u_save((linenr_t)(rs-1), (linenr_t)(re+1)) != OK) { ! Tcl_SetResult(tclinfo.interp, "cannot save undo information", TCL_STATIC); err = TCL_ERROR; } while (err == TCL_OK && rs <= re) *************** *** 1740,1759 **** line = (char *)ml_get_buf(curbuf, (linenr_t)rs, FALSE); if (!line) { ! Tcl_SetResult(tcl.interp, "cannot get line", TCL_STATIC); err = TCL_ERROR; break; } ! Tcl_SetVar(tcl.interp, var_line, line, 0); ! err = Tcl_Eval(tcl.interp, script); if (err != TCL_OK) break; ! line = Tcl_GetVar(tcl.interp, var_line, 0); if (line) { if (ml_replace((linenr_t)rs, (char_u *)line, TRUE) != OK) { ! Tcl_SetResult(tcl.interp, "cannot replace line", TCL_STATIC); err = TCL_ERROR; break; } --- 1846,1866 ---- line = (char *)ml_get_buf(curbuf, (linenr_t)rs, FALSE); if (!line) { ! Tcl_SetResult(tclinfo.interp, "cannot get line", TCL_STATIC); err = TCL_ERROR; break; } ! Tcl_SetVar(tclinfo.interp, var_line, line, 0); ! Tcl_AllowExceptions(tclinfo.interp); ! err = Tcl_Eval(tclinfo.interp, script); if (err != TCL_OK) break; ! line = Tcl_GetVar(tclinfo.interp, var_line, 0); if (line) { if (ml_replace((linenr_t)rs, (char_u *)line, TRUE) != OK) { ! Tcl_SetResult(tclinfo.interp, "cannot replace line", TCL_STATIC); err = TCL_ERROR; break; } *************** *** 1764,1780 **** } ++rs; ++lnum; ! Tcl_UpdateLinkedVar(tcl.interp, var_lnum); } update_curbuf(NOT_VALID); ! Tcl_UnsetVar(tcl.interp, var_line, 0); ! Tcl_UnlinkVar(tcl.interp, var_lnum); if (err == TCL_OK) ! Tcl_ResetResult(tcl.interp); return tclexit(err); } static void tcldelallrefs(ref) --- 1871,1888 ---- } ++rs; ++lnum; ! Tcl_UpdateLinkedVar(tclinfo.interp, var_lnum); } update_curbuf(NOT_VALID); ! Tcl_UnsetVar(tclinfo.interp, var_line, 0); ! Tcl_UnlinkVar(tclinfo.interp, var_lnum); if (err == TCL_OK) ! Tcl_ResetResult(tclinfo.interp); return tclexit(err); } + static void tcldelallrefs(ref) diff -crN ../vim-5.6/src/keymap.h ./src/keymap.h *** ../vim-5.6/src/keymap.h Thu Sep 9 17:06:35 1999 --- ./src/keymap.h Sun Apr 16 11:24:45 2000 *************** *** 203,209 **** KE_S_XF4, KE_MOUSEDOWN, /* scroll wheel pseudo-button Down */ ! KE_MOUSEUP /* scroll wheel pseudo-button Up */ }; /* --- 203,214 ---- KE_S_XF4, KE_MOUSEDOWN, /* scroll wheel pseudo-button Down */ ! KE_MOUSEUP, /* scroll wheel pseudo-button Up */ ! ! KE_KINS, /* keypad Insert key */ ! KE_KDEL, /* keypad Delete key */ ! ! KE_CSI /* CSI typed directly */ }; /* *************** *** 320,326 **** --- 325,333 ---- #define K_BS TERMCAP2KEY('k', 'b') #define K_INS TERMCAP2KEY('k', 'I') + #define K_KINS TERMCAP2KEY(KS_EXTRA, KE_KINS) #define K_DEL TERMCAP2KEY('k', 'D') + #define K_KDEL TERMCAP2KEY(KS_EXTRA, KE_KDEL) #define K_HOME TERMCAP2KEY('k', 'h') #define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */ #define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME) *************** *** 345,350 **** --- 352,359 ---- #define K_SELECT TERMCAP2KEY(KS_SELECT, K_FILLER) #define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, K_FILLER) + + #define K_CSI TERMCAP2KEY(KS_EXTRA, KE_CSI) /* * Symbols for pseudo keys which are translated from the real key symbols diff -crN ../vim-5.6/src/main.c ./src/main.c *** ../vim-5.6/src/main.c Thu Jan 13 22:58:37 2000 --- ./src/main.c Tue Jun 20 20:38:10 2000 *************** *** 17,22 **** --- 17,27 ---- # include /* special MSDOS swapping library */ #endif + #ifdef HAVE_TCL + # undef EXTERN /* redefined in tcl.h */ + # include + #endif + #ifdef HAVE_FCNTL_H # include #endif *************** *** 49,55 **** "Too many \"+command\" or \"-c command\" arguments", }; ! #if defined(UNIX) || defined(__EMX__) reset_signals(); /* kill us with CTRL-C here, if you like */ #endif --- 54,60 ---- "Too many \"+command\" or \"-c command\" arguments", }; ! #if defined(UNIX) || defined(__EMX__) || defined(VMS) reset_signals(); /* kill us with CTRL-C here, if you like */ #endif *************** *** 93,99 **** #endif }; ! #if defined(UNIX) || defined(__EMX__) reset_signals(); /* kill us with CTRL-C here, if you like */ #endif --- 98,104 ---- #endif }; ! #if defined(UNIX) || defined(__EMX__) || defined(VMS) reset_signals(); /* kill us with CTRL-C here, if you like */ #endif *************** *** 298,303 **** --- 303,312 ---- __uname_control = __UNAME_NO_PROCESS; #endif + #ifdef HAVE_TCL + Tcl_FindExecutable(argv[0]); + #endif + #ifdef MEM_PROFILE atexit(vim_mem_profile_dump); #endif *************** *** 319,324 **** --- 328,337 ---- gui_prepare(&argc, argv); /* Prepare for possibly starting GUI sometime */ #endif + #if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC) + make_version(); + #endif + /* * Allocate space for the generic buffers (needed for set_init_1() and * EMSG2()). *************** *** 1010,1021 **** */ if (p_exrc) { ! #ifdef UNIX { struct stat s; /* if ".vimrc" file is not owned by user, set 'secure' mode */ ! if (mch_stat(VIMRC_FILE, &s) || s.st_uid != getuid()) secure = p_secure; } #else --- 1023,1041 ---- */ if (p_exrc) { ! #if defined(UNIX) || defined(VMS) { struct stat s; /* if ".vimrc" file is not owned by user, set 'secure' mode */ ! ! if (mch_stat(VIMRC_FILE, &s) || s.st_uid != ! # ifdef UNIX ! getuid() ! # else /* VMS */ ! ((getgid() << 16) | getuid()) ! # endif ! ) secure = p_secure; } #else *************** *** 1042,1052 **** if (i == FAIL) { ! #ifdef UNIX struct stat s; /* if ".exrc" is not owned by user set 'secure' mode */ ! if (mch_stat(EXRC_FILE, &s) || s.st_uid != getuid()) secure = p_secure; else secure = 0; --- 1062,1078 ---- if (i == FAIL) { ! #if defined(UNIX) || defined(VMS) struct stat s; /* if ".exrc" is not owned by user set 'secure' mode */ ! if (mch_stat(EXRC_FILE, &s) || s.st_uid != ! # ifdef UNIX ! getuid() ! # else /* VMS */ ! ((getgid() << 16) | getuid()) ! # endif ! ) secure = p_secure; else secure = 0; *************** *** 1442,1447 **** --- 1468,1478 ---- #if defined(WIN32) && !defined(USE_GUI_WIN32) mch_set_winsize_now(); /* Allow winsize changes from now on */ #endif + + /* If ":startinsert" command used, stuff a dummy command to be able to + * call normal_cmd(), which will then start Insert mode. */ + if (restart_edit) + stuffReadbuff((char_u *)"\034\016"); /* * main command loop diff -crN ../vim-5.6/src/mark.c ./src/mark.c *** ../vim-5.6/src/mark.c Thu Aug 19 22:18:52 1999 --- ./src/mark.c Sat Apr 15 17:38:44 2000 *************** *** 817,827 **** if (name == NULL) continue; ! fprintf(fp, "'%c %ld %ld %s\n", i < NMARKS ? i + 'A' : i - NMARKS + '0', (long)namedfm[i].mark.lnum, ! (long)namedfm[i].mark.col, ! name); if (namedfm[i].fnum) vim_free(name); } --- 817,827 ---- if (name == NULL) continue; ! fprintf(fp, "'%c %ld %ld ", i < NMARKS ? i + 'A' : i - NMARKS + '0', (long)namedfm[i].mark.lnum, ! (long)namedfm[i].mark.col); ! viminfo_writestring(fp, name); if (namedfm[i].fnum) vim_free(name); } *************** *** 902,908 **** buf->b_ffname[0] != NUL && !removable(buf->b_ffname)) { home_replace(NULL, buf->b_ffname, IObuff, IOSIZE, TRUE); ! fprintf(fp_out, "\n> %s\n", (char *)IObuff); if (buf->b_last_cursor.lnum != 0) fprintf(fp_out, "\t\"\t%ld\t%d\n", buf->b_last_cursor.lnum, buf->b_last_cursor.col); --- 902,909 ---- buf->b_ffname[0] != NUL && !removable(buf->b_ffname)) { home_replace(NULL, buf->b_ffname, IObuff, IOSIZE, TRUE); ! fprintf(fp_out, "\n> "); ! viminfo_writestring(fp_out, IObuff); if (buf->b_last_cursor.lnum != 0) fprintf(fp_out, "\t\"\t%ld\t%d\n", buf->b_last_cursor.lnum, buf->b_last_cursor.col); *************** *** 933,939 **** { BUF *buf; int num_marked_files; - char_u save_char; int load_marks; int copy_marks_out; char_u *str; --- 934,939 ---- *************** *** 960,975 **** } /* * Find file name, set str to start. * Ignore leading and trailing white space. */ str = skipwhite(line + 1); p = str + STRLEN(str); while (p != str && (*p == NUL || vim_isspace(*p))) p--; if (*p) p++; - save_char = *p; *p = NUL; /* --- 960,978 ---- } /* + * Handle long line and translate escaped characters. * Find file name, set str to start. * Ignore leading and trailing white space. */ str = skipwhite(line + 1); + str = viminfo_readstring(str, fp_in); + if (str == NULL) + continue; p = str + STRLEN(str); while (p != str && (*p == NUL || vim_isspace(*p))) p--; if (*p) p++; *p = NUL; /* *************** *** 1003,1014 **** if (buf == NULL || !buf->b_marks_read) { copy_marks_out = TRUE; ! *p = save_char; ! fputs("\n", fp_out); ! fputs((char *)line, fp_out); count++; } } while (!(eof = vim_fgets(line, LSIZE, fp_in)) && line[0] == TAB) { if (load_marks) --- 1006,1018 ---- if (buf == NULL || !buf->b_marks_read) { copy_marks_out = TRUE; ! fputs("\n> ", fp_out); ! viminfo_writestring(fp_out, str); count++; } } + vim_free(str); + while (!(eof = vim_fgets(line, LSIZE, fp_in)) && line[0] == TAB) { if (load_marks) diff -crN ../vim-5.6/src/memline.c ./src/memline.c *** ../vim-5.6/src/memline.c Wed Jan 12 11:36:22 2000 --- ./src/memline.c Wed Jun 7 21:08:32 2000 *************** *** 885,897 **** } home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE); ! smsg((char_u *)"Using swap file \"%s\"", NameBuff); if (curbuf->b_ffname == NULL) STRCPY(NameBuff, "No File"); else home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE); ! smsg((char_u *)"Original file \"%s\"", NameBuff); msg_putchar('\n'); /* --- 885,909 ---- } home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE); ! smsg((char_u *)"Using swap file \"%s\"", ! #ifdef VMS ! vms_fixfilename(NameBuff) ! #else ! NameBuff ! #endif ! ); if (curbuf->b_ffname == NULL) STRCPY(NameBuff, "No File"); else home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE); ! smsg((char_u *)"Original file \"%s\"", ! #ifdef VMS ! vms_fixfilename(NameBuff) ! #else ! NameBuff ! #endif ! ); msg_putchar('\n'); /* *************** *** 1196,1205 **** { if (fname == NULL || *fname == NULL) { ! #if defined(VMS) || defined(RISCOS) ! names[0] = vim_strsave((char_u *)"*_sw#"); #else names[0] = vim_strsave((char_u *)"*.sw?"); #endif #ifdef UNIX /* for Unix names starting with a dot are special */ --- 1208,1221 ---- { if (fname == NULL || *fname == NULL) { ! #ifdef VMS ! names[0] = vim_strsave((char_u *)"*_sw%"); #else + # ifdef RISCOS + names[0] = vim_strsave((char_u *)"*_sw#"); + # else names[0] = vim_strsave((char_u *)"*.sw?"); + # endif #endif #ifdef UNIX /* for Unix names starting with a dot are special */ *************** *** 1222,1231 **** { if (fname == NULL || *fname == NULL) { ! #ifdef RISCOS ! names[0] = concat_fnames(dir_name, (char_u *)"*_sw#", TRUE); #else names[0] = concat_fnames(dir_name, (char_u *)"*.sw?", TRUE); #endif #ifdef UNIX /* for Unix names starting with a dot are special */ --- 1238,1251 ---- { if (fname == NULL || *fname == NULL) { ! #ifdef VMS ! names[0] = concat_fnames(dir_name, (char_u *)"*_sw%", TRUE); #else + # ifdef RISCOS + names[0] = concat_fnames(dir_name, (char_u *)"*_sw#", TRUE); + # else names[0] = concat_fnames(dir_name, (char_u *)"*.sw?", TRUE); + # endif #endif #ifdef UNIX /* for Unix names starting with a dot are special */ *************** *** 1233,1244 **** names[2] = concat_fnames(dir_name, (char_u *)".sw?", TRUE); num_names = 3; #else ! #ifdef VMS ! names[1] = concat_fnames(dir_name, (char_u *)".*_sw?", TRUE); num_names = 2; ! #else num_names = 1; ! #endif #endif } else --- 1253,1264 ---- names[2] = concat_fnames(dir_name, (char_u *)".sw?", TRUE); num_names = 3; #else ! # ifdef VMS ! names[1] = concat_fnames(dir_name, (char_u *)".*_sw%", TRUE); num_names = 2; ! # else num_names = 1; ! # endif #endif } else *************** *** 1472,1478 **** if (b0.b0_fname[0] == NUL) MSG_PUTS("[No File]"); else ! msg_outtrans(b0.b0_fname); MSG_PUTS("\n modified: "); MSG_PUTS(b0.b0_dirty ? "YES" : "no"); --- 1492,1504 ---- if (b0.b0_fname[0] == NUL) MSG_PUTS("[No File]"); else ! msg_outtrans( ! #ifdef VMS ! vms_fixfilename(b0.b0_fname) ! #else ! b0.b0_fname ! #endif ! ); MSG_PUTS("\n modified: "); MSG_PUTS(b0.b0_dirty ? "YES" : "no"); *************** *** 1601,1610 **** * Also try with 'shortname' set, in case the file is on a DOS filesystem. */ curbuf->b_shortname = TRUE; ! #ifdef RISCOS ! names[num_names] = modname(path, (char_u *)"_sw#", FALSE); #else names[num_names] = modname(path, (char_u *)".sw?", FALSE); #endif if (names[num_names] == NULL) goto end; --- 1627,1640 ---- * Also try with 'shortname' set, in case the file is on a DOS filesystem. */ curbuf->b_shortname = TRUE; ! #ifdef VMS ! names[num_names] = modname(path, (char_u *)"_sw%", FALSE); #else + # ifdef RISCOS + names[num_names] = modname(path, (char_u *)"_sw#", FALSE); + # else names[num_names] = modname(path, (char_u *)".sw?", FALSE); + # endif #endif if (names[num_names] == NULL) goto end; *************** *** 3350,3356 **** * file names. If this is the first try and the swap file name does not fit in * 8.3, detect if this is the case, set shortname and try again. */ ! if (fname[n - 1] == 'p' && !(buf->b_p_sn || buf->b_shortname)) { char_u *tail; char_u *fname2; --- 3380,3387 ---- * file names. If this is the first try and the swap file name does not fit in * 8.3, detect if this is the case, set shortname and try again. */ ! if (fname[n - 2] == 'w' && fname[n - 1] == 'p' ! && !(buf->b_p_sn || buf->b_shortname)) { char_u *tail; char_u *fname2; *************** *** 3495,3501 **** /* * get here when file already exists */ ! if (fname[n - 1] == 'p') /* first try */ { #ifndef SHORT_FNAME /* --- 3526,3532 ---- /* * get here when file already exists */ ! if (fname[n - 2] == 'w' && fname[n - 1] == 'p') /* first try */ { #ifndef SHORT_FNAME /* *************** *** 3658,3670 **** } } ! if (fname[n - 1] == 'a') /* tried enough names, give up */ ! { ! vim_free(fname); ! fname = NULL; ! break; } ! --fname[n - 1]; /* change last char of the name */ } vim_free(dir_name); --- 3689,3713 ---- } } ! /* ! * Change the ".swp" extension to find another file that can be used. ! * First decrement the last char: ".swo", ".swn", etc. ! * If that still isn't enough decrement the last but one char: ".svz" ! * Can happen when editing many "No File" buffers. ! */ ! if (fname[n - 1] == 'a') /* ".s?a" */ ! { ! if (fname[n - 2] == 'a') /* ".saa": tried enough, give up */ ! { ! EMSG("Too many swap files found"); ! vim_free(fname); ! fname = NULL; ! break; ! } ! --fname[n - 2]; /* ".svz", ".suz", etc. */ ! fname[n - 1] = 'z' + 1; } ! --fname[n - 1]; /* ".swo", ".swn", etc. */ } vim_free(dir_name); *************** *** 4112,4117 **** --- 4155,4161 ---- int text_end; long offset; int len; + int ffdos = (get_fileformat(buf) == EOL_DOS); if (buf->b_ml.ml_usedchunks == -1 || buf->b_ml.ml_chunksize == NULL *************** *** 4134,4146 **** && ((line && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines) || (offset ! && offset >= size + buf->b_ml.ml_chunksize[curix].mlcs_totalsize))) { curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines; size += buf->b_ml.ml_chunksize[curix].mlcs_totalsize; ! curix++; ! if (offset && get_fileformat(buf) == EOL_DOS) size += buf->b_ml.ml_chunksize[curix].mlcs_numlines; } while ((line && curline < line) || (offset && size < offset)) --- 4178,4191 ---- && ((line && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines) || (offset ! && offset >= size + buf->b_ml.ml_chunksize[curix].mlcs_totalsize ! + ffdos * buf->b_ml.ml_chunksize[curix].mlcs_numlines))) { curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines; size += buf->b_ml.ml_chunksize[curix].mlcs_totalsize; ! if (offset && ffdos) size += buf->b_ml.ml_chunksize[curix].mlcs_numlines; + curix++; } while ((line && curline < line) || (offset && size < offset)) *************** *** 4169,4188 **** else { while (offset >= size ! + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK)) { if (idx == count - 1) break; idx++; - if (get_fileformat(buf) == EOL_DOS) - size++; } } len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK); size += len; if (offp != NULL && size >= offset) { ! if (size == offset) *offp = 0; else if (idx == start_idx) *offp = offset - size + len; --- 4214,4234 ---- else { while (offset >= size ! + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK) ! + ffdos) { + if (ffdos) + size++; if (idx == count - 1) break; idx++; } } len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK); size += len; if (offp != NULL && size >= offset) { ! if (size + ffdos == offset) *offp = 0; else if (idx == start_idx) *offp = offset - size + len; *************** *** 4194,4200 **** curline = buf->b_ml.ml_locked_high + 1; } ! if (get_fileformat(buf) == EOL_DOS) size += line - 1; return size; } --- 4240,4246 ---- curline = buf->b_ml.ml_locked_high + 1; } ! if (ffdos) size += line - 1; return size; } diff -crN ../vim-5.6/src/menu.c ./src/menu.c *** ../vim-5.6/src/menu.c Sun Jan 16 16:32:33 2000 --- ./src/menu.c Sat Apr 15 17:51:40 2000 *************** *** 631,637 **** VimMenu *menu; menu = *menup; - *menup = menu->next; #ifdef USE_GUI /* Free machine specific menu structures (only when already created) */ --- 631,636 ---- *************** *** 639,644 **** --- 638,647 ---- if (gui.in_use) gui_mch_destroy_menu(menu); #endif + + /* Don't change *menup until after calling gui_mch_destroy_menu(). The + * MacOS code needs the original structure to properly delete the menu. */ + *menup = menu->next; vim_free(menu->name); vim_free(menu->dname); vim_free(menu->actext); *************** *** 761,767 **** MSG_PUTS(" "); } /* Same highlighting as for directories!? */ ! msg_puts_attr(menu->name, hl_attr(HLF_D)); } if (menu != NULL && menu->children == NULL) --- 764,770 ---- MSG_PUTS(" "); } /* Same highlighting as for directories!? */ ! msg_outtrans_attr(menu->name, hl_attr(HLF_D)); } if (menu != NULL && menu->children == NULL) diff -crN ../vim-5.6/src/message.c ./src/message.c *** ../vim-5.6/src/message.c Mon Dec 6 17:58:35 1999 --- ./src/message.c Tue Jun 20 11:54:36 2000 *************** *** 657,663 **** /* * When switching screens, we need to output an extra newline on exit. */ ! #ifdef UNIX if (swapping_screen() && !termcap_active) newline_on_exit = TRUE; #endif --- 657,663 ---- /* * When switching screens, we need to output an extra newline on exit. */ ! #if defined(UNIX) || defined(VMS) if (swapping_screen() && !termcap_active) newline_on_exit = TRUE; #endif *************** *** 857,862 **** --- 857,877 ---- while (--len >= 0) { + #ifdef MULTI_BYTE + /* check multibyte */ + if (is_dbcs && len > 0 && IsLeadByte(*str)) + { + char_u buf[3]; + + buf[0] = *str++; + buf[1] = *str++; + buf[2] = NUL; + msg_puts_attr(buf, attr); + retval += 2; + --len; + continue; + } + #endif msg_puts_attr(transchar(*str), attr); retval += charsize(*str); ++str; *************** *** 1229,1236 **** * (some terminals scroll automatically, some don't. To avoid * problems we scroll ourselves) */ ! if (msg_row >= Rows - 1 && (*s == '\n' || msg_col >= Columns - 1 || ! (*s == TAB && msg_col >= ((Columns - 1) & ~7)))) { /* When no more prompt an no more room, truncate here */ if (msg_no_more && lines_left == 0) --- 1244,1257 ---- * (some terminals scroll automatically, some don't. To avoid * problems we scroll ourselves) */ ! if (msg_row >= Rows - 1 ! && (*s == '\n' ! || msg_col >= Columns - 1 ! || (*s == TAB && msg_col >= ((Columns - 1) & ~7)) ! #ifdef MULTI_BYTE ! || (is_dbcs && IsLeadByte(*s) && msg_col >= Columns - 2) ! #endif ! )) { /* When no more prompt an no more room, truncate here */ if (msg_no_more && lines_left == 0) *************** *** 1373,1378 **** --- 1394,1424 ---- msg_screen_putchar(' ', attr); while (msg_col & 7); } + #ifdef MULTI_BYTE + else if (is_dbcs && *(s + 1) != NUL && IsLeadByte(*s)) + { + if (msg_col % Columns == Columns - 1) + { + msg_screen_putchar('>', hl_attr(HLF_AT)); + continue; + } + else + { + char_u mbyte[3]; /* only for dbcs */ + + mbyte[0] = *s; + mbyte[1] = *(s + 1); + mbyte[2] = NUL; + screen_puts(mbyte, msg_row, msg_col, attr); + if ((msg_col += 2) >= Columns) + { + msg_col = 0; + ++msg_row; + } + ++s; + } + } + #endif else msg_screen_putchar(*s, attr); ++s; diff -crN ../vim-5.6/src/misc1.c ./src/misc1.c *** ../vim-5.6/src/misc1.c Thu Nov 4 10:17:00 1999 --- ./src/misc1.c Tue Jun 20 21:30:53 2000 *************** *** 187,192 **** --- 187,197 ---- int new_plines = 0; /* init for GCC */ int extra_plines = 0; #ifdef SMARTINDENT + int do_si = (curbuf->b_p_si + # ifdef CINDENT + && !curbuf->b_p_cin + # endif + ); int no_si = FALSE; /* reset did_si afterwards */ int first_char = NUL; /* init for GCC */ #endif *************** *** 238,244 **** { p_extra = saved_line + curwin->w_cursor.col; #ifdef SMARTINDENT ! if (curbuf->b_p_si) /* need first char after new line break */ { p = skipwhite(p_extra); first_char = *p; --- 243,249 ---- { p_extra = saved_line + curwin->w_cursor.col; #ifdef SMARTINDENT ! if (do_si) /* need first char after new line break */ { p = skipwhite(p_extra); first_char = *p; *************** *** 271,277 **** */ if (curbuf->b_p_ai #ifdef SMARTINDENT ! || curbuf->b_p_si #endif ) { --- 276,282 ---- */ if (curbuf->b_p_ai #ifdef SMARTINDENT ! || do_si #endif ) { *************** *** 290,296 **** * don't add an indent. Fixes inserting a NL before '{' in line * "if (condition) {" */ ! if (!trunc_line && curbuf->b_p_si && *saved_line != NUL && (p_extra == NULL || first_char != '{')) { char_u *ptr; --- 295,301 ---- * don't add an indent. Fixes inserting a NL before '{' in line * "if (condition) {" */ ! if (!trunc_line && do_si && *saved_line != NUL && (p_extra == NULL || first_char != '{')) { char_u *ptr; *************** *** 445,451 **** } curwin->w_cursor = old_cursor; } ! if (curbuf->b_p_si) can_si = TRUE; #endif /* SMARTINDENT */ --- 450,456 ---- } curwin->w_cursor = old_cursor; } ! if (do_si) can_si = TRUE; #endif /* SMARTINDENT */ *************** *** 692,698 **** /* Recompute the indent, it may have changed. */ if (curbuf->b_p_ai #ifdef SMARTINDENT ! || curbuf->b_p_si #endif ) newindent = get_indent_str(leader); --- 697,703 ---- /* Recompute the indent, it may have changed. */ if (curbuf->b_p_ai #ifdef SMARTINDENT ! || do_si #endif ) newindent = get_indent_str(leader); *************** *** 764,770 **** if (comment_end[0] == '*' && comment_end[1] == '/' && (curbuf->b_p_ai #ifdef SMARTINDENT ! || curbuf->b_p_si #endif )) { --- 769,775 ---- if (comment_end[0] == '*' && comment_end[1] == '/' && (curbuf->b_p_ai #ifdef SMARTINDENT ! || do_si #endif )) { *************** *** 1354,1359 **** --- 1359,1368 ---- extra = 1; else extra = 0; + #ifdef MULTI_BYTE + if (is_dbcs && State == REPLACE && IsLeadByte(c)) + extra = 1; + #endif /* * A character has to be put on the replace stack if there is a *************** *** 1410,1416 **** curwin->w_p_list = old_list; } ! newp = alloc_check((unsigned)(oldlen + extra)); if (newp == NULL) return; if (col > 0) --- 1419,1436 ---- curwin->w_p_list = old_list; } ! #ifdef MULTI_BYTE ! if (State == REPLACE && is_dbcs) ! { ! /* For multi-byte add one byte when new char is multi-byte, subtract ! * one byte when old char was multi-byte. */ ! newp = alloc_check((unsigned)(oldlen + extra ! + (IsLeadByte(c) ? 1 : 0) ! - (IsLeadByte(oldp[col]) ? 1 : 0))); ! } ! else ! #endif ! newp = alloc_check((unsigned)(oldlen + extra)); if (newp == NULL) return; if (col > 0) *************** *** 1422,1454 **** mch_memmove(p + 1, oldp + i, (size_t)(oldlen - i)); } else ! mch_memmove(p + extra, oldp + col, (size_t)(oldlen - col)); ! #ifdef MULTI_BYTE ! /* ! * We define that "[]" is a multi-byte character. For example, if ! * replace(R) is done over "a[]" with "[]". Finally, "[]]" is ! * constructed, but the following line replaces "[]]" with "[] ". ! */ ! if (is_dbcs && State == REPLACE && IsLeadByte(*p) && p[1] != NUL) ! p[1] = ' '; #endif *p = c; ml_replace(lnum, newp, FALSE); /* ! * If we're in insert or replace mode and 'showmatch' is set, then check for ! * right parens and braces. If there isn't a match, then beep. If there ! * is a match AND it's on the screen, then flash to it briefly. If it ! * isn't on the screen, don't do anything. */ #ifdef RIGHTLEFT ! if (p_sm && (State & INSERT) && ! ((!(curwin->w_p_rl ^ p_ri) && (c == ')' || c == '}' || c == ']')) || ! ((curwin->w_p_rl ^ p_ri) && (c == '(' || c == '{' || c == '[')))) #else ! if (p_sm && (State & INSERT) && (c == ')' || c == '}' || c == ']')) #endif showmatch(); #ifdef RIGHTLEFT --- 1442,1477 ---- mch_memmove(p + 1, oldp + i, (size_t)(oldlen - i)); } else ! { #ifdef MULTI_BYTE ! /* if oldp have multi-byte, don't move old trail byte */ ! if (is_dbcs && State == REPLACE && IsLeadByte(oldp[col])) ! mch_memmove(p + extra, oldp + col + 1, (size_t)(oldlen - col - 1)); ! else #endif + mch_memmove(p + extra, oldp + col, (size_t)(oldlen - col)); + } + *p = c; ml_replace(lnum, newp, FALSE); /* ! * If we're in Insert or Replace mode and 'showmatch' is set, then briefly ! * show the match for right parens and braces. */ + if (p_sm && (State & INSERT) #ifdef RIGHTLEFT ! && ((!(curwin->w_p_rl ^ p_ri) ! && (c == ')' || c == '}' || c == ']')) ! || ((curwin->w_p_rl ^ p_ri) ! && (c == '(' || c == '{' || c == '['))) #else ! && (c == ')' || c == '}' || c == ']') #endif + #ifdef MULTI_BYTE + && !(is_dbcs && IsTrailByte(newp, p)) + #endif + ) showmatch(); #ifdef RIGHTLEFT *************** *** 2101,2107 **** n = n * 10 + c - '0'; msg_putchar(c); } ! else if (c == K_DEL || c == K_BS || c == Ctrl('H')) { n /= 10; MSG_PUTS("\b \b"); --- 2124,2130 ---- n = n * 10 + c - '0'; msg_putchar(c); } ! else if (c == K_DEL || c == K_KDEL || c == K_BS || c == Ctrl('H')) { n /= 10; MSG_PUTS("\b \b"); *************** *** 2209,2215 **** --- 2232,2243 ---- { char_u *var; + #ifdef VMS + var = mch_getenv((char_u *)"SYS$LOGIN"); + #else var = mch_getenv((char_u *)"HOME"); + #endif + if (var != NULL && *var == NUL) /* empty is same as not set */ var = NULL; #if defined(OS2) || defined(MSDOS) || defined(MSWIN) *************** *** 2308,2318 **** } else /* user directory */ { ! #ifndef UNIX ! /* cannot expand user's home directory, so don't try */ ! var = NULL; ! tail = (char_u *)""; /* for gcc */ ! #else /* * Copy ~user to dst[], so we can put a NUL after it. */ --- 2336,2342 ---- } else /* user directory */ { ! #if defined(UNIX) || (defined(VMS) && defined(USER_HOME)) /* * Copy ~user to dst[], so we can put a NUL after it. */ *************** *** 2325,2338 **** && !vim_ispathsep(*tail)) *var++ = *tail++; *var = NUL; ! /* * If the system supports getpwnam(), use it. * Otherwise, or if getpwnam() fails, the shell is used to * expand ~user. This is slower and may fail if the shell * does not support ~user (old versions of /bin/sh). */ ! # if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H) { struct passwd *pw; --- 2349,2362 ---- && !vim_ispathsep(*tail)) *var++ = *tail++; *var = NUL; ! # ifdef UNIX /* * If the system supports getpwnam(), use it. * Otherwise, or if getpwnam() fails, the shell is used to * expand ~user. This is slower and may fail if the shell * does not support ~user (old versions of /bin/sh). */ ! # if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H) { struct passwd *pw; *************** *** 2343,2356 **** var = NULL; } if (var == NULL) ! # endif { expand_context = EXPAND_FILES; var = ExpandOne(dst, NULL, WILD_ADD_SLASH|WILD_SILENT, WILD_EXPAND_FREE); mustfree = TRUE; } ! #endif /* UNIX */ } if (var != NULL && *var != NUL && --- 2367,2416 ---- var = NULL; } if (var == NULL) ! # endif { expand_context = EXPAND_FILES; var = ExpandOne(dst, NULL, WILD_ADD_SLASH|WILD_SILENT, WILD_EXPAND_FREE); mustfree = TRUE; } ! ! # else /* !UNIX, thus VMS */ ! /* ! * USER_HOME is a comma-separated list of ! * directories to search for the user account in. ! */ ! { ! char_u test[MAXPATHL], paths[MAXPATHL]; ! char_u *path, *next_path, *ptr; ! struct stat st; ! ! STRCPY(paths, USER_HOME); ! next_path = paths; ! while (*next_path) ! { ! for (path = next_path; *next_path && *next_path != ','; ! next_path++); ! if (*next_path) ! *next_path++ = NUL; ! STRCPY(test, path); ! STRCAT(test, "/"); ! STRCAT(test, dst + 1); ! if (mch_stat(test, &st) == 0) ! { ! var = alloc(STRLEN(test) + 1); ! STRCPY(var, test); ! mustfree = TRUE; ! break; ! } ! } ! } ! # endif /* UNIX */ ! #else ! /* cannot expand user's home directory, so don't try */ ! var = NULL; ! tail = (char_u *)""; /* for gcc */ ! #endif /* UNIX || VMS */ } if (var != NULL && *var != NUL && *************** *** 2522,2528 **** { *mustfree = TRUE; } ! else { p = default_vim_dir; *mustfree = FALSE; --- 2582,2588 ---- { *mustfree = TRUE; } ! else if (*default_vim_dir != NUL) { p = default_vim_dir; *mustfree = FALSE; *************** *** 2676,2682 **** --- 2736,2748 ---- */ if (homedir != NULL) dirlen = STRLEN(homedir); + + #ifdef VMS + homedir_env = mch_getenv((char_u *)"SYS$LOGIN"); + #else homedir_env = mch_getenv((char_u *)"HOME"); + #endif + if (homedir_env != NULL && *homedir_env == NUL) homedir_env = NULL; if (homedir_env != NULL) *************** *** 2714,2719 **** --- 2780,2786 ---- */ if (!vim_ispathsep(src[0]) && --dstlen > 0) *dst++ = '/'; + break; } if (p == homedir_env) break; *************** *** 2917,2923 **** return (c == ':' || c == '/' || c == '\\'); # else # ifdef VMS ! return (c == ':' || c == '[' || c == ']' || c == '/'); # else # ifdef COLON_AS_PATHSEP return (c == ':'); --- 2984,2992 ---- return (c == ':' || c == '/' || c == '\\'); # else # ifdef VMS ! /* server"user passwd"::device:[full.path.name]fname.extension;version" */ ! return (c == ':' || c == '[' || c == ']' || c == '/' ! || c == '<' || c == '>' || c == '"' ); # else # ifdef COLON_AS_PATHSEP return (c == ':'); *************** *** 2949,2955 **** { while (len > 0 && *x && *y) { ! if (tolower(*x) != tolower(*y) && !(*x == '/' && *y == '\\') && !(*x == '\\' && *y == '/')) break; --- 3018,3024 ---- { while (len > 0 && *x && *y) { ! if (TO_LOWER(*x) != TO_LOWER(*y) && !(*x == '/' && *y == '\\') && !(*x == '\\' && *y == '/')) break; *************** *** 5277,5282 **** --- 5346,5354 ---- if (ffname == NULL) /* out of memory */ break; tail = gettail((*file)[i]); + #ifdef VMS + vms_remove_version(ffname); + #endif /* try all patterns in 'wildignore' */ p = p_wig; diff -crN ../vim-5.6/src/misc2.c ./src/misc2.c *** ../vim-5.6/src/misc2.c Sat Jan 8 21:27:11 2000 --- ./src/misc2.c Mon Jun 5 13:09:50 2000 *************** *** 673,678 **** --- 673,686 ---- length = 1; /* count the trailing '/' and NUL */ for (p = string; *p; p++) { + #ifdef MULTI_BYTE + if (is_dbcs && *(p + 1) != NUL && IsLeadByte(*p)) + { + length += 2; + ++p; /* skip multibyte */ + continue; + } + #endif if (vim_strchr(esc_chars, *p) != NULL) ++length; /* count a backslash */ ++length; /* count an ordinary char */ *************** *** 683,688 **** --- 691,704 ---- p2 = escaped_string; for (p = string; *p; p++) { + #ifdef MULTI_BYTE + if (is_dbcs && *(p + 1) != NUL && IsLeadByte(*p)) + { + *p2++ = *p++; /* skip multibyte lead */ + *p2++ = *p; /* skip multibyte trail */ + continue; + } + #endif if (vim_strchr(esc_chars, *p) != NULL) *p2++ = '\\'; *p2++ = *p; *************** *** 1335,1344 **** --- 1351,1363 ---- {K_BS, (char_u *)"BS"}, {K_BS, (char_u *)"BackSpace"}, /* Alternative name */ {ESC, (char_u *)"Esc"}, + {CSI, (char_u *)"CSI"}, + {K_CSI, (char_u *)"xCSI"}, {'|', (char_u *)"Bar"}, {'\\', (char_u *)"Bslash"}, {K_DEL, (char_u *)"Del"}, {K_DEL, (char_u *)"Delete"}, /* Alternative name */ + {K_KDEL, (char_u *)"kDel"}, {K_UP, (char_u *)"Up"}, {K_DOWN, (char_u *)"Down"}, {K_LEFT, (char_u *)"Left"}, *************** *** 1392,1397 **** --- 1411,1417 ---- {K_UNDO, (char_u *)"Undo"}, {K_INS, (char_u *)"Insert"}, {K_INS, (char_u *)"Ins"}, /* Alternative name */ + {K_KINS, (char_u *)"kInsert"}, {K_HOME, (char_u *)"Home"}, {K_KHOME, (char_u *)"kHome"}, {K_XHOME, (char_u *)"xHome"}, *************** *** 1747,1753 **** /* don't want keycode, use single byte code */ if (key == K_BS) key = BS; ! else if (key == K_DEL) key = DEL; } --- 1767,1773 ---- /* don't want keycode, use single byte code */ if (key == K_BS) key = BS; ! else if (key == K_DEL || key == K_KDEL) key = DEL; } *************** *** 1987,1992 **** --- 2007,2014 ---- #ifdef USE_GUI ++hold_gui_events; #endif + /* The external command may update a tags file, clear cached tags. */ + tag_freematch(); if (cmd == NULL || *p_sxq == NUL) retval = mch_call_shell(cmd, opt); diff -crN ../vim-5.6/src/multbyte.c ./src/multbyte.c *** ../vim-5.6/src/multbyte.c Wed Dec 1 18:21:21 1999 --- ./src/multbyte.c Wed Jun 7 12:29:37 2000 *************** *** 40,46 **** * CodePage identifier, which we can pass directly in to Windows API*/ return IsDBCSLeadByteEx(is_dbcs, (BYTE)c); #else ! # ifdef BROKEN_LOCALE /* * if mblen is not available, character which MSB is turned on are treated * as leading byte character. (note : This assumption is not always true.) --- 40,46 ---- * CodePage identifier, which we can pass directly in to Windows API*/ return IsDBCSLeadByteEx(is_dbcs, (BYTE)c); #else ! # if defined(BROKEN_LOCALE) || defined(macintosh) /* * if mblen is not available, character which MSB is turned on are treated * as leading byte character. (note : This assumption is not always true.) *************** *** 206,212 **** if (focus) { ! if (!xim_has_focus) { xim_has_focus = 1; #ifdef USE_GUI_GTK --- 206,220 ---- if (focus) { ! /* In Normal mode, only connect to IM if user uses over-the-spot. */ ! if (!xim_has_focus ! && (!(State & NORMAL) ! #ifdef USE_GUI_GTK ! || (xim_input_style & GDK_IM_PREEDIT_POSITION) ! #else ! || (input_style & XIMPreeditPosition) ! #endif ! )) { xim_has_focus = 1; #ifdef USE_GUI_GTK *************** *** 236,242 **** if (!xic) return; ! xim_set_focus(!(State & NORMAL)); #ifdef USE_GUI_GTK if (gdk_im_ready()) --- 244,250 ---- if (!xic) return; ! xim_set_focus(TRUE); #ifdef USE_GUI_GTK if (gdk_im_ready()) *************** *** 611,617 **** #ifdef USE_FONTSET if (!gui.fontset) { ! EMSG("XIM requires guifontset setting"); return FALSE; } #else --- 619,628 ---- #ifdef USE_FONTSET if (!gui.fontset) { ! /* This message is annoying when Vim was compiled with XIM support but ! * it's not being used. ! * EMSG("XIM requires guifontset setting"); ! */ return FALSE; } #else diff -crN ../vim-5.6/src/normal.c ./src/normal.c *** ../vim-5.6/src/normal.c Mon Dec 20 09:45:46 1999 --- ./src/normal.c Mon Jun 5 15:22:19 2000 *************** *** 102,109 **** static void nv_put __ARGS((CMDARG *cap)); /* - * normal - * * Execute a command in Normal mode. * * This is basically a big switch with the cases arranged in rough categories --- 102,107 ---- *************** *** 310,318 **** { /* Pick up any leading digits and compute ca.count0 */ while ( (c >= '1' && c <= '9') ! || (ca.count0 != 0 && (c == K_DEL || c == '0'))) { ! if (c == K_DEL) { ca.count0 /= 10; #ifdef CMDLINE_INFO --- 308,316 ---- { /* Pick up any leading digits and compute ca.count0 */ while ( (c >= '1' && c <= '9') ! || (ca.count0 != 0 && (c == K_DEL || c == K_KDEL || c == '0'))) { ! if (c == K_DEL || c == K_KDEL) { ca.count0 /= 10; #ifdef CMDLINE_INFO *************** *** 1023,1028 **** --- 1021,1027 ---- case 'I': case 'i': case K_INS: + case K_KINS: command_busy = nv_edit(&ca); break; *************** *** 1081,1092 **** } /* FALLTHROUGH */ case K_DEL: case 'Y': case 'D': case 'C': case 'x': case 'X': ! if (ca.cmdchar == K_DEL) ca.cmdchar = 'x'; /* DEL key behaves like 'x' */ /* with Visual these commands are operators */ --- 1080,1092 ---- } /* FALLTHROUGH */ case K_DEL: + case K_KDEL: case 'Y': case 'D': case 'C': case 'x': case 'X': ! if (ca.cmdchar == K_DEL || ca.cmdchar == K_KDEL) ca.cmdchar = 'x'; /* DEL key behaves like 'x' */ /* with Visual these commands are operators */ *************** *** 1439,1464 **** static colnr_t redo_VIsual_col; /* number of cols or end column */ static long redo_VIsual_count; /* count for Visual operator */ ! #if defined(USE_CLIPBOARD) && !defined(MSWIN) /* * Yank the visual area into the GUI selection register before we operate ! * on it and lose it forever. This could call do_pending_operator() ! * recursively, but that's OK because gui_yank will be TRUE for the ! * nested call. Note also that we call clip_copy_selection() and not ! * clip_auto_select(). This is because even when 'autoselect' is not set, ! * if we operate on the text, eg by deleting it, then this is considered to ! * be an explicit request for it to be put in the global cut buffer, so we ! * always want to do it here. -- webb */ - /* MSWINDOWS: don't do this, there is no automatic copy to the clipboard */ - /* Don't do it if a specific register was specified, so that ""x"*P works */ if (clipboard.available && oap->op_type != OP_NOP && !gui_yank && VIsual_active && oap->regname == 0 && !redo_VIsual_busy) ! clip_copy_selection(); #endif old_cursor = curwin->w_cursor; --- 1439,1459 ---- static colnr_t redo_VIsual_col; /* number of cols or end column */ static long redo_VIsual_count; /* count for Visual operator */ ! #if defined(USE_CLIPBOARD) /* * Yank the visual area into the GUI selection register before we operate ! * on it and lose it forever. ! * Don't do it if a specific register was specified, so that ""x"*P works. ! * This could call do_pending_operator() recursively, but that's OK ! * because gui_yank will be TRUE for the nested call. */ if (clipboard.available && oap->op_type != OP_NOP && !gui_yank && VIsual_active && oap->regname == 0 && !redo_VIsual_busy) ! clip_auto_select(); #endif old_cursor = curwin->w_cursor; *************** *** 1871,1877 **** /* This is a new edit command, not a restart. We don't edit * recursively. */ restart_edit = 0; ! op_insert(oap); /* handles insert & append; will call edit() */ } #endif break; --- 1866,1873 ---- /* This is a new edit command, not a restart. We don't edit * recursively. */ restart_edit = 0; ! op_insert(oap, cap->count1);/* handles insert & append ! * will call edit() */ } #endif break; *************** *** 2217,2223 **** return FALSE; #endif #if defined(USE_GUI_MOTIF) || defined(USE_GUI_GTK) \ ! || defined(USE_GUI_ATHENA) || defined(USE_GUI_MSWIN) if (gui.in_use) { jump_flags = 0; --- 2213,2220 ---- return FALSE; #endif #if defined(USE_GUI_MOTIF) || defined(USE_GUI_GTK) \ ! || defined(USE_GUI_ATHENA) || defined(USE_GUI_MSWIN) \ ! || defined(USE_GUI_MAC) if (gui.in_use) { jump_flags = 0; *************** *** 3366,3372 **** #ifdef CMDLINE_INFO (void)add_to_showcmd(nchar); #endif ! if (nchar == K_DEL) n /= 10; else if (vim_isdigit(nchar)) n = n * 10 + (nchar - '0'); --- 3363,3369 ---- #ifdef CMDLINE_INFO (void)add_to_showcmd(nchar); #endif ! if (nchar == K_DEL || nchar == K_KDEL) n /= 10; else if (vim_isdigit(nchar)) n = n * 10 + (nchar - '0'); *************** *** 3754,3761 **** else if (cmdchar == 'K' && *p_kp != NUL) aux_ptr = escape_chars; else ! /* Don't escape chars in tag with a backslash */ ! aux_ptr = (char_u *)""; while (n--) { /* put a backslash before \ and some others */ --- 3751,3758 ---- else if (cmdchar == 'K' && *p_kp != NUL) aux_ptr = escape_chars; else ! /* Don't escape spaces and Tabs in a tag with a backslash */ ! aux_ptr = (char_u *)"\\|\""; while (n--) { /* put a backslash before \ and some others */ *************** *** 4520,4529 **** #ifdef MULTI_BYTE if (is_dbcs) { if (trailbyte != NUL) ! ptr[curwin->w_cursor.col++] = trailbyte; else if (IsLeadByte(prechar)) ! (void)del_chars((long)1, TRUE); } #endif } --- 4517,4549 ---- #ifdef MULTI_BYTE if (is_dbcs) { + /* Handle three situations: + * 1. replace double-byte with double-byte: set trailbyte. + * 2. replace single-byte with double-byte: insert trailbyte. + * 3. replace double-byte with single-byte: delete char. + */ if (trailbyte != NUL) ! { ! if (IsLeadByte(prechar)) ! { ! ptr[curwin->w_cursor.col] = trailbyte; ! ++curwin->w_cursor.col; ! } ! else ! { ! (void)ins_char(trailbyte); ! if (n > 1) ! /* pointer will have changed, get it again */ ! ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, ! TRUE); ! } ! } else if (IsLeadByte(prechar)) ! { ! mch_memmove(ptr + curwin->w_cursor.col, ! ptr + curwin->w_cursor.col + 1, ! STRLEN(ptr + curwin->w_cursor.col)); ! } } #endif } *************** *** 5750,5756 **** CMDARG *cap; { /* is equal to "i" */ ! if (cap->cmdchar == K_INS) cap->cmdchar = 'i'; /* in Visual mode "A" and "I" are an operator */ --- 5770,5776 ---- CMDARG *cap; { /* is equal to "i" */ ! if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS) cap->cmdchar = 'i'; /* in Visual mode "A" and "I" are an operator */ diff -crN ../vim-5.6/src/ops.c ./src/ops.c *** ../vim-5.6/src/ops.c Mon Dec 13 16:07:36 1999 --- ./src/ops.c Fri Jun 2 12:28:27 2000 *************** *** 86,91 **** --- 86,92 ---- static int put_in_typebuf __ARGS((char_u *s, int colon)); static void stuffescaped __ARGS((char_u *arg)); static int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg)); + static void cmdline_paste_str __ARGS((char_u *s, int literally)); static void free_yank __ARGS((long)); static void free_yank_all __ARGS((void)); static void block_prep __ARGS((OPARG *oap, struct block_def *, linenr_t, int)); *************** *** 213,226 **** shift_block(oap, amount); #endif else ! /* Don't move the line right if it starts with # and p_si is set. */ #if defined(SMARTINDENT) || defined(CINDENT) if (first_char != '#' || ( # ifdef SMARTINDENT !curbuf->b_p_si ! # endif ! # if defined(SMARTINDENT) && defined(CINDENT) ! && # endif # ifdef CINDENT (!curbuf->b_p_cin || !in_cinkeys('#', ' ', TRUE)) --- 214,229 ---- shift_block(oap, amount); #endif else ! /* Move the line right if it doesn't start with '#', 'smartindent' ! * isn't set or 'cindent' isn't set or '#' isn't in 'cino'. */ #if defined(SMARTINDENT) || defined(CINDENT) if (first_char != '#' || ( # ifdef SMARTINDENT + # ifdef CINDENT + (!curbuf->b_p_si || curbuf->b_p_cin) && + # else !curbuf->b_p_si ! # endif # endif # ifdef CINDENT (!curbuf->b_p_cin || !in_cinkeys('#', ' ', TRUE)) *************** *** 480,499 **** int count = 0; /* extra spaces to replace a cut TAB */ int spaces = 0; /* non-zero if cutting a TAB */ colnr_t offset; /* pointer along new line */ ! int s_len; /* STRLEN(s) */ char_u *newp, *oldp; /* new, old lines */ linenr_t lnum; /* loop var */ int oldstate = State; State = INSERT; /* don't want REPLACE for State */ for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++) { block_prep(oap, bdp, lnum, TRUE); if (bdp->is_short && b_insert) continue; /* OP_INSERT, line ends before block start */ - s_len = STRLEN(s); - oldp = ml_get(lnum); if (b_insert) --- 483,502 ---- int count = 0; /* extra spaces to replace a cut TAB */ int spaces = 0; /* non-zero if cutting a TAB */ colnr_t offset; /* pointer along new line */ ! unsigned s_len; /* STRLEN(s) */ char_u *newp, *oldp; /* new, old lines */ linenr_t lnum; /* loop var */ int oldstate = State; State = INSERT; /* don't want REPLACE for State */ + s_len = STRLEN(s); + for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++) { block_prep(oap, bdp, lnum, TRUE); if (bdp->is_short && b_insert) continue; /* OP_INSERT, line ends before block start */ oldp = ml_get(lnum); if (b_insert) *************** *** 1171,1178 **** * return FAIL for failure, OK otherwise */ int ! cmdline_paste(regname) int regname; { long i; char_u *arg; --- 1174,1182 ---- * return FAIL for failure, OK otherwise */ int ! cmdline_paste(regname, literally) int regname; + int literally; /* Insert text literally instead of "as typed" */ { long i; char_u *arg; *************** *** 1198,1207 **** { if (arg == NULL) return FAIL; ! i = put_on_cmdline(arg, -1, TRUE); if (allocated) vim_free(arg); ! return (int)i; } get_yank_register(regname, FALSE); --- 1202,1211 ---- { if (arg == NULL) return FAIL; ! cmdline_paste_str(arg, literally); if (allocated) vim_free(arg); ! return (int)OK; } get_yank_register(regname, FALSE); *************** *** 1210,1225 **** for (i = 0; i < y_current->y_size; ++i) { ! put_on_cmdline(y_current->y_array[i], -1, FALSE); /* insert ^M between lines and after last line if type is MLINE */ if (y_current->y_type == MLINE || i < y_current->y_size - 1) ! put_on_cmdline((char_u *)"\r", 1, FALSE); } return OK; } /* * op_delete - handle a delete operation * * return FAIL if undo failed, OK otherwise. --- 1214,1257 ---- for (i = 0; i < y_current->y_size; ++i) { ! cmdline_paste_str(y_current->y_array[i], literally); /* insert ^M between lines and after last line if type is MLINE */ if (y_current->y_type == MLINE || i < y_current->y_size - 1) ! cmdline_paste_str((char_u *)"\r", literally); } return OK; } /* + * Put a string on the command line. + * When "literally" is TRUE, insert literally. + * When "literally" is FALSE, insert as typed, but don't leave the command + * line. + */ + static void + cmdline_paste_str(s, literally) + char_u *s; + int literally; + { + if (literally) + put_on_cmdline(s, -1, TRUE); + else + while (*s) + { + if (*s == Ctrl('V') && s[1]) + stuffcharReadbuff(*s++); + else if (*s == ESC || *s == Ctrl('C') || *s == CR || *s == NL + #ifdef UNIX + || *s == intr_char + #endif + || (*s == Ctrl('\\') && s[1] == Ctrl('N'))) + stuffcharReadbuff(Ctrl('V')); + stuffcharReadbuff(*s++); + } + } + + /* * op_delete - handle a delete operation * * return FAIL if undo failed, OK otherwise. *************** *** 1598,1606 **** * Thus the number of characters may increase! */ /* allow for pre spaces */ ! n = (bd.startspaces ? bd.start_char_vcols - 1 : 0 ); /* allow for post spp */ ! n += ( bd.endspaces && !bd.is_oneChar ? bd.end_char_vcols - 1 : 0 ); n += (oap->end_vcol - oap->start_vcol) - bd.textlen + 1; oldp = ml_get_curline(); --- 1630,1638 ---- * Thus the number of characters may increase! */ /* allow for pre spaces */ ! n = (bd.startspaces ? bd.start_char_vcols - 1 : 0); /* allow for post spp */ ! n += (bd.endspaces && !bd.is_oneChar ? bd.end_char_vcols - 1 : 0); n += (oap->end_vcol - oap->start_vcol) - bd.textlen + 1; oldp = ml_get_curline(); *************** *** 1788,1808 **** * op_insert - Insert and append operators for Visual mode. */ void ! op_insert(oap) OPARG *oap; { long ins_len, pre_textlen = 0; char_u *firstline, *ins_text; struct block_def bd; if (u_save((linenr_t)(oap->start.lnum - 1), (linenr_t)(oap->end.lnum + 1)) == FAIL) return; /* edit() changes this - record it for OP_APPEND */ ! bd.is_MAX = (curwin->w_curswant==MAXCOL); /* beyond EOL allowed in VIsual mode */ ! bd.is_EOL = (linetabsize( ml_get_curline()) == (int)oap->end_vcol); /* vis block is still marked. Get rid of it now. */ curwin->w_cursor.lnum = oap->start.lnum; --- 1820,1842 ---- * op_insert - Insert and append operators for Visual mode. */ void ! op_insert(oap, count1) OPARG *oap; + long count1; { long ins_len, pre_textlen = 0; char_u *firstline, *ins_text; struct block_def bd; + int i; if (u_save((linenr_t)(oap->start.lnum - 1), (linenr_t)(oap->end.lnum + 1)) == FAIL) return; /* edit() changes this - record it for OP_APPEND */ ! bd.is_MAX = (curwin->w_curswant == MAXCOL); /* beyond EOL allowed in VIsual mode */ ! bd.is_EOL = (linetabsize(ml_get_curline()) == (int)oap->end_vcol); /* vis block is still marked. Get rid of it now. */ curwin->w_cursor.lnum = oap->start.lnum; *************** *** 1810,1819 **** if (oap->block_mode) { ! /* We first input the new text */ ! firstline = ml_get(oap->start.lnum); ! pre_textlen = STRLEN(firstline); block_prep(oap, &bd, oap->start.lnum, TRUE); } if (oap->op_type == OP_APPEND) --- 1844,1855 ---- if (oap->block_mode) { ! /* Get the info about the block before entering the text */ block_prep(oap, &bd, oap->start.lnum, TRUE); + firstline = ml_get(oap->start.lnum) + bd.textcol; + if (oap->op_type == OP_APPEND) + firstline += bd.textlen; + pre_textlen = STRLEN(firstline); } if (oap->op_type == OP_APPEND) *************** *** 1822,1841 **** { /* this lil bit if code adapted from nv_append() */ curwin->w_set_curswant = TRUE; ! while (oneright() == OK ! && (curwin->w_cursor.col < (bd.textcol + bd.textlen - 1))) ; } else curwin->w_cursor = oap->end; ! /* Works just like an 'i'nsert on the next character. */ ! if (!lineempty(curwin->w_cursor.lnum) ! && oap->start_vcol != oap->end_vcol) ! inc_cursor(); } ! edit(NUL, FALSE, (linenr_t)1); /* if user has moved off this line, we don't know what to do, so do * nothing */ --- 1858,1887 ---- { /* this lil bit if code adapted from nv_append() */ curwin->w_set_curswant = TRUE; ! while (inc_cursor() == 0 ! && (curwin->w_cursor.col < bd.textcol + bd.textlen)) ; + if (bd.is_short && !bd.is_MAX) + { + /* First line was too short, make it longer and adjust the + * values in "bd". */ + for (i = 0; i < bd.endspaces; ++i) + ins_char(' '); + bd.textlen += bd.endspaces; + } } else + { curwin->w_cursor = oap->end; ! /* Works just like an 'i'nsert on the next character. */ ! if (!lineempty(curwin->w_cursor.lnum) ! && oap->start_vcol != oap->end_vcol) ! inc_cursor(); ! } } ! edit(NUL, FALSE, (linenr_t)count1); /* if user has moved off this line, we don't know what to do, so do * nothing */ *************** *** 1845,1865 **** if (oap->block_mode) { ! firstline = ml_get(oap->start.lnum); /* * Subsequent calls to ml_get() flush the firstline data - take a * copy of the required string. */ if ((ins_len = STRLEN(firstline) - pre_textlen) > 0) { if ((ins_text = alloc_check((unsigned)(ins_len + 1))) != 0) { ! if (oap->op_type == OP_APPEND) ! STRNCPY(ins_text, firstline + bd.textcol + bd.textlen, ! ins_len); ! else ! STRNCPY(ins_text, firstline + bd.textcol, ins_len); *(ins_text + ins_len) = NUL; /* block handled here */ --- 1891,1929 ---- if (oap->block_mode) { ! struct block_def bd2; ! ! /* ! * Spaces and tabs in the indent may have changed to other spaces and ! * tabs. Get the starting column again and correct the lenght. ! * Don't do this when "$" used, end-of-line will have changed. ! */ ! block_prep(oap, &bd2, oap->start.lnum, TRUE); ! if (!bd.is_MAX || bd2.textlen < bd.textlen) ! { ! if (oap->op_type == OP_APPEND) ! { ! pre_textlen += bd2.textlen - bd.textlen; ! if (bd2.endspaces) ! --bd2.textlen; ! } ! bd.textcol = bd2.textcol; ! bd.textlen = bd2.textlen; ! } ! /* * Subsequent calls to ml_get() flush the firstline data - take a * copy of the required string. */ + firstline = ml_get(oap->start.lnum) + bd.textcol; + if (oap->op_type == OP_APPEND) + firstline += bd.textlen; if ((ins_len = STRLEN(firstline) - pre_textlen) > 0) { if ((ins_text = alloc_check((unsigned)(ins_len + 1))) != 0) { ! STRNCPY(ins_text, firstline, ins_len); *(ins_text + ins_len) = NUL; /* block handled here */ *************** *** 1925,1931 **** { l = 0; #ifdef SMARTINDENT ! if (curbuf->b_p_si) can_si = TRUE; /* It's like opening a new line, do si */ #endif } --- 1989,1999 ---- { l = 0; #ifdef SMARTINDENT ! if (curbuf->b_p_si ! # ifdef CINDENT ! && !curbuf->b_p_cin ! # endif ! ) can_si = TRUE; /* It's like opening a new line, do si */ #endif } *************** *** 2756,2769 **** if (count == 0 && i == y_size - 1) lendiff = STRLEN(ptr); #if defined(SMARTINDENT) || defined(CINDENT) ! if (*ptr == '#' # ifdef SMARTINDENT ! && curbuf->b_p_si # endif # ifdef CINDENT ! && curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE) # endif ! ) indent = 0; /* Leave # lines at start */ else #endif --- 2824,2841 ---- if (count == 0 && i == y_size - 1) lendiff = STRLEN(ptr); #if defined(SMARTINDENT) || defined(CINDENT) ! if (*ptr == '#' && ( # ifdef SMARTINDENT ! # ifdef CINDENT ! (curbuf->b_p_si && !curbuf->b_p_cin) || ! # else ! curbuf->b_p_si ! # endif # endif # ifdef CINDENT ! (curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE)) # endif ! )) indent = 0; /* Leave # lines at start */ else #endif *************** *** 3630,3636 **** bdp->end_vcol += incr; ++pend; } ! if (bdp->end_vcol < oap->end_vcol && (!is_del || oap->op_type == OP_APPEND || oap->op_type == OP_REPLACE)) /* line too short */ --- 3702,3708 ---- bdp->end_vcol += incr; ++pend; } ! if (bdp->end_vcol <= oap->end_vcol && (!is_del || oap->op_type == OP_APPEND || oap->op_type == OP_REPLACE)) /* line too short */ *************** *** 3639,3645 **** bdp->is_short = TRUE; #endif if (oap->op_type == OP_APPEND) ! bdp->endspaces = oap->end_vcol - bdp->end_vcol; else bdp->endspaces = 0; } --- 3711,3717 ---- bdp->is_short = TRUE; #endif if (oap->op_type == OP_APPEND) ! bdp->endspaces = oap->end_vcol - bdp->end_vcol + 1; else bdp->endspaces = 0; } diff -crN ../vim-5.6/src/option.c ./src/option.c *** ../vim-5.6/src/option.c Mon Dec 27 12:58:12 1999 --- ./src/option.c Wed Jun 7 12:56:08 2000 *************** *** 643,649 **** {"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA, (char_u *)&p_isp, { ! #if defined(MSDOS) || defined(MSWIN) || defined(OS2) (char_u *)"@,~-255", #else (char_u *)"@,161-255", --- 643,649 ---- {"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA, (char_u *)&p_isp, { ! #if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(macintosh) (char_u *)"@,~-255", #else (char_u *)"@,161-255", *************** *** 812,818 **** #if defined(MSDOS) || defined(MSWIN) (char_u *)"popup", #else ! (char_u *)"extend",/* TODO: macintosh: "mac" */ #endif (char_u *)0L}}, {"mousetime", "mouset", P_NUM|P_VI_DEF, --- 812,822 ---- #if defined(MSDOS) || defined(MSWIN) (char_u *)"popup", #else ! # if defined(macintosh) ! (char_u *)"popup_setpos", ! # else ! (char_u *)"extend", ! # endif #endif (char_u *)0L}}, {"mousetime", "mouset", P_NUM|P_VI_DEF, *************** *** 1275,1281 **** {"undolevels", "ul", P_NUM|P_VI_DEF, (char_u *)&p_ul, { ! #if defined(UNIX) || defined(WIN32) || defined(OS2) (char_u *)1000L, #else (char_u *)100L, --- 1279,1285 ---- {"undolevels", "ul", P_NUM|P_VI_DEF, (char_u *)&p_ul, { ! #if defined(UNIX) || defined(WIN32) || defined(OS2) || defined(VMS) (char_u *)1000L, #else (char_u *)100L, *************** *** 1466,1472 **** static char *(p_mousem_values[]) = {"extend", "popup", "popup_setpos", "mac", NULL}; static char *(p_slm_values[]) = {"mouse", "key", "cmd", NULL}; static char *(p_sel_values[]) = {"inclusive", "exclusive", "old", NULL}; ! #if defined(USE_MOUSE) && defined(UNIX) static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", NULL}; #endif static char *(p_km_values[]) = {"startsel", "stopsel", NULL}; --- 1470,1476 ---- static char *(p_mousem_values[]) = {"extend", "popup", "popup_setpos", "mac", NULL}; static char *(p_slm_values[]) = {"mouse", "key", "cmd", NULL}; static char *(p_sel_values[]) = {"inclusive", "exclusive", "old", NULL}; ! #if defined(USE_MOUSE) && (defined(UNIX) || defined(VMS)) static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", NULL}; #endif static char *(p_km_values[]) = {"startsel", "stopsel", NULL}; *************** *** 1902,1907 **** --- 1906,1924 ---- #ifdef WANT_TITLE set_title_defaults(); #endif + + #ifdef BACKSLASH_IN_FILENAME + /* If 'shellslash' was set in a vimrc file, need to adjust the file name + * arguments. */ + if (p_ssl) + { + int i; + + for (i = 0; i < arg_file_count; ++i) + if (arg_files[i] != NULL) + slash_adjust(arg_files[i]); + } + #endif } #ifdef USE_GUI *************** *** 2575,2581 **** } nextchar = *p; *p = NUL; ! add_termcode(name, arg); *p = nextchar; } if (full_screen) --- 2592,2598 ---- } nextchar = *p; *p = NUL; ! add_termcode(name, arg, FALSE); *p = nextchar; } if (full_screen) *************** *** 2865,2870 **** --- 2882,2905 ---- } /* + * Mark a terminal option as allocated, found by a pointer into term_strings[]. + */ + void + set_term_option_alloced(p) + char_u **p; + { + int opt_idx; + + for (opt_idx = 1; options[opt_idx].fullname != NULL; opt_idx++) + if (options[opt_idx].var == (char_u *)p) + { + options[opt_idx].flags |= P_ALLOCED; + return; + } + return; /* cannot happen: didn't find it! */ + } + + /* * Set a string option to a new value (without checking the effect). * The string is copied into allocated memory. * If 'dofree' is set, the old value may be freed. *************** *** 3448,3454 **** gui_init_which_components(oldval); #endif ! #if defined(USE_MOUSE) && defined(UNIX) /* 'ttymouse' */ else if (varp == &p_ttym) { --- 3483,3489 ---- gui_init_which_components(oldval); #endif ! #if defined(USE_MOUSE) && (defined(UNIX) || defined(VMS)) /* 'ttymouse' */ else if (varp == &p_ttym) { diff -crN ../vim-5.6/src/option.h ./src/option.h *** ../vim-5.6/src/option.h Sat Oct 2 14:27:41 1999 --- ./src/option.h Mon Jun 5 10:31:48 2000 *************** *** 184,190 **** #define GO_RIGHT 'r' /* use right scrollbar */ #define GO_TEAROFF 't' /* add tear-off menu items */ #define GO_TOOLBAR 'T' /* add toolbar */ ! #define GO_VERTICAL 'v' /* vertical toolbar */ #define GO_ALL "abfgilmMprtTv" /* all possible flags for 'go' */ /* flags for 'comments' option */ --- 184,190 ---- #define GO_RIGHT 'r' /* use right scrollbar */ #define GO_TEAROFF 't' /* add tear-off menu items */ #define GO_TOOLBAR 'T' /* add toolbar */ ! #define GO_VERTICAL 'v' /* arrange dialog buttons vertically */ #define GO_ALL "abfgilmMprtTv" /* all possible flags for 'go' */ /* flags for 'comments' option */ diff -crN ../vim-5.6/src/os_unix.c ./src/os_unix.c *** ../vim-5.6/src/os_unix.c Fri Jan 14 22:27:22 2000 --- ./src/os_unix.c Wed Jun 7 17:24:21 2000 *************** *** 1452,1463 **** #endif } ! #ifdef __EMX__ /* * Replace all slashes by backslashes. * When 'shellslash' set do it the other way around. */ ! static void slash_adjust(p) char_u *p; { --- 1452,1463 ---- #endif } ! #if defined(__EMX__) || defined(PROTO) /* * Replace all slashes by backslashes. * When 'shellslash' set do it the other way around. */ ! void slash_adjust(p) char_u *p; { *************** *** 1700,1705 **** --- 1700,1710 ---- out_char('\n'); else msg_clr_eos(); /* clear the rest of the display */ + + /* Cursor may have been switched off without calling starttermcap() + * when doing "vim -u vimrc" and vimrc contains ":q". */ + if (full_screen) + cursor_on(); } out_flush(); ml_close_all(TRUE); /* remove all memfiles */ *************** *** 1852,1858 **** intr_char = keys.sg_kill; #endif buf[1] = NUL; ! add_termcode((char_u *)"kb", buf); /* * If and are now the same, redefine . --- 1857,1863 ---- intr_char = keys.sg_kill; #endif buf[1] = NUL; ! add_termcode((char_u *)"kb", buf, FALSE); /* * If and are now the same, redefine . *************** *** 1917,1923 **** # ifdef XTERM_MOUSE if (use_xterm_mouse()) { ! set_mouse_termcode(KS_MOUSE, (char_u *)"\033[M"); if (*p_mouse != NUL) { /* force mouse off and maybe on to send possibly new mouse --- 1922,1929 ---- # ifdef XTERM_MOUSE if (use_xterm_mouse()) { ! set_mouse_termcode(KS_MOUSE, (char_u *)(term_is_8bit(T_NAME) ! ? "\233M" : "\033[M")); if (*p_mouse != NUL) { /* force mouse off and maybe on to send possibly new mouse *************** *** 2548,2558 **** if (ta_buf[i] == CSI && len - i > 2) { c = TERMCAP2KEY(ta_buf[i + 1], ta_buf[i + 2]); ! if (c == K_DEL || c == K_BS) { mch_memmove(ta_buf + i + 1, ta_buf + i + 3, (size_t)(len - i - 2)); ! if (c == K_DEL) ta_buf[i] = DEL; else ta_buf[i] = Ctrl('H'); --- 2554,2564 ---- if (ta_buf[i] == CSI && len - i > 2) { c = TERMCAP2KEY(ta_buf[i + 1], ta_buf[i + 2]); ! if (c == K_DEL || c == K_KDEL || c == K_BS) { mch_memmove(ta_buf + i + 1, ta_buf + i + 3, (size_t)(len - i - 2)); ! if (c == K_DEL || c == K_KDEL) ta_buf[i] = DEL; else ta_buf[i] = Ctrl('H'); *************** *** 4038,4044 **** STRCPY(buf, mouse_code); strp = buf + STRLEN(buf); ! *strp++ = xterm_button | MOUSE_DRAG; *strp++ = (char_u)(col + ' ' + 1); *strp++ = (char_u)(row + ' ' + 1); *strp = 0; --- 4044,4050 ---- STRCPY(buf, mouse_code); strp = buf + STRLEN(buf); ! *strp++ = (xterm_button | MOUSE_DRAG) & ~0x20; *strp++ = (char_u)(col + ' ' + 1); *strp++ = (char_u)(row + ' ' + 1); *strp = 0; diff -crN ../vim-5.6/src/os_unix.h ./src/os_unix.h *** ../vim-5.6/src/os_unix.h Tue Sep 7 21:17:13 1999 --- ./src/os_unix.h Wed Jun 7 13:56:51 2000 *************** *** 32,39 **** #endif /* On AIX 4.2 there is a conflicting prototype for ioctl() in stropts.h and ! * unistd.h. This hack should fix that (suggested by Jeff George) */ ! #if defined(USE_GUI) && defined(_AIX) && !defined(_NO_PROTO) # define _NO_PROTO #endif --- 32,40 ---- #endif /* On AIX 4.2 there is a conflicting prototype for ioctl() in stropts.h and ! * unistd.h. This hack should fix that (suggested by Jeff George). ! * But on AIX 4.3 it's alright (suggested by Jake Hamby). */ ! #if defined(USE_GUI) && defined(_AIX) && !defined(_AIX43) && !defined(_NO_PROTO) # define _NO_PROTO #endif *************** *** 83,89 **** #endif /* always use unlink() to remove files */ ! #define mch_remove(x) unlink((char *)(x)) /* The number of arguments to a signal handler is configured here. */ /* It used to be a long list of almost all systems. Any system that doesn't --- 84,92 ---- #endif /* always use unlink() to remove files */ ! #ifndef PROTO ! # define mch_remove(x) unlink((char *)(x)) ! #endif /* The number of arguments to a signal handler is configured here. */ /* It used to be a long list of almost all systems. Any system that doesn't *************** *** 319,324 **** --- 322,328 ---- # endif #endif + #ifndef PROTO #ifdef HAVE_RENAME # define mch_rename(src, dst) rename(src, dst) #else *************** *** 327,332 **** --- 331,337 ---- #define mch_chdir(s) chdir(s) #define mch_getenv(x) (char_u *)getenv((char *)(x)) #define mch_setenv(name, val, x) setenv(name, val, x) + #endif #if !defined(S_ISDIR) && defined(S_IFDIR) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) diff -crN ../vim-5.6/src/proto/buffer.pro ./src/proto/buffer.pro *** ../vim-5.6/src/proto/buffer.pro Sun Jan 16 14:22:13 2000 --- ./src/proto/buffer.pro Sat Jun 24 11:18:28 2000 *************** *** 16,21 **** --- 16,22 ---- int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options)); BUF *buflist_findnr __ARGS((int nr)); char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail)); + FPOS *buflist_findfpos __ARGS((BUF *buf)); linenr_t buflist_findlnum __ARGS((BUF *buf)); void buflist_list __ARGS((void)); int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_t *lnum)); diff -crN ../vim-5.6/src/proto/gui_gtk_x11.pro ./src/proto/gui_gtk_x11.pro *** ../vim-5.6/src/proto/gui_gtk_x11.pro Sun Jan 16 14:23:16 2000 --- ./src/proto/gui_gtk_x11.pro Sat Jun 24 11:19:29 2000 *************** *** 26,32 **** int gui_mch_haskey __ARGS((char_u *name)); int gui_get_x11_windis __ARGS((Window *win, Display **dis)); void gui_mch_beep __ARGS((void)); ! void gui_mch_flash __ARGS((void)); void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc)); void gui_mch_iconify __ARGS((void)); void gui_mch_draw_hollow_cursor __ARGS((GuiColor color)); --- 26,32 ---- int gui_mch_haskey __ARGS((char_u *name)); int gui_get_x11_windis __ARGS((Window *win, Display **dis)); void gui_mch_beep __ARGS((void)); ! void gui_mch_flash __ARGS((int msec)); void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc)); void gui_mch_iconify __ARGS((void)); void gui_mch_draw_hollow_cursor __ARGS((GuiColor color)); diff -crN ../vim-5.6/src/proto/gui_x11.pro ./src/proto/gui_x11.pro *** ../vim-5.6/src/proto/gui_x11.pro Sun Jan 16 14:23:17 2000 --- ./src/proto/gui_x11.pro Sat Jun 24 11:19:30 2000 *************** *** 23,29 **** int gui_mch_haskey __ARGS((char_u *name)); int gui_get_x11_windis __ARGS((Window *win, Display **dis)); void gui_mch_beep __ARGS((void)); ! void gui_mch_flash __ARGS((void)); void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc)); void gui_mch_iconify __ARGS((void)); void gui_mch_draw_hollow_cursor __ARGS((GuiColor color)); --- 23,29 ---- int gui_mch_haskey __ARGS((char_u *name)); int gui_get_x11_windis __ARGS((Window *win, Display **dis)); void gui_mch_beep __ARGS((void)); ! void gui_mch_flash __ARGS((int msec)); void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc)); void gui_mch_iconify __ARGS((void)); void gui_mch_draw_hollow_cursor __ARGS((GuiColor color)); diff -crN ../vim-5.6/src/proto/ops.pro ./src/proto/ops.pro *** ../vim-5.6/src/proto/ops.pro Sun Jan 16 14:22:46 2000 --- ./src/proto/ops.pro Sat Jun 24 11:18:59 2000 *************** *** 13,24 **** int do_record __ARGS((int c)); int do_execreg __ARGS((int regname, int colon, int addcr)); int insert_reg __ARGS((int regname, int literally)); ! int cmdline_paste __ARGS((int regname)); int op_delete __ARGS((OPARG *oap)); int op_replace __ARGS((OPARG *oap, int c)); void op_tilde __ARGS((OPARG *oap)); void swapchar __ARGS((int op_type, FPOS *pos)); ! void op_insert __ARGS((OPARG *oap)); int op_change __ARGS((OPARG *oap)); void init_yank __ARGS((void)); int op_yank __ARGS((OPARG *oap, int deleting, int mess)); --- 13,24 ---- int do_record __ARGS((int c)); int do_execreg __ARGS((int regname, int colon, int addcr)); int insert_reg __ARGS((int regname, int literally)); ! int cmdline_paste __ARGS((int regname, int literally)); int op_delete __ARGS((OPARG *oap)); int op_replace __ARGS((OPARG *oap, int c)); void op_tilde __ARGS((OPARG *oap)); void swapchar __ARGS((int op_type, FPOS *pos)); ! void op_insert __ARGS((OPARG *oap, long count1)); int op_change __ARGS((OPARG *oap)); void init_yank __ARGS((void)); int op_yank __ARGS((OPARG *oap, int deleting, int mess)); diff -crN ../vim-5.6/src/proto/option.pro ./src/proto/option.pro *** ../vim-5.6/src/proto/option.pro Sun Jan 16 14:22:48 2000 --- ./src/proto/option.pro Sat Jun 24 11:19:01 2000 *************** *** 13,18 **** --- 13,19 ---- void check_options __ARGS((void)); void check_buf_options __ARGS((BUF *buf)); void free_string_option __ARGS((char_u *p)); + void set_term_option_alloced __ARGS((char_u **p)); void set_string_option_direct __ARGS((char_u *name, int opt_idx, char_u *val, int dofree)); char_u *check_stl_option __ARGS((char_u *s)); int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval)); diff -crN ../vim-5.6/src/proto/os_unix.pro ./src/proto/os_unix.pro *** ../vim-5.6/src/proto/os_unix.pro Sun Jan 16 14:22:50 2000 --- ./src/proto/os_unix.pro Sat Jun 24 11:19:03 2000 *************** *** 22,27 **** --- 22,28 ---- void mch_get_host_name __ARGS((char_u *s, int len)); long mch_get_pid __ARGS((void)); int mch_dirname __ARGS((char_u *buf, int len)); + void slash_adjust __ARGS((char_u *p)); int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force)); int mch_isFullName __ARGS((char_u *fname)); long mch_getperm __ARGS((char_u *name)); diff -crN ../vim-5.6/src/proto/regexp.pro ./src/proto/regexp.pro *** ../vim-5.6/src/proto/regexp.pro Sun Jan 16 14:22:52 2000 --- ./src/proto/regexp.pro Sat Jun 24 11:19:06 2000 *************** *** 4,7 **** --- 4,8 ---- int vim_regcomp_had_eol __ARGS((void)); int vim_regexec __ARGS((vim_regexp *prog, char_u *string, int at_bol)); char_u *regtilde __ARGS((char_u *source, int magic)); + void vim_regnewptr __ARGS((vim_regexp *prog, char_u *old_ptr, char_u *new_ptr)); int vim_regsub __ARGS((vim_regexp *prog, char_u *source, char_u *dest, int copy, int magic)); diff -crN ../vim-5.6/src/proto/search.pro ./src/proto/search.pro *** ../vim-5.6/src/proto/search.pro Sun Jan 16 14:22:55 2000 --- ./src/proto/search.pro Sat Jun 24 11:19:09 2000 *************** *** 1,5 **** --- 1,6 ---- /* search.c */ vim_regexp *search_regcomp __ARGS((char_u *pat, int pat_save, int pat_use, int options)); + char_u *get_search_pat __ARGS((void)); void save_search_patterns __ARGS((void)); void restore_search_patterns __ARGS((void)); void set_reg_ic __ARGS((char_u *pat)); diff -crN ../vim-5.6/src/proto/tag.pro ./src/proto/tag.pro *** ../vim-5.6/src/proto/tag.pro Sun Jan 16 14:22:58 2000 --- ./src/proto/tag.pro Sat Jun 24 11:19:11 2000 *************** *** 1,5 **** --- 1,6 ---- /* tag.c */ int do_tag __ARGS((char_u *tag, int type, int count, int forceit, int verbose)); + void tag_freematch __ARGS((void)); void do_tags __ARGS((void)); int find_tags __ARGS((char_u *pat, int *num_matches, char_u ***matchesp, int flags, int mincount)); void simplify_filename __ARGS((char_u *filename)); diff -crN ../vim-5.6/src/proto/term.pro ./src/proto/term.pro *** ../vim-5.6/src/proto/term.pro Sun Jan 16 14:23:00 2000 --- ./src/proto/term.pro Sat Jun 24 11:19:13 2000 *************** *** 4,9 **** --- 4,10 ---- void del_mouse_termcode __ARGS((int n)); void getlinecol __ARGS((void)); int add_termcap_entry __ARGS((char_u *name, int force)); + int term_is_8bit __ARGS((char_u *name)); int term_is_gui __ARGS((char_u *name)); char_u *tltoa __ARGS((unsigned long i)); void termcapinit __ARGS((char_u *name)); *************** *** 39,45 **** void scroll_region_set __ARGS((WIN *wp, int off)); void scroll_region_reset __ARGS((void)); void clear_termcodes __ARGS((void)); ! void add_termcode __ARGS((char_u *name, char_u *string)); char_u *find_termcode __ARGS((char_u *name)); char_u *get_termcode __ARGS((int i)); void del_termcode __ARGS((char_u *name)); --- 40,46 ---- void scroll_region_set __ARGS((WIN *wp, int off)); void scroll_region_reset __ARGS((void)); void clear_termcodes __ARGS((void)); ! void add_termcode __ARGS((char_u *name, char_u *string, int use_8bit)); char_u *find_termcode __ARGS((char_u *name)); char_u *get_termcode __ARGS((int i)); void del_termcode __ARGS((char_u *name)); diff -crN ../vim-5.6/src/proto/version.pro ./src/proto/version.pro *** ../vim-5.6/src/proto/version.pro Sun Jan 16 14:23:06 2000 --- ./src/proto/version.pro Sat Jun 24 11:19:18 2000 *************** *** 1,4 **** --- 1,5 ---- /* version.c */ + void make_version __ARGS((void)); int highest_patch __ARGS((void)); void do_version __ARGS((char_u *arg)); void list_version __ARGS((void)); diff -crN ../vim-5.6/src/regexp.c ./src/regexp.c *** ../vim-5.6/src/regexp.c Sat May 15 15:48:51 1999 --- ./src/regexp.c Wed Jun 7 16:13:32 2000 *************** *** 2954,2959 **** --- 2954,2983 ---- } /* + * Adjust the pointers in "prog" for moving the matches text from "old_ptr" to + * "new_ptr". Used when saving a copy of the matched text and want to use + * vim_regsub(). + */ + void + vim_regnewptr(prog, old_ptr, new_ptr) + vim_regexp *prog; + char_u *old_ptr; + char_u *new_ptr; + { + int j; + + for (j = 0; j < NSUBEXP; ++j) + { + /* Careful with these pointer computations, it can go wrong for + * segmented memory (16 bit MS-DOS). */ + if (prog->startp[j] != NULL) + prog->startp[j] = new_ptr + (prog->startp[j] - old_ptr); + if (prog->endp[j] != NULL) + prog->endp[j] = new_ptr + (prog->endp[j] - old_ptr); + } + } + + /* * vim_regsub() - perform substitutions after a regexp match * * If copy is TRUE really copy into dest. diff -crN ../vim-5.6/src/screen.c ./src/screen.c *** ../vim-5.6/src/screen.c Mon Dec 27 12:57:25 1999 --- ./src/screen.c Wed Jun 7 14:43:59 2000 *************** *** 67,72 **** --- 67,73 ---- static void win_update __ARGS((WIN *wp)); static int win_line __ARGS((WIN *, linenr_t, int, int)); + static int char_needs_redraw __ARGS((char_u *screenp_from, char_u *screenp_to, int len)); #ifdef RIGHTLEFT static void screen_line __ARGS((int row, int endcol, int clear_rest, int rlflag)); #define SCREEN_LINE(r, e, c, rl) screen_line((r), (e), (c), (rl)) *************** *** 1875,1880 **** --- 1876,1908 ---- } /* + * Check whether the given character needs redrawing: + * - the (first byte of the) character is different + * - the attributes are different + * - the character is multi-byte and the next byte is different + */ + static int + char_needs_redraw(screenp_from, screenp_to, len) + char_u *screenp_from; + char_u *screenp_to; + int len; + { + if (len > 0 + && ((*screenp_from != *screenp_to + || *(screenp_from + Columns) != *(screenp_to + Columns)) + + #ifdef MULTI_BYTE + || (is_dbcs + && len > 1 + && *(screenp_from + 1) != *(screenp_to + 1) + && IsLeadByte(*screenp_from)) + #endif + )) + return TRUE; + return FALSE; + } + + /* * Move one "cooked" screen line to the screen, but only the characters that * have actually changed. Handle insert/delete character. * 'endcol' gives the columns where valid characters are. *************** *** 1899,1909 **** char_u *screenp_from; char_u *screenp_to; int col = 0; int force = FALSE; /* force update rest of the line */ #ifdef MULTI_BYTE int char_bytes; /* 1 : if normal char */ /* 2 : if DBCS char */ ! int need_update; /* bool variable */ #endif screenp_from = current_LinePointer; --- 1927,1948 ---- char_u *screenp_from; char_u *screenp_to; int col = 0; + #if defined(USE_GUI) || defined(UNIX) + int hl; + #endif int force = FALSE; /* force update rest of the line */ + int redraw_this /* bool: does character need redraw? */ + #ifdef USE_GUI + = TRUE /* For GUI when while-loop empty */ + #endif + ; + int redraw_next; /* redraw_this for next character */ #ifdef MULTI_BYTE int char_bytes; /* 1 : if normal char */ /* 2 : if DBCS char */ ! # define CHAR_BYTES char_bytes ! #else ! # define CHAR_BYTES 1 #endif screenp_from = current_LinePointer; *************** *** 1926,1975 **** col = endcol + 1; screenp_to = LinePointers[row] + col; screenp_from += col; } - while (rlflag ? (col < Columns) : (col < endcol)) - #else while (col < endcol) - #endif { #ifdef MULTI_BYTE ! if (is_dbcs && IsLeadByte(*screenp_from) && (col + 1 < endcol)) ! { char_bytes = 2; - if ( force - || *screenp_from != *screenp_to - || *(screenp_from + 1) != *(screenp_to + 1) - || *(screenp_from + Columns) != *(screenp_to + Columns) - ) - need_update = TRUE; - else - need_update = FALSE; - } else - { char_bytes = 1; - if ( force - || *screenp_from != *screenp_to - || *(screenp_from + Columns) != *(screenp_to + Columns) - ) - need_update = TRUE; - else - need_update = FALSE; - } #endif ! if ( ! #if defined(MULTI_BYTE) ! need_update ! #else ! force ! || *screenp_from != *screenp_to ! || *(screenp_from + Columns) != *(screenp_to + Columns) ! #endif ! ) { /* * Special handling when 'xs' termcap flag set (hpterm): * Attributes for characters are stored at the position where the --- 1965,2005 ---- col = endcol + 1; screenp_to = LinePointers[row] + col; screenp_from += col; + + endcol = Columns; } + #endif /* RIGHTLEFT */ + + redraw_next = char_needs_redraw(screenp_from, screenp_to, endcol - col); while (col < endcol) { #ifdef MULTI_BYTE ! if (is_dbcs && (col + 1 < endcol) && IsLeadByte(*screenp_from)) char_bytes = 2; else char_bytes = 1; #endif ! redraw_this = redraw_next; ! redraw_next = force || char_needs_redraw(screenp_from + CHAR_BYTES, ! screenp_to + CHAR_BYTES, endcol - col - CHAR_BYTES); ! ! #ifdef USE_GUI ! /* If the next character was bold, then redraw the current character to ! * remove any pixels that might have spilt over into us. This only ! * happens in the GUI. ! */ ! if (redraw_next && gui.in_use) { + hl = *(screenp_to + CHAR_BYTES + Columns); + if (hl > HL_ALL || (hl & HL_BOLD)) + redraw_this = TRUE; + } + #endif + if (redraw_this) + { /* * Special handling when 'xs' termcap flag set (hpterm): * Attributes for characters are stored at the position where the *************** *** 1997,2002 **** --- 2027,2033 ---- out_str(T_CE); /* clear rest of this screen line */ screen_start(); /* don't know where cursor is now */ force = TRUE; /* force redraw of rest of the line */ + redraw_next = TRUE; /* or else next char would miss out */ /* * If the previous character was highlighted, need to stop *************** *** 2014,2027 **** #ifdef MULTI_BYTE if (is_dbcs) { ! /* The trick to make a force update */ ! if (!IsLeadByte(*screenp_from) && IsLeadByte(*screenp_to)) ! *(screenp_to + 1) = 0; ! else if ((char_bytes == 2) ! && mb_isbyte1(LinePointers[row], col + 1)) { *(screenp_to + 1) = 0; *(screenp_to + 2) = 0; } } #endif --- 2045,2065 ---- #ifdef MULTI_BYTE if (is_dbcs) { ! if (char_bytes == 1 && col + 1 < endcol ! && IsLeadByte(*screenp_to)) { + /* When: !DBCS(*screenp_from) && DBCS(*screenp_to) */ *(screenp_to + 1) = 0; + redraw_next = TRUE; + } + else if (char_bytes == 2 && col + 2 < endcol + && !IsLeadByte(*screenp_to) + && IsLeadByte(*(screenp_to + 1))) + { + /* When: DBCS(*screenp_from) && DBCS(*screenp_to+1) */ + /* *(screenp_to + 1) = 0; redundant code */ *(screenp_to + 2) = 0; + redraw_next = TRUE; } } #endif *************** *** 2049,2069 **** # endif ) { ! int n; ! ! n = *(screenp_to + Columns); ! # ifdef MULTI_BYTE ! if (col + char_bytes < Columns && (n > HL_ALL || (n & HL_BOLD))) ! *(screenp_to + char_bytes) = 0; ! # else ! if (col + 1 < Columns && (n > HL_ALL || (n & HL_BOLD))) ! *(screenp_to + 1) = 0; ! # endif } #endif *(screenp_to + Columns) = *(screenp_from + Columns); #ifdef MULTI_BYTE ! if (char_bytes == 2) /* just a hack */ *(screenp_to + Columns + 1) = *(screenp_from + Columns); screen_char_n(screenp_to, char_bytes, row, col); #else --- 2087,2101 ---- # endif ) { ! hl = *(screenp_to + Columns); ! if (hl > HL_ALL || (hl & HL_BOLD)) ! redraw_next = TRUE; } #endif *(screenp_to + Columns) = *(screenp_from + Columns); #ifdef MULTI_BYTE ! /* just a hack: It makes two bytes of DBCS have same attributes */ ! if (char_bytes == 2) *(screenp_to + Columns + 1) = *(screenp_from + Columns); screen_char_n(screenp_to, char_bytes, row, col); #else *************** *** 2090,2104 **** } } ! #ifdef MULTI_BYTE ! screenp_to += char_bytes; ! screenp_from += char_bytes; ! col += char_bytes; ! #else ! ++screenp_to; ! ++screenp_from; ! ++col; ! #endif } if (clear_rest --- 2122,2130 ---- } } ! screenp_to += CHAR_BYTES; ! screenp_from += CHAR_BYTES; ! col += CHAR_BYTES; } if (clear_rest *************** *** 2108,2113 **** --- 2134,2142 ---- ) { /* blank out the rest of the line */ + #ifdef USE_GUI + int startCol = col; + #endif while (col < Columns && *screenp_to == ' ' && *(screenp_to + Columns) == 0) { *************** *** 2115,2121 **** --- 2144,2171 ---- ++col; } if (col < Columns) + { + #ifdef USE_GUI + /* + * In the GUI, clearing the rest of the line may leave pixels + * behind if the first character cleared was bold. Some bold + * fonts spill over the left. In this case we redraw the previous + * character too. If we didn't skip any blanks above, then we + * only redraw if the character wasn't already redrawn anyway. + */ + if (gui.in_use && (col > startCol || !redraw_this) + # ifdef MULTI_BYTE + && !is_dbcs + # endif + ) + { + hl = *(screenp_to + Columns); + if (hl > HL_ALL || (hl & HL_BOLD)) + screen_char(screenp_to - 1, row, col - 1); + } + #endif screen_fill(row, row + 1, col, (int)Columns, ' ', ' ', 0); + } } } *************** *** 2509,2514 **** --- 2559,2566 ---- attr = 0; } } + if (maxlen >= sizeof(buf)) + maxlen = sizeof(buf) - 1; len = build_stl_str_hl(wp, buf, p, fillchar, maxlen, hl); *************** *** 2910,2917 **** case STL_BYTEVAL_X: base= 'X'; case STL_BYTEVAL: ! num = ((State & INSERT) || empty_line) ? ! 0 : linecont[wp->w_cursor.col]; if (num == NL) num = 0; else if (num == CR && get_fileformat(wp->w_buffer) == EOL_MAC) --- 2962,2977 ---- case STL_BYTEVAL_X: base= 'X'; case STL_BYTEVAL: ! if ((State & INSERT) || empty_line) ! num = 0; ! else ! { ! num = linecont[wp->w_cursor.col]; ! #ifdef MULTI_BYTE ! if (is_dbcs && IsLeadByte((int)num)) ! num = (num << 8) + linecont[wp->w_cursor.col + 1]; ! #endif ! } if (num == NL) num = 0; else if (num == CR && get_fileformat(wp->w_buffer) == EOL_MAC) *************** *** 3066,3073 **** for (l = 0; l < itemcnt; l++) if (item[l].type == Trunc) break; ! l = l == itemcnt ? 0 : l; ! s = item[l].start; if ((int) (s - out) > maxlen) { /* Truncation mark is beyond max length */ s = out + maxlen - 1; --- 3126,3138 ---- for (l = 0; l < itemcnt; l++) if (item[l].type == Trunc) break; ! if (itemcnt == 0) ! s = out; ! else ! { ! l = l == itemcnt ? 0 : l; ! s = item[l].start; ! } if ((int) (s - out) > maxlen) { /* Truncation mark is beyond max length */ s = out + maxlen - 1; *************** *** 3081,3087 **** else { p = s + num - maxlen; ! mch_memmove(s, p, STRLEN(s) + 1); *s = '<'; for (; l < itemcnt; l++) item[l].start -= num - maxlen; --- 3146,3152 ---- else { p = s + num - maxlen; ! mch_memmove(s, p, STRLEN(p) + 1); *s = '<'; for (; l < itemcnt; l++) item[l].start -= num - maxlen; *************** *** 3154,3175 **** int attr; { char_u *screenp; if (NextScreen != NULL && row < Rows) /* safety check */ { screenp = LinePointers[row] + col; while (*text && col < Columns) { ! if (*screenp != *text || *(screenp + Columns) != attr || ! exmode_active) { *screenp = *text; *(screenp + Columns) = attr; screen_char(screenp, row, col); } - ++screenp; - ++col; - ++text; } } } --- 3219,3273 ---- int attr; { char_u *screenp; + #ifdef MULTI_BYTE + int is_mbyte; + #endif if (NextScreen != NULL && row < Rows) /* safety check */ { screenp = LinePointers[row] + col; while (*text && col < Columns) { ! #ifdef MULTI_BYTE ! /* check if this is the first byte of a multibyte */ ! if (is_dbcs && text[1] != NUL && IsLeadByte(*text)) ! is_mbyte = 1; ! else ! is_mbyte = 0; ! #endif ! if (*screenp != *text ! #ifdef MULTI_BYTE ! || (is_mbyte && screenp[1] != text[1]) ! #endif ! || *(screenp + Columns) != attr ! || exmode_active) { *screenp = *text; *(screenp + Columns) = attr; screen_char(screenp, row, col); + #ifdef MULTI_BYTE + if (is_mbyte) + { + screenp[1] = text[1]; + screenp[Columns + 1] = attr; + screen_char(screenp + 1, row, col + 1); + } + #endif + } + #ifdef MULTI_BYTE + if (is_mbyte) + { + screenp += 2; + col += 2; + text += 2; + } + else + #endif + { + ++screenp; + ++col; + ++text; } } } } *************** *** 6359,6365 **** return IN_BUFFER | CURSOR_MOVED; /* Cursor has moved */ } ! #if defined(USE_GUI_MOTIF) || defined(USE_GUI_GTK) \ || defined(USE_GUI_ATHENA) || defined(USE_GUI_MSWIN) || defined(PROTO) /* * Translate window coordinates to buffer position without any side effects --- 6457,6463 ---- return IN_BUFFER | CURSOR_MOVED; /* Cursor has moved */ } ! #if defined(USE_GUI_MOTIF) || defined(USE_GUI_GTK) || defined (USE_GUI_MAC) \ || defined(USE_GUI_ATHENA) || defined(USE_GUI_MSWIN) || defined(PROTO) /* * Translate window coordinates to buffer position without any side effects diff -crN ../vim-5.6/src/search.c ./src/search.c *** ../vim-5.6/src/search.c Sat Jan 15 21:12:19 2000 --- ./src/search.c Tue Jun 20 15:55:33 2000 *************** *** 183,188 **** --- 183,197 ---- return vim_regcomp(pat, magic); } + /* + * Get search pattern used by search_regcomp(). + */ + char_u * + get_search_pat() + { + return mr_pattern; + } + static void save_re_pat(idx, pat, magic) int idx; *************** *** 790,795 **** --- 799,806 ---- *p++ = '+'; if (spats[0].off.off != 0 || spats[0].off.line) sprintf((char *)p, "%ld", spats[0].off.off); + else + *p = NUL; } msg_start(); *************** *** 1060,1065 **** --- 1071,1081 ---- int col; char_u *p; int len; + #ifdef MULTI_BYTE + int c2 = NUL; /* 2nd byte for DBCS */ + static int lastc2 = NUL; /* 2nd last character searched */ + int char_bytes; /* 1: normal char, 2: DBCS char */ + #endif if (c != NUL) /* normal search: remember args for repeat */ { *************** *** 1068,1073 **** --- 1084,1093 ---- lastc = c; lastcdir = dir; lastctype = type; + #ifdef MULTI_BYTE + if (is_dbcs && IsLeadByte(c)) + lastc2 = c2 = (char_u)safe_vgetc(); + #endif } } else /* repeat previous search */ *************** *** 1080,1111 **** dir = lastcdir; type = lastctype; c = lastc; } p = ml_get_curline(); col = curwin->w_cursor.col; len = STRLEN(p); while (count--) { for (;;) { if ((col += dir) < 0 || col >= len) return FALSE; #ifdef MULTI_BYTE if (is_dbcs && dir < 0 && IsTrailByte(p, &p[col])) continue; /* skip multibyte's trail byte */ #endif ! if (p[col] == c) ! break; ! #ifdef MULTI_BYTE ! if (is_dbcs && dir > 0 && IsLeadByte(p[col])) ! ++col; /* skip multibyte's trail byte */ ! #endif } } if (type) col -= dir; curwin->w_cursor.col = col; return TRUE; } --- 1100,1157 ---- dir = lastcdir; type = lastctype; c = lastc; + #ifdef MULTI_BYTE + c2 = lastc2; + #endif } p = ml_get_curline(); col = curwin->w_cursor.col; len = STRLEN(p); + #ifdef MULTI_BYTE + if (is_dbcs && IsLeadByte(c)) + char_bytes = 2; + else + char_bytes = 1; + #endif + while (count--) { for (;;) { + #ifdef MULTI_BYTE + if (is_dbcs && dir > 0 && IsLeadByte(p[col])) + ++col; /* advance two bytes for multibyte char */ + #endif if ((col += dir) < 0 || col >= len) return FALSE; #ifdef MULTI_BYTE if (is_dbcs && dir < 0 && IsTrailByte(p, &p[col])) continue; /* skip multibyte's trail byte */ + + if (is_dbcs && char_bytes == 2) + { + if (p[col] == c && p[col + 1] == c2) + break; + } + else #endif ! if (p[col] == c) ! break; } } if (type) + { + /* backup to before the character (possibly double-byte) */ col -= dir; + #ifdef MULTI_BYTE + if (is_dbcs + && ((dir < 0 && char_bytes == 2) + || (dir > 0 && IsTrailByte(p, &p[col])))) + col -= dir; + #endif + } curwin->w_cursor.col = col; return TRUE; } *************** *** 1720,1725 **** --- 1766,1772 ---- /* * Move cursor briefly to character matching the one under the cursor. * Show the match only if it is visible on the screen. + * If there isn't a match, then beep. */ void showmatch() *************** *** 2034,2040 **** if (c == ' ' || c == '\t' || c == NUL) return 0; #ifdef MULTI_BYTE ! if (is_dbcs && IsLeadByte(c)) { /* process code leading/trailing bytes */ unsigned char pcode_lb = c & 0xff; --- 2081,2087 ---- if (c == ' ' || c == '\t' || c == NUL) return 0; #ifdef MULTI_BYTE ! if (is_dbcs && c > 0xff) { /* process code leading/trailing bytes */ unsigned char pcode_lb = c & 0xff; *************** *** 2049,2055 **** lb = pcode_lb; tb = pcode_tb; /* convert process code to JIS */ ! #ifdef WIN32 /* process code is SJIS */ if (lb <= 0x9f) lb = (lb - 0x81) * 2 + 0x21; --- 2096,2102 ---- lb = pcode_lb; tb = pcode_tb; /* convert process code to JIS */ ! # if defined(WIN32) || defined(macintosh) /* process code is SJIS */ if (lb <= 0x9f) lb = (lb - 0x81) * 2 + 0x21; *************** *** 2064,2070 **** tb -= 0x7e; lb += 1; } ! #else /* * XXX: Code page identification can not use with all * system! So, some other encoding information --- 2111,2117 ---- tb -= 0x7e; lb += 1; } ! # else /* * XXX: Code page identification can not use with all * system! So, some other encoding information *************** *** 2077,2083 **** /* assume process code is JAPANESE-EUC */ lb &= 0x7f; tb &= 0x7f; ! #endif /* exceptions */ switch (lb << 8 | tb) { --- 2124,2130 ---- /* assume process code is JAPANESE-EUC */ lb &= 0x7f; tb &= 0x7f; ! # endif /* exceptions */ switch (lb << 8 | tb) { *************** *** 3407,3421 **** * Also check for a "/ *" or "/ /" before the match. * Skips lines like "int backwards; / * normal index * * /" when looking for "normal". */ ! else #endif for (p = line; *p && p < startp; ++p) ! if (p[0] == '/' && (p[1] == '*' || p[1] == '/')) { matched = FALSE; ! break; } #ifdef COMMENTS fo_do_comments = FALSE; #endif --- 3454,3484 ---- * Also check for a "/ *" or "/ /" before the match. * Skips lines like "int backwards; / * normal index * * /" when looking for "normal". + * Note: Doesn't skip "/ *" in comments. */ ! p = skipwhite(line); ! if (matched ! || (p[0] == '/' && p[1] == '*') || p[0] == '*') #endif for (p = line; *p && p < startp; ++p) ! { ! if (matched ! && p[0] == '/' ! && (p[1] == '*' || p[1] == '/')) { matched = FALSE; ! /* After "//" all text is comment */ ! if (p[1] == '/') ! break; ! ++p; } + else if (!matched && p[0] == '*' && p[1] == '/') + { + /* Can find match after "* /". */ + matched = TRUE; + ++p; + } + } #ifdef COMMENTS fo_do_comments = FALSE; #endif diff -crN ../vim-5.6/src/structs.h ./src/structs.h *** ../vim-5.6/src/structs.h Thu Dec 2 17:43:04 1999 --- ./src/structs.h Mon May 22 09:42:51 2000 *************** *** 323,329 **** struct keyentry { struct keyentry *next; /* next keyword in the hash list */ ! int syn_inc_lvl; /* ":syn include" level for this match */ short syn_id; /* syntax ID for this match (if non-zero) */ short *next_list; /* ID list for next match (if non-zero) */ short flags; /* see syntax.c */ --- 323,329 ---- struct keyentry { struct keyentry *next; /* next keyword in the hash list */ ! int syn_inc_tag; /* ":syn include" tag for this match */ short syn_id; /* syntax ID for this match (if non-zero) */ short *next_list; /* ID list for next match (if non-zero) */ short flags; /* see syntax.c */ *************** *** 412,418 **** int b_dev; /* device number (-1 if not set) */ ino_t b_ino; /* inode number */ #endif ! #ifdef USE_SNIFF int b_sniff; /* file was loaded through Sniff */ #endif --- 412,420 ---- int b_dev; /* device number (-1 if not set) */ ino_t b_ino; /* inode number */ #endif ! #ifdef macintosh ! FSSpec b_FSSpec; /* MacOS File Identification */ ! #endif #ifdef USE_SNIFF int b_sniff; /* file was loaded through Sniff */ #endif diff -crN ../vim-5.6/src/syntax.c ./src/syntax.c *** ../vim-5.6/src/syntax.c Tue Jan 11 18:49:27 2000 --- ./src/syntax.c Mon May 22 09:42:51 2000 *************** *** 125,131 **** char sp_type; /* see SPTYPE_ defines below */ char sp_syncing; /* this item used for syncing */ short sp_flags; /* see HL_ defines below */ ! int sp_syn_inc_lvl; /* ":syn include" level of item */ short sp_syn_id; /* highlight group ID of item */ short sp_syn_match_id; /* highlight group ID of pattern */ char_u *sp_pattern; /* regexp to match, pattern */ --- 125,131 ---- char sp_type; /* see SPTYPE_ defines below */ char sp_syncing; /* this item used for syncing */ short sp_flags; /* see HL_ defines below */ ! int sp_syn_inc_tag; /* ":syn include" unique tag */ short sp_syn_id; /* highlight group ID of item */ short sp_syn_match_id; /* highlight group ID of pattern */ char_u *sp_pattern; /* regexp to match, pattern */ *************** *** 232,242 **** static char_u **syn_cmdlinep; /* ! * Another Annoying Hack(TM): To prevent rules from higher or lower in the ! * ":syn include" stack from from leaking into ALLBUT lists, we track the ! * current stack "level". */ ! static int current_syn_inc_lvl = 0; /* * To reduce the time spent in keepend(), remember at which level in the state --- 232,243 ---- static char_u **syn_cmdlinep; /* ! * Another Annoying Hack(TM): To prevent rules from other ":syn include"'d ! * files from from leaking into ALLBUT lists, we assign a unique ID to the ! * rules in each ":syn include"'d file. */ ! static int current_syn_inc_tag = 0; ! static int running_syn_inc_tag = 0; /* * To reduce the time spent in keepend(), remember at which level in the state *************** *** 1348,1361 **** && ((current_next_list != 0 && in_id_list(current_next_list, spp->sp_syn_id, ! spp->sp_syn_inc_lvl, 0)) || (current_next_list == 0 && ((cur_si == NULL && !(spp->sp_flags & HL_CONTAINED)) || (cur_si != NULL && in_id_list(cur_si->si_cont_list, spp->sp_syn_id, ! spp->sp_syn_inc_lvl, spp->sp_flags & HL_CONTAINED)))))) { int lc_col; --- 1349,1362 ---- && ((current_next_list != 0 && in_id_list(current_next_list, spp->sp_syn_id, ! spp->sp_syn_inc_tag, 0)) || (current_next_list == 0 && ((cur_si == NULL && !(spp->sp_flags & HL_CONTAINED)) || (cur_si != NULL && in_id_list(cur_si->si_cont_list, spp->sp_syn_id, ! spp->sp_syn_inc_tag, spp->sp_flags & HL_CONTAINED)))))) { int lc_col; *************** *** 2157,2169 **** if ( STRCMP(keyword, ktab->keyword) == 0 && ( (current_next_list != 0 && in_id_list(current_next_list, ktab->syn_id, ! ktab->syn_inc_lvl, 0)) || (current_next_list == 0 && ((cur_si == NULL && !(ktab->flags & HL_CONTAINED)) || (cur_si != NULL && in_id_list(cur_si->si_cont_list, ktab->syn_id, ! ktab->syn_inc_lvl, ktab->flags & HL_CONTAINED)))))) { *endcol = startcol + len - 1; --- 2158,2170 ---- if ( STRCMP(keyword, ktab->keyword) == 0 && ( (current_next_list != 0 && in_id_list(current_next_list, ktab->syn_id, ! ktab->syn_inc_tag, 0)) || (current_next_list == 0 && ((cur_si == NULL && !(ktab->flags & HL_CONTAINED)) || (cur_si != NULL && in_id_list(cur_si->si_cont_list, ktab->syn_id, ! ktab->syn_inc_tag, ktab->flags & HL_CONTAINED)))))) { *endcol = startcol + len - 1; *************** *** 3013,3019 **** return; STRCPY(ktab->keyword, name); ktab->syn_id = id; ! ktab->syn_inc_lvl = current_syn_inc_lvl; ktab->flags = flags; ktab->next_list = copy_id_list(next_list); --- 3014,3020 ---- return; STRCPY(ktab->keyword, name); ktab->syn_id = id; ! ktab->syn_inc_tag = current_syn_inc_tag; ktab->flags = flags; ktab->next_list = copy_id_list(next_list); *************** *** 3106,3111 **** --- 3107,3114 ---- {"skipempty", 9, HL_SKIPEMPTY}, {"grouphere", 9, HL_SYNC_HERE}, {"groupthere", 10, HL_SYNC_THERE}, + {"display", 7, 0}, + {"fold", 4, 0}, }; if (arg == NULL) /* already detected error */ *************** *** 3238,3243 **** --- 3241,3247 ---- char_u *rest; char_u *errormsg = NULL; int prev_toplvl_grp; + int prev_syn_inc_tag; eap->nextcmd = find_nextcmd(arg); if (eap->skip) *************** *** 3272,3286 **** /* * Save and restore the existing top-level grouplist id and ":syn ! * include" level around the actual inclusion. */ ! current_syn_inc_lvl++; prev_toplvl_grp = curbuf->b_syn_topgrp; curbuf->b_syn_topgrp = sgl_id; if (do_source(eap->arg, FALSE, FALSE) == FAIL) emsg2(e_notopen, eap->arg); curbuf->b_syn_topgrp = prev_toplvl_grp; ! current_syn_inc_lvl--; } /* --- 3276,3291 ---- /* * Save and restore the existing top-level grouplist id and ":syn ! * include" tag around the actual inclusion. */ ! prev_syn_inc_tag = current_syn_inc_tag; ! current_syn_inc_tag = ++running_syn_inc_tag; prev_toplvl_grp = curbuf->b_syn_topgrp; curbuf->b_syn_topgrp = sgl_id; if (do_source(eap->arg, FALSE, FALSE) == FAIL) emsg2(e_notopen, eap->arg); curbuf->b_syn_topgrp = prev_toplvl_grp; ! current_syn_inc_tag = prev_syn_inc_tag; } /* *************** *** 3429,3435 **** SYN_ITEMS(curbuf)[idx].sp_syncing = syncing; SYN_ITEMS(curbuf)[idx].sp_type = SPTYPE_MATCH; SYN_ITEMS(curbuf)[idx].sp_syn_id = syn_id; ! SYN_ITEMS(curbuf)[idx].sp_syn_inc_lvl = current_syn_inc_lvl; SYN_ITEMS(curbuf)[idx].sp_flags = flags; SYN_ITEMS(curbuf)[idx].sp_sync_idx = sync_idx; SYN_ITEMS(curbuf)[idx].sp_cont_list = cont_list; --- 3434,3440 ---- SYN_ITEMS(curbuf)[idx].sp_syncing = syncing; SYN_ITEMS(curbuf)[idx].sp_type = SPTYPE_MATCH; SYN_ITEMS(curbuf)[idx].sp_syn_id = syn_id; ! SYN_ITEMS(curbuf)[idx].sp_syn_inc_tag = current_syn_inc_tag; SYN_ITEMS(curbuf)[idx].sp_flags = flags; SYN_ITEMS(curbuf)[idx].sp_sync_idx = sync_idx; SYN_ITEMS(curbuf)[idx].sp_cont_list = cont_list; *************** *** 3652,3658 **** (item == ITEM_SKIP) ? SPTYPE_SKIP : SPTYPE_END; SYN_ITEMS(curbuf)[idx].sp_flags |= flags; SYN_ITEMS(curbuf)[idx].sp_syn_id = syn_id; ! SYN_ITEMS(curbuf)[idx].sp_syn_inc_lvl = current_syn_inc_lvl; SYN_ITEMS(curbuf)[idx].sp_syn_match_id = ppp->pp_matchgroup_id; if (item == ITEM_START) --- 3657,3663 ---- (item == ITEM_SKIP) ? SPTYPE_SKIP : SPTYPE_END; SYN_ITEMS(curbuf)[idx].sp_flags |= flags; SYN_ITEMS(curbuf)[idx].sp_syn_id = syn_id; ! SYN_ITEMS(curbuf)[idx].sp_syn_inc_tag = current_syn_inc_tag; SYN_ITEMS(curbuf)[idx].sp_syn_match_id = ppp->pp_matchgroup_id; if (item == ITEM_START) *************** *** 4288,4294 **** short **list; /* where to store the resulting list, if not NULL, the list is silently skipped! */ { ! char_u *p; char_u *end; int round; int count; --- 4293,4299 ---- short **list; /* where to store the resulting list, if not NULL, the list is silently skipped! */ { ! char_u *p = NULL; char_u *end; int round; int count; *************** *** 4358,4364 **** vim_free(name); break; } ! id = CONTAINS_ALLBUT + current_syn_inc_lvl; } else if (name[1] == '@') { --- 4363,4369 ---- vim_free(name); break; } ! id = CONTAINS_ALLBUT + current_syn_inc_tag; } else if (name[1] == '@') { *************** *** 4495,4504 **** * Check if "id" is in the "contains" or "nextgroup" list of pattern "idx". */ static int ! in_id_list(list, id, inclvl, contained) short *list; /* id list */ int id; /* group id */ ! int inclvl; /* ":syn include" level of group id */ int contained; /* group id is contained */ { int retval; --- 4500,4509 ---- * Check if "id" is in the "contains" or "nextgroup" list of pattern "idx". */ static int ! in_id_list(list, id, inctag, contained) short *list; /* id list */ int id; /* group id */ ! int inctag; /* ":syn include" tag of group id */ int contained; /* group id is contained */ { int retval; *************** *** 4519,4525 **** */ if (*list >= CONTAINS_ALLBUT && *list < CLUSTER_ID_MIN) { ! if (*list - CONTAINS_ALLBUT != inclvl) return FALSE; ++list; retval = FALSE; --- 4524,4530 ---- */ if (*list >= CONTAINS_ALLBUT && *list < CLUSTER_ID_MIN) { ! if (*list - CONTAINS_ALLBUT != inctag) return FALSE; ++list; retval = FALSE; *************** *** 4538,4544 **** if (scl_id >= 0) { scl_list = SYN_CLSTR(syn_buf)[scl_id].scl_list; ! if (scl_list != NULL && in_id_list(scl_list, id, inclvl, contained)) return retval; } } --- 4543,4549 ---- if (scl_id >= 0) { scl_list = SYN_CLSTR(syn_buf)[scl_id].scl_list; ! if (scl_list != NULL && in_id_list(scl_list, id, inctag, contained)) return retval; } } diff -crN ../vim-5.6/src/tag.c ./src/tag.c *** ../vim-5.6/src/tag.c Thu Jan 13 14:14:32 2000 --- ./src/tag.c Thu Jun 8 20:56:56 2000 *************** *** 86,91 **** --- 86,93 ---- static char_u *bottommsg = (char_u *)"at bottom of tag stack"; static char_u *topmsg = (char_u *)"at top of tag stack"; + static char_u *tagmatchname = NULL; /* name of last used tag */ + /* * We use ftello() here, if available. It returns off_t instead of long, * which helps if long is 32 bit and off_t is 64 bit. *************** *** 146,158 **** char_u **new_matches; int attr; int use_tagstack; /* remember the matches for the last used tag */ static int num_matches = 0; static int max_num_matches = 0; /* limit used for match search */ static char_u **matches = NULL; static int flags; - static char_u *matchname = NULL; if (type == DT_HELP) { --- 148,160 ---- char_u **new_matches; int attr; int use_tagstack; + int skip_msg = FALSE; /* remember the matches for the last used tag */ static int num_matches = 0; static int max_num_matches = 0; /* limit used for match search */ static char_u **matches = NULL; static int flags; if (type == DT_HELP) { *************** *** 314,320 **** --- 316,326 ---- if (cur_match >= MAXCOL) cur_match = MAXCOL - 1; else if (cur_match < 0) + { + EMSG("Cannot go before first matching tag"); + skip_msg = TRUE; cur_match = 0; + } } } *************** *** 348,362 **** name = tag; else name = tagstack[tagstackidx].tagname; ! other_name = (matchname == NULL || STRCMP(matchname, name) != 0); if (new_tag || (cur_match >= num_matches && max_num_matches != MAXCOL) || other_name) { if (other_name) { ! vim_free(matchname); ! matchname = vim_strsave(name); } if (type == DT_SELECT || type == DT_JUMP) --- 354,368 ---- name = tag; else name = tagstack[tagstackidx].tagname; ! other_name = (tagmatchname == NULL || STRCMP(tagmatchname, name) != 0); if (new_tag || (cur_match >= num_matches && max_num_matches != MAXCOL) || other_name) { if (other_name) { ! vim_free(tagmatchname); ! tagmatchname = vim_strsave(name); } if (type == DT_SELECT || type == DT_JUMP) *************** *** 629,635 **** --- 635,651 ---- } if (cur_match >= num_matches) + { + if (type == DT_NEXT || type == DT_FIRST) + { + if (num_matches == 1) + EMSG("There is only one matching tag"); + else + EMSG("Cannot go beyond last matching tag"); + skip_msg = TRUE; + } cur_match = num_matches - 1; + } if (use_tagstack) { tagstack[tagstackidx].cur_match = cur_match; *************** *** 649,655 **** #ifdef USE_CSCOPE && type != DT_CSCOPE #endif ! && (num_matches > 1 || ic)) { /* Give an indication of the number of matching tags */ sprintf((char *)msg_buf, "tag %d of %d%s", --- 665,672 ---- #ifdef USE_CSCOPE && type != DT_CSCOPE #endif ! && (num_matches > 1 || ic) ! && !skip_msg) { /* Give an indication of the number of matching tags */ sprintf((char *)msg_buf, "tag %d of %d%s", *************** *** 729,734 **** --- 746,761 ---- #endif } + /* + * Free cached tags. + */ + void + tag_freematch() + { + vim_free(tagmatchname); + tagmatchname = NULL; + } + static void taglen_advance(l) int l; *************** *** 806,812 **** * TAG_REGEXP use "pat" as a regexp * TAG_NOIC don't always ignore case */ - int find_tags(pat, num_matches, matchesp, flags, mincount) char_u *pat; /* pattern to search for */ --- 833,838 ---- *************** *** 932,937 **** --- 958,967 ---- ) goto findtag_end; + #ifdef USE_CSCOPE + STRCPY(tag_fname, "from cscope"); /* for error messages */ + #endif + /* * Initialize a few variables */ *************** *** 1175,1195 **** if (STRNCMP(p + 1, "include", 7) == 0 && incstack_idx < INCSTACK_SIZE) { if ((incstack[incstack_idx].etag_fname = vim_strsave(tag_fname)) != NULL) { incstack[incstack_idx].fp = fp; ! if ((fp = mch_fopen((char *)ebuf, "r")) == NULL) { ! fp = incstack[incstack_idx].fp; ! vim_free(incstack[incstack_idx].etag_fname); } ! else { ! STRCPY(tag_fname, ebuf); ! ++incstack_idx; } - is_etag = 0; /* we can include anything */ } } } --- 1205,1244 ---- if (STRNCMP(p + 1, "include", 7) == 0 && incstack_idx < INCSTACK_SIZE) { + /* Save current "fp" and "tag_fname" in the stack. */ if ((incstack[incstack_idx].etag_fname = vim_strsave(tag_fname)) != NULL) { + char_u *fullpath_ebuf; + incstack[incstack_idx].fp = fp; ! fp = NULL; ! ! /* Figure out "tag_fname" and "fp" to use for ! * included file. */ ! fullpath_ebuf = expand_tag_fname(ebuf, ! tag_fname, FALSE); ! if (fullpath_ebuf != NULL) { ! fp = mch_fopen((char *)fullpath_ebuf, "r"); ! if (fp != NULL) ! { ! if (STRLEN(fullpath_ebuf) > LSIZE) ! EMSG2("Tag file path trucated for %s\n", ebuf); ! STRNCPY(tag_fname, fullpath_ebuf, LSIZE); ! tag_fname[LSIZE] = NUL; ! ++incstack_idx; ! is_etag = 0; /* we can include anything */ ! } ! vim_free(fullpath_ebuf); } ! if (fp == NULL) { ! /* Can't open the included file, skip it and ! * restore old value of "fp". */ ! fp = incstack[incstack_idx].fp; ! vim_free(incstack[incstack_idx].etag_fname); } } } } *************** *** 2614,2628 **** { /* At this point "p" is pointing to the char following a "/". */ #ifdef VMS ! /* VMS allows disk:[directory - don't strip the [ in directory */ ! if (*p == '[' && p > filename && p[-1] == ':') { ! ++components; /* vms directory component */ p = getnextcomp(p + 1); } else #endif ! if (vim_ispathsep(*p)) movetail(p, p + 1); /* remove duplicate "/" */ else if (p[0] == '.' && vim_ispathsep(p[1])) movetail(p, p + 2); /* strip "./" */ --- 2663,2686 ---- { /* At this point "p" is pointing to the char following a "/". */ #ifdef VMS ! /* VMS allows device:[path] - don't strip the [ in directory */ ! if ((*p == '[' || *p == '<') && p > filename && p[-1] == ':') { ! /* :[ or :< composition: vms directory component */ ! ++components; p = getnextcomp(p + 1); } + /* allow remote calls as host"user passwd"::device:[path] */ + else if (p[0] == ':' && p[1] == ':' && p > filename && p[-1] == '"' ) + { + /* ":: composition: vms host/passwd component */ + ++components; + p = getnextcomp(p + 2); + + } else #endif ! if (vim_ispathsep(*p)) movetail(p, p + 1); /* remove duplicate "/" */ else if (p[0] == '.' && vim_ispathsep(p[1])) movetail(p, p + 2); /* strip "./" */ diff -crN ../vim-5.6/src/term.c ./src/term.c *** ../vim-5.6/src/term.c Sun Jan 2 14:00:24 2000 --- ./src/term.c Tue Jun 20 12:22:20 2000 *************** *** 79,85 **** || (defined(USE_MOUSE) && (!defined(UNIX) || defined(XTERM_MOUSE))) static int get_bytes_from_buf __ARGS((char_u *, char_u *, int)); #endif ! static int term_is_builtin __ARGS((char_u *)); #ifdef HAVE_TGETENT static char_u *tgetent_error __ARGS((char_u *, char_u *)); --- 79,86 ---- || (defined(USE_MOUSE) && (!defined(UNIX) || defined(XTERM_MOUSE))) static int get_bytes_from_buf __ARGS((char_u *, char_u *, int)); #endif ! static int term_is_builtin __ARGS((char_u *name)); ! static int term_7to8bit __ARGS((char_u *p)); #ifdef HAVE_TGETENT static char_u *tgetent_error __ARGS((char_u *, char_u *)); *************** *** 568,575 **** {K_F8, "\316B"}, {K_F9, "\316C"}, {K_F10, "\316D"}, ! {K_F11, "\316\205"}, /* only when nobioskey */ ! {K_F12, "\316\206"}, /* only when nobioskey */ {K_S_F1, "\316T"}, {K_S_F2, "\316U"}, {K_S_F3, "\316V"}, --- 569,576 ---- {K_F8, "\316B"}, {K_F9, "\316C"}, {K_F10, "\316D"}, ! {K_F11, "\316\205"}, ! {K_F12, "\316\206"}, {K_S_F1, "\316T"}, {K_S_F2, "\316U"}, {K_S_F3, "\316V"}, *************** *** 580,587 **** {K_S_F8, "\316["}, {K_S_F9, "\316\\"}, {K_S_F10, "\316]"}, ! {K_S_F11, "\316\207"}, /* only when nobioskey */ ! {K_S_F12, "\316\210"}, /* only when nobioskey */ {K_INS, "\316R"}, {K_DEL, "\316S"}, {K_HOME, "\316G"}, --- 581,588 ---- {K_S_F8, "\316["}, {K_S_F9, "\316\\"}, {K_S_F10, "\316]"}, ! {K_S_F11, "\316\207"}, ! {K_S_F12, "\316\210"}, {K_INS, "\316R"}, {K_DEL, "\316S"}, {K_HOME, "\316G"}, *************** *** 701,706 **** --- 702,777 ---- {K_KMULTIPLY, "\3167"}, # endif + # if defined(VMS) || defined(ALL_BUILTIN_TCAPS) + /* + * VT320 is working as an ANSI terminal compatible DEC terminal. + * (it covers VT1x0, VT2x0 and VT3x0 up to VT320 on VMS as well) + * Note: K_F1...K_F5 are for internal use, should not be defined. + * TODO:- rewrite ESC[ codes to CSI + * - keyboard languages (CSI ? 26 n) + */ + {(int)KS_NAME, "vt320"}, + {(int)KS_CE, "\033[K"}, + {(int)KS_AL, "\033[L"}, + # ifdef TERMINFO + {(int)KS_CAL, "\033[%p1%dL"}, + # else + {(int)KS_CAL, "\033[%dL"}, + # endif + {(int)KS_DL, "\033[M"}, + # ifdef TERMINFO + {(int)KS_CDL, "\033[%p1%dM"}, + # else + {(int)KS_CDL, "\033[%dM"}, + # endif + {(int)KS_CL, "\033[H\033[2J"}, + {(int)KS_ME, "\033[0m"}, + {(int)KS_MR, "\033[7m"}, + {(int)KS_MS, "y"}, + {(int)KS_LE, "\010"}, + # ifdef TERMINFO + {(int)KS_CM, "\033[%i%p1%d;%p2%dH"}, + # else + {(int)KS_CM, "\033[%i%d;%dH"}, + # endif + # ifdef TERMINFO + {(int)KS_CRI, "\033[%p1%dC"}, + # else + {(int)KS_CRI, "\033[%dC"}, + # endif + {K_UP, "\033[A"}, + {K_DOWN, "\033[B"}, + {K_RIGHT, "\033[C"}, + {K_LEFT, "\033[D"}, + {K_F6, "\033[17~"}, + {K_F7, "\033[18~"}, + {K_F8, "\033[19~"}, + {K_F9, "\033[20~"}, + {K_F10, "\033[21~"}, + /* {K_F11, "\033[23~"}, (ESC) should not define, sometimes does not work */ + {K_F12, "\033[24~"}, + {K_F13, "\033[25~"}, + {K_F14, "\033[26~"}, + {K_F15, "\033[28~"}, /* Help */ + {K_F16, "\033[29~"}, /* Select */ + {K_F17, "\033[31~"}, + {K_F18, "\033[32~"}, + {K_F19, "\033[33~"}, + {K_F20, "\033[34~"}, + {K_INS, "\033[2~"}, + {K_DEL, "\033[3~"}, + {K_HOME, "\033[1~"}, + {K_END, "\033[4~"}, + {K_PAGEUP, "\033[5~"}, + {K_PAGEDOWN, "\033[6~"}, + {K_KPLUS, "\033Ok"}, /* keypad plus */ + {K_KMINUS, "\033Om"}, /* keypad minus */ + {K_KDIVIDE, "\033Oo"}, /* keypad / */ + {K_KMULTIPLY, "\033Oj"}, /* keypad * */ + {K_KENTER, "\033OM"}, /* keypad Enter */ + {K_BS, "\x7f"}, /* for some reason 0177 doesn't work */ + # endif + # if defined(ALL_BUILTIN_TCAPS) || defined(__MINT__) /* * Ordinary vt52 *************** *** 882,888 **** {K_KDIVIDE, "\033Oo"}, /* keypad / */ {K_KMULTIPLY, "\033Oj"}, /* keypad * */ {K_KENTER, "\033OM"}, /* keypad Enter */ ! /* {K_DEL, "\033[3~"}, not used */ {BT_EXTRA_KEYS, ""}, {TERMCAP2KEY('k', '0'), "\033[10~"}, /* F0 */ --- 953,959 ---- {K_KDIVIDE, "\033Oo"}, /* keypad / */ {K_KMULTIPLY, "\033Oj"}, /* keypad * */ {K_KENTER, "\033OM"}, /* keypad Enter */ ! {K_KDEL, "\033[3~"}, /* keypad Del */ {BT_EXTRA_KEYS, ""}, {TERMCAP2KEY('k', '0'), "\033[10~"}, /* F0 */ *************** *** 1123,1129 **** --- 1194,1202 ---- {K_UNDO, "[UNDO]"}, {K_BS, "[BS]"}, {K_INS, "[INS]"}, + {K_KINS, "[KINS]"}, {K_DEL, "[DEL]"}, + {K_KDEL, "[KDEL]"}, {K_HOME, "[HOME]"}, {K_KHOME, "[KHOME]"}, {K_XHOME, "[XHOME]"}, *************** *** 1195,1201 **** #endif #ifdef VMS ! # define DEFAULT_TERM (char_u *)"ansi" #endif #ifdef __BEOS__ --- 1268,1274 ---- #endif #ifdef VMS ! # define DEFAULT_TERM (char_u *)"vt320" #endif #ifdef __BEOS__ *************** *** 1235,1241 **** return p; else #endif ! if (STRCMP(term, p->bt_string) == 0) return p; } ++p; --- 1308,1319 ---- return p; else #endif ! #ifdef VMS ! if (STRCMP(p->bt_string, "vt320") == 0 && vim_is_vt300(term)) ! return p; ! else ! #endif ! if (STRCMP(term, p->bt_string) == 0) return p; } ++p; *************** *** 1254,1275 **** { struct builtin_term *p; char_u name[2]; p = find_builtin_term(term); for (++p; p->bt_entry != (int)KS_NAME && p->bt_entry != BT_EXTRA_KEYS; ++p) { if ((int)p->bt_entry < 0x100) /* KS_xx entry */ { ! if (term_strings[p->bt_entry] == NULL || ! term_strings[p->bt_entry] == empty_option) ! term_strings[p->bt_entry] = (char_u *)p->bt_string; } else { name[0] = KEY2TERMCAP0((int)p->bt_entry); name[1] = KEY2TERMCAP1((int)p->bt_entry); if (find_termcode(name) == NULL) ! add_termcode(name, (char_u *)p->bt_string); } } } --- 1332,1378 ---- { struct builtin_term *p; char_u name[2]; + int term_8bit; p = find_builtin_term(term); + term_8bit = term_is_8bit(term); + for (++p; p->bt_entry != (int)KS_NAME && p->bt_entry != BT_EXTRA_KEYS; ++p) { if ((int)p->bt_entry < 0x100) /* KS_xx entry */ { ! /* Only set the value if it wasn't set yet. */ ! if (term_strings[p->bt_entry] == NULL ! || term_strings[p->bt_entry] == empty_option) ! { ! /* 8bit terminal: use CSI instead of [ */ ! if (term_8bit && term_7to8bit((char_u *)p->bt_string) != 0) ! { ! char_u *s, *t; ! ! s = vim_strsave((char_u *)p->bt_string); ! if (s != NULL) ! { ! for (t = s; *t; ++t) ! if (term_7to8bit(t)) ! { ! *t = term_7to8bit(t); ! STRCPY(t + 1, t + 2); ! } ! term_strings[p->bt_entry] = s; ! set_term_option_alloced(&term_strings[p->bt_entry]); ! } ! } ! else ! term_strings[p->bt_entry] = (char_u *)p->bt_string; ! } } else { name[0] = KEY2TERMCAP0((int)p->bt_entry); name[1] = KEY2TERMCAP1((int)p->bt_entry); if (find_termcode(name) == NULL) ! add_termcode(name, (char_u *)p->bt_string, term_8bit); } } } *************** *** 1400,1406 **** { if (find_termcode((char_u *)key_names[i]) == NULL) add_termcode((char_u *)key_names[i], ! TGETSTR(key_names[i], &tp)); } /* if cursor-left == backspace, ignore it (televideo 925) */ --- 1503,1509 ---- { if (find_termcode((char_u *)key_names[i]) == NULL) add_termcode((char_u *)key_names[i], ! TGETSTR(key_names[i], &tp), FALSE); } /* if cursor-left == backspace, ignore it (televideo 925) */ *************** *** 1408,1414 **** { p = TGETSTR("kl", &tp); if (p != NULL && *p != Ctrl('H')) ! add_termcode((char_u *)"kl", p); } if (height == 0) --- 1511,1517 ---- { p = TGETSTR("kl", &tp); if (p != NULL && *p != Ctrl('H')) ! add_termcode((char_u *)"kl", p, FALSE); } if (height == 0) *************** *** 1601,1614 **** bs_p = find_termcode((char_u *)"kb"); del_p = find_termcode((char_u *)"kD"); if (bs_p == NULL || *bs_p == NUL) ! add_termcode((char_u *)"kb", (bs_p = (char_u *)"\010")); if ((del_p == NULL || *del_p == NUL) && (bs_p == NULL || *bs_p != '\177')) ! add_termcode((char_u *)"kD", (char_u *)"\177"); } #ifdef USE_MOUSE ! # ifdef UNIX /* * For Unix, set the 'ttymouse' option to the type of mouse to be used. * The termcode for the mouse is added as a side effect in option.c. --- 1704,1717 ---- bs_p = find_termcode((char_u *)"kb"); del_p = find_termcode((char_u *)"kD"); if (bs_p == NULL || *bs_p == NUL) ! add_termcode((char_u *)"kb", (bs_p = (char_u *)"\010"), FALSE); if ((del_p == NULL || *del_p == NUL) && (bs_p == NULL || *bs_p != '\177')) ! add_termcode((char_u *)"kD", (char_u *)"\177", FALSE); } #ifdef USE_MOUSE ! # if defined(UNIX) || defined(VMS) /* * For Unix, set the 'ttymouse' option to the type of mouse to be used. * The termcode for the mouse is added as a side effect in option.c. *************** *** 1657,1663 **** name[0] = (int)KS_EXTRA; name[1] = (int)KE_SNIFF; ! add_termcode(name, (char_u *)"\233sniff"); } #endif --- 1760,1766 ---- name[0] = (int)KS_EXTRA; name[1] = (int)KE_SNIFF; ! add_termcode(name, (char_u *)"\233sniff", FALSE); } #endif *************** *** 1674,1680 **** } #endif ! #ifdef UNIX /* * 'ttyfast' is default on for xterm, iris-ansi and a few others. */ --- 1777,1783 ---- } #endif ! #if defined(UNIX) || defined(VMS) /* * 'ttyfast' is default on for xterm, iris-ansi and a few others. */ *************** *** 1774,1780 **** name[0] = n; name[1] = K_FILLER; ! add_termcode(name, s); # ifdef NETTERM_MOUSE if (n == KS_NETTERM_MOUSE) has_mouse_termcode |= HMT_NETTERM; --- 1877,1883 ---- name[0] = n; name[1] = K_FILLER; ! add_termcode(name, s, FALSE); # ifdef NETTERM_MOUSE if (n == KS_NETTERM_MOUSE) has_mouse_termcode |= HMT_NETTERM; *************** *** 1789,1795 **** } # endif ! # if ((defined(UNIX) || defined(OS2)) && (defined(XTERM_MOUSE) \ || defined(DEC_MOUSE) || defined(GPM_MOUSE))) || defined(PROTO) void del_mouse_termcode(n) --- 1892,1898 ---- } # endif ! # if ((defined(UNIX) || defined(VMS) || defined(OS2)) && (defined(XTERM_MOUSE) \ || defined(DEC_MOUSE) || defined(GPM_MOUSE))) || defined(PROTO) void del_mouse_termcode(n) *************** *** 1828,1841 **** int i; i = TGETENT(tbuf, term); ! if (i == -1) ! return (char_u *)"Cannot open termcap file"; ! if (i == 0) #ifdef TERMINFO ! return (char_u *)"Terminal entry not found in terminfo"; #else ! return (char_u *)"Terminal entry not found in termcap"; #endif return NULL; } --- 1931,1952 ---- int i; i = TGETENT(tbuf, term); ! if (i < 1) ! { ! /* On FreeBSD tputs() gets a SEGV after a tgetent() which fails. Call ! * tgetent() with the always existing "dumb" entry to avoid a crash or ! * hang. */ ! (void)TGETENT(tbuf, "dumb"); ! ! if (i == -1) ! return (char_u *)"Cannot open termcap file"; ! if (i == 0) #ifdef TERMINFO ! return (char_u *)"Terminal entry not found in terminfo"; #else ! return (char_u *)"Terminal entry not found in termcap"; #endif + } return NULL; } *************** *** 1869,1875 **** { char_u tbuf[TBUFSZ]; ! if (T_NAME != NULL && *T_NAME != NUL && TGETENT(tbuf, T_NAME) > 0) { if (Columns == 0) Columns = tgetnum("co"); --- 1980,1986 ---- { char_u tbuf[TBUFSZ]; ! if (T_NAME != NULL && *T_NAME != NUL && tgetent_error(tbuf, T_NAME) == NULL) { if (Columns == 0) Columns = tgetnum("co"); *************** *** 1955,1961 **** { if ((int)termp->bt_entry == key) { ! add_termcode(name, (char_u *)termp->bt_string); return OK; } ++termp; --- 2066,2073 ---- { if ((int)termp->bt_entry == key) { ! add_termcode(name, (char_u *)termp->bt_string, ! term_is_8bit(term)); return OK; } ++termp; *************** *** 1974,1980 **** string = TGETSTR((char *)name, &tp); if (string != NULL && *string != NUL) { ! add_termcode(name, string); return OK; } } --- 2086,2092 ---- string = TGETSTR((char *)name, &tp); if (string != NULL && *string != NUL) { ! add_termcode(name, string, FALSE); return OK; } } *************** *** 2001,2006 **** --- 2113,2152 ---- return (STRNCMP(name, "builtin_", (size_t)8) == 0); } + /* + * Return TRUE if terminal "name" uses CSI instead of [. + * Assume that the terminal is using 8-bit controls when the name contains + * "8bit", like in "xterm-8bit". + */ + int + term_is_8bit(name) + char_u *name; + { + return (strstr((char *)name, "8bit") != NULL); + } + + /* + * Translate terminal control chars from 7-bit to 8-bit: + * [ -> CSI + * ] -> + * O -> + */ + static int + term_7to8bit(p) + char_u *p; + { + if (*p == ESC) + { + if (p[1] == '[') + return CSI; + if (p[1] == ']') + return 0x9d; + if (p[1] == 'O') + return 0x8f; + } + return 0; + } + #ifdef USE_GUI int term_is_gui(name) *************** *** 2354,2380 **** char_u *s; int n; { /* Special handling of 16 colors, because termcap can't handle it */ /* Also accept "\e[3%dm" for TERMINFO, it is sometimes used */ if (n > 7 && atoi((char *)T_CCO) == 16 ! && s[0] == ESC && s[1] == '[' && s[2] != NUL ! && (STRCMP(s + 3, "%p1%dm") == 0 || STRCMP(s + 3, "%dm") == 0)) { ! if (s[2] == '3') /* foreground */ { #ifdef TERMINFO ! OUT_STR(tgoto("\033[9%p1%dm", 0, n - 8)); #else ! OUT_STR(tgoto("\033[9%dm", 0, n - 8)); #endif return; } ! if (s[2] == '4') /* background */ { #ifdef TERMINFO ! OUT_STR(tgoto("\033[10%p1%dm", 0, n - 8)); #else ! OUT_STR(tgoto("\033[10%dm", 0, n - 8)); #endif return; } --- 2500,2534 ---- char_u *s; int n; { + int i = 2; /* index in s[] just after [ or CSI */ + /* Special handling of 16 colors, because termcap can't handle it */ /* Also accept "\e[3%dm" for TERMINFO, it is sometimes used */ + /* Also accept CSI instead of [ */ if (n > 7 && atoi((char *)T_CCO) == 16 ! && ((s[0] == ESC && s[1] == '[') || (s[0] == CSI && (i = 1) == 1)) ! && s[i] != NUL ! && (STRCMP(s + i + 1, "%p1%dm") == 0 ! || STRCMP(s + i + 1, "%dm") == 0)) { ! if (s[i] == '3') /* foreground */ { #ifdef TERMINFO ! OUT_STR(tgoto(i == 2 ? "\033[9%p1%dm" ! : "\233\071%p1%dm", 0, n - 8)); #else ! OUT_STR(tgoto(i == 2 ? "\033[9%dm" : "\233\071%dm", 0, n - 8)); #endif return; } ! if (s[i] == '4') /* background */ { #ifdef TERMINFO ! OUT_STR(tgoto(i == 2 ? "\033[10%p1%dm" ! : "\233\061\060%p1%dm", 0, n - 8)); #else ! OUT_STR(tgoto(i == 2 ? "\033[10%dm" ! : "\233\061\060%dm", 0, n - 8)); #endif return; } *************** *** 2383,2389 **** OUT_STR(tgoto((char *)s, 0, n)); } ! #if (defined(WANT_TITLE) && (defined(UNIX) || defined(OS2))) || defined(PROTO) /* * Generic function to set window title, using t_ts and t_fs. */ --- 2537,2543 ---- OUT_STR(tgoto((char *)s, 0, n)); } ! #if (defined(WANT_TITLE) && (defined(UNIX) || defined(OS2) || defined(VMS))) || defined(PROTO) /* * Generic function to set window title, using t_ts and t_fs. */ *************** *** 2730,2742 **** */ if (tmode != TMODE_COOK || cur_tmode != TMODE_COOK) { out_flush(); mch_settmode(tmode); /* machine specific function */ cur_tmode = tmode; #ifdef USE_MOUSE ! if (tmode != TMODE_RAW) ! mch_setmouse(FALSE); /* switch mouse off */ ! else setmouse(); /* may switch mouse on */ #endif out_flush(); --- 2884,2898 ---- */ if (tmode != TMODE_COOK || cur_tmode != TMODE_COOK) { + #ifdef USE_MOUSE + if (tmode != TMODE_RAW) + mch_setmouse(FALSE); /* switch mouse off */ + #endif out_flush(); mch_settmode(tmode); /* machine specific function */ cur_tmode = tmode; #ifdef USE_MOUSE ! if (tmode == TMODE_RAW) setmouse(); /* may switch mouse on */ #endif out_flush(); *************** *** 2744,2750 **** #ifdef HAVE_TGETENT /* Request version string (for xterm) just after switching to raw mode ! * (otherwise the result will be echoed). The result it caught in * check_termcode(). */ if (cur_tmode == TMODE_RAW && need_get_crv && *T_CRV) { --- 2900,2906 ---- #ifdef HAVE_TGETENT /* Request version string (for xterm) just after switching to raw mode ! * (otherwise the result will be echoed). The result is caught in * check_termcode(). */ if (cur_tmode == TMODE_RAW && need_get_crv && *T_CRV) { *************** *** 2984,2992 **** * The list is kept alphabetical for ":set termcap" */ void ! add_termcode(name, string) ! char_u *name; ! char_u *string; { struct termcode *new_tc; int i, j; --- 3140,3149 ---- * The list is kept alphabetical for ":set termcap" */ void ! add_termcode(name, string, use_8bit) ! char_u *name; ! char_u *string; ! int use_8bit; /* replace 7-bit control by 8-bit one */ { struct termcode *new_tc; int i, j; *************** *** 3002,3007 **** --- 3159,3171 ---- if (s == NULL) return; + /* Change leading [ to CSI, change O to . */ + if (use_8bit && term_7to8bit(string) != 0) + { + mch_memmove(s, s + 1, STRLEN(s)); + s[0] = term_7to8bit(string); + } + need_gather = TRUE; /* need to fill termleader[] */ /* *************** *** 3146,3151 **** --- 3310,3316 ---- int mouse_code = 0; /* init for GCC */ int modifiers; int is_click, is_drag; + int wheel_code = 0; int current_button; static int held_button = MOUSE_RELEASE; static int orig_num_clicks = 1; *************** *** 3291,3312 **** { /* Check for xterm version string: "[>;;c". Also * eat other possible responses to t_RV, rxvt returns ! * "[?1;2c" */ ! if (tp[0] == ESC && tp[1] == '[' && len >= 3 && *T_CRV != NUL) { j = 0; extra = 0; ! for (i = 3; i < len && (isdigit(tp[i]) || tp[i] == ';'); ++i) if (tp[i] == ';' && ++j == 1) extra = atoi((char *)tp + i + 1); if (i == len) return -1; /* not enough characters */ /* eat it when at least one digit and ending in 'c' */ ! if (i > 3 && tp[i] == 'c') { /* If xterm version is >= 95, we can use mouse dragging */ ! if (tp[2] == '>' && j == 2 && extra >= 95) set_option_value((char_u *)"ttymouse", 0L, (char_u *)"xterm2"); key_name[0] = (int)KS_EXTRA; --- 3456,3479 ---- { /* Check for xterm version string: "[>;;c". Also * eat other possible responses to t_RV, rxvt returns ! * "[?1;2c". Also accept CSI instead of [. */ ! if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3) ! || (tp[0] == CSI && len >= 2))) { j = 0; extra = 0; ! for (i = 2 + (tp[0] != CSI); ! i < len && (isdigit(tp[i]) || tp[i] == ';'); ++i) if (tp[i] == ';' && ++j == 1) extra = atoi((char *)tp + i + 1); if (i == len) return -1; /* not enough characters */ /* eat it when at least one digit and ending in 'c' */ ! if (i > 2 + (tp[0] != CSI) && tp[i] == 'c') { /* If xterm version is >= 95, we can use mouse dragging */ ! if (tp[1 + (tp[0] != CSI)] == '>' && j == 2 && extra >= 95) set_option_value((char_u *)"ttymouse", 0L, (char_u *)"xterm2"); key_name[0] = (int)KS_EXTRA; *************** *** 3342,3354 **** { /* * For xterm and MSDOS we get "scr", where ! * s == encoded button state (0x20 = left, 0x22 = right, etc.) * c == column + ' ' + 1 == column + 33 * r == row + ' ' + 1 == row + 33 * ! * The coordinates are passed on through global variables. Ugly, ! * but this avoids trouble with mouse clicks at an unexpected ! * moment and allows for mapping them. */ num_bytes = get_bytes_from_buf(tp + slen, bytes, 3); if (num_bytes == -1) /* not enough coordinates */ --- 3509,3531 ---- { /* * For xterm and MSDOS we get "scr", where ! * s == encoded button state: ! * 0x20 = left button down ! * 0x21 = middle button down ! * 0x22 = right button down ! * 0x23 = any button release ! * 0x60 = button 4 down (scroll wheel down) ! * 0x61 = button 5 down (scroll wheel up) ! * add 0x04 for SHIFT ! * add 0x08 for ALT ! * add 0x10 for CTRL ! * add 0x20 for mouse drag (0x40 is drag with left button) * c == column + ' ' + 1 == column + 33 * r == row + ' ' + 1 == row + 33 * ! * The coordinates are passed on through global variables. ! * Ugly, but this avoids trouble with mouse clicks at an ! * unexpected moment and allows for mapping them. */ num_bytes = get_bytes_from_buf(tp + slen, bytes, 3); if (num_bytes == -1) /* not enough coordinates */ *************** *** 3357,3380 **** mouse_col = bytes[1] - ' ' - 1; mouse_row = bytes[2] - ' ' - 1; slen += num_bytes; ! # ifdef UNIX ! if (use_xterm_mouse() > 1) { if (mouse_code & MOUSE_DRAG_XTERM) mouse_code |= MOUSE_DRAG; } ! # endif ! # ifdef XTERM_CLIP ! else { ! if (!(mouse_code & MOUSE_DRAG & ~MOUSE_CLICK_MASK)) ! { ! if ((mouse_code & MOUSE_RELEASE) == MOUSE_RELEASE) ! stop_xterm_trace(); ! else ! start_xterm_trace(mouse_code); ! } } # endif } # endif /* !UNIX || XTERM_MOUSE */ --- 3534,3572 ---- mouse_col = bytes[1] - ' ' - 1; mouse_row = bytes[2] - ' ' - 1; slen += num_bytes; ! ! # if !defined(MSWIN) && !defined(MSDOS) ! /* ! * Handle mouse events. ! * Recognize the xterm mouse wheel, but not in the GUI ! * and the MS-DOS or Win32 console (multi-clicks use >= 0x60). ! */ ! if (mouse_code >= MOUSEWHEEL_LOW ! # ifdef USE_GUI ! && !gui.in_use ! # endif ! ) ! { ! /* Keep the mouse_code before it's changed, so that we ! * remember that it was a mouse wheel click. */ ! wheel_code = mouse_code; ! } ! # ifdef UNIX ! else if (use_xterm_mouse() > 1) { if (mouse_code & MOUSE_DRAG_XTERM) mouse_code |= MOUSE_DRAG; } ! # endif ! # ifdef XTERM_CLIP ! else if (!(mouse_code & MOUSE_DRAG & ~MOUSE_CLICK_MASK)) { ! if ((mouse_code & MOUSE_RELEASE) == MOUSE_RELEASE) ! stop_xterm_trace(); ! else ! start_xterm_trace(mouse_code); } + # endif # endif } # endif /* !UNIX || XTERM_MOUSE */ *************** *** 3556,3562 **** is_drag = TRUE; current_button = held_button; } ! else { # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) # ifdef GPM_MOUSE --- 3748,3754 ---- is_drag = TRUE; current_button = held_button; } ! else if (wheel_code == 0) { # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) # ifdef GPM_MOUSE *************** *** 3641,3647 **** /* Work out our pseudo mouse event */ key_name[0] = (int)KS_EXTRA; ! key_name[1] = get_pseudo_mouse_code(current_button, is_click, is_drag); } #endif /* USE_MOUSE */ --- 3833,3843 ---- /* Work out our pseudo mouse event */ key_name[0] = (int)KS_EXTRA; ! if (wheel_code != 0) ! key_name[1] = (wheel_code & 1) ! ? (int)KE_MOUSEUP : (int)KE_MOUSEDOWN; ! else ! key_name[1] = get_pseudo_mouse_code(current_button, is_click, is_drag); } #endif /* USE_MOUSE */ *************** *** 3893,3898 **** --- 4089,4100 ---- break; } } + + #ifdef MULTI_BYTE + /* skip multibyte char correctly */ + if (is_dbcs && IsLeadByte(*src) && src[1] != NUL) + result[dlen++] = *src++; + #endif result[dlen++] = *src++; } result[dlen] = NUL; diff -crN ../vim-5.6/src/testdir/Makefile ./src/testdir/Makefile *** ../vim-5.6/src/testdir/Makefile Tue Jul 20 13:39:16 1999 --- ./src/testdir/Makefile Sat Apr 29 22:16:34 2000 *************** *** 35,44 **** -rm -rf *.out test.log .in.out: $(VIMPROG) -u vimrc.unix -U NONE -s dotest.in $*.in /bin/sh -c "if diff test.out $*.ok; \ then mv -f test.out $*.out; \ ! else echo $* FAILED >>test.log; \ fi" -rm -f Xdotest --- 35,45 ---- -rm -rf *.out test.log .in.out: + -rm -f $*.failed $(VIMPROG) -u vimrc.unix -U NONE -s dotest.in $*.in /bin/sh -c "if diff test.out $*.ok; \ then mv -f test.out $*.out; \ ! else echo $* FAILED >>test.log; mv -f test.out $*.failed; \ fi" -rm -f Xdotest diff -crN ../vim-5.6/src/toolcheck ./src/toolcheck *** ../vim-5.6/src/toolcheck Mon May 12 19:40:16 1997 --- ./src/toolcheck Tue Feb 8 20:01:41 2000 *************** *** 5,11 **** # 24.7.95 jw. retval=0 ! reply="`sh -version 2>&1 < /dev/null`" case "$reply" in GNU*1.14.3*) echo "- sh is '$reply'"; --- 5,11 ---- # 24.7.95 jw. retval=0 ! reply="`sh -version -c exit 2>&1 < /dev/null`" case "$reply" in GNU*1.14.3*) echo "- sh is '$reply'"; diff -crN ../vim-5.6/src/ui.c ./src/ui.c *** ../vim-5.6/src/ui.c Tue Jan 11 18:01:44 2000 --- ./src/ui.c Sat Jun 3 11:37:13 2000 *************** *** 38,52 **** #endif } ! #if defined(USE_GUI) || defined(PROTO) /* * When executing an external program, there may be some typed characters that * are not consumed by it. Give them back to ui_inchar() and they are stored * here for the next call. */ static char_u *ta_str = NULL; ! static int ta_off; /* offset for next char to use */ ! static int ta_len; /* length of ta_str */ void ui_inchar_undo(s, len) --- 38,52 ---- #endif } ! #if (defined(USE_GUI) && defined(UNIX)) || defined(PROTO) /* * When executing an external program, there may be some typed characters that * are not consumed by it. Give them back to ui_inchar() and they are stored * here for the next call. */ static char_u *ta_str = NULL; ! static int ta_off; /* offset for next char to use when ta_str != NULL */ ! static int ta_len; /* length of ta_str when it's not NULL*/ void ui_inchar_undo(s, len) *************** *** 62,70 **** new = alloc(newlen); if (new != NULL) { ! mch_memmove(new, ta_str + ta_off, (size_t)(ta_len - ta_off)); ! mch_memmove(new + ta_len - ta_off, s, (size_t)len); ! vim_free(ta_str); ta_str = new; ta_len = newlen; ta_off = 0; --- 62,75 ---- new = alloc(newlen); if (new != NULL) { ! if (ta_str != NULL) ! { ! mch_memmove(new, ta_str + ta_off, (size_t)(ta_len - ta_off)); ! mch_memmove(new + ta_len - ta_off, s, (size_t)len); ! vim_free(ta_str); ! } ! else ! mch_memmove(new, s, (size_t)len); ta_str = new; ta_len = newlen; ta_off = 0; *************** *** 86,92 **** int maxlen; long wtime; /* don't use "time", MIPS cannot handle it */ { ! #ifdef USE_GUI /* * Use the typeahead if there is any. */ --- 91,97 ---- int maxlen; long wtime; /* don't use "time", MIPS cannot handle it */ { ! #if defined(USE_GUI) && defined(UNIX) /* * Use the typeahead if there is any. */ *************** *** 1288,1293 **** --- 1293,1299 ---- inbufcount = 0; # else + len = 0; /* to avoid gcc warning */ for (try = 0; try < 100; ++try) { len = read(read_cmd_fd, (char *)inbuf + inbufcount, *************** *** 1525,1531 **** XtGetSelectionValue(myShell, XA_PRIMARY, type, clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); ! /* Do we need this?: */ XFlush(dpy); /* --- 1531,1538 ---- XtGetSelectionValue(myShell, XA_PRIMARY, type, clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); ! /* Make sure the request for the selection goes out before waiting for ! * a response. */ XFlush(dpy); /* *************** *** 1538,1544 **** if (XCheckTypedEvent(dpy, SelectionNotify, &event)) break; ! /* Do we need this?: */ XSync(dpy, False); } --- 1545,1551 ---- if (XCheckTypedEvent(dpy, SelectionNotify, &event)) break; ! /* Do we need this? Probably not. */ XSync(dpy, False); } diff -crN ../vim-5.6/src/version.c ./src/version.c *** ../vim-5.6/src/version.c Sun Jan 16 14:11:37 2000 --- ./src/version.c Sat Jun 24 11:07:43 2000 *************** *** 23,30 **** char *Version = VIM_VERSION_SHORT; char *mediumVersion = VIM_VERSION_MEDIUM; ! #ifdef HAVE_DATE_TIME char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")"; #else char *longVersion = VIM_VERSION_LONG; #endif --- 23,49 ---- char *Version = VIM_VERSION_SHORT; char *mediumVersion = VIM_VERSION_MEDIUM; ! ! #if defined(HAVE_DATE_TIME) || defined(PROTO) ! # if (defined(VMS) && defined(VAXC)) || defined(PROTO) ! char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__) ! + sizeof(__TIME__) + 3]; ! void ! make_version() ! { ! /* ! * Construct the long version string. Necessary because ! * VAX C can't catenate strings in the preprocessor. ! */ ! strcpy(longVersion, VIM_VERSION_LONG_DATE); ! strcat(longVersion, __DATE__); ! strcat(longVersion, " "); ! strcat(longVersion, __TIME__); ! strcat(longVersion, ")"); ! } ! # else char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")"; + # endif #else char *longVersion = VIM_VERSION_LONG; #endif *************** *** 79,85 **** #else "-cmdline_info", #endif ! #ifdef CRYPTV "+comments", #else "-comments", --- 98,104 ---- #else "-cmdline_info", #endif ! #ifdef COMMENTS "+comments", #else "-comments", *************** *** 156,162 **** #if !defined(USE_SYSTEM) && defined(UNIX) "+fork()", #endif ! #ifdef UNIX # ifdef USE_GUI_GTK "+GUI_GTK", # else --- 175,181 ---- #if !defined(USE_SYSTEM) && defined(UNIX) "+fork()", #endif ! #if defined(UNIX) || defined(VMS) # ifdef USE_GUI_GTK "+GUI_GTK", # else *************** *** 220,236 **** # else "-mouse", #endif ! #ifdef UNIX # ifdef DEC_MOUSE "+mouse_dec", # else "-mouse_dec", # endif ! #ifdef GPM_MOUSE "+mouse_gpm", ! #else "-mouse_gpm", ! #endif # ifdef NETTERM_MOUSE "+mouse_netterm", # else --- 239,255 ---- # else "-mouse", #endif ! #if defined(UNIX) || defined(VMS) # ifdef DEC_MOUSE "+mouse_dec", # else "-mouse_dec", # endif ! # ifdef GPM_MOUSE "+mouse_gpm", ! # else "-mouse_gpm", ! # endif # ifdef NETTERM_MOUSE "+mouse_netterm", # else *************** *** 263,278 **** #else "-perl", #endif - #ifdef QUICKFIX - "+quickfix", - #else - "-quickfix", - #endif #ifdef HAVE_PYTHON "+python", #else "-python", #endif #ifdef RIGHTLEFT "+rightleft", #else --- 282,297 ---- #else "-perl", #endif #ifdef HAVE_PYTHON "+python", #else "-python", #endif + #ifdef QUICKFIX + "+quickfix", + #else + "-quickfix", + #endif #ifdef RIGHTLEFT "+rightleft", #else *************** *** 381,387 **** #else "-writebackup", #endif ! #ifdef UNIX # if defined(WANT_X11) && defined(HAVE_X11) "+X11", # else --- 400,406 ---- #else "-writebackup", #endif ! #if defined(UNIX) || defined(VMS) # if defined(WANT_X11) && defined(HAVE_X11) "+X11", # else *************** *** 492,497 **** --- 511,519 ---- #ifdef RISCOS MSG_PUTS("\nRISC OS version"); #endif + #ifdef VMS + MSG_PUTS("\nOpenVMS version"); + #endif /* Print the list of patch numbers if there is at least one. */ /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */ *************** *** 521,535 **** } } ! #ifdef UNIX ! MSG_PUTS("\nCompiled by "); ! MSG_PUTS(compiled_user); ! MSG_PUTS("@"); ! MSG_PUTS(compiled_sys); ! MSG_PUTS(", with (+) or without (-):\n"); ! #else ! MSG_PUTS("\nCompiled with (+) or without (-):\n"); #endif /* print all the features */ for (i = 0; features[i] != NULL; ++i) --- 543,563 ---- } } ! #if defined(UNIX) || defined(VMS) ! if (*compiled_user != NUL) ! { ! MSG_PUTS("\nCompiled by "); ! MSG_PUTS(compiled_user); ! if (*compiled_sys != NUL) ! { ! MSG_PUTS("@"); ! MSG_PUTS(compiled_sys); ! } ! MSG_PUTS(", with (+) or without (-):\n"); ! } ! else #endif + MSG_PUTS("\nCompiled with (+) or without (-):\n"); /* print all the features */ for (i = 0; features[i] != NULL; ++i) *************** *** 556,562 **** version_msg("\"\n"); #endif #ifdef USR_VIMRC_FILE3 ! version_msg(" 3d user vimrc file: \""); version_msg(USR_VIMRC_FILE3); version_msg("\"\n"); #endif --- 584,590 ---- version_msg("\"\n"); #endif #ifdef USR_VIMRC_FILE3 ! version_msg(" 3d user vimrc file: \""); version_msg(USR_VIMRC_FILE3); version_msg("\"\n"); #endif *************** *** 585,591 **** version_msg("\"\n"); # endif # ifdef USR_GVIMRC_FILE3 ! version_msg("3d user gvimrc file: \""); version_msg(USR_GVIMRC_FILE3); version_msg("\"\n"); # endif --- 613,619 ---- version_msg("\"\n"); # endif # ifdef USR_GVIMRC_FILE3 ! version_msg(" 3d user gvimrc file: \""); version_msg(USR_GVIMRC_FILE3); version_msg("\"\n"); # endif *************** *** 598,615 **** # endif #endif #ifdef HAVE_PATHDEF ! version_msg(" fall-back for $VIM: \""); ! version_msg((char *)default_vim_dir); ! MSG_PUTS("\"\n"); if (*default_vimruntime_dir != NUL) { ! version_msg(" and for $VIMRUNTIME: \""); version_msg((char *)default_vimruntime_dir); MSG_PUTS("\"\n"); } version_msg("Compilation: "); version_msg((char *)all_cflags); msg_putchar('\n'); version_msg("Linking: "); version_msg((char *)all_lflags); #endif --- 626,654 ---- # endif #endif #ifdef HAVE_PATHDEF ! if (*default_vim_dir != NUL) ! { ! version_msg(" fall-back for $VIM: \""); ! version_msg((char *)default_vim_dir); ! MSG_PUTS("\"\n"); ! } if (*default_vimruntime_dir != NUL) { ! version_msg(" f-b for $VIMRUNTIME: \""); version_msg((char *)default_vimruntime_dir); MSG_PUTS("\"\n"); } version_msg("Compilation: "); version_msg((char *)all_cflags); msg_putchar('\n'); + #ifdef VMS + if (*compiler_version != NUL) + { + version_msg("Compiler: "); + version_msg((char *)compiler_version); + msg_putchar('\n'); + } + #endif version_msg("Linking: "); version_msg((char *)all_lflags); #endif diff -crN ../vim-5.6/src/version.h ./src/version.h *** ../vim-5.6/src/version.h Sun Jan 16 14:10:29 2000 --- ./src/version.h Sat Jun 24 11:07:17 2000 *************** *** 15,26 **** #define VIM_VERSION_MAJOR 5 #define VIM_VERSION_MAJOR_STR "5" ! #define VIM_VERSION_MINOR 6 ! #define VIM_VERSION_MINOR_STR "6" ! #define VIM_VERSION_BUILD 62 ! #define VIM_VERSION_BUILD_STR "62" #define VIM_VERSION_PATCHLEVEL 0 #define VIM_VERSION_PATCHLEVEL_STR "0" /* * VIM_VERSION_NODOT is used for the runtime directory name. --- 15,29 ---- #define VIM_VERSION_MAJOR 5 #define VIM_VERSION_MAJOR_STR "5" ! #define VIM_VERSION_MINOR 7 ! #define VIM_VERSION_MINOR_STR "7" ! #define VIM_VERSION_BUILD 64 ! #define VIM_VERSION_BUILD_BCD 0x64 ! #define VIM_VERSION_BUILD_STR "64" #define VIM_VERSION_PATCHLEVEL 0 #define VIM_VERSION_PATCHLEVEL_STR "0" + /* Used by MacOS port should be one of: development, alpha, beta, final */ + #define VIM_VERSION_RELEASE final /* * VIM_VERSION_NODOT is used for the runtime directory name. *************** *** 28,35 **** * VIM_VERSION_MEDIUM is used for the startup-screen. * VIM_VERSION_LONG is used for the ":version" command and "Vim -h". */ ! #define VIM_VERSION_NODOT "vim56" ! #define VIM_VERSION_SHORT "5.6" ! #define VIM_VERSION_MEDIUM "5.6" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.6 (2000 Jan 16)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.6 (2000 Jan 16, compiled " --- 31,38 ---- * VIM_VERSION_MEDIUM is used for the startup-screen. * VIM_VERSION_LONG is used for the ":version" command and "Vim -h". */ ! #define VIM_VERSION_NODOT "vim57" ! #define VIM_VERSION_SHORT "5.7" ! #define VIM_VERSION_MEDIUM "5.7" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.7 (2000 Jun 24)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.7 (2000 Jun 24, compiled " diff -crN ../vim-5.6/src/vim.h ./src/vim.h *** ../vim-5.6/src/vim.h Tue Jan 11 16:20:58 2000 --- ./src/vim.h Sat Mar 25 20:37:52 2000 *************** *** 886,901 **** #ifdef USE_MOUSE ! /* Codes for mouse event */ # define MOUSE_LEFT 0x00 # define MOUSE_MIDDLE 0x01 # define MOUSE_RIGHT 0x02 # define MOUSE_RELEASE 0x03 # define MOUSE_SHIFT 0x04 # define MOUSE_ALT 0x08 # define MOUSE_CTRL 0x10 ! /* mouse buttons that are handled like a key press */ # define MOUSE_4 0x100 /* scroll wheel down */ # define MOUSE_5 0x200 /* scroll wheel up */ --- 886,903 ---- #ifdef USE_MOUSE ! /* Codes for mouse button events in lower three bits: */ # define MOUSE_LEFT 0x00 # define MOUSE_MIDDLE 0x01 # define MOUSE_RIGHT 0x02 # define MOUSE_RELEASE 0x03 + + /* bit masks for modifiers: */ # define MOUSE_SHIFT 0x04 # define MOUSE_ALT 0x08 # define MOUSE_CTRL 0x10 ! /* mouse buttons that are handled like a key press (GUI only) */ # define MOUSE_4 0x100 /* scroll wheel down */ # define MOUSE_5 0x200 /* scroll wheel up */ *************** *** 904,910 **** # define MOUSE_DRAG (0x40 | MOUSE_RELEASE) ! # define MOUSE_CLICK_MASK 0x03 # define NUM_MOUSE_CLICKS(code) \ (((unsigned)((code) & 0xC0) >> 6) + 1) --- 906,915 ---- # define MOUSE_DRAG (0x40 | MOUSE_RELEASE) ! /* Lowest button code for using the mouse wheel (xterm only) */ ! # define MOUSEWHEEL_LOW 0x60 ! ! # define MOUSE_CLICK_MASK 0x03 # define NUM_MOUSE_CLICKS(code) \ (((unsigned)((code) & 0xC0) >> 6) + 1) diff -crN ../vim-5.6/src/window.c ./src/window.c *** ../vim-5.6/src/window.c Thu Jan 13 10:59:45 2000 --- ./src/window.c Tue Jan 25 10:47:16 2000 *************** *** 937,946 **** win_free(win); /* Make sure curwin isn't invalid. It can cause severe trouble when ! * printing an error message. */ if (win == curwin) { curwin = wp; close_curwin = TRUE; } if (p_ea) --- 937,948 ---- win_free(win); /* Make sure curwin isn't invalid. It can cause severe trouble when ! * printing an error message. For win_equal() curbuf needs to be valid ! * too. */ if (win == curwin) { curwin = wp; + curbuf = wp->w_buffer; close_curwin = TRUE; } if (p_ea) *************** *** 1470,1476 **** { /* Always keep current window at least one line high, even when * 'winminheight' is zero */ ! if (height == 0) /* need at least one line */ { height = 1; room = 1; --- 1472,1478 ---- { /* Always keep current window at least one line high, even when * 'winminheight' is zero */ ! if (height <= 0) /* need at least one line */ { height = 1; room = 1; diff -crN ../vim-5.6/src/xxd/xxd.c ./src/xxd/xxd.c *** ../vim-5.6/src/xxd/xxd.c Mon Jun 14 16:31:58 1999 --- ./src/xxd/xxd.c Tue Jun 20 21:39:25 2000 *************** *** 47,52 **** --- 47,54 ---- * 26.09.98 Fixed: 'xxd -i infile outfile' did not truncate outfile. * 27.10.98 Fixed: -g option parser required blank. * option -b added: 01000101 binary output in normal format. + * 16.05.00 Added VAXC changes by Stephen P. Wall + * 16.05.00 Improved MMS file and merege for VMS by Zoltan Arpadffy * * (c) 1990-1998 by Juergen Weigert (jnweiger@informatik.uni-erlangen.de) * *************** *** 55,61 **** * lose money and don't ask me. */ #include ! #include #ifdef __TSC__ # define MSDOS #endif --- 57,67 ---- * lose money and don't ask me. */ #include ! #ifdef VAXC ! # include ! #else ! # include ! #endif #ifdef __TSC__ # define MSDOS #endif *************** *** 135,145 **** # define BIN_ASSIGN(fp, yes) setmode(fileno(fp), (yes) ? O_BINARY : O_TEXT) # define PATH_SEP '\\' #else ! # define BIN_READ(dummy) "r" ! # define BIN_WRITE(dummy) "w" ! # define BIN_CREAT(dummy) O_CREAT ! # define BIN_ASSIGN(fp, dummy) fp ! # define PATH_SEP '/' #endif /* open has only to arguments on the Mac */ --- 141,160 ---- # define BIN_ASSIGN(fp, yes) setmode(fileno(fp), (yes) ? O_BINARY : O_TEXT) # define PATH_SEP '\\' #else ! # ifdef VMS ! # define BIN_READ(dummy) "r" ! # define BIN_WRITE(dummy) "w" ! # define BIN_CREAT(dummy) O_CREAT ! # define BIN_ASSIGN(fp, dummy) fp ! # define PATH_SEP ']' ! # define FILE_SEP '.' ! # else ! # define BIN_READ(dummy) "r" ! # define BIN_WRITE(dummy) "w" ! # define BIN_CREAT(dummy) O_CREAT ! # define BIN_ASSIGN(fp, dummy) fp ! # define PATH_SEP '/' ! # endif #endif /* open has only to arguments on the Mac */ *************** *** 156,162 **** #endif #ifndef __P ! # ifdef __STDC__ # define __P(a) a # else # define __P(a) () --- 171,177 ---- #endif #ifndef __P ! # if defined(__STDC__) || defined(MSDOS) || defined(WIN32) || defined(OS2) # define __P(a) a # else # define __P(a) () *************** *** 416,421 **** --- 431,444 ---- for (pp = pname; *pp; ) if (*pp++ == PATH_SEP) pname = pp; + #ifdef FILE_SEP + for (pp = pname; *pp; pp++) + if (*pp == FILE_SEP) + { + *pp = '\0'; + break; + } + #endif while (argc >= 2) {