--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.051
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.051 (after 7.0.44)
+Problem: The Perl interface doesn't compile or doesn't work properly.
+Solution: Remove the spaces before #ifdef and avoid an empty line above it.
+Files: src/if_perl.xs
+
+
+*** ../vim-7.0.050/src/if_perl.xs Tue Aug 8 16:47:38 2006
+--- src/if_perl.xs Fri Aug 11 22:51:01 2006
+***************
+*** 1068,1098 ****
+ line = SvPV(ST(i),PL_na);
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ buf_T *save_curbuf = curbuf;
+
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_savesub(lnum) == OK)
+ {
+ ml_replace(lnum, (char_u *)line, TRUE);
+ changed_bytes(lnum, 0);
+ }
+!
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ }
+ }
+ }
+--- 1068,1097 ----
+ line = SvPV(ST(i),PL_na);
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ buf_T *save_curbuf = curbuf;
+
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_savesub(lnum) == OK)
+ {
+ ml_replace(lnum, (char_u *)line, TRUE);
+ changed_bytes(lnum, 0);
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ }
+ }
+ }
+***************
+*** 1130,1144 ****
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+ buf_T *save_curbuf = curbuf;
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_savedel(lnum, 1) == OK)
+ {
+ ml_delete(lnum, 0);
+--- 1129,1143 ----
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+ buf_T *save_curbuf = curbuf;
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_savedel(lnum, 1) == OK)
+ {
+ ml_delete(lnum, 0);
+***************
+*** 1146,1159 ****
+ if (save_curbuf == curbuf)
+ check_cursor();
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+--- 1145,1158 ----
+ if (save_curbuf == curbuf)
+ check_cursor();
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+***************
+*** 1180,1210 ****
+ line = SvPV(ST(i),PL_na);
+ if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ buf_T *save_curbuf = curbuf;
+
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_inssub(lnum + 1) == OK)
+ {
+ ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+ }
+!
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+--- 1179,1208 ----
+ line = SvPV(ST(i),PL_na);
+ if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+! #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+ buf_T *save_curbuf = curbuf;
+
+ curbuf = vimbuf;
+ curwin->w_buffer = vimbuf;
+! #endif
+ if (u_inssub(lnum + 1) == OK)
+ {
+ ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+*** ../vim-7.0.050/src/version.c Tue Aug 8 21:36:15 2006
+--- src/version.c Fri Aug 11 22:55:25 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 51,
+ /**/
+
+--
+"A clear conscience is usually the sign of a bad memory."
+ -- Steven Wright
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.052
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.052
+Problem: The user may not be aware that the Vim server allows others more
+ functionality than desired.
+Solution: When running Vim as root don't become a Vim server without an
+ explicit --servername argument.
+Files: src/main.c
+
+
+*** ../vim-7.0.051/src/main.c Mon Jun 19 10:56:20 2006
+--- src/main.c Tue Aug 8 11:02:44 2006
+***************
+*** 3212,3221 ****
+ * Register for remote command execution with :serversend and --remote
+ * unless there was a -X or a --servername '' on the command line.
+ * Only register nongui-vim's with an explicit --servername argument.
+ */
+ if (X_DISPLAY != NULL && parmp->servername != NULL && (
+ # ifdef FEAT_GUI
+! gui.in_use ||
+ # endif
+ parmp->serverName_arg != NULL))
+ {
+--- 3212,3226 ----
+ * Register for remote command execution with :serversend and --remote
+ * unless there was a -X or a --servername '' on the command line.
+ * Only register nongui-vim's with an explicit --servername argument.
++ * When running as root --servername is also required.
+ */
+ if (X_DISPLAY != NULL && parmp->servername != NULL && (
+ # ifdef FEAT_GUI
+! (gui.in_use
+! # ifdef UNIX
+! && getuid() != 0
+! # endif
+! ) ||
+ # endif
+ parmp->serverName_arg != NULL))
+ {
+*** ../vim-7.0.051/src/version.c Fri Aug 11 22:56:44 2006
+--- src/version.c Tue Aug 15 21:41:24 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 52,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+148. You find it easier to dial-up the National Weather Service
+ Weather/your_town/now.html than to simply look out the window.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.053
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.053
+Problem: Shortening a directory name may fail when there are multi-byte
+ characters.
+Solution: Copy the correct bytes. (Titov Anatoly)
+Files: src/misc1.c
+
+
+*** ../vim-7.0.052/src/misc1.c Sun Apr 30 20:49:14 2006
+--- src/misc1.c Tue Aug 8 11:23:45 2006
+***************
+*** 4492,4498 ****
+ int l = mb_ptr2len(s);
+
+ while (--l > 0)
+! *d++ = *s++;
+ }
+ # endif
+ }
+--- 4492,4498 ----
+ int l = mb_ptr2len(s);
+
+ while (--l > 0)
+! *d++ = *++s;
+ }
+ # endif
+ }
+*** ../vim-7.0.052/src/version.c Tue Aug 15 21:42:18 2006
+--- src/version.c Tue Aug 15 22:23:44 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 53,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+150. You find yourself counting emoticons to get to sleep.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.054
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.054
+Problem: Mac: Using a menu name that only has a mnemonic or accelerator
+ causes a crash. (Elliot Shank)
+Solution: Check for an empty menu name. Also delete empty submenus that
+ were created before detecting the error.
+Files: src/menu.c
+
+
+*** ../vim-7.0.053/src/menu.c Wed May 3 23:28:47 2006
+--- src/menu.c Tue Aug 8 20:53:25 2006
+***************
+*** 511,516 ****
+--- 511,524 ----
+ * name (without mnemonic and accelerator text). */
+ next_name = menu_name_skip(name);
+ dname = menu_text(name, NULL, NULL);
++ if (dname == NULL)
++ goto erret;
++ if (*dname == NUL)
++ {
++ /* Only a mnemonic or accelerator is not valid. */
++ EMSG(_("E792: Empty menu name"));
++ goto erret;
++ }
+
+ /* See if it's already there */
+ lower_pri = menup;
+***************
+*** 704,709 ****
+--- 712,718 ----
+ parent = menu;
+ name = next_name;
+ vim_free(dname);
++ dname = NULL;
+ if (pri_tab[pri_idx + 1] != -1)
+ ++pri_idx;
+ }
+***************
+*** 793,798 ****
+--- 802,823 ----
+ erret:
+ vim_free(path_name);
+ vim_free(dname);
++
++ /* Delete any empty submenu we added before discovering the error. Repeat
++ * for higher levels. */
++ while (parent != NULL && parent->children == NULL)
++ {
++ if (parent->parent == NULL)
++ menup = &root_menu;
++ else
++ menup = &parent->parent->children;
++ for ( ; *menup != NULL && *menup != parent; menup = &((*menup)->next))
++ ;
++ if (*menup == NULL) /* safety check */
++ break;
++ parent = parent->parent;
++ free_menu(menup);
++ }
+ return FAIL;
+ }
+
+*** ../vim-7.0.053/src/version.c Tue Aug 15 22:26:04 2006
+--- src/version.c Wed Aug 16 15:53:39 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 54,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+156. You forget your friend's name but not her e-mail address.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.055
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.055
+Problem: ":startinsert" in a CmdwinEnter autocommand doesn't take immediate
+ effect. (Bradley White)
+Solution: Put a NOP key in the typeahead buffer. Also avoid that using
+ CTRL-C to go back to the command line moves the cursor left.
+Files: src/edit.c, src/ex_getln.c
+
+
+*** ../vim-7.0.054/src/edit.c Fri Jun 23 21:36:49 2006
+--- src/edit.c Wed Aug 16 16:17:29 2006
+***************
+*** 882,887 ****
+--- 882,888 ----
+ /* Close the cmdline window. */
+ cmdwin_result = K_IGNORE;
+ got_int = FALSE; /* don't stop executing autocommands et al. */
++ nomove = TRUE;
+ goto doESCkey;
+ }
+ #endif
+***************
+*** 2414,2419 ****
+--- 2415,2421 ----
+ compl_matches = ins_compl_make_cyclic();
+ compl_started = TRUE;
+ compl_used_match = TRUE;
++ compl_cont_status = 0;
+
+ compl_curr_match = compl_first_match;
+ ins_complete(Ctrl_N);
+*** ../vim-7.0.054/src/ex_getln.c Sun Apr 30 20:43:17 2006
+--- src/ex_getln.c Wed Aug 16 16:07:04 2006
+***************
+*** 5982,5987 ****
+--- 5982,5989 ----
+ typestr[0] = cmdwin_type;
+ typestr[1] = NUL;
+ apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf);
++ if (restart_edit != 0) /* autocmd with ":startinsert" */
++ stuffcharReadbuff(K_NOP);
+ # endif
+
+ i = RedrawingDisabled;
+*** ../vim-7.0.054/src/version.c Wed Aug 16 15:56:58 2006
+--- src/version.c Wed Aug 16 16:21:45 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 55,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+157. You fum through a magazine, you first check to see if it has a web
+ address.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.056
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.056
+Problem: "#!something" gives an error message.
+Solution: Ignore this line, so that it can be used in an executable Vim
+ script.
+Files: src/ex_docmd.c
+
+
+*** ../vim-7.0.055/src/ex_docmd.c Sat May 13 12:36:18 2006
+--- src/ex_docmd.c Thu Aug 10 23:50:32 2006
+***************
+*** 1709,1714 ****
+--- 1712,1721 ----
+ */
+ save_cmdmod = cmdmod;
+ vim_memset(&cmdmod, 0, sizeof(cmdmod));
++
++ /* "#!anything" is handled like a comment. */
++ if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!')
++ goto doend;
+
+ /*
+ * Repeat until no more command modifiers are found.
+*** ../vim-7.0.055/src/version.c Wed Aug 16 16:24:58 2006
+--- src/version.c Wed Aug 16 17:05:35 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 56,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+158. You get a tuner card so you can watch TV while surfing.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.058
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.058
+Problem: The gbk and and gb18030 encodings are not recognized.
+Solution: Add aliases to cp936. (Edward L. Fox)
+Files: src/mbyte.c
+
+
+*** ../vim-7.0.057/src/mbyte.c Sat May 13 17:10:00 2006
+--- src/mbyte.c Sat Aug 12 22:59:55 2006
+***************
+*** 363,368 ****
+--- 363,370 ----
+ {"932", IDX_CP932},
+ {"949", IDX_CP949},
+ {"936", IDX_CP936},
++ {"gbk", IDX_CP936},
++ {"gb18030", IDX_CP936}, /* only 99% the same */
+ {"950", IDX_CP950},
+ {"eucjp", IDX_EUC_JP},
+ {"unix-jis", IDX_EUC_JP},
+*** ../vim-7.0.057/src/version.c Wed Aug 16 17:36:21 2006
+--- src/version.c Wed Aug 16 18:04:14 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 58,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+162. You go outside and look for a brightness knob to turn down the sun.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.059
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.059
+Problem: The Perl interface doesn't compile with ActiveState Perl 5.8.8.
+Solution: Remove the __attribute__() items. (Edward L. Fox)
+Files: src/if_perl.xs
+
+
+*** ../vim-7.0.058/src/if_perl.xs Fri Aug 11 22:56:44 2006
+--- src/if_perl.xs Wed Aug 16 14:45:15 2006
+***************
+*** 155,162 ****
+ static int (*perl_run)(PerlInterpreter*);
+ static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
+ static void* (*Perl_get_context)(void);
+! static void (*Perl_croak)(pTHX_ const char*, ...) __attribute__((noreturn));
+! static void (*Perl_croak_nocontext)(const char*, ...) __attribute__((noreturn));
+ static I32 (*Perl_dowantarray)(pTHX);
+ static void (*Perl_free_tmps)(pTHX);
+ static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
+--- 155,162 ----
+ static int (*perl_run)(PerlInterpreter*);
+ static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
+ static void* (*Perl_get_context)(void);
+! static void (*Perl_croak)(pTHX_ const char*, ...);
+! static void (*Perl_croak_nocontext)(const char*, ...);
+ static I32 (*Perl_dowantarray)(pTHX);
+ static void (*Perl_free_tmps)(pTHX);
+ static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
+*** ../vim-7.0.058/src/version.c Wed Aug 16 18:05:36 2006
+--- src/version.c Wed Aug 16 18:18:35 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 59,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+163. You go outside for the fresh air (at -30 degrees) but open the
+ window first to hear new mail arrive.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.060
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.060 (after 7.0.51)
+Problem: Code for temporarily switching to another buffer is duplicated in
+ quite a few places.
+Solution: Use aucmd_prepbuf() and aucmd_restbuf() also when FEAT_AUTOCMD is
+ not defined.
+Files: src/buffer.c, src/eval.c, src/fileio.c, src/if_ruby.c,
+ src/if_perl.xs, src/quickfix.c, src/structs.h
+
+
+*** ../vim-7.0.059/src/buffer.c Thu Apr 27 01:49:30 2006
+--- src/buffer.c Wed Aug 16 14:36:17 2006
+***************
+*** 5420,5430 ****
+ buf_T *newbuf;
+ int differ = TRUE;
+ linenr_T lnum;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *old_curbuf = curbuf;
+- #endif
+ exarg_T ea;
+
+ /* Allocate a buffer without putting it in the buffer list. */
+--- 5420,5426 ----
+***************
+*** 5439,5451 ****
+ return TRUE;
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, newbuf);
+- #else
+- curbuf = newbuf;
+- curwin->w_buffer = newbuf;
+- #endif
+
+ if (ml_open(curbuf) == OK
+ && readfile(buf->b_ffname, buf->b_fname,
+--- 5435,5442 ----
+***************
+*** 5466,5478 ****
+ }
+ vim_free(ea.cmd);
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+- #else
+- curbuf = old_curbuf;
+- curwin->w_buffer = old_curbuf;
+- #endif
+
+ if (curbuf != newbuf) /* safety check */
+ wipe_buffer(newbuf, FALSE);
+--- 5457,5464 ----
+*** ../vim-7.0.059/src/eval.c Sun Jul 23 22:07:55 2006
+--- src/eval.c Wed Aug 16 14:38:32 2006
+***************
+*** 14184,14194 ****
+ typval_T *rettv;
+ {
+ buf_T *buf;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *save_curbuf;
+- #endif
+ char_u *varname, *bufvarname;
+ typval_T *varp;
+ char_u nbuf[NUMBUFLEN];
+--- 14184,14190 ----
+***************
+*** 14205,14216 ****
+ if (buf != NULL && varname != NULL && varp != NULL)
+ {
+ /* set curbuf to be our buf, temporarily */
+- #ifdef FEAT_AUTOCMD
+ aucmd_prepbuf(&aco, buf);
+- #else
+- save_curbuf = curbuf;
+- curbuf = buf;
+- #endif
+
+ if (*varname == '&')
+ {
+--- 14201,14207 ----
+***************
+*** 14237,14247 ****
+ }
+
+ /* reset notion of buffer */
+- #ifdef FEAT_AUTOCMD
+ aucmd_restbuf(&aco);
+- #else
+- curbuf = save_curbuf;
+- #endif
+ }
+ }
+
+--- 14228,14234 ----
+*** ../vim-7.0.059/src/fileio.c Sun Apr 30 20:33:48 2006
+--- src/fileio.c Wed Aug 16 14:39:23 2006
+***************
+*** 6450,6466 ****
+ int old_ro = buf->b_p_ro;
+ buf_T *savebuf;
+ int saved = OK;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "buf" and save some things */
+ aucmd_prepbuf(&aco, buf);
+- #else
+- buf_T *save_curbuf = curbuf;
+-
+- curbuf = buf;
+- curwin->w_buffer = buf;
+- #endif
+
+ /* We only want to read the text from the file, not reset the syntax
+ * highlighting, clear marks, diff status, etc. Force the fileformat
+--- 6450,6459 ----
+***************
+*** 6573,6586 ****
+ curbuf->b_p_ro |= old_ro;
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+- #else
+- curwin->w_buffer = save_curbuf;
+- curbuf = save_curbuf;
+- #endif
+ }
+
+ /*ARGSUSED*/
+--- 6566,6574 ----
+***************
+*** 8088,8093 ****
+--- 8076,8082 ----
+ * Search a window for the current buffer. Save the cursor position and
+ * screen offset.
+ * Set "curbuf" and "curwin" to match "buf".
++ * When FEAT_AUTOCMD is not defined another version is used, see below.
+ */
+ void
+ aucmd_prepbuf(aco, buf)
+***************
+*** 8151,8156 ****
+--- 8140,8146 ----
+ /*
+ * Cleanup after executing autocommands for a (hidden) buffer.
+ * Restore the window as it was (if possible).
++ * When FEAT_AUTOCMD is not defined another version is used, see below.
+ */
+ void
+ aucmd_restbuf(aco)
+***************
+*** 9063,9069 ****
+--- 9053,9089 ----
+ return retval;
+ }
+
++ #else /* FEAT_AUTOCMD */
++
++ /*
++ * Prepare for executing commands for (hidden) buffer "buf".
++ * This is the non-autocommand version, it simply saves "curbuf" and sets
++ * "curbuf" and "curwin" to match "buf".
++ */
++ void
++ aucmd_prepbuf(aco, buf)
++ aco_save_T *aco; /* structure to save values in */
++ buf_T *buf; /* new curbuf */
++ {
++ aco->save_buf = buf;
++ curbuf = buf;
++ curwin->w_buffer = buf;
++ }
++
++ /*
++ * Restore after executing commands for a (hidden) buffer.
++ * This is the non-autocommand version.
++ */
++ void
++ aucmd_restbuf(aco)
++ aco_save_T *aco; /* structure holding saved values */
++ {
++ curbuf = aco->save_buf;
++ curwin->w_buffer = curbuf;
++ }
++
+ #endif /* FEAT_AUTOCMD */
++
+
+ #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO)
+ /*
+*** ../vim-7.0.059/src/if_ruby.c Tue Jun 20 21:08:02 2006
+--- src/if_ruby.c Wed Aug 16 14:41:11 2006
+***************
+*** 644,664 ****
+ static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
+ {
+ char *line = STR2CSTR(str);
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *save_curbuf = curbuf;
+- #endif
+
+ if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
+ {
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf for "buf" and save some things */
+ aucmd_prepbuf(&aco, buf);
+- #else
+- curbuf = buf;
+- curwin->w_buffer = buf;
+- #endif
+
+ if (u_savesub(n) == OK) {
+ ml_replace(n, (char_u *)line, TRUE);
+--- 644,655 ----
+***************
+*** 668,681 ****
+ #endif
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+! #else
+! curwin->w_buffer = save_curbuf;
+! curbuf = save_curbuf;
+! #endif
+ update_curbuf(NOT_VALID);
+ }
+ else
+--- 659,668 ----
+ #endif
+ }
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+!
+ update_curbuf(NOT_VALID);
+ }
+ else
+***************
+*** 699,719 ****
+ {
+ buf_T *buf = get_buf(self);
+ long n = NUM2LONG(num);
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *save_curbuf = curbuf;
+- #endif
+
+ if (n > 0 && n <= buf->b_ml.ml_line_count)
+ {
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf for "buf" and save some things */
+ aucmd_prepbuf(&aco, buf);
+- #else
+- curbuf = buf;
+- curwin->w_buffer = buf;
+- #endif
+
+ if (u_savedel(n, 1) == OK) {
+ ml_delete(n, 0);
+--- 686,697 ----
+***************
+*** 725,738 ****
+ changed();
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+! #else
+! curwin->w_buffer = save_curbuf;
+! curbuf = save_curbuf;
+! #endif
+ update_curbuf(NOT_VALID);
+ }
+ else
+--- 703,712 ----
+ changed();
+ }
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+!
+ update_curbuf(NOT_VALID);
+ }
+ else
+***************
+*** 747,767 ****
+ buf_T *buf = get_buf(self);
+ char *line = STR2CSTR(str);
+ long n = NUM2LONG(num);
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *save_curbuf = curbuf;
+- #endif
+
+ if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
+ {
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf for "buf" and save some things */
+ aucmd_prepbuf(&aco, buf);
+- #else
+- curbuf = buf;
+- curwin->w_buffer = buf;
+- #endif
+
+ if (u_inssub(n + 1) == OK) {
+ ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
+--- 721,732 ----
+***************
+*** 773,786 ****
+ changed();
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+! #else
+! curwin->w_buffer = save_curbuf;
+! curbuf = save_curbuf;
+! #endif
+ update_curbuf(NOT_VALID);
+ }
+ else {
+--- 738,747 ----
+ changed();
+ }
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+!
+ update_curbuf(NOT_VALID);
+ }
+ else {
+*** ../vim-7.0.059/src/if_perl.xs Wed Aug 16 18:19:41 2006
+--- src/if_perl.xs Wed Aug 16 14:45:15 2006
+***************
+*** 1068,1097 ****
+ line = SvPV(ST(i),PL_na);
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+- #else
+- buf_T *save_curbuf = curbuf;
+
+- curbuf = vimbuf;
+- curwin->w_buffer = vimbuf;
+- #endif
+ if (u_savesub(lnum) == OK)
+ {
+ ml_replace(lnum, (char_u *)line, TRUE);
+ changed_bytes(lnum, 0);
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+- #else
+- curwin->w_buffer = save_curbuf;
+- curbuf = save_curbuf;
+- #endif
+ }
+ }
+ }
+--- 1068,1087 ----
+ line = SvPV(ST(i),PL_na);
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+
+ if (u_savesub(lnum) == OK)
+ {
+ ml_replace(lnum, (char_u *)line, TRUE);
+ changed_bytes(lnum, 0);
+ }
+!
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+ }
+ }
+ }
+***************
+*** 1128,1158 ****
+ {
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+- buf_T *save_curbuf = curbuf;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+! #else
+! curbuf = vimbuf;
+! curwin->w_buffer = vimbuf;
+! #endif
+ if (u_savedel(lnum, 1) == OK)
+ {
+ ml_delete(lnum, 0);
+ deleted_lines_mark(lnum, 1L);
+! if (save_curbuf == curbuf)
+ check_cursor();
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+! curwin->w_buffer = save_curbuf;
+! curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+--- 1118,1140 ----
+ {
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+!
+ if (u_savedel(lnum, 1) == OK)
+ {
+ ml_delete(lnum, 0);
+ deleted_lines_mark(lnum, 1L);
+! if (aco.save_buf == curbuf)
+ check_cursor();
+ }
+!
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+!
+ update_curbuf(VALID);
+ }
+ }
+***************
+*** 1179,1208 ****
+ line = SvPV(ST(i),PL_na);
+ if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+- #else
+- buf_T *save_curbuf = curbuf;
+
+- curbuf = vimbuf;
+- curwin->w_buffer = vimbuf;
+- #endif
+ if (u_inssub(lnum + 1) == OK)
+ {
+ ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+ }
+! #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+! #else
+! curwin->w_buffer = save_curbuf;
+! curbuf = save_curbuf;
+! #endif
+ update_curbuf(VALID);
+ }
+ }
+--- 1161,1181 ----
+ line = SvPV(ST(i),PL_na);
+ if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "vimbuf" and save some things */
+ aucmd_prepbuf(&aco, vimbuf);
+
+ if (u_inssub(lnum + 1) == OK)
+ {
+ ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+ }
+!
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "vimbuf" invalid! */
+!
+ update_curbuf(VALID);
+ }
+ }
+*** ../vim-7.0.059/src/quickfix.c Tue Jun 20 20:49:42 2006
+--- src/quickfix.c Wed Aug 16 14:43:06 2006
+***************
+*** 2463,2494 ****
+ qf_info_T *qi;
+ {
+ buf_T *buf;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *save_curbuf;
+- #endif
+
+ /* Check if a buffer for the quickfix list exists. Update it. */
+ buf = qf_find_buf(qi);
+ if (buf != NULL)
+ {
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, buf);
+- #else
+- save_curbuf = curbuf;
+- curbuf = buf;
+- #endif
+
+ qf_fill_buffer(qi);
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+- #else
+- curbuf = save_curbuf;
+- #endif
+
+ (void)qf_win_pos_update(qi, 0);
+ }
+--- 2463,2481 ----
+***************
+*** 2977,2986 ****
+ #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ char_u *save_ei = NULL;
+ #endif
+- #ifndef FEAT_AUTOCMD
+- buf_T *save_curbuf;
+- #else
+ aco_save_T aco;
+ char_u *au_name = NULL;
+ int flags = 0;
+ colnr_T col;
+--- 2964,2971 ----
+ #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ char_u *save_ei = NULL;
+ #endif
+ aco_save_T aco;
++ #ifdef FEAT_AUTOCMD
+ char_u *au_name = NULL;
+ int flags = 0;
+ colnr_T col;
+***************
+*** 3201,3224 ****
+ * need to be done now, in that buffer. And the modelines
+ * need to be done (again). But not the window-local
+ * options! */
+- #if defined(FEAT_AUTOCMD)
+ aucmd_prepbuf(&aco, buf);
+- #else
+- save_curbuf = curbuf;
+- curbuf = buf;
+- curwin->w_buffer = curbuf;
+- #endif
+ #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ apply_autocmds(EVENT_FILETYPE, buf->b_p_ft,
+ buf->b_fname, TRUE, buf);
+ #endif
+ do_modelines(OPT_NOWIN);
+- #if defined(FEAT_AUTOCMD)
+ aucmd_restbuf(&aco);
+- #else
+- curbuf = save_curbuf;
+- curwin->w_buffer = curbuf;
+- #endif
+ }
+ }
+ }
+--- 3186,3198 ----
+***************
+*** 3319,3329 ****
+ {
+ buf_T *newbuf;
+ int failed = TRUE;
+- #ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+- #else
+- buf_T *old_curbuf = curbuf;
+- #endif
+
+ /* Allocate a buffer without putting it in the buffer list. */
+ newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
+--- 3293,3299 ----
+***************
+*** 3333,3345 ****
+ /* Init the options. */
+ buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
+
+- #ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, newbuf);
+- #else
+- curbuf = newbuf;
+- curwin->w_buffer = newbuf;
+- #endif
+
+ /* Need to set the filename for autocommands. */
+ (void)setfname(curbuf, fname, NULL, FALSE);
+--- 3303,3310 ----
+***************
+*** 3370,3382 ****
+ }
+ }
+
+- #ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+- #else
+- curbuf = old_curbuf;
+- curwin->w_buffer = old_curbuf;
+- #endif
+
+ if (!buf_valid(newbuf))
+ return NULL;
+--- 3335,3342 ----
+*** ../vim-7.0.059/src/structs.h Sun Apr 9 23:52:16 2006
+--- src/structs.h Wed Aug 16 19:30:48 2006
+***************
+*** 2213,2230 ****
+
+ /*
+ * Struct to save values in before executing autocommands for a buffer that is
+! * not the current buffer.
+ */
+ typedef struct
+ {
+ buf_T *save_buf; /* saved curbuf */
+ buf_T *new_curbuf; /* buffer to be used */
+ win_T *save_curwin; /* saved curwin, NULL if it didn't change */
+ win_T *new_curwin; /* new curwin if save_curwin != NULL */
+ pos_T save_cursor; /* saved cursor pos of save_curwin */
+ linenr_T save_topline; /* saved topline of save_curwin */
+! #ifdef FEAT_DIFF
+ int save_topfill; /* saved topfill of save_curwin */
+ #endif
+ } aco_save_T;
+
+--- 2213,2232 ----
+
+ /*
+ * Struct to save values in before executing autocommands for a buffer that is
+! * not the current buffer. Without FEAT_AUTOCMD only "curbuf" is remembered.
+ */
+ typedef struct
+ {
+ buf_T *save_buf; /* saved curbuf */
++ #ifdef FEAT_AUTOCMD
+ buf_T *new_curbuf; /* buffer to be used */
+ win_T *save_curwin; /* saved curwin, NULL if it didn't change */
+ win_T *new_curwin; /* new curwin if save_curwin != NULL */
+ pos_T save_cursor; /* saved cursor pos of save_curwin */
+ linenr_T save_topline; /* saved topline of save_curwin */
+! # ifdef FEAT_DIFF
+ int save_topfill; /* saved topfill of save_curwin */
++ # endif
+ #endif
+ } aco_save_T;
+
+*** ../vim-7.0.059/src/version.c Wed Aug 16 18:19:41 2006
+--- src/version.c Wed Aug 16 19:31:01 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 60,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+164. You got out to buy software, instead of going out for a beer.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.061
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.061
+Problem: Insert mode completion for Vim commands may crash if there is
+ nothing to complete.
+Solution: Instead of freeing the pattern make it empty, so that a "not
+ found" error is given. (Yukihiro Nakadaira)
+Files: src/edit.c
+
+
+*** ../vim-7.0.060/src/edit.c Wed Aug 16 16:24:58 2006
+--- src/edit.c Wed Aug 16 21:20:29 2006
+***************
+*** 4691,4708 ****
+ (int)STRLEN(compl_pattern), curs_col);
+ if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
+ || compl_xp.xp_context == EXPAND_NOTHING)
+! {
+ compl_col = curs_col;
+- compl_length = 0;
+- vim_free(compl_pattern);
+- compl_pattern = NULL;
+- }
+ else
+! {
+! startcol = (int)(compl_xp.xp_pattern - compl_pattern);
+! compl_col = startcol;
+! compl_length = curs_col - startcol;
+! }
+ }
+ else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
+ {
+--- 4692,4703 ----
+ (int)STRLEN(compl_pattern), curs_col);
+ if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
+ || compl_xp.xp_context == EXPAND_NOTHING)
+! /* No completion possible, use an empty pattern to get a
+! * "pattern not found" message. */
+ compl_col = curs_col;
+ else
+! compl_col = (int)(compl_xp.xp_pattern - compl_pattern);
+! compl_length = curs_col - compl_col;
+ }
+ else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
+ {
+*** ../vim-7.0.060/src/version.c Wed Aug 16 19:34:59 2006
+--- src/version.c Wed Aug 16 21:25:03 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 61,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+165. You have a web page burned into your glasses
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.062
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.062
+Problem: Mac: Crash when using the popup menu for spell correction. The
+ popup menu appears twice when letting go of the right mouse button
+ early.
+Solution: Don't show the popup menu on the release of the right mouse
+ button. Also check that a menu pointer is actually valid.
+Files: src/proto/menu.pro, src/menu.c, src/normal.c, src/term.c
+
+
+*** ../vim-7.0.061/src/proto/menu.pro Fri Mar 24 23:37:59 2006
+--- src/proto/menu.pro Wed Aug 16 20:25:57 2006
+***************
+*** 10,15 ****
+--- 10,16 ----
+ extern int menu_is_child_of_popup __ARGS((vimmenu_T *menu));
+ extern int menu_is_toolbar __ARGS((char_u *name));
+ extern int menu_is_separator __ARGS((char_u *name));
++ extern int check_menu_pointer __ARGS((vimmenu_T *root, vimmenu_T *menu_to_check));
+ extern void gui_create_initial_menus __ARGS((vimmenu_T *menu));
+ extern void gui_update_menus __ARGS((int modes));
+ extern int gui_is_menu_shortcut __ARGS((int key));
+*** ../vim-7.0.061/src/menu.c Wed Aug 16 15:56:58 2006
+--- src/menu.c Wed Aug 16 20:35:09 2006
+***************
+*** 1778,1783 ****
+--- 1778,1804 ----
+ }
+
+ /*
++ * Check that a pointer appears in the menu tree. Used to protect from using
++ * a menu that was deleted after it was selected but before the event was
++ * handled.
++ * Return OK or FAIL. Used recursively.
++ */
++ int
++ check_menu_pointer(root, menu_to_check)
++ vimmenu_T *root;
++ vimmenu_T *menu_to_check;
++ {
++ vimmenu_T *p;
++
++ for (p = root; p != NULL; p = p->next)
++ if (p == menu_to_check
++ || (p->children != NULL
++ && check_menu_pointer(p->children, menu_to_check) == OK))
++ return OK;
++ return FAIL;
++ }
++
++ /*
+ * After we have started the GUI, then we can create any menus that have been
+ * defined. This is done once here. add_menu_path() may have already been
+ * called to define these menus, and may be called again. This function calls
+*** ../vim-7.0.061/src/normal.c Sat Apr 29 23:53:55 2006
+--- src/normal.c Wed Aug 16 19:54:04 2006
+***************
+*** 2504,2510 ****
+ * NOTE: Ignore right button down and drag mouse events.
+ * Windows only shows the popup menu on the button up event.
+ */
+! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
+ if (!is_click)
+ return FALSE;
+ #endif
+--- 2504,2511 ----
+ * NOTE: Ignore right button down and drag mouse events.
+ * Windows only shows the popup menu on the button up event.
+ */
+! #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
+! || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
+ if (!is_click)
+ return FALSE;
+ #endif
+*** ../vim-7.0.061/src/term.c Wed May 3 23:26:49 2006
+--- src/term.c Wed Aug 16 21:24:21 2006
+***************
+*** 4783,4788 ****
+--- 4783,4796 ----
+ return -1;
+ current_menu = (vimmenu_T *)val;
+ slen += num_bytes;
++
++ /* The menu may have been deleted right after it was used, check
++ * for that. */
++ if (check_menu_pointer(root_menu, current_menu) == FAIL)
++ {
++ key_name[0] = KS_EXTRA;
++ key_name[1] = (int)KE_IGNORE;
++ }
+ }
+ # endif
+ # ifdef FEAT_GUI_TABLINE
+*** ../vim-7.0.061/src/version.c Wed Aug 16 21:26:19 2006
+--- src/version.c Wed Aug 16 21:40:37 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 62,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+166. You have been on your computer soo long that you didn't realize
+ you had grandchildren.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.0.063
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.063
+Problem: Tiny chance for a memory leak. (coverity)
+Solution: Free pointer when next memory allocation fails.
+Files: src/eval.c
+
+
+*** ../vim-7.0.062/src/eval.c Wed Aug 16 19:34:59 2006
+--- src/eval.c Wed Aug 16 21:33:24 2006
+***************
+*** 18811,18816 ****
+--- 18811,18817 ----
+ if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL)
+ {
+ vim_free(fudi.fd_di);
++ vim_free(fp);
+ goto erret;
+ }
+ }
+*** ../vim-7.0.062/src/version.c Wed Aug 16 21:42:34 2006
+--- src/version.c Wed Aug 16 22:02:57 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 63,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+167. You have more than 200 websites bookmarked.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///