diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-12-31 19:07:19 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-12-31 19:07:19 +0100 |
commit | e7fedb6ebe72d9a475aa65109b77d5ed4667067a (patch) | |
tree | 19327fc9d1ca538d9c5c81c7284adf492e790e6d | |
parent | e3303cb0817e826e3c25d5dc4ac10b569d0841e1 (diff) |
patch 7.4.1008v7.4.1008
Problem: The OS/2 code pollutes the source while nobody uses it these days.
Solution: Drop the support for OS/2.
-rw-r--r-- | runtime/doc/os_os2.txt | 214 | ||||
-rw-r--r-- | src/INSTALL | 41 | ||||
-rw-r--r-- | src/Make_os2.mak | 163 | ||||
-rw-r--r-- | src/digraph.c | 6 | ||||
-rw-r--r-- | src/eval.c | 3 | ||||
-rw-r--r-- | src/ex_cmds.c | 4 | ||||
-rw-r--r-- | src/ex_docmd.c | 4 | ||||
-rw-r--r-- | src/ex_getln.c | 2 | ||||
-rw-r--r-- | src/feature.h | 4 | ||||
-rw-r--r-- | src/fileio.c | 12 | ||||
-rw-r--r-- | src/getchar.c | 12 | ||||
-rw-r--r-- | src/globals.h | 4 | ||||
-rw-r--r-- | src/macros.h | 2 | ||||
-rw-r--r-- | src/memline.c | 9 | ||||
-rw-r--r-- | src/misc1.c | 21 | ||||
-rw-r--r-- | src/misc2.c | 2 | ||||
-rw-r--r-- | src/netbeans.c | 2 | ||||
-rw-r--r-- | src/option.c | 99 | ||||
-rw-r--r-- | src/option.h | 2 | ||||
-rw-r--r-- | src/os_os2_cfg.h | 254 | ||||
-rw-r--r-- | src/os_unix.c | 78 | ||||
-rw-r--r-- | src/os_unix.h | 98 | ||||
-rw-r--r-- | src/proto/os_unix.pro | 1 | ||||
-rw-r--r-- | src/term.c | 5 | ||||
-rw-r--r-- | src/testdir/Make_os2.mak | 67 | ||||
-rw-r--r-- | src/testdir/os2.vim | 3 | ||||
-rw-r--r-- | src/ui.c | 8 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim.h | 4 | ||||
-rw-r--r-- | src/window.c | 2 |
30 files changed, 126 insertions, 1002 deletions
diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt index 231d7d1027..53bb79927d 100644 --- a/runtime/doc/os_os2.txt +++ b/runtime/doc/os_os2.txt @@ -1,221 +1,13 @@ -*os_os2.txt* For Vim version 7.4. Last change: 2007 Apr 22 +*os_os2.txt* For Vim version 7.4. Last change: 2015 Dec 31 VIM REFERENCE MANUAL by Paul Slootman *os2* *OS2* *OS/2* -This file contains the particularities for the OS/2 version of Vim. +This file used to contain the particularities for the OS/2 version of Vim. -At present there is no native PM version of the GUI version of Vim: The OS/2 -version is a console application. However, there is now a Win32s-compatible -GUI version, which should be usable by owners of Warp 4 (which supports -Win32s) in a Win-OS/2 session. The notes in this file refer to the native -console version. +The OS/2 support was removed in patch 7.4.1008. -NOTE - -This OS/2 port works well for me and a couple of other OS/2 users; however, -since I haven't had much feedback, that either means no (OS/2-specific) bugs -exist (besides the ones mentioned below), or no one has yet created a -situation in which any bugs are apparent. File I/O in Dos and Unix mode, -binary mode, and FAT handling all seem to work well, which would seem to be -the most likely places for trouble. - -A known problem is that files opened by Vim are inherited by other programs -that are started via a shell escape from within Vim. This specifically means -that Vim won't be able to remove the swap file(s) associated with buffers open -at the time the other program was started, until the other program is stopped. -At that time, the swap file may be removed, but if Vim could not do that the -first time, it won't be removed at all. You'll get warnings that some other -Vim session may be editing the file when you start Vim up again on that file. -This can be reproduced with ":!start epm". Now quit Vim, and start Vim again -with the file that was in the buffer at the time epm was started. I'm working -on this! - -A second problem is that Vim doesn't understand the situation when using it -when accessing the OS/2 system via the network, e.g. using telnet from a Unix -system, and then starting Vim. The problem seems to be that OS/2 =sometimes= -recognizes function / cursor keys, and tries to convert those to the -corresponding OS/2 codes generated by the "normal" PC keyboard. I've been -testing a workaround (mapping the OS/2 codes to the correct functions), but so -far I can't say anything conclusive (this is on Warp 3, by the way). In the -meantime any help will be appreciated. - - -PREREQUISITES - -To run Vim, you need the emx runtime environment (at least rev. 0.9b). This -is generally available as (ask Archie about it): - - emxrt.zip emx runtime package - -I've included a copy of emx.dll, which should be copied to one of the -directories listed in your LIBPATH. Emx is GPL'ed, but the emx.dll library is -not (read COPYING.EMX to find out what that means to you). - -This emx.dll is from the emxfix04.zip package, which unfortunately has a bug, -eh, I mean a POSIX feature, in select(). Versions of Vim before 3.27 will -appear to hang when starting (actually, while processing vimrc). Hit <Enter> a -couple of times until Vim starts working if this happens. Next, get an up to -date version of Vim! - - -HELP AND VIMRC FILE - -If you unpack the archive that Vim came in and run Vim directly from where it -was unpacked, Vim should be able to find the runtime files and your .vimrc -without any settings. - -If you put the runtime files separately from the binary, the VIM environment -variable is used to find the location of the help files and the system .vimrc. -Place an entry such as this in CONFIG.SYS: > - - SET VIM=c:/local/lib/vim - -Put your .vimrc and your other Vim files in this directory. Copy the runtime -directory to this directory. Each version of Vim has its own runtime -directory. It will be called something like "c:/local/lib/vim/vim54". Thus -you get a tree of Vim files like this: - c:/local/lib/vim/.vimrc - c:/local/lib/vim/vim54/filetype.vim - c:/local/lib/vim/vim54/doc/help.txt - etc. - -Note: .vimrc may also be called _vimrc to accommodate those who have chosen to -install OS/2 on a FAT file system. Vim first tries to find .vimrc and if that -fails, looks for _vimrc in the same place. The existence of a .vimrc or -_vimrc file influences the 'compatible' options, which can have unexpected side -effects. See |'compatible'|. - -If you're using network drives with OS/2, then you can install Vim on a -network drive (including .vimrc; this is then called the "system" vimrc file), -and then use a personal copy of .vimrc (the "user" vimrc file). This should be -located in a directory indicated by the HOME environment variable. - - -ENVIRONMENT VARIABLES IN FILE NAMES - -This HOME environment variable is also used when using ~ in file names, so -":e ~/textfile" will edit the file "textfile" in the directory referred to by -HOME. Additionally you can use other environment variables in file names, as -in ":n $SRC/*.c". - -The HOME environment variable is also used to locate the .viminfo file -(see |viminfo-file|). There is no support yet for .viminfo on FAT file -systems yet, sorry. You could try the -i startup flag (as in "vim -i -$HOME/_viminfo") however. - -If the HOME environment variable is not set, the value "C:/" is used as a -default. - - -BACKSLASHES - -Using slashes ('/') and backslashes ('\') can be a bit of a problem (see -|dos-backslash| for more explanation), but in almost all cases Vim does "The -Right Thing". Vim itself uses backslashes in file names, but will happily -accept forward slashes if they are entered (in fact, sometimes that works -better!). - - -TEMP FILES - -Temporary files (for filtering) are put in the first directory in the next -list that exists and where a file can be created: - $TMP - $TEMP - C:\TMP - C:\TEMP - current directory - - -TERMINAL SETTING - - *os2ansi* -Use "os2ansi" as the TERM environment variable (or don't set it at all, as the -default is the correct value). You can set term to os2ansi in the .vimrc, in -case you need TERM to be a different value for other applications. The -problem is that OS/2 ANSI emulation is quite limited (it doesn't have insert / -delete line, for example). - -If you want to use a different value for TERM (because of other programs, for -example), make sure that the termcap entry for that TERM value has the -appropriate key mappings. The termcap.dat distributed with emx does not always -have them. Here are some suitable values to add to the termcap entry of your -choice; these allow the cursor keys and the named function keys (such as -pagedown) to work. - - :ku=\316H:kd=\316P:kl=\316K:kr=\316M:%i=\316t:#4=\316s:\ - :kD=\316S:kI=\316R:kN=\316Q:kP=\316I:kh=\316G:@7=\316O:\ - :k1=\316;:k2=\316<:k3=\316=:k4=\316>:k5=\316?:k6=\316@:\ - :k7=\316A:k8=\316B:k9=\316C:k;=\316D: - - -Paul Slootman - - -43 LINE WINDOW - -A suggestion from Steven Tryon, on how to run Vim in a bigger window: - -When I call Vim from an OS/2 WPS application such as PMMail it comes up -in the default 25-line mode. To get a more useful window size I make -my external editor "vimbig.cmd" which in turn calls "vimbig2.cmd". -Brute force and awkwardness, perhaps, but it works. - -vimbig.cmd: > - @echo off - start "Vi Improved" /f vimbig2.cmd %1 %2 %3 %4 - -vimbig2.cmd: > - @echo off - mode 80,43 - vim.exe %1 %2 %3 %4 - exit -< - -CLIPBOARD ACCESS (provided by Alexander Wagner) - -Vim for OS/2 has no direct access to the system clipboard. To enable access -anyway you need an additional tool which gives you access to the clipboard -from within a vio application. The freeware package clipbrd.zip by Stefan -Gruendel can be used for this purpose. You might download the package -including precompiled binaries and all sources from: - http://www.os2site.com/sw/util/clipboard/index.html - http://download.uni-hd.de/ftp/pub/os2/pmtools/ - -Installation of this package is straight forward: just put the two executables -that come with this package into a directory within your PATH for Vim should -be able to call them from whatever directory you are working. - -To copy text from the clipboard to your Vim session you can use the :r -command. Simply call clipbrd.exe from within Vim in the following way: > - - :r !clipbrd -r - -To copy text from Vim to the system clipboard just mark the text in the usual -vim-manner and call: > - - :!clipbrd -w - -which will write your selection right into OS/2's clipboard. - -For ease of use you might want to add some maps for these commands. E.g. to -use F11 to paste the clipboard into Vim and F12 to copy selected text to the -clipboard you would use: > - - if has("os2") - imap <F11> <ESC>:r !clipbrd -r<CR>i - vmap <F12> :!clipbrd -w<cr> - else - imap <F11> <ESC>"*p<CR>i - vmap <F12> "*y - endif - -This will ensure that only on OS/2 clipbrd is called whereas on other -platforms vims build in mechanism is used. (To enable this functions on every -load of Vim place the above lines in your .vimrc.) - vim:tw=78:ts=8:ft=help:norl: diff --git a/src/INSTALL b/src/INSTALL index 54297d198e..521d058be4 100644 --- a/src/INSTALL +++ b/src/INSTALL @@ -176,46 +176,7 @@ And to not search for locally installed headers and libraries at all, use: 3. OS/2 ======= -Summary: -ren Makefile Makefile.unix -ren makefile.os2 Makefile -make - -This port of Vim to OS/2 is based on the emx environment together -with GNU C. The main design goal of emx is to simplify porting Unix -software to OS/2 and DOS. Because of this, almost all the Unix defines -etc. already existing in the Vim source code could be reused. Only where -OS/2 specifics came into play were additional changes necessary. Those -places can be found by searching for "OS2" and "__EMX__" (I've tried to -keep emx-specific things separate from generic OS/2 stuff). - -Note: This OS/2 port works well for me and an additional OS/2 user on - the Vim development team (Karsten Sievert); however, since I - haven't had any other feedback from other people, that either - means no (OS/2-specific) bugs exist, or no one has yet created - a situation in which any bugs are apparent. - Report any problems or other comments to paul@wau.mis.ah.nl - (email valid up to at least September 1996, after that try - paul@wurtel.hobby.nl, paul@murphy.nl, or paulS@toecompst.nl). - Textmode/notextmode and binary mode both seem to work well. - -Prerequisites: -- To compile, you need the emx environment (at least rev. 0.9b), GCC, - some make utility (GNU make works fine). These are generally - available as (ask Archie about them): - emxrt.zip emx runtime package - emxdev.zip emx development system (without compiler) - GNU programs compiled for emx, patches and patched sources: - gnudev1.zip GNU development tools compiled for emx (part 1) - gnudev2.zip GNU development tools compiled for emx (part 2) - gnumake.zip GNU make -- Don't set a TERM environment variable; Vim defaults to os2ansi - which is available as a builtin termcap entry. Using other values - may give problems! (OS/2 ANSI emulation is quite limited.) If you - need to set TERM for other programs, you may consider putting - set term=os2ansi in the vimrc file. - -Check ../runtime/doc/os_os2.txt for additional info on running Vim. +OS/2 support was removed in patch 7.4.1008 4. Atari MiNT diff --git a/src/Make_os2.mak b/src/Make_os2.mak deleted file mode 100644 index cd62d1c6d5..0000000000 --- a/src/Make_os2.mak +++ /dev/null @@ -1,163 +0,0 @@ -# -# Makefile for VIM on OS/2 using EMX vim:ts=8:sw=8:tw=78 -# -# Created by: Paul Slootman -# - -### This Makefile has been successfully tested on these systems. -### Check the (*) column for remarks, listed below. -### Later code changes may cause small problems, otherwise Vim is supposed to -### compile and run without problems. -### Just to show that this is just like the Unix version! - -#system: configurations: version (*) tested by: -#------------- ------------------------ ------- - ---------- -#OS/2 Warp HPFS gcc-2.7.2+emx-0.9b -GUI 4.5 Paul Slootman -#OS/2 FAT gcc-2.6.3+emx -GUI 4.5 Karsten Sievert - -#>>>>> choose options: - -### See feature.h for a list of optionals. -### Any other defines can be included here. - -DEFINES = -DUSE_SYSTEM=1 - -#>>>>> name of the compiler and linker, name of lib directory -CC = gcc - -#>>>>> end of choices - -### Name of target(s) -TARGET = vim.exe - -### Names of the tools that are also made -TOOLS = xxd/xxd.exe tee/tee.exe - -########################################################################### - -INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_unix.h structs.h os_os2_cfg.h -CFLAGS = -O2 -fno-strength-reduce -DOS2 -Wall -Iproto $(DEFINES) - -OBJ = \ - blowfish.o \ - buffer.o \ - charset.o \ - crypt.o \ - crypt_zip.o \ - diff.o \ - digraph.o \ - edit.o \ - eval.o \ - ex_cmds.o \ - ex_cmds2.o \ - ex_docmd.o \ - ex_eval.o \ - ex_getln.o \ - fileio.o \ - fold.o \ - getchar.o \ - hardcopy.o \ - hashtab.o \ - main.o \ - mark.o \ - memfile.o \ - memline.o \ - menu.o \ - message.o \ - misc1.o \ - misc2.o \ - move.o \ - mbyte.o \ - normal.o \ - ops.o \ - option.o \ - popupmnu.o \ - quickfix.o \ - regexp.o \ - screen.o \ - search.o \ - sha256.o \ - spell.o \ - syntax.o \ - tag.o \ - term.o \ - ui.o \ - undo.o \ - window.o \ - os_unix.o - -LIBS = -ltermcap - -# Default target is making the executable -all: $(TARGET) $(TOOLS) - -# Link the target for normal use -LFLAGS = -Zcrtdll -s -o $(TARGET) $(LIBS) - -$(TARGET): $(OBJ) version.c version.h - $(CC) $(CFLAGS) version.c $(OBJ) $(LFLAGS) - -xxd/xxd.exe: xxd/xxd.c - cd xxd & $(MAKE) -f Make_os2.mak - -tee/tee.exe: tee/tee.c - cd tee & $(MAKE) -f Makefile - -test: - cd testdir & $(MAKE) -f Make_os2.mak - -clean: - -del *.o - -del *.exe - -del *.~ *~ *.bak - cd xxd & $(MAKE) -f Make_os2.mak clean - cd tee & $(MAKE) -f Makefile clean - -########################################################################### - -os_unix.o: os_unix.c $(INCL) -blowfish.o: blowfish.c $(INCL) -buffer.o: buffer.c $(INCL) -charset.o: charset.c $(INCL) -crypt.o: crypt.c $(INCL) -crypt_zip.o: crypt_zip.c $(INCL) -diff.o: diff.c $(INCL) -digraph.o: digraph.c $(INCL) -edit.o: edit.c $(INCL) -eval.o: eval.c $(INCL) -ex_cmds.o: ex_cmds.c $(INCL) -ex_cmds2.o: ex_cmds2.c $(INCL) -ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h -ex_eval.o: ex_eval.c $(INCL) ex_cmds.h -ex_getln.o: ex_getln.c $(INCL) -fileio.o: fileio.c $(INCL) -fold.o: fold.c $(INCL) -getchar.o: getchar.c $(INCL) -hardcopy.o: hardcopy.c $(INCL) -hashtab.o: hashtab.c $(INCL) -main.o: main.c $(INCL) -mark.o: mark.c $(INCL) -memfile.o: memfile.c $(INCL) -memline.o: memline.c $(INCL) -menu.o: menu.c $(INCL) -message.o: message.c $(INCL) -misc1.o: misc1.c $(INCL) -misc2.o: misc2.c $(INCL) -move.o: move.c $(INCL) -mbyte.o: mbyte.c $(INCL) -normal.o: normal.c $(INCL) -ops.o: ops.c $(INCL) -option.o: option.c $(INCL) -popupmnu.o: popupmnu.c $(INCL) -quickfix.o: quickfix.c $(INCL) -regexp.o: regexp.c $(INCL) -screen.o: screen.c $(INCL) -search.o: search.c $(INCL) -sha256.o: sha256.c $(INCL) -spell.o: spell.c $(INCL) -syntax.o: syntax.c $(INCL) -tag.o: tag.c $(INCL) -term.o: term.c $(INCL) -ui.o: ui.c $(INCL) -undo.o: undo.c $(INCL) -window.o: window.c $(INCL) diff --git a/src/digraph.c b/src/digraph.c index 9f7d0cc4e2..ba24e3f0fc 100644 --- a/src/digraph.c +++ b/src/digraph.c @@ -39,7 +39,7 @@ static garray_T user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL}; * compilers cannot handle them (Amiga SAS/C is the most picky one). */ static digr_T digraphdefault[] = -#if defined(MSDOS) || defined(OS2) +#if defined(MSDOS) /* * MSDOS digraphs. */ @@ -105,7 +105,7 @@ static digr_T digraphdefault[] = {NUL, NUL, NUL} }; -#else /* !MSDOS && !OS2 */ +#else /* !MSDOS */ # ifdef __MINT__ /* @@ -2007,7 +2007,7 @@ static digr_T digraphdefault[] = # endif /* EBCDIC */ # endif /* !HPUX_DIGRAPHS */ # endif /* !__MINT__ */ -#endif /* !MSDOS && !OS2 */ +#endif /* !MSDOS */ /* * handle digraphs after typing a character diff --git a/src/eval.c b/src/eval.c index eca8224ebf..8b972dfe78 100644 --- a/src/eval.c +++ b/src/eval.c @@ -12791,9 +12791,6 @@ f_has(argvars, rettv) #if defined(MACOS_X_UNIX) "macunix", #endif -#ifdef OS2 - "os2", -#endif #ifdef __QNX__ "qnx", #endif diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 73a55641ad..f3cb4b4069 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1570,7 +1570,7 @@ make_filter_cmd(cmd, itmp, otmp) char_u *buf; long_u len; -#if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2) +#if defined(UNIX) && !defined(ARCHIE) int is_fish_shell; char_u *shell_name = get_isolated_shell_name(); @@ -1590,7 +1590,7 @@ make_filter_cmd(cmd, itmp, otmp) if (buf == NULL) return NULL; -#if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2) +#if defined(UNIX) && !defined(ARCHIE) /* * Put braces around the command (for concatenated commands) when * redirecting input and/or output. diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 31b51e99d6..0e8e7bda10 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3794,7 +3794,7 @@ set_one_cmd_context(xp, buff) /* Check for environment variable */ if (*xp->xp_pattern == '$' -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) || *xp->xp_pattern == '%' #endif ) @@ -5073,7 +5073,7 @@ expand_filename(eap, cmdlinep, errormsgp) * For Unix and OS/2, when wildcards are expanded, this is * done by ExpandOne() below. */ -#if defined(UNIX) || defined(OS2) +#if defined(UNIX) if (!has_wildcards) #endif backslash_halve(eap->arg); diff --git a/src/ex_getln.c b/src/ex_getln.c index b6aeacf1a9..391946623e 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4955,7 +4955,7 @@ expand_shellcmd(filepat, num_file, file, flagsarg) if (*s == ' ') ++s; /* Skip space used for absolute path name. */ -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) e = vim_strchr(s, ';'); #else e = vim_strchr(s, ':'); diff --git a/src/feature.h b/src/feature.h index c499d9d50a..c2bf2605d8 100644 --- a/src/feature.h +++ b/src/feature.h @@ -60,7 +60,7 @@ */ #if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \ && !defined(FEAT_BIG) && !defined(FEAT_HUGE) -# if defined(MSWIN) || defined(DJGPP) || defined(OS2) || defined(VMS) || defined(MACOS) || defined(AMIGA) +# if defined(MSWIN) || defined(DJGPP) || defined(VMS) || defined(MACOS) || defined(AMIGA) # define FEAT_BIG # else # ifdef MSDOS @@ -1046,7 +1046,7 @@ * +mouse Any mouse support (any of the above enabled). */ /* OS/2 and Amiga console have no mouse support */ -#if !defined(AMIGA) && !defined(OS2) +#if !defined(AMIGA) # ifdef FEAT_NORMAL # define FEAT_MOUSE_XTERM # endif diff --git a/src/fileio.c b/src/fileio.c index 9224777711..362d82ee05 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -445,7 +445,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) return FAIL; } #endif -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* * MS-Windows allows opening a device, but we will probably get stuck * trying to read it. @@ -526,7 +526,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) file_readonly = FALSE; if (read_stdin) { -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* Force binary I/O on stdin to avoid CR-LF -> LF conversion. */ setmode(0, O_BINARY); #endif @@ -3553,7 +3553,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, } if (c == NODE_WRITABLE) { -# if defined(MSDOS) || defined(MSWIN) || defined(OS2) +# if defined(MSDOS) || defined(MSWIN) /* MS-Windows allows opening a device, but we will probably get stuck * trying to write to it. */ if (!p_odev) @@ -6055,7 +6055,7 @@ shorten_fname(full_path, dir_name) if (fnamencmp(dir_name, full_path, len) == 0) { p = full_path + len; -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* * MSDOS: when a file is in the root directory, dir_name will end in a * slash, since C: by itself does not define a specific dir. In this @@ -6072,7 +6072,7 @@ shorten_fname(full_path, dir_name) #endif } } -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* * When using a file in the current drive, remove the drive name: * "A:\dir\file" -> "\dir\file". This helps when moving a session file on @@ -6330,7 +6330,7 @@ buf_modname(shortname, fname, ext, prepend_dot) else if ((int)STRLEN(e) + extlen > 4) s = e + 4 - extlen; } -#if defined(OS2) || defined(USE_LONG_FNAME) || defined(WIN3264) +#if defined(USE_LONG_FNAME) || defined(WIN3264) /* * If there is no file name, and the extension starts with '.', put a * '_' before the dot, because just ".ext" may be invalid if it's on a diff --git a/src/getchar.c b/src/getchar.c index f4ec991b09..70829e18ef 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -962,8 +962,8 @@ init_typebuf() } /* - * insert a string in position 'offset' in the typeahead buffer (for "@r" - * and ":normal" command, vgetorpeek() and check_termcode()) + * Insert a string in position 'offset' in the typeahead buffer (for "@r" + * and ":normal" command, vgetorpeek() and check_termcode()). * * If noremap is REMAP_YES, new string can be mapped again. * If noremap is REMAP_NONE, new string cannot be mapped again. @@ -5295,7 +5295,7 @@ check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr) } #endif -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) +#if defined(MSDOS) || defined(MSWIN) || defined(MACOS) #define VIS_SEL (VISUAL+SELECTMODE) /* abbreviation */ @@ -5308,7 +5308,7 @@ static struct initmap int mode; } initmappings[] = { -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* Use the Windows (CUA) keybindings. */ # ifdef FEAT_GUI /* paste, copy and cut */ @@ -5379,7 +5379,7 @@ static struct initmap void init_mappings() { -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) +#if defined(MSDOS) || defined(MSWIN) ||defined(MACOS) int i; for (i = 0; i < sizeof(initmappings) / sizeof(struct initmap); ++i) @@ -5387,7 +5387,7 @@ init_mappings() #endif } -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) \ +#if defined(MSDOS) || defined(MSWIN) \ || defined(FEAT_CMDWIN) || defined(MACOS) || defined(PROTO) /* * Add a mapping "map" for mode "mode". diff --git a/src/globals.h b/src/globals.h index f0879dc670..d921a4e246 100644 --- a/src/globals.h +++ b/src/globals.h @@ -19,7 +19,7 @@ */ EXTERN long Rows /* nr of rows in the screen */ #ifdef DO_INIT -# if defined(MSDOS) || defined(WIN3264) || defined(OS2) +# if defined(MSDOS) || defined(WIN3264) = 25L # else = 24L @@ -1534,7 +1534,7 @@ EXTERN char_u e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); #endif EXTERN char_u e_secure[] INIT(= N_("E523: Not allowed here")); #if defined(AMIGA) || defined(MACOS) || defined(MSWIN) \ - || defined(UNIX) || defined(VMS) || defined(OS2) + || defined(UNIX) || defined(VMS) EXTERN char_u e_screenmode[] INIT(= N_("E359: Screen mode setting not supported")); #endif EXTERN char_u e_scroll[] INIT(= N_("E49: Invalid scroll size")); diff --git a/src/macros.h b/src/macros.h index caaca9a3ef..737eddf520 100644 --- a/src/macros.h +++ b/src/macros.h @@ -231,7 +231,7 @@ #if defined(UNIX) || defined(VMS) /* open in rw------- mode */ # define mch_open_rw(n, f) mch_open((n), (f), (mode_t)0600) #else -# if defined(MSDOS) || defined(MSWIN) || defined(OS2) /* open read/write */ +# if defined(MSDOS) || defined(MSWIN) /* open read/write */ # define mch_open_rw(n, f) mch_open((n), (f), S_IREAD | S_IWRITE) # else # define mch_open_rw(n, f) mch_open((n), (f), 0) diff --git a/src/memline.c b/src/memline.c index a1c07a967b..cd6d151e13 100644 --- a/src/memline.c +++ b/src/memline.c @@ -4211,8 +4211,7 @@ findswapname(buf, dirp, old_fname) #endif char_u *buf_fname = buf->b_fname; -#if !defined(SHORT_FNAME) \ - && ((!defined(UNIX) && !defined(OS2)) || defined(ARCHIE)) +#if !defined(SHORT_FNAME) && (!defined(UNIX) || defined(ARCHIE)) # define CREATE_DUMMY_FILE FILE *dummyfd = NULL; @@ -4272,7 +4271,7 @@ findswapname(buf, dirp, old_fname) fname = NULL; break; } -#if (defined(UNIX) || defined(OS2)) && !defined(ARCHIE) && !defined(SHORT_FNAME) +#if defined(UNIX) && !defined(ARCHIE) && !defined(SHORT_FNAME) /* * Some systems have a MS-DOS compatible filesystem that use 8.3 character * file names. If this is the first try and the swap file name does not fit in @@ -4323,10 +4322,6 @@ findswapname(buf, dirp, old_fname) { f1 = mch_open_rw((char *)fname, O_RDWR|O_CREAT|O_EXCL|O_EXTRA); -#if defined(OS2) - if (f1 < 0 && errno == ENOENT) - same = TRUE; -#endif created1 = TRUE; } if (f1 >= 0) diff --git a/src/misc1.c b/src/misc1.c index 5190db4a13..d1e762c9a7 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3856,7 +3856,7 @@ init_homedir() # endif #endif -#if defined(OS2) || defined(MSDOS) || defined(MSWIN) +#if defined(MSDOS) || defined(MSWIN) /* * Default home dir is C:/ * Best assumption we can make in such a situation. @@ -3995,7 +3995,7 @@ expand_env_esc(srcp, dst, dstlen, esc, one, startstr) && at_start #endif ) -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) || *src == '%' #endif || (*src == '~' && at_start)) @@ -4024,21 +4024,16 @@ expand_env_esc(srcp, dst, dstlen, esc, one, startstr) #endif { while (c-- > 0 && *tail != NUL && ((vim_isIDc(*tail)) -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) || (*src == '%' && *tail != '%') #endif )) { -#ifdef OS2 /* env vars only in uppercase */ - *var++ = TOUPPER_LOC(*tail); - tail++; /* toupper() may be a macro! */ -#else *var++ = *tail++; -#endif } } -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX) +#if defined(MSDOS) || defined(MSWIN) || defined(UNIX) # ifdef UNIX if (src[1] == '{' && *tail != '}') # else @@ -4056,7 +4051,7 @@ expand_env_esc(srcp, dst, dstlen, esc, one, startstr) #endif *var = NUL; var = vim_getenv(dst, &mustfree); -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX) +#if defined(MSDOS) || defined(MSWIN) || defined(UNIX) } #endif } @@ -4249,7 +4244,7 @@ vim_getenv(name, mustfree) char_u *pend; int vimruntime; -#if defined(OS2) || defined(MSDOS) || defined(MSWIN) +#if defined(MSDOS) || defined(MSWIN) /* use "C:/" when $HOME is not set */ if (STRCMP(name, "HOME") == 0) return homedir; @@ -5000,7 +4995,7 @@ get_past_head(path) { char_u *retval; -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) /* may skip "c:" */ if (isalpha(path[0]) && path[1] == ':') retval = path + 2; @@ -10882,7 +10877,7 @@ has_env_var(p) if (*p == '\\' && p[1] != NUL) ++p; else if (vim_strchr((char_u *) -#if defined(MSDOS) || defined(MSWIN) || defined(OS2) +#if defined(MSDOS) || defined(MSWIN) "$%" #else "$" diff --git a/src/misc2.c b/src/misc2.c index beb3d4662e..f13a80e223 100644 --- a/src/misc2.c +++ b/src/misc2.c |