To: vim-dev@vim.org Subject: Patch 6.0.176 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.176 Problem: When killed by a signal autocommands are still triggered as if nothing happened. Solution: Add the v:dying variable to allow autocommands to work differently when a deadly signal has been trapped. Files: src/eval.c, src/os_unix.c, src/vim.h *** ../vim60.175/src/eval.c Sun Feb 3 16:32:18 2002 --- src/eval.c Mon Feb 4 16:43:16 2002 *************** *** 174,179 **** --- 174,180 ---- {"foldlevel", sizeof("foldlevel") - 1, NULL, VAR_NUMBER, VV_RO}, {"progname", sizeof("progname") - 1, NULL, VAR_STRING, VV_RO}, {"servername", sizeof("servername") - 1, NULL, VAR_STRING, VV_RO}, + {"dying", sizeof("dying") - 1, NULL, VAR_NUMBER, VV_RO}, }; static int eval0 __ARGS((char_u *arg, VAR retvar, char_u **nextcmd, int evaluate)); *** ../vim60.175/src/os_unix.c Mon Dec 31 17:47:49 2001 --- src/os_unix.c Mon Feb 4 16:47:46 2002 *************** *** 765,770 **** --- 808,818 ---- /* Remember how often we have been called. */ ++entered; + #ifdef FEAT_EVAL + /* Set the v:dying variable. */ + set_vim_var_nr(VV_DYING, (long)entered); + #endif + #ifdef HAVE_GETRLIMIT /* Since we are now using the signal stack, need to reset the stack * limit. Otherwise using a regexp will fail. */ *** ../vim60.175/src/vim.h Thu Jan 17 11:00:13 2002 --- src/vim.h Mon Feb 4 16:43:35 2002 *************** *** 1413,1419 **** #define VV_FOLDLEVEL 25 #define VV_PROGNAME 26 #define VV_SEND_SERVER 27 ! #define VV_LEN 28 /* number of v: vars */ #ifdef FEAT_CLIPBOARD --- 1413,1420 ---- #define VV_FOLDLEVEL 25 #define VV_PROGNAME 26 #define VV_SEND_SERVER 27 ! #define VV_DYING 28 ! #define VV_LEN 29 /* number of v: vars */ #ifdef FEAT_CLIPBOARD *** ../vim60.175/src/version.c Mon Feb 4 15:18:30 2002 --- src/version.c Mon Feb 4 17:04:51 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 176, /**/ -- hundred-and-one symptoms of being an internet addict: 199. You read this entire list of symptoms, looking for something that doesn't describe you. /// 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 ///