To: vim_dev@googlegroups.com Subject: Patch 8.1.2180 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2180 Problem: Error E303 is not useful when 'directory' is empty. Solution: Skip the error message. (Daniel Hahler, #5067) Files: src/memline.c, src/testdir/test_recover.vim, runtime/doc/options.txt, runtime/doc/message.txt *** ../vim-8.1.2179/src/memline.c 2019-09-21 23:09:00.975830710 +0200 --- src/memline.c 2019-10-19 17:00:07.888797552 +0200 *************** *** 804,812 **** } } ! if (mfp->mf_fname == NULL) /* Failed! */ { ! need_wait_return = TRUE; /* call wait_return later */ ++no_wait_return; (void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"), buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname); --- 804,812 ---- } } ! if (*p_dir != NUL && mfp->mf_fname == NULL) { ! need_wait_return = TRUE; // call wait_return later ++no_wait_return; (void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"), buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname); *** ../vim-8.1.2179/src/testdir/test_recover.vim 2017-10-15 22:02:53.000000000 +0200 --- src/testdir/test_recover.vim 2019-10-19 16:55:49.949711955 +0200 *************** *** 12,17 **** --- 12,23 ---- set dir=/notexist/ endif call assert_fails('split Xtest', 'E303:') + + " No error with empty 'directory' setting. + set directory= + split XtestOK + close! + set dir& endfunc *** ../vim-8.1.2179/runtime/doc/options.txt 2019-09-28 19:04:06.997029566 +0200 --- runtime/doc/options.txt 2019-10-19 16:57:43.501311699 +0200 *************** *** 2692,2698 **** - The swap file will be created in the first directory where this is possible. - Empty means that no swap file will be used (recovery is ! impossible!). - A directory "." means to put the swap file in the same directory as the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" --- 2693,2699 ---- - The swap file will be created in the first directory where this is possible. - Empty means that no swap file will be used (recovery is ! impossible!) and no |E303| error will be given. - A directory "." means to put the swap file in the same directory as the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" *** ../vim-8.1.2179/runtime/doc/message.txt 2019-05-05 18:11:46.316590662 +0200 --- runtime/doc/message.txt 2019-10-19 17:00:23.616741242 +0200 *************** *** 576,582 **** Vim was not able to create a swap file. You can still edit the file, but if Vim unexpectedly exits the changes will be lost. And Vim may consume a lot of memory when editing a big file. You may want to change the 'directory' option ! to avoid this error. See |swap-file|. *E140* > Use ! to write partial buffer --- 582,589 ---- Vim was not able to create a swap file. You can still edit the file, but if Vim unexpectedly exits the changes will be lost. And Vim may consume a lot of memory when editing a big file. You may want to change the 'directory' option ! to avoid this error. This error is not given when 'directory' is empty. See ! |swap-file|. *E140* > Use ! to write partial buffer *** ../vim-8.1.2179/src/version.c 2019-10-19 15:18:38.907008718 +0200 --- src/version.c 2019-10-19 16:56:49.265503378 +0200 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2180, /**/ -- SOLDIER: What? A swallow carrying a coconut? ARTHUR: It could grip it by the husk ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///