To: vim_dev@googlegroups.com Subject: Patch 9.0.0278 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0278 Problem: The +wildignore feature is nearly always available. Solution: Graduate +wildignore for consistency. Files: runtime/doc/options.txt, runtime/doc/various.txt, src/feature.h, src/bufwrite.c, src/evalfunc.c, src/fileio.c, src/filepath.c, src/option.c, src/version.c, src/option.h, src/optiondefs.h *** ../vim-9.0.0277/runtime/doc/options.txt 2022-08-25 18:12:00.350668422 +0100 --- runtime/doc/options.txt 2022-08-26 16:19:31.920516046 +0100 *************** *** 1151,1158 **** Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*" Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*") global - {not available when compiled without the |+wildignore| - feature} A list of file patterns. When one of the patterns matches with the name of the file which is written, no backup file is created. Both the specified file name and the full path name of the file are used. --- 1177,1182 ---- *************** *** 8995,9002 **** *'wildignore'* *'wig'* 'wildignore' 'wig' string (default "") global - {not available when compiled without the |+wildignore| - feature} A list of file patterns. A file that matches with one of these patterns is ignored when expanding |wildcards|, completing file or directory names, and influences the result of |expand()|, |glob()| and --- 9022,9027 ---- *************** *** 9127,9134 **** *'wildoptions'* *'wop'* 'wildoptions' 'wop' string (default "") global - {not available when compiled without the |+wildignore| - feature} A list of words that change how |cmdline-completion| is done. The following values are supported: fuzzy Use |fuzzy-matching| to find completion matches. When --- 9152,9157 ---- *** ../vim-9.0.0277/runtime/doc/various.txt 2022-08-25 18:12:00.350668422 +0100 --- runtime/doc/various.txt 2022-08-26 16:19:51.740477785 +0100 *************** *** 491,497 **** T *+visualextra* extra Visual mode commands |blockwise-operators| T *+vreplace* |gR| and |gr| *+vtp* on MS-Windows console: support for 'termguicolors' ! N *+wildignore* |'wildignore'| N *+wildmenu* |'wildmenu'| T *+windows* more than one window; Always enabled since 8.0.1118. m *+writebackup* |'writebackup'| is default on --- 491,497 ---- T *+visualextra* extra Visual mode commands |blockwise-operators| T *+vreplace* |gR| and |gr| *+vtp* on MS-Windows console: support for 'termguicolors' ! T *+wildignore* |'wildignore'| Always enabled since 9.0.0278 N *+wildmenu* |'wildmenu'| T *+windows* more than one window; Always enabled since 8.0.1118. m *+writebackup* |'writebackup'| is default on *** ../vim-9.0.0277/src/feature.h 2022-08-25 18:12:00.354668433 +0100 --- src/feature.h 2022-08-26 16:18:17.984660161 +0100 *************** *** 118,123 **** --- 118,124 ---- * +textobjects Text objects: "vaw", "das", etc. * +file_in_path "gf" and "" commands. * +path_extra up/downwards searching in 'path' and 'tags'. + * +wildignore 'wildignore' and 'backupskip' options * * Obsolete: * +tag_old_static Old style static tags: "file:tag file ..". *************** *** 285,291 **** /* * +timers timer_start() */ ! #if defined(FEAT_RELTIME) && (defined(UNIX) || defined(MSWIN) || defined(VMS) ) # define FEAT_TIMERS #endif --- 286,292 ---- /* * +timers timer_start() */ ! #if defined(FEAT_RELTIME) && (defined(UNIX) || defined(MSWIN) || defined(VMS)) # define FEAT_TIMERS #endif *************** *** 338,351 **** #endif /* - * +wildignore 'wildignore' and 'backupskip' options - * Needed for Unix to make "crontab -e" work. - */ - #if defined(FEAT_NORMAL) || defined(UNIX) - # define FEAT_WILDIGN - #endif - - /* * +wildmenu 'wildmenu' option */ #if defined(FEAT_NORMAL) --- 339,344 ---- *** ../vim-9.0.0277/src/bufwrite.c 2022-08-25 15:11:11.404084538 +0100 --- src/bufwrite.c 2022-08-26 16:17:08.544797853 +0100 *************** *** 1136,1145 **** // If 'backupskip' is not empty, don't make a backup for some files. dobackup = (p_wb || p_bk || *p_pm != NUL); - #ifdef FEAT_WILDIGN if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname)) dobackup = FALSE; - #endif // Save the value of got_int and reset it. We don't want a previous // interruption cancel writing, only hitting CTRL-C while writing should --- 1136,1143 ---- *** ../vim-9.0.0277/src/evalfunc.c 2022-08-25 18:12:00.350668422 +0100 --- src/evalfunc.c 2022-08-26 16:17:17.864779231 +0100 *************** *** 6260,6272 **** 0 #endif }, ! {"wildignore", ! #ifdef FEAT_WILDIGN ! 1 ! #else ! 0 ! #endif ! }, {"wildmenu", #ifdef FEAT_WILDMENU 1 --- 6260,6266 ---- 0 #endif }, ! {"wildignore", 1}, {"wildmenu", #ifdef FEAT_WILDMENU 1 *** ../vim-9.0.0277/src/fileio.c 2022-08-26 13:16:16.233122555 +0100 --- src/fileio.c 2022-08-26 16:17:25.636763733 +0100 *************** *** 312,318 **** curbuf->b_op_start = orig_start; if (flags & READ_NOFILE) ! return NOTDONE; // so that BufEnter can be triggered } if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) --- 312,320 ---- curbuf->b_op_start = orig_start; if (flags & READ_NOFILE) ! // Return NOTDONE instead of FAIL so that BufEnter can be triggered ! // and other operations don't fail. ! return NOTDONE; } if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) *************** *** 5402,5408 **** return result; } - #if defined(FEAT_WILDIGN) || defined(PROTO) /* * Return TRUE if a file matches with a pattern in "list". * "list" is a comma-separated list of patterns, like 'wildignore'. --- 5404,5409 ---- *************** *** 5436,5442 **** } return FALSE; } - #endif /* * Convert the given pattern "pat" which has shell style wildcards in it, into --- 5437,5442 ---- *** ../vim-9.0.0277/src/filepath.c 2022-08-25 16:02:09.677816456 +0100 --- src/filepath.c 2022-08-26 16:17:35.284744529 +0100 *************** *** 3136,3142 **** if ((flags & EW_KEEPALL) || retval == FAIL) return retval; - #ifdef FEAT_WILDIGN /* * Remove names that match 'wildignore'. */ --- 3136,3141 ---- *************** *** 3172,3178 **** return FAIL; } } - #endif /* * Move the names where 'suffixes' match to the end. --- 3171,3176 ---- *** ../vim-9.0.0277/src/option.c 2022-08-25 16:02:09.681816465 +0100 --- src/option.c 2022-08-26 16:17:54.880705690 +0100 *************** *** 126,142 **** set_string_default_esc("sh", p, TRUE); #endif - #ifdef FEAT_WILDIGN /* * Set the default for 'backupskip' to include environment variables for * temp files. */ { ! # ifdef UNIX static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"}; ! # else static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"}; ! # endif int len; garray_T ga; int mustfree; --- 126,141 ---- set_string_default_esc("sh", p, TRUE); #endif /* * Set the default for 'backupskip' to include environment variables for * temp files. */ { ! #ifdef UNIX static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"}; ! #else static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"}; ! #endif int len; garray_T ga; int mustfree; *************** *** 148,162 **** for (n = 0; n < (long)ARRAY_LENGTH(names); ++n) { mustfree = FALSE; ! # ifdef UNIX if (*names[n] == NUL) ! # ifdef MACOS_X p = (char_u *)"/private/tmp"; ! # else p = (char_u *)"/tmp"; - # endif - else # endif p = vim_getenv((char_u *)names[n], &mustfree); if (p != NULL && *p != NUL) { --- 147,161 ---- for (n = 0; n < (long)ARRAY_LENGTH(names); ++n) { mustfree = FALSE; ! #ifdef UNIX if (*names[n] == NUL) ! # ifdef MACOS_X p = (char_u *)"/private/tmp"; ! # else p = (char_u *)"/tmp"; # endif + else + #endif p = vim_getenv((char_u *)names[n], &mustfree); if (p != NULL && *p != NUL) { *************** *** 186,192 **** vim_free(ga.ga_data); } } - #endif /* * 'maxmemtot' and 'maxmem' may have to be adjusted for available memory --- 185,190 ---- *** ../vim-9.0.0277/src/version.c 2022-08-26 15:48:10.055864801 +0100 --- src/version.c 2022-08-26 16:38:24.289724507 +0100 *************** *** 655,665 **** "-vtp", # endif #endif - #ifdef FEAT_WILDIGN "+wildignore", - #else - "-wildignore", - #endif #ifdef FEAT_WILDMENU "+wildmenu", #else --- 655,661 ---- *** ../vim-9.0.0277/src/option.h 2022-08-25 16:02:09.681816465 +0100 --- src/option.h 2022-08-26 16:18:31.676633302 +0100 *************** *** 451,459 **** #define BO_TERM 0x40000 #define BO_WILD 0x80000 - #ifdef FEAT_WILDIGN EXTERN char_u *p_bsk; // 'backupskip' - #endif #ifdef FEAT_CRYPT EXTERN char_u *p_cm; // 'cryptmethod' #endif --- 451,457 ---- *************** *** 1061,1069 **** #define FEAT_WAK EXTERN char_u *p_wak; // 'winaltkeys' #endif - #ifdef FEAT_WILDIGN EXTERN char_u *p_wig; // 'wildignore' - #endif EXTERN int p_wiv; // 'weirdinvert' EXTERN char_u *p_ww; // 'whichwrap' EXTERN long p_wc; // 'wildchar' --- 1059,1065 ---- *** ../vim-9.0.0277/src/optiondefs.h 2022-08-25 16:02:09.681816465 +0100 --- src/optiondefs.h 2022-08-26 16:18:47.088603146 +0100 *************** *** 427,439 **** #endif (char_u *)0L} SCTX_INIT}, {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_WILDIGN (char_u *)&p_bsk, PV_NONE, {(char_u *)"", (char_u *)0L} - #else - (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} - #endif SCTX_INIT}, {"balloondelay","bdlay",P_NUM|P_VI_DEF, #ifdef FEAT_BEVAL --- 427,434 ---- *************** *** 2757,2767 **** (char_u *)&p_wcm, PV_NONE, {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"wildignore", "wig", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, - #ifdef FEAT_WILDIGN (char_u *)&p_wig, PV_NONE, - #else - (char_u *)NULL, PV_NONE, - #endif {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"wildignorecase", "wic", P_BOOL|P_VI_DEF, (char_u *)&p_wic, PV_NONE, --- 2752,2758 ---- *** ../vim-9.0.0277/src/version.c 2022-08-26 15:48:10.055864801 +0100 --- src/version.c 2022-08-26 16:38:24.289724507 +0100 *************** *** 725,726 **** --- 721,724 ---- { /* Add new patch number below this line */ + /**/ + 278, /**/ -- A programmer's wife asks him: "Please run to the store and pick up a loaf of bread. If they have eggs, get a dozen". The programmer comes home with 12 loafs of bread. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///