To: vim-dev@vim.org Subject: Patch 6.0.205 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.205 (extra) Problem: "gvim -f" still forks when using the batch script to start Vim. Solution: Add an argument to "start" to use a foreground session (Michael Geddes) Files: src/dosinst.c *** ../vim60.204/src/dosinst.c Fri Nov 2 16:20:26 2001 --- src/dosinst.c Sun Feb 10 12:55:22 2002 *************** *** 740,784 **** fprintf(fd, "goto eof\n\n"); fprintf(fd, ":havevim\n"); ! fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n\n"); ! ! fprintf(fd, "rem for Win95 collect the arguments in VIMARGS\n"); fprintf(fd, "set VIMARGS=\n"); fprintf(fd, ":loopstart\n"); fprintf(fd, "if .%%1==. goto loopend\n"); fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n"); fprintf(fd, "shift\n"); fprintf(fd, "goto loopstart\n\n"); fprintf(fd, ":loopend\n"); /* For gvim.exe use "start" to avoid that the console window stays * open. */ if (*exename == 'g') fprintf(fd, "start "); /* Do use quotes here if the path includes a space. */ if (strchr(installdir, ' ') != NULL) fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf, vimarg); else fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg); - fprintf(fd, "set VIMARGS=\n"); fprintf(fd, "goto eof\n\n"); fprintf(fd, ":ntaction\n"); fprintf(fd, "rem for WinNT we can use %%*\n"); /* For gvim.exe use "start /b" to avoid that the console window * stays open. */ if (*exename == 'g') fprintf(fd, "start \"dummy\" /b "); /* Do use quotes here if the path includes a space. */ if (strchr(installdir, ' ') != NULL) fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg); else fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg); fprintf(fd, "\n:eof\n"); fclose(fd); printf("%s has been %s\n", batpath, --- 740,825 ---- fprintf(fd, "goto eof\n\n"); fprintf(fd, ":havevim\n"); ! fprintf(fd, "rem collect the arguments in VIMARGS for Win95\n"); fprintf(fd, "set VIMARGS=\n"); + if (*exename == 'g') + fprintf(fd, "set VIMNOFORK=\n"); fprintf(fd, ":loopstart\n"); fprintf(fd, "if .%%1==. goto loopend\n"); + if (*exename == 'g') + { + fprintf(fd, "if NOT .%%1==.-f goto noforkarg\n"); + fprintf(fd, "set VIMNOFORK=1\n"); + fprintf(fd, ":noforkarg\n"); + } fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n"); fprintf(fd, "shift\n"); fprintf(fd, "goto loopstart\n\n"); fprintf(fd, ":loopend\n"); + fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n\n"); + /* For gvim.exe use "start" to avoid that the console window stays * open. */ if (*exename == 'g') + { + fprintf(fd, "if .%%VIMNOFORK%%==.1 goto nofork\n"); fprintf(fd, "start "); + } /* Do use quotes here if the path includes a space. */ if (strchr(installdir, ' ') != NULL) fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf, vimarg); else fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg); fprintf(fd, "goto eof\n\n"); + if (*exename == 'g') + { + fprintf(fd, ":nofork\n"); + fprintf(fd, "start /w "); + /* Do use quotes here if the path includes a space. */ + if (strchr(installdir, ' ') != NULL) + fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf, + vimarg); + else + fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg); + fprintf(fd, "goto eof\n\n"); + } + fprintf(fd, ":ntaction\n"); fprintf(fd, "rem for WinNT we can use %%*\n"); /* For gvim.exe use "start /b" to avoid that the console window * stays open. */ if (*exename == 'g') + { + fprintf(fd, "if .%%VIMNOFORK%%==.1 goto noforknt\n"); fprintf(fd, "start \"dummy\" /b "); + } /* Do use quotes here if the path includes a space. */ if (strchr(installdir, ' ') != NULL) fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg); else fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg); + fprintf(fd, "goto eof\n\n"); + + if (*exename == 'g') + { + fprintf(fd, ":noforknt\n"); + fprintf(fd, "start \"dummy\" /b /wait "); + /* Do use quotes here if the path includes a space. */ + if (strchr(installdir, ' ') != NULL) + fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg); + else + fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg); + } fprintf(fd, "\n:eof\n"); + fprintf(fd, "set VIMARGS=\n"); + if (*exename == 'g') + fprintf(fd, "set VIMNOFORK=\n"); fclose(fd); printf("%s has been %s\n", batpath, *** ../vim60.204/src/version.c Sun Feb 10 12:52:47 2002 --- src/version.c Sun Feb 10 12:50:17 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 205, /**/ -- Veni, Vidi, Video -- I came, I saw, I taped what I saw. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///